# How to “stamp” the same text on each page of a document

I want to have drafting information appear on each page of document.

I have seen something similar in the Kluwer document class where it defines \@oddfoot and \@evenfoot for a lot of possibilities.

Is there an easier way than this? Is there a way to do it without overwriting existing headers?

-

You can use the everypage module to execute Latex code just before each page is shipped. You can use PS specials to put in things like watermarks in the page (cf. the watermark package in the ncctools bundle, which I belive uses this technique), or overlay graphics on the page using PS drawing packages.

-
Exactly what I needed. I combine this with TikZ's ability to reference the current page for absolute positioning of the text (see TikZ 2.0 manual Section 15.13.2). –  Niall Murphy Jul 28 '10 at 11:16

There are a couple of packages to stamp a watermark on every page: draftcopy and draftwatermark. Depending on the nature of what you want to stamp on every page, they may be useful to you.

-

You can use the package fancyhdr to simplify the creation and modification of page styles.

However, doing it manually isn’t that hard either. It basically boils down to redefining the \ps@plain command, so that this redefines \@oddfoot and \@evenfoot:

% Define a nice example stamp.
\newcommand\myoverlay{
% Taken from the TikZ documentation.
% NB: This requires \usepackage{tikz}!
\begin{tikzpicture}[remember picture,overlay]
\node [rotate=60,scale=10,text opacity=0.2]
at (current page.center) {Example};
\end{tikzpicture}
}

% Save the old definition:
\let\old@ps@plain\ps@plain

\renewcommand\ps@plain{
% First, load the old definition:
\old@ps@plain

% Now, save the previously (by \@old@ps@plain) defined footers:
\let\old@oddfoot\@oddfoot
\let\old@evenfoot\@evenfoot

% Actual redefinition of the footer to include the overlay stamp.
\gdef\@oddfoot{
\old@oddfoot
\myoverlay
}
\gdef\@evenfoot{
\old@evenfoot
\myoverlay
}
}


Now tested, it works. But notice that it only works on pages whose page style is actually plain. Some pages – e.g. \part title pages – automatically define their page to have some other page style. This can of course be addressed by redefining those page styles as well. But I guess that using fancyvrb or the packages mentioned by Charles save a bit of work.

-

ConTeXt provides layers for that purpose. You can read more about it at http://wiki.contextgarden.net/Layers.

-
For using layers to get watermarks in ConTeXt, see wiki.contextgarden.net/Draft_Watermark –  Aditya Aug 4 '10 at 21:50

The 'background' package is another one that makes it simple to put a watermark (or other overlays) on pages. Default setting, I believe, is to put a huge 'DRAFT' diagonally across the page:

http://tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=background

-