11 Sep 2011 18:37
Preview FAQ: colors
Julien Rioux <jrioux <at> physics.utoronto.ca>
2011-09-11 16:37:32 GMT
2011-09-11 16:37:32 GMT
How to customize foreground and background colors in previews,
compatible with the tightpage option, and both dvips and pdflatex backends?
--
Ideally, with a preamble such as
\usepackage{color}
\pagecolor{blue}
\color{red}
\usepackage[active,tightpage]{preview}
the output would have red text on blue background on each page, and the
correct tight bounding box. But this is not the case: only the
\pagecolor is understood and only by pdflatex.
We can add hooks to each preview to add the foreground color.
\g <at> addto <at> macro\preview{\color{red}}
It works. Well, what about adding the \pagecolor there as well? The
problem is that the special postscript code from \pagecolor interferes
with the postscript code generated by the tightpage option (the bounding
box info appears after the color info in the generated postscript, but
it should appear before). Nevermind, we'll generate our own. The
relevant code is
\color{blue}\special{ps::clippath fill}
(Continue reading)
RSS Feed