Fix misparsing of \usepackage in

\@ifundefined{textcolor}{\usepackage{color}}{}


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37140 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2011-01-06 21:38:26 +00:00
parent 416d19ff84
commit 9ac7fa483d

View File

@ -1094,6 +1094,16 @@ void parse_preamble(Parser & p, ostream & os,
}
}
else if (t.cs() == "@ifundefined") {
// prevent misparsing of \usepackage if it is used
// as an argument (see e.g. our own output of
// \@ifundefined above)
h_preamble << t.asInput();
h_preamble << '{' << p.verbatim_item() << '}';
h_preamble << '{' << p.verbatim_item() << '}';
h_preamble << '{' << p.verbatim_item() << '}';
}
else if (!t.cs().empty() && !in_lyx_preamble)
h_preamble << '\\' << t.cs();
}