mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-27 14:29:21 +00:00
tex2lyx:
- support for box background color, document fontcolor and background color (note_fontcolor was already supported) - add colors and a nested box to the testfile git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39949 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
5c5850e28f
commit
2a8dcf2b10
@ -52,7 +52,6 @@ Format LaTeX feature LyX feature
|
||||
347 tabular valign InsetTabular
|
||||
348 \phantom, \hphantom, \vphantom InsetPhantom
|
||||
350 ? \default_output_format
|
||||
351 ? \backgroundcolor
|
||||
353 \printsubindex InsetIndex
|
||||
354 \printindex*, \printsubindex* InsetIndex
|
||||
358 custom bibtex command \bibtex_command
|
||||
@ -73,9 +72,6 @@ Format LaTeX feature LyX feature
|
||||
378 revision info InsetInfo
|
||||
380 ? InsetPreview
|
||||
381 \xymatrix@!{0,R,C} InsetMathXYMatrix
|
||||
382 note_fontcolor InsetNote
|
||||
384 document font color \fontcolor
|
||||
385 shaded box background color \boxbgcolor
|
||||
386 LyX version InsetInfo
|
||||
390 forward/reverse search \forward_search, \forward_macro
|
||||
391 decimal alignment in tables InsetTabular
|
||||
|
@ -212,6 +212,9 @@ string h_use_bibtopic = "false";
|
||||
string h_paperorientation = "portrait";
|
||||
string h_suppress_date = "false";
|
||||
string h_use_refstyle = "0";
|
||||
string h_backgroundcolor;
|
||||
string h_boxbgcolor;
|
||||
string h_fontcolor;
|
||||
string h_notefontcolor;
|
||||
string h_secnumdepth = "3";
|
||||
string h_tocdepth = "3";
|
||||
@ -764,8 +767,14 @@ void end_preamble(ostream & os, TextClass const & /*textclass*/)
|
||||
<< "\\paperorientation " << h_paperorientation << '\n'
|
||||
<< "\\suppress_date " << h_suppress_date << '\n'
|
||||
<< "\\use_refstyle " << h_use_refstyle << '\n';
|
||||
if (!h_fontcolor.empty())
|
||||
os << "\\fontcolor " << h_fontcolor << '\n';
|
||||
if (!h_notefontcolor.empty())
|
||||
os << "\\notefontcolor " << h_notefontcolor << '\n';
|
||||
if (!h_backgroundcolor.empty())
|
||||
os << "\\backgroundcolor " << h_backgroundcolor << '\n';
|
||||
if (!h_boxbgcolor.empty())
|
||||
os << "\\boxbgcolor " << h_boxbgcolor << '\n';
|
||||
os << h_margins
|
||||
<< "\\secnumdepth " << h_secnumdepth << "\n"
|
||||
<< "\\tocdepth " << h_tocdepth << "\n"
|
||||
@ -1127,9 +1136,18 @@ void parse_preamble(Parser & p, ostream & os,
|
||||
string const color = p.getArg('{', '}');
|
||||
string const space = p.getArg('{', '}');
|
||||
string const value = p.getArg('{', '}');
|
||||
if (color == "note_fontcolor" && space == "rgb") {
|
||||
if (color == "document_fontcolor" && space == "rgb") {
|
||||
RGBColor c(RGBColorFromLaTeX(value));
|
||||
h_fontcolor = X11hexname(c);
|
||||
} else if (color == "note_fontcolor" && space == "rgb") {
|
||||
RGBColor c(RGBColorFromLaTeX(value));
|
||||
h_notefontcolor = X11hexname(c);
|
||||
} else if (color == "page_backgroundcolor" && space == "rgb") {
|
||||
RGBColor c(RGBColorFromLaTeX(value));
|
||||
h_backgroundcolor = X11hexname(c);
|
||||
} else if (color == "shadecolor" && space == "rgb") {
|
||||
RGBColor c(RGBColorFromLaTeX(value));
|
||||
h_boxbgcolor = X11hexname(c);
|
||||
} else {
|
||||
h_preamble << "\\definecolor{" << color
|
||||
<< "}{" << space << "}{" << value
|
||||
|
@ -10,6 +10,10 @@
|
||||
|
||||
\usepackage{amsmath}
|
||||
\usepackage{color}
|
||||
\definecolor{page_backgroundcolor}{rgb}{1, 0.3359375, 0}
|
||||
\pagecolor{page_backgroundcolor}
|
||||
\definecolor{document_fontcolor}{rgb}{0.66796875, 1, 0}
|
||||
\color{document_fontcolor}
|
||||
\definecolor{note_fontcolor}{rgb}{0, 0, 1}
|
||||
\definecolor{shadecolor}{rgb}{1, 0, 0}
|
||||
\usepackage{framed}
|
||||
@ -140,6 +144,11 @@ $\boxed{\int A=B}$
|
||||
\begin{shaded}%
|
||||
Shaded background box\end{shaded}
|
||||
|
||||
\begin{minipage}[c]{1\columnwidth}%
|
||||
\begin{shaded}%
|
||||
Shaded background box, with inner minipage\end{shaded}%
|
||||
\end{minipage}
|
||||
|
||||
\section{Colors}
|
||||
|
||||
\subsection{Predefined Colors}
|
||||
|
Loading…
Reference in New Issue
Block a user