From: Georg Baum Date: Wed, 30 Mar 2005 09:05:30 +0000 (+0000) Subject: require amsmath when needed X-Git-Tag: 1.6.10~14441 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=fbca01c39fea991629db87fd5495994b255b222a;p=features.git require amsmath when needed git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9757 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index 9e85296406..5c1436b83a 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,3 +1,8 @@ +2005-03-27 Georg Baum + + * 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 diff --git a/src/mathed/math_amsarrayinset.C b/src/mathed/math_amsarrayinset.C index 448fd152a7..4acba92900 100644 --- a/src/mathed/math_amsarrayinset.C +++ b/src/mathed/math_amsarrayinset.C @@ -10,6 +10,7 @@ #include +#include "LaTeXFeatures.h" #include "math_amsarrayinset.h" #include "math_data.h" #include "math_mathmlstream.h" @@ -103,3 +104,10 @@ void MathAMSArrayInset::normalize(NormalStream & os) const MathGridInset::normalize(os); os << ']'; } + + +void MathAMSArrayInset::validate(LaTeXFeatures & features) const +{ + features.require("amsmath"); + MathGridInset::validate(features); +} diff --git a/src/mathed/math_amsarrayinset.h b/src/mathed/math_amsarrayinset.h index 6185a6c2a5..9f3901fe54 100644 --- a/src/mathed/math_amsarrayinset.h +++ b/src/mathed/math_amsarrayinset.h @@ -35,7 +35,8 @@ public: void write(WriteStream & os) const; /// void normalize(NormalStream &) const; - + /// + void validate(LaTeXFeatures & features) const; private: virtual std::auto_ptr doClone() const; /// diff --git a/src/mathed/math_arrayinset.C b/src/mathed/math_arrayinset.C index 1e1554d45c..6cbcd3a093 100644 --- a/src/mathed/math_arrayinset.C +++ b/src/mathed/math_arrayinset.C @@ -10,6 +10,7 @@ #include +#include "LaTeXFeatures.h" #include "math_arrayinset.h" #include "math_data.h" #include "math_parser.h" @@ -130,3 +131,11 @@ void MathArrayInset::maple(MapleStream & os) const MathGridInset::maple(os); os << ')'; } + + +void MathArrayInset::validate(LaTeXFeatures & features) const +{ + if (name_ == "subarray") + features.require("amsmath"); + MathGridInset::validate(features); +} diff --git a/src/mathed/math_arrayinset.h b/src/mathed/math_arrayinset.h index a61e7c036b..f3f9b7d5ee 100644 --- a/src/mathed/math_arrayinset.h +++ b/src/mathed/math_arrayinset.h @@ -25,7 +25,7 @@ public: 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); /// void metrics(MetricsInfo & mi, Dimension & dim) const; @@ -44,7 +44,8 @@ public: void normalize(NormalStream & os) const; /// void maple(MapleStream & os) const; - + /// + void validate(LaTeXFeatures & features) const; private: virtual std::auto_ptr doClone() const; /// diff --git a/src/mathed/math_substackinset.C b/src/mathed/math_substackinset.C index 6a288af21b..b60e4898cc 100644 --- a/src/mathed/math_substackinset.C +++ b/src/mathed/math_substackinset.C @@ -10,6 +10,7 @@ #include +#include "LaTeXFeatures.h" #include "math_substackinset.h" #include "math_data.h" #include "math_mathmlstream.h" @@ -75,3 +76,10 @@ void MathSubstackInset::maple(MapleStream & os) const MathGridInset::maple(os); os << ')'; } + + +void MathSubstackInset::validate(LaTeXFeatures & features) const +{ + features.require("amsmath"); + MathGridInset::validate(features); +} diff --git a/src/mathed/math_substackinset.h b/src/mathed/math_substackinset.h index 8013695740..ca84d21e58 100644 --- a/src/mathed/math_substackinset.h +++ b/src/mathed/math_substackinset.h @@ -38,6 +38,8 @@ public: void normalize(NormalStream &) const; /// void maple(MapleStream &) const; + /// + void validate(LaTeXFeatures & features) const; private: virtual std::auto_ptr doClone() const; };