[Tex/LaTex] Include several pages of a PDF without losing LaTex document style


I would like to include several pages of a PDF as a subsection in my LaTex Document using the package pdfpages. I tried


from the question How to include PDF pages without a newpage before the first page?
But unfortunately every single page of the pdf becomes a new subsection though I would like to have just one subsection with five pages. The default setting
for pagecommand does not work for me either, because I want the normal page numbers, headseplines and so on to appear. I have no idea which option for pagecommand I could use to make this work. Thanks a lot for your help!

Best Answer

The default pagecommand uses \thispagestyle{empty} which disables page numbers, headers and footers etc. You can use pagecommand={} to overwrite this and get normal layout for these pages.