]> git.lyx.org Git - features.git/commitdiff
Do not swallow math comments in tex2lyx.
authorGeorg Baum <baum@lyx.org>
Sun, 6 May 2012 14:46:06 +0000 (16:46 +0200)
committerGeorg Baum <baum@lyx.org>
Sun, 6 May 2012 14:48:44 +0000 (16:48 +0200)
This is not needed, since LyX supports comments in math. Data loss with math
comments containing a backslash in LyX has been fixed as well.
The test case was found in bug #8104.

src/mathed/MathParser.cpp
src/tex2lyx/math.cpp
src/tex2lyx/test/test-insets.tex

index df7169432048ca6252524d09f0f084f8ffcb59bf..9752320095312a75ff1b857d007ee0e679b50c27 100644 (file)
@@ -1018,7 +1018,7 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
                                Token const & t = getToken();
                                if (t.cat() == catNewline)
                                        break;
-                               s += t.asString();
+                               s += t.asInput();
                        }
                        cell->push_back(MathAtom(new InsetMathComment(buf, s)));
                        skipSpaces();
index 1a8158b5a27847fa97962d8b5533b5feac004f89..83e21013cccaf457d90edc565ce06fff8df8af1a 100644 (file)
@@ -121,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();
index b30050dc4ab133e5e551e8d9e4fc0f596b3f7b16..30ecd0f3955648f7fa873f219dc0546339913af1 100644 (file)
@@ -535,6 +535,15 @@ builtin \textasciicircum % with a comment
 A sub\textsubscript{sc\emph{ript}} and super\textsuperscript{script
 with $a^2+b^2=c^2$ math}.
 
+\section{Mathematics\index{Mathematics}}
+
+Let $f:\left[  a,b\right]  \rightarrow%
+%TCIMACRO{\U{211d} }%
+%BeginExpansion
+\mathbb{R}
+%EndExpansion
+$.
+
 \printindex{}
 
 \printnomenclature hello