Do not swallow math comments in tex2lyx.

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.
This commit is contained in:
Georg Baum 2012-05-06 16:46:06 +02:00
parent 4ce24954aa
commit c9f68139cb
3 changed files with 11 additions and 2 deletions

View 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();

View 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();

View 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