]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_spaceinset.C
rename commandtags.h to lfuns.h and renumber/cleanup. Rebuild the tree !
[lyx.git] / src / mathed / math_spaceinset.C
index 7f2461ba9467364b45ca7c1e5f605abb4c2f3c2c..d2d2232595e995ec7bfcbdc1ed698ea61f51dc68 100644 (file)
@@ -1,12 +1,10 @@
-#ifdef __GNUG__
-#pragma implementation
-#endif
 
 #include "math_spaceinset.h"
 #include "math_support.h"
 #include "LColor.h"
 #include "frontends/Painter.h"
 #include "math_mathmlstream.h"
+#include "LaTeXFeatures.h"
 #include "debug.h"
 
 
@@ -27,8 +25,8 @@ MathSpaceInset::MathSpaceInset(int sp)
 MathSpaceInset::MathSpaceInset(string const & name)
        : space_(1)
 {
-       for (int i = 0; i < nSpace; ++i) 
-               if (latex_mathspace[i] == name) 
+       for (int i = 0; i < nSpace; ++i)
+               if (latex_mathspace[i] == name)
                        space_ = i;
 }
 
@@ -86,18 +84,28 @@ void MathSpaceInset::incSpace()
 }
 
 
-void MathSpaceInset::maplize(MapleStream & os) const
+void MathSpaceInset::validate(LaTeXFeatures & features) const
+{
+       if (space_ >= 0 && space_< nSpace) {
+               if ((latex_mathspace[space_] == "negmedspace")
+                || (latex_mathspace[space_] == "negthickspace"))
+                       features.require("amsmath");
+       }
+}
+
+
+void MathSpaceInset::maple(MapleStream & os) const
 {
        os << ' ';
 }
 
-void MathSpaceInset::mathematicize(MathematicaStream & os) const
+void MathSpaceInset::mathematica(MathematicaStream & os) const
 {
        os << ' ';
 }
 
 
-void MathSpaceInset::octavize(OctaveStream & os) const
+void MathSpaceInset::octave(OctaveStream & os) const
 {
        os << ' ';
 }
@@ -105,12 +113,14 @@ void MathSpaceInset::octavize(OctaveStream & os) const
 
 void MathSpaceInset::normalize(NormalStream & os) const
 {
-       os << "[space " << int(space_) << ' ' << latex_mathspace[space_] << "] ";
+       os << "[space " << int(space_) << "] ";
 }
 
 
 void MathSpaceInset::write(WriteStream & os) const
 {
-       if (space_ >= 0 && space_ < nSpace)
-               os << '\\' << latex_mathspace[space_] << ' ';
+       if (space_ >= 0 && space_ < nSpace) {
+               os << '\\' << latex_mathspace[space_];
+               os.pendingSpace(true);
+       }
 }