]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathBox.cpp
A little cleanup of the layout files.
[lyx.git] / src / mathed / InsetMathBox.cpp
index c5272c20e00ba2cba6b3bbfb35cdb36a33ed29b6..3e101232da8cfde9294dc32c4a97f87a571eae4d 100644 (file)
@@ -3,7 +3,7 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author André Pönitz
+ * \author André Pönitz
  * \author Ling Li (InsetMathMakebox)
  *
  * Full author contact details are available in file CREDITS.
@@ -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);
+}
+
+
 
 /////////////////////////////////////////////////////////////////////
 //
@@ -90,7 +99,7 @@ void InsetMathFBox::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        FontSetChanger dummy(mi.base, "textnormal");
        cell(0).metrics(mi, dim);
-       metricsMarkers(dim, 3); // 1 pixel space, 1 frame, 1 space
+       metricsMarkers2(dim, 3); // 1 pixel space, 1 frame, 1 space
 }
 
 
@@ -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) << '}';
 }