38

I'm writing a report, in LaTeX. And I need to include, as appendices, other latex documents I have written. I am currently doing this using pdfpages and it works. However, the inserted PDF has no page numbers and it overlays my base documents page numbering, resulting in no page numbers on the PDF pages. My questions:

  1. How to solve the above problem.
  2. Is there a better way to do this.
N.N.
  • 36,163
  • 2
    As far as I know, pdfpages simply embeds the pages from the other PDFs without recompiling them. I don't think PDF pages has the capacity to edit the inserted PDF at all. If the appendices are your own, why not insert the source with \include or \input? That way it'll recompile and produce consistent page numbers. – Warrick Aug 18 '11 at 15:13
  • I initially did try with both, using \input it would not compile (not sure why) with \include it compiled but the included document wasnt there. So pdf pages provided the simplest solution. – Rabid.Eeyore Aug 19 '11 at 07:13

3 Answers3

39

pdfpages provides the pagecommand option for \includepdf, which can be used to apply a page style for each page, to print headings and more. For example, add plain page style or your own page style to get page numbers on all included pages:

\includepdf[pages=-,pagecommand=\thispagestyle{plain}]{filename}
Stefan Kottwitz
  • 231,401
14

You can also include the next command, for all pdfs that will be put into the document,

\includepdfset{pagecommand=\thispagestyle{plain}}

This command goes after \usepackage{pdfpages}.

adn
  • 11,233
Peter
  • 231
4

This keeps the pagestyle:

\includepdf[pages=myPageNumber, pagecommand={}]{myPresentation.pdf}

However, it does not increment the page number accordingly.

Reference: https://tex.stackexchange.com/a/21249/1567

Wok
  • 267