]> git.lyx.org Git - lyx.git/blobdiff - src/tex2lyx/math.C
code cosmetics to the iterator fix
[lyx.git] / src / tex2lyx / math.C
index b9458e07efe17e69d226ef4a04d0714f7189d65c..7a883d928b21a4b814289c6ce53c84af822d86af 100644 (file)
@@ -25,18 +25,7 @@ using std::string;
 
 bool is_math_env(string const & name)
 {
-       static char const * const known_math_envs[] = { "equation",
-       "equation*", "eqnarray", "eqnarray*", "align", "align*", "gather",
-       "gather*", "multline", "multline*", "math", "displaymath", "flalign",
-       "flalign*",
-       // These require extra args
-       "alignat", "alignat*", "xalignat", "xalignat*", "xxalignat",
-       0};
-
-       for (char const * const * what = known_math_envs; *what; ++what)
-               if (*what == name)
-                       return true;
-       return false;
+       return known_math_environments.find(name) != known_math_environments.end();
 }
 
 
@@ -216,6 +205,13 @@ void parse_math(Parser & p, ostream & os, unsigned flags, const mode_type mode)
                else if (t.cs() == "ss")
                        os << "ß";
 
+               else if (t.cs() == "cr") {
+                       // lyx can't handle \\cr
+                       cerr << "Warning: Converting TeX '\\cr' to LaTeX '\\\\'."
+                            << endl;
+                       os << "\\\\";
+               }
+
                else
                        os << t.asInput();