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 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?

share|improve this question
add comment

5 Answers

up vote 14 down vote accepted

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.

share|improve this answer
1  
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
add comment

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

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

share|improve this answer
3  
For using layers to get watermarks in ConTeXt, see wiki.contextgarden.net/Draft_Watermark –  Aditya Aug 4 '10 at 21:50
add comment

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

share|improve this answer
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.