# How can I have text colored on screen and black on printing?

I have a document with colored hyperlinks, using the options of the `hyperref` package. I also have lots of tikz-figures that use various shades of gray and occasionally some colors.

The way my document is right now looks very nice on screen but not so great when I print it on a monochrome printer. I tried using `xcolor`'s `\selectcolormodel{gray}` but then all the colors are printed as shades of grey. This is ok for figures but not acceptable for the text.

Is there a way to change the color of the text (and only that) to black when printing the document? The figures should stay as they are (colored/shaded).

If this is not possible, is there a way to turn all the figures in grayscale and all the text to black?

Are things like these possible or do I have to maintain 2 diferrent versions of my document (i.e. one for on-screen reading and the other one for printing)?

I am using XeLaTeX if it is of any importance.

some text

and a figure with shades of grey

-
If the colored text is coming just from hyperlinks, it's a matter of saying `\hypersetup{colorlinks=false}`, I believe. – egreg Jul 8 '11 at 10:23
Nice picture. Is it done with TikZ? – N.N. Jul 8 '11 at 10:28
I think you have to go with two versions of the document. Except the PDF format itself support two sets of colors. – Martin Scharrer Jul 8 '11 at 10:55
Do your really need colored links? You can switch to a colored border around links to make them stand out (see egreg's first comment). This border is then not printed. – Martin Scharrer Jul 8 '11 at 12:48
@Martin, thank you for your suggestion. No I don't really need them. I just prefer them. I find the colored boxes rather distracting. And if there are lots of references close together sometimes they fall on each other. I think that my question is rather specific though. Even something like `It cannot be done` + a reference is a perfectly acceptable answer. If nothing comes up, I will ask on `comp.text.tex`. – pmav99 Jul 9 '11 at 20:03

try

``````\usepackage[ocgcolorlinks]{hyperref}
``````

it needs the `pdftex` or (for xelatex) the `dvipdfm` driver – Herbert Jul 8 '11 at 12:42
@pmav99: See e.g. tug.org/applications/hyperref/ftp/README. "Experimental option `ocgcolorlink`. The idea are colored links, when viewed, but printed without colors. This [..] uses Optional Content Groups, a feature introduced in PDF 1.5. Main disadvantage: Links cannot be broken across lines. PDF reference 1.7: 4.10.2 "Making Graphical Content Optional": Graphics state operations, such as setting the color, ..., are still applied. Therefore the link text is put in a box and set twice, with and without color." Exactly what I thought. – Martin Scharrer Jul 8 '11 at 12:51