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

I would like to write some text in latex, then replace the black of the letters by a transparent layer, and overlay on top of a PDF photo. I could do it by exporting to photoshop, but I would like a latex-only solution. Thanks!

share|improve this question
Could you provide an example? How much text are we talking about, one word, a sentence, a whole paragraph? – Jake Jul 13 '12 at 10:23
I don't really understand the question but if I interpreted right you want something like this: tex.stackexchange.com/questions/47024/… – szantaii Jul 13 '12 at 11:15
@szantaii: I don't think that's what the OP wants: In the solution you linked to, a simple shape is used for clipping a block of text. The OP wants to use the shape of the letters to clip a photo, if I understand correctly. Maybe tex.stackexchange.com/a/58873/2552 can help – Jake Jul 13 '12 at 12:04
up vote 10 down vote accepted

Here's a solution with tikz using scope fading and tikzfadingfrompicture.

  [anchor=south west,text=transparent!0,text width=6cm,font=\bfseries\scriptsize]
  \fill [black!20] (-3cm,-3.2cm) rectangle (3cm,3.2cm);
  \node[scope fading=lipsum,fit fading=false,fill=white,minimum size=6.4cm]{};
  \node[scope fading=lipsum,fit fading=false]{\includegraphics[width=6.4cm]{tiger}};

enter image description here

share|improve this answer
`` `` Sweet!! `` `` – percusse Jul 13 '12 at 17:17

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.