TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In a previous question ( How do I globally set the text color in XeLaTeX ), I've asked how to globally set a text colour in XeLaTeX and got some excellent answers.

However, while the proposed mechanisms seem to work in most cases, they also seem to fail consistently for the colour white. I'm not sure if this is a bug or if I'm doing something wrong here, but please consider the following example:

\setmainfont[Color=white]{Linux Libertine O}
\setsansfont[Color=white]{Linux Biolinum O}


\chapter{A chapter}
\section{A section}
\texttt{Some mono text}
The text above is invisible as it is all black and not white.

{\addfontfeature{Color=yellow} Some yellow text showing up on the dark page.}
{\addfontfeature{Color=white} Some white text invisible on the dark page.}


The example follows @AlanMunn s suggestion on the other question. The result is:

White text is black

The white text is printed in black. Other colours (like yellow in the example) work well.

If I use @Herbert s suggestion of adding



to the document, I keep stumbling over environments that are still black, like the captions of figures for example. In any case, the \color command seems to be stronger than the fontspec setting.

Any thoughts or solutions to this?

share|improve this question
This looks like a bug (maybe in the driver?) It works with LuaLaTeX, so if that's an option for you, you could try that. Alternatively, loading xcolor with the [svgnames] option and using Snow instead of white gives you a very close approximation. – Alan Munn Sep 13 '11 at 12:25
Another alternative is to use the technique that Philippe Goutet in your previous question. tex.stackexchange.com/questions/26549/… – Alan Munn Sep 13 '11 at 13:06
@AlanMunn Thanks for pointing back to Philippe's answer. Indeed, that's the one that should get the credit here. – kongo09 Sep 13 '11 at 21:24

It seems to be a bug in XeTeX, as

\font\x="Linux Libertine O:color=FFFFFF"
\x ABC\bye

prints ABC in black, while

\font\x="Linux Libertine O:color=FFFFFE"
\x ABC\bye

prints ABC in "almost white".

So the answer might be

\setmainfont[Color=FFFFFE]{Linux Libertine O}

This "explains" Alan's suggestion.

share|improve this answer
You could make it FEFEFE for even color distribution. – Andrey Vihrov Sep 13 '11 at 15:28
Thanks, that's a good workaround, but not really white. – kongo09 Sep 13 '11 at 21:24
@kongo09: sorry, but it seems that really white is not accepted by XeTeX. – egreg Sep 13 '11 at 21:27
up vote 1 down vote accepted

Full credit goes to Philippe Goutet who wrote the follwing answer here: How do I globally set the text color in XeLaTeX

Thanks to Alan Munn for pointing this out.

Here's a way to do it which will work whether you use XeLaTeX or not, and whether you use Komascript or not. It works by redefining the default color used by LaTeX.






\section{A section heading}

some test text

share|improve this answer
Just doing \color{red} before \begin{document} would have the same effect. – David Carlisle Jul 15 at 6:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.