tex2lyx: addendum to r39949; handle the case that LyX's defined colors are defined but not used, now it is assures that only the color is used that is actually used for \color and \pagecolor

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39989 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Uwe Stöhr 2011-10-26 00:31:02 +00:00
parent fc75fcafbd
commit e9d2c866b4
2 changed files with 19 additions and 1 deletions

View File

@ -915,6 +915,24 @@ void parse_preamble(Parser & p, ostream & os,
h_suppress_date = "true";
}
else if (t.cs() == "color") {
string argument = p.getArg('{', '}');
// check the case that not a color defined by LyX is used
if (argument != "document_fontcolor") {
h_preamble << t.asInput() << '{' << argument << '}';
h_fontcolor = "";
}
}
else if (t.cs() == "pagecolor") {
string argument = p.getArg('{', '}');
// check the case that not a color defined by LyX is used
if (argument != "page_backgroundcolor") {
h_preamble << t.asInput() << '{' << argument << '}';
h_backgroundcolor = "";
}
}
else if (t.cs() == "makeatletter") {
// LyX takes care of this
p.setCatCode('@', catLetter);

View File

@ -15,7 +15,7 @@
\definecolor{document_fontcolor}{rgb}{0.66796875, 1, 0}
\color{document_fontcolor}
\definecolor{note_fontcolor}{rgb}{0, 0, 1}
\definecolor{shadecolor}{rgb}{1, 0, 0}
\definecolor{shadecolor}{rgb}{1, 1, 0}
\usepackage{framed}
\usepackage{calc}
\usepackage{fancybox}