mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 18:08:10 +00:00
\color may have an optional argument (part of bug #6567).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40134 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
292d4e3d5d
commit
7185c39fb1
@ -1003,17 +1003,22 @@ void Preamble::parse(Parser & p, string const & forceclass,
|
||||
}
|
||||
|
||||
else if (t.cs() == "color") {
|
||||
string const space =
|
||||
(p.hasOpt() ? p.getArg('[', ']') : string());
|
||||
string argument = p.getArg('{', '}');
|
||||
// check the case that a standard color is used
|
||||
if (is_known(argument, known_basic_colors)) {
|
||||
if (space.empty() && is_known(argument, known_basic_colors)) {
|
||||
h_fontcolor = rgbcolor2code(argument);
|
||||
preamble.registerAutomaticallyLoadedPackage("color");
|
||||
} else if (argument == "document_fontcolor")
|
||||
} else if (space.empty() && argument == "document_fontcolor")
|
||||
preamble.registerAutomaticallyLoadedPackage("color");
|
||||
// check the case that LyX's document_fontcolor is defined
|
||||
// but not used for \color
|
||||
else {
|
||||
h_preamble << t.asInput() << '{' << argument << '}';
|
||||
h_preamble << t.asInput();
|
||||
if (!space.empty())
|
||||
h_preamble << '[' << space << ']';
|
||||
h_preamble << '{' << argument << '}';
|
||||
// the color might already be set because \definecolor
|
||||
// is parsed before this
|
||||
h_fontcolor = "";
|
||||
|
@ -38,6 +38,8 @@
|
||||
|
||||
\definecolor{darkgreen}{cmyk}{0.5, 0, 1, 0.5}
|
||||
|
||||
\color[rgb]{0,0,0}
|
||||
|
||||
\usepackage{ifpdf} % part of the hyperref bundle
|
||||
\ifpdf % if pdflatex is used
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user