1

I've searched a lot and can't find any answers to this, so I suspect the answer is no.

I'm trying to achieve a text fill effect like you can do in PowerPoint, like so:

Image text fill

It's scaling the image exactly to the bounds of the text (whether it spans across multiple lines or not), and filling the text with that image.

Is this possible to do in LaTeX?

Thanks!

Josh
  • 23

1 Answers1

2

It is quite simple – just a couple of lines of code — with pstricks, more precisely with the pst-text and pst-fill packages.

Also, with auto-pst-pdf, it works with pdflatex if you add to the compiler the switch -shell-escape (for TeX Live, MacTeX) or --enable-write18 (MiKTeX):

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc} 
\usepackage{pst-text, pst-fill, auto-pst-pdf}%
\usepackage{graphicx}

\begin{document}

\centering
\includegraphics[scale=0.4]{Piero_di_Cosimo_1}\medskip

\Huge\sffamily\bfseries
\begin{center}
SOMETIMES TO UNDERSTAND \\
A \begin{pspicture}\psboxfill{\includegraphics{Piero_di_Cosimo.eps}}%
    \pscharpath[fillstyle=boxfill, linestyle=none]{ WORD’S MEANING}
    \end{pspicture} YOU \\
NEED MORE THAN A \\
DEFINITION
\end{center}

\end{document}

enter image description here

Bernard
  • 271,350
  • Thank you very much, Bernard. This gave me what I needed to do more effective searching. I ended up going with the solution given in the second part of this answer here: https://tex.stackexchange.com/a/192990/146997 – Josh Oct 30 '17 at 23:50