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 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
add comment

1 Answer

up vote 8 down vote accepted

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

\documentclass{standalone}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{tikz}
\usepackage{lipsum}
\usetikzlibrary{fadings}
\begin{tikzfadingfrompicture}[name=lipsum]
  \node
  [anchor=south west,text=transparent!0,text width=6cm,font=\bfseries\scriptsize]
  {\lipsum[1]};
\end{tikzfadingfrompicture}
\begin{document}
\begin{tikzpicture}
  \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}};
\end{tikzpicture}
\end{document}

enter image description here

share|improve this answer
1  
`` `` Sweet!! `` `` –  percusse Jul 13 '12 at 17:17
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.