]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathBox.cpp
* src/mathed/InsetMathHull.cpp:
[lyx.git] / src / mathed / InsetMathBox.cpp
index c5272c20e00ba2cba6b3bbfb35cdb36a33ed29b6..603ea05b380dae32128e51a5fd4a8abaf35df39f 100644 (file)
@@ -39,6 +39,7 @@ InsetMathBox::InsetMathBox(docstring const & name)
 
 void InsetMathBox::write(WriteStream & os) const
 {
+       ModeSpecifier specifier(os, TEXT_MODE);
        os << '\\' << name_ << '{' << cell(0) << '}';
 }
 
@@ -73,6 +74,14 @@ void InsetMathBox::infoize(odocstream & os) const
 }
 
 
+void InsetMathBox::validate(LaTeXFeatures & features) const
+{
+       if (name_ == "tag" || name_ == "tag*")
+               features.require("amsmath");
+       cell(0).validate(features);
+}
+
+
 
 /////////////////////////////////////////////////////////////////////
 //
@@ -107,6 +116,7 @@ void InsetMathFBox::draw(PainterInfo & pi, int x, int y) const
 
 void InsetMathFBox::write(WriteStream & os) const
 {
+       ModeSpecifier specifier(os, TEXT_MODE);
        os << "\\fbox{" << cell(0) << '}';
 }
 
@@ -203,6 +213,7 @@ void InsetMathMakebox::draw(PainterInfo & pi, int x, int y) const
 
 void InsetMathMakebox::write(WriteStream & os) const
 {
+       ModeSpecifier specifier(os, TEXT_MODE);
        os << (framebox_ ? "\\framebox" : "\\makebox");
        if (cell(0).size() || !os.latex()) {
                os << '[' << cell(0) << ']';
@@ -258,6 +269,7 @@ void InsetMathBoxed::draw(PainterInfo & pi, int x, int y) const
 
 void InsetMathBoxed::write(WriteStream & os) const
 {
+       ModeSpecifier specifier(os, MATH_MODE);
        os << "\\boxed{" << cell(0) << '}';
 }