#include <iostream>
+
+namespace lyx {
+
using std::cerr;
using std::endl;
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();
}
os << '}';
}
+ else if (t.cs() == "tag") {
+ os << '\\' << t.cs();
+ if (p.next_token().asInput() == "*") {
+ p.get_token();
+ os << '*';
+ }
+ os << '{';
+ parse_math(p, os, FLAG_ITEM, MATHTEXT_MODE);
+ os << '}';
+ }
+
else if (t.cs() == "mbox" || t.cs() == "fbox") {
os << "\\" << t.cs() << '{';
parse_math(p, os, FLAG_ITEM, MATHTEXT_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();
// }])
+
+
+} // namespace lyx