Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

text

and a figure with shades of grey

shades

share|improve this question
3  
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
1  
Nice picture. Is it done with TikZ? –  N.N. Jul 8 '11 at 10:28
1  
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
2  
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
2  
@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
show 7 more comments

1 Answer

try

\usepackage[ocgcolorlinks]{hyperref}

Needs a pdf version 1.5 and links can not be broken across lines.

share|improve this answer
1  
thank you. Unfortunately it is not good enough. Links are still colored, and the links that cannot be broken are very inconvenient too. Causes lots of overfull hboxes. By the way, ocgcolorlinks is an undocumented option? I can't find any reference at hyperref's doc. –  pmav99 Jul 8 '11 at 12:05
    
it needs the pdftex or (for xelatex) the dvipdfm driver –  Herbert Jul 8 '11 at 12:42
1  
@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
add comment

Your Answer

 
discard

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.