I have a LaTeX document with a PDF containing a schema that has been included with \includepdf[pages={1}, angle=-90]{yyyyyy.pdf}. I would like this PDF to have right numbering like others pages. If I write a fixed page number on the PDF before inclusion this can not move because my document is still evolving.

Is there any way to add a page number (dynamically) in such case, or I must wait the end of my document to edit my page with the good page number and include into my document?

migrated from stackoverflow.com Aug 12 '16 at 10:35

This question came from our site for professional and enthusiast programmers.

  • Can't you create the PDF without a page number and place the PDF as a standalone figure, rather than an entire page? – Rad Lexus Jul 25 '16 at 9:52
  • Try adding the option pagecommand={\thispagestyle{plain}}. – Werner Jul 25 '16 at 14:08

As werner said adding the option pagecommand={\thispagestyle{plain}} would make LaTeX number the page where you include the pdf. However this solution does not hide the original page number. Tilting the page also make the solution harder.

TikZ offer a rather hacky solution, it can overlay over your included pdf. See Positioning relative to page in TikZ to know more about it

Here is how to overlay a 2 on an included pdf, you might have to change the position a little to have it perfectly displayed :

\includepdf[ angle=-90,pagecommand={
\begin{tikzpicture}[remember picture, overlay,every node/.style={anchor=center}]
    \node [fill=white] at (page cs:-0.76,0) {2};

Note that the coordinate system page is from the question I have lin ked.

With \pgfmathsetmacro{\page}{1} you can then change dynamically the page number you have placed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.