TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I include a tikzpicture on every page?

I would like to create a complicated document template (page should be framed, and have a table to hold document information both in the header and footer).

I was thinking of using something like:

\begin{tikzpicture}[remember picture,overlay]  
% complicated layout should be here, simple example is given below:  
% \node [xshift=1cm,yshift=1cm] at (current page.south west)  
% {This is an absolutely positioned text in the page};  

Do you have any other suggestions on how to create such a template?

share|improve this question
up vote 6 down vote accepted

What I usually do in LaTeX is setting up a header and place the TikZ code which should appear on every page in the header. If you do not want to display a header, you can anyway use this pattern and leave all other header fields empty. And if you are already using a header you can place this code to an arbitrary cell since it is using the overlay option.

share|improve this answer

everyshi is an alternative to everypage. I suppose the bophook package and your TikZ overlay snippet will also work.

To save some compile time you should probably save your tikzpicture to a \savebox (reference) and do a \usebox on every page, though.

share|improve this answer

I assume, from the \begin...\end you use in your example, that you are using LaTeX. ConTeXt has it's own builtin way of handling this.

You can use something like you give in your example together with the everypage package, which would take care of placing the material on each page.

If your "page template" is more complicated, I suggest you take a look at the flowfram package. You can achieve fairly complicated things with that.

share|improve this answer

I would look into the TikZ cousin pgffor commands, they allow a better looping construct than LaTeX typically employs. That said I don't know if looping over pages is something it can do. In that case maybe Rupert is correct and putting this in the header is good for you.

share|improve this answer
Looping over pages is not something it can do, because TeX's processing system "ships out" each page and forgets about it. – Matthew Leingang Nov 5 '10 at 18:25

Your Answer


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.