X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftex2lyx%2Fmath.cpp;h=1a8158b5a27847fa97962d8b5533b5feac004f89;hb=05446b232f7716fecdea26af61b3fa1de0274c4d;hp=44b0f083897a0dbac249416194b1982255e03e00;hpb=337c6d157754e2f613ddbc3bca072ca658282edf;p=lyx.git diff --git a/src/tex2lyx/math.cpp b/src/tex2lyx/math.cpp index 44b0f08389..1a8158b5a2 100644 --- a/src/tex2lyx/math.cpp +++ b/src/tex2lyx/math.cpp @@ -12,6 +12,7 @@ #include +#include "Preamble.h" #include "tex2lyx.h" #include @@ -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()) { @@ -58,7 +69,7 @@ void parse_math(Parser & p, ostream & os, unsigned flags, const mode_type mode) // if (t.cat() == catMath) { if (mode == MATHTEXT_MODE) { - // we are inside some text mode thingy, so opening new math is allowed + // we are inside some text mode thing, so opening new math is allowed Token const & n = p.get_token(); if (n.cat() == catMath) { // TeX's $$...$$ syntax for displayed math @@ -221,6 +232,11 @@ 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 os << t.asInput();