]> git.lyx.org Git - lyx.git/blobdiff - src/tex2lyx/math.cpp
Fix #10778 (issue with CJK and language nesting)
[lyx.git] / src / tex2lyx / math.cpp
index f615926efa6e2d6daf0eae8902b58891e6025c18..9fddeea16c7536cd32f0fecf49098c446686d087 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <config.h>
 
+#include "Preamble.h"
 #include "tex2lyx.h"
 
 #include <iostream>
@@ -27,6 +28,16 @@ bool is_math_env(string const & name)
 }
 
 
+bool is_display_math_env(string const & name)
+{
+       CommandMap::const_iterator it = known_math_environments.find(name);
+       if (it != known_math_environments.end())
+               if (!it->second.empty())
+                       return it->second.back() == displaymath;
+       return false;
+}
+
+
 void parse_math(Parser & p, ostream & os, unsigned flags, const mode_type mode)
 {
        while (p.good()) {
@@ -110,7 +121,7 @@ void parse_math(Parser & p, ostream & os, unsigned flags, const mode_type mode)
 
                else if (t.cat() == catComment) {
                        if (!t.cs().empty())
-                               cerr << "Ignoring comment: " << t.asInput();
+                               os << t.asInput();
                        else
                                // "%\n" combination
                                p.skip_spaces();
@@ -221,6 +232,16 @@ void parse_math(Parser & p, ostream & os, unsigned flags, const mode_type mode)
                        os << "\\\\";
                }
 
+               else if (t.cs() == "vref" || t.cs() == "vpageref") {
+                       os << t.asInput();
+                       preamble.registerAutomaticallyLoadedPackage("varioref");
+               }
+
+               else if (t.cs() == "textipa") {
+                       os << t.asInput();
+                       preamble.registerAutomaticallyLoadedPackage("tipa");
+               }
+
                else
                        os << t.asInput();