schussman.com logo

Posting other peoples' hints

I found myself today with the desire to incorporate a bit of watermark-ish text and graphic into a LaTeX document. The regular graphics commands don’t work very well with this, so I went googling and found the code below.

Note that the following isn’t my tip, but the page that references the code points to a 404 link. I tracked down the google cache to get the original link back out and thought I’d share.


\usepackage{eso-pic}
\usepackage{color}
\usepackage{type1cm}
\makeatletter
  \AddToShipoutPicture*{%
    \setlength{\@tempdimb}{.5\paperwidth}%
    \setlength{\@tempdimc}{.5\paperheight}%
    \setlength{\unitlength}{1pt}%
    \put(\strip@pt\@tempdimb,\strip@pt\@tempdimc){%
\makebox(0,0){\rotatebox{45}{\textcolor[gray]{0.75}
{\fontsize{5cm}{5cm}\selectfont{Draft}}}}
    }
}
\makeatother

Change the final makebox statement to include any text or command that you want to be stamped on the page. Also, remove the asterisk from the opening AddToShipoutPicture command to have your image stamped on every page, rather than just the first.


About, the short version

I’m a sociologist. This site is powered by Textpattern, TextDrive and the sociological imagination. For more about me and this site, see the long version.

Syndicate me with any of the following: Atom, RSS, sociology and linklog feeds are available.