37

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.

migrated from stackoverflow.com Aug 18 '11 at 13:48

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

  • 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 7:13
37

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}
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}.

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

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.