diff --git a/src/tex2lyx/preamble.cpp b/src/tex2lyx/preamble.cpp index fb31e65a3a..dafceb42e0 100644 --- a/src/tex2lyx/preamble.cpp +++ b/src/tex2lyx/preamble.cpp @@ -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); diff --git a/src/tex2lyx/test/box-color-size-space-align.tex b/src/tex2lyx/test/box-color-size-space-align.tex index 33d76cd008..dcbfb70d3b 100644 --- a/src/tex2lyx/test/box-color-size-space-align.tex +++ b/src/tex2lyx/test/box-color-size-space-align.tex @@ -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}