require amsmath when needed

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9757 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2005-03-30 09:05:30 +00:00
parent 42dfdbc8c7
commit fbca01c39f
7 changed files with 37 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2005-03-27 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* math_amsarrayinset.[Ch] (validate): new, require amsmath
* math_substackinset.[Ch] (validate): ditto
* math_arrayinset.[Ch] (validate): ditto (in the case of subarray)
2005-03-24 Martin Vermeer <martin.vermeer@hut.fi> 2005-03-24 Martin Vermeer <martin.vermeer@hut.fi>

View File

@ -10,6 +10,7 @@
#include <config.h> #include <config.h>
#include "LaTeXFeatures.h"
#include "math_amsarrayinset.h" #include "math_amsarrayinset.h"
#include "math_data.h" #include "math_data.h"
#include "math_mathmlstream.h" #include "math_mathmlstream.h"
@ -103,3 +104,10 @@ void MathAMSArrayInset::normalize(NormalStream & os) const
MathGridInset::normalize(os); MathGridInset::normalize(os);
os << ']'; os << ']';
} }
void MathAMSArrayInset::validate(LaTeXFeatures & features) const
{
features.require("amsmath");
MathGridInset::validate(features);
}

View File

@ -35,7 +35,8 @@ public:
void write(WriteStream & os) const; void write(WriteStream & os) const;
/// ///
void normalize(NormalStream &) const; void normalize(NormalStream &) const;
///
void validate(LaTeXFeatures & features) const;
private: private:
virtual std::auto_ptr<InsetBase> doClone() const; virtual std::auto_ptr<InsetBase> doClone() const;
/// ///

View File

@ -10,6 +10,7 @@
#include <config.h> #include <config.h>
#include "LaTeXFeatures.h"
#include "math_arrayinset.h" #include "math_arrayinset.h"
#include "math_data.h" #include "math_data.h"
#include "math_parser.h" #include "math_parser.h"
@ -130,3 +131,11 @@ void MathArrayInset::maple(MapleStream & os) const
MathGridInset::maple(os); MathGridInset::maple(os);
os << ')'; os << ')';
} }
void MathArrayInset::validate(LaTeXFeatures & features) const
{
if (name_ == "subarray")
features.require("amsmath");
MathGridInset::validate(features);
}

View File

@ -25,7 +25,7 @@ public:
char valign, std::string const & halign); char valign, std::string const & halign);
/// ///
MathArrayInset(std::string const &, char valign, std::string const & halign); MathArrayInset(std::string const &, char valign, std::string const & halign);
/// convienience constructor from whitespace/newline seperated data /// convenience constructor from whitespace/newline separated data
MathArrayInset(std::string const &, std::string const & str); MathArrayInset(std::string const &, std::string const & str);
/// ///
void metrics(MetricsInfo & mi, Dimension & dim) const; void metrics(MetricsInfo & mi, Dimension & dim) const;
@ -44,7 +44,8 @@ public:
void normalize(NormalStream & os) const; void normalize(NormalStream & os) const;
/// ///
void maple(MapleStream & os) const; void maple(MapleStream & os) const;
///
void validate(LaTeXFeatures & features) const;
private: private:
virtual std::auto_ptr<InsetBase> doClone() const; virtual std::auto_ptr<InsetBase> doClone() const;
/// ///

View File

@ -10,6 +10,7 @@
#include <config.h> #include <config.h>
#include "LaTeXFeatures.h"
#include "math_substackinset.h" #include "math_substackinset.h"
#include "math_data.h" #include "math_data.h"
#include "math_mathmlstream.h" #include "math_mathmlstream.h"
@ -75,3 +76,10 @@ void MathSubstackInset::maple(MapleStream & os) const
MathGridInset::maple(os); MathGridInset::maple(os);
os << ')'; os << ')';
} }
void MathSubstackInset::validate(LaTeXFeatures & features) const
{
features.require("amsmath");
MathGridInset::validate(features);
}

View File

@ -38,6 +38,8 @@ public:
void normalize(NormalStream &) const; void normalize(NormalStream &) const;
/// ///
void maple(MapleStream &) const; void maple(MapleStream &) const;
///
void validate(LaTeXFeatures & features) const;
private: private:
virtual std::auto_ptr<InsetBase> doClone() const; virtual std::auto_ptr<InsetBase> doClone() const;
}; };