]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MathStream.h
Assure correct spacing of colored items in mathed
[lyx.git] / src / mathed / MathStream.h
index f6f6e7525d28665690814f60505288a53341740f..9344dac497e85e6f37531b06984327ed65ed7ea2 100644 (file)
@@ -101,6 +101,10 @@ public:
        void asciiOnly(bool ascii);
        /// tell whether to use only ascii chars when producing latex code
        bool asciiOnly() const { return ascii_; }
+       /// tell whether we are in a MathClass inset
+       void inMathClass(bool mathclass) { mathclass_ = mathclass; };
+       /// tell whether we are in a MathClass inset
+       bool inMathClass() const { return mathclass_; }
        /// LaTeX encoding
        Encoding const * encoding() const { return encoding_; }
 
@@ -142,6 +146,8 @@ private:
        Encoding const * encoding_;
        /// Row entry we are in
        TexRow::RowEntry row_entry_;
+       /// whether we are in a MathClass inset
+       bool mathclass_;
 };
 
 ///
@@ -340,7 +346,7 @@ class MathExportException : public std::exception {};
 class MathStream {
 public:
        /// Builds a stream proxy for os; the MathML namespace is given by xmlns (supposed to be already defined elsewhere in the document).
-       explicit MathStream(odocstream & os, std::string xmlns="");
+       explicit MathStream(odocstream & os, std::string xmlns="", bool xmlMode=false);
        ///
        void cr();
        ///
@@ -361,6 +367,8 @@ public:
        bool inText() const { return in_text_; }
        ///
        std::string xmlns() const { return xmlns_; }
+       ///
+       bool xmlMode() const { return xml_mode_; }
        /// Returns the tag name prefixed by the name space if needed.
        std::string namespacedTag(std::string tag) const { return ((xmlns().empty()) ? "" : xmlns() + ":") + tag; }
 private:
@@ -379,6 +387,8 @@ private:
        ///
        std::string xmlns_;
        ///
+       bool xml_mode_;
+       ///
        friend class SetMode;
 };
 
@@ -646,7 +656,7 @@ OctaveStream & operator<<(OctaveStream &, char);
 OctaveStream & operator<<(OctaveStream &, int);
 
 
-docstring convertDelimToXMLEscape(docstring const & name);
+docstring convertDelimToXMLEscape(docstring const & name, bool xmlmode);
 
 } // namespace lyx