The branch, 2.0.x, has been updated. - Log -----------------------------------------------------------------
commit 30219ffc37300933b9d67b868df55d841494f82f Author: Georg Baum <[email protected]> Date: Sun May 13 18:54:14 2012 +0200 Forgot the test case for bug #8116. diff --git a/src/tex2lyx/test/test-structure.tex b/src/tex2lyx/test/test-structure.tex index 6ca8769..609860f 100644 --- a/src/tex2lyx/test/test-structure.tex +++ b/src/tex2lyx/test/test-structure.tex @@ -30,6 +30,23 @@ \newcommand{\strong}[1]{\textbf{#1}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands. +%% Special footnote code from the package 'stblftnt.sty' +%% Author: Robin Fairbairns -- Last revised Dec 13 1996 +\let\SF@@footnote\footnote +\def\footnote{\ifx\protect\@typeset@protect + \expandafter\SF@@footnote +\else + \expandafter\SF@gobble@opt +\fi +} +\expandafter\def\csname SF@gobble@opt \endcsname{\@ifnextchar[%] + \SF@gobble@twobracket + \@gobble +} +\edef\SF@gobble@opt{\noexpand\protect + \expandafter\noexpand\csname SF@gobble@opt \endcsname} + \def\SF@gobble@twobracket[#1]#2{} + \newenvironment{foo}{==[}{]==} \usepackage{fixltx2e} % this should cause the fixltx2e module to be loaded commit 72023030d9908038295822adadfc29551917354e Author: Georg Baum <[email protected]> Date: Sun May 13 18:41:51 2012 +0200 Fix bug #8116. The string we parse as name may contain backslashes if \csname ... \endcsname is used. Therefore we have to output it using asInput() instead of cs(). diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp index d1fd963..b3202ac 100644 --- a/src/tex2lyx/Preamble.cpp +++ b/src/tex2lyx/Preamble.cpp @@ -1269,8 +1269,12 @@ void Preamble::parse(Parser & p, string const & forceclass, else if (t.cs() == "def") { string name = p.get_token().cs(); + // In fact, name may be more than the name: + // In the test case of bug 8116 + // name == "csname SF@gobble@opt \endcsname". + // Therefore, we need to use asInput() instead of cs(). while (p.next_token().cat() != catBegin) - name += p.get_token().cs(); + name += p.get_token().asInput(); if (!in_lyx_preamble) h_preamble << "\\def\\" << name << '{' << p.verbatim_item() << "}"; ----------------------------------------------------------------------- Summary of changes: src/tex2lyx/Preamble.cpp | 6 +++++- src/tex2lyx/test/test-structure.tex | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletions(-) hooks/post-receive -- The LyX Source Repository
