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 would like to decorate pages of some pdf documents with tikzpictures. My idea was to include them with pdfpages, and then draw a tikzpicture overlay on top of the page.

\documentclass[12pt]{article}

\usepackage{pdfpages}
\usepackage{tikz}
\begin{document}

\includepdf[pages=1]{someinputpdf}
\begin{tikzpicture}[remember picture,overlay]
\node at (current page.center) {test};
\end{tikzpicture}

\end{document}

However, tikzpicture ends up at page 2 of the resulting document. Is there a way to achieve similar functionality?

share|improve this question

1 Answer 1

up vote 15 down vote accepted

You could use the pagecommand option, such as

\includepdf[pagecommand={\begin{tikzpicture}...\end{tikzpicture}}]{filename}
share|improve this answer
    
Very nice. Can this option be set globally for all \includepdf calls? –  Martin Scharrer Mar 7 '11 at 10:32
    
There is just one slight problem -- it seems that [remember picture, overlay] doesn't work. –  ipavlic Mar 7 '11 at 10:33
    
@ipavlic: What exactly doesn't work? It works fine in my test with [remember picture, overlay] but not without. –  Martin Scharrer Mar 7 '11 at 10:47
1  
To answer my own question: \setkeys{pdfpages}{<options>} makes the options global, like with graphicx. –  Martin Scharrer Mar 7 '11 at 10:48
    
@Martin: apparently, I was mistaken. It works as expected, both with and without [remember picture, overlay]. –  ipavlic Mar 7 '11 at 11:55

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.