I have a chapter of attachments which contains pdf files in this format, using the awesome pdfpages package:

Lots of multipage pdfs following

This works, but apparently clears out the header and page numbers of the parent document. What setting do I have to change to get back the header and page numbers?

  • As far as I understand ---and unfortunately--- this is not possible. However, I do have a little hope because the table of contents points to the correct page when using multiple \includepdf – Mario S. E. Jun 6 '13 at 16:41

You can use the pagecommand key to declare the desired page style for the included pages:

\usepackage[a6paper]{geometry}% just for the example

\fancyhead[C]{Some centered header}




The file b.tex used to produce b.pdf is:


The resulting document, after the inclusion is (notice that the included pages have the fancy page style of the parent document):

enter image description here

| improve this answer | |
  • Thanks! What is the reason for the missing header and page numbers? If I understand your post correctly, I am generating a 'new header'. Can I ask Latex somehow to use the parent document format 'original header' rather than the fancyhdr? – Hauke Jun 7 '13 at 7:39
  • what is the solution if scrpage2 is used instead of fancyhdr – Micha Jun 7 '13 at 7:46
  • 8
    I got it! \includepdf[pages=-,frame,scale=0.85,pagecommand={\pagestyle{plain}}]{b.pdf} enforces the original header with page numbers. Without the scaling, the pdfs would overlap with the header. pagecommand={\pagestyle... got me on the right track. – Hauke Jun 7 '13 at 7:49
  • @Gonzola, I suspect that pdfpages automatically sets the pagestyle to empty...? – Hauke Jun 7 '13 at 7:51
  • @Hauke yes; the default for pagecommand is \pagestyle{empty}. – Gonzalo Medina Jun 7 '13 at 12:43

I had a similar problem which was easily solved by using pagecommand but without any additional style or package. Just this way :

Lots of multipage pdfs following

to force latex to use the current page style

| improve this answer | |

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.