0

I'm building an appendix, and there are a lot of PDF-documents. Each document should be its own appendix, that is each should be its own chapter.

The problem is that I want the PDF inserted right after the chapter-heading, but in practice its pushed to the next page.

\usepackage{pdfpages} % in config-file
\begin{appendices}
    \chapter{Appendix name }
    \label{app:label}
    \includepdf[pages={-}]{appendices/mypdf.pdf}
\end{appendices}

That is: I get a page with a chapter-header, and no content, then a new page where the PDF is inserted. I haven't found any resources that explain this.

I looked in the answer given here, but that does not work either. (\includepdf[scale=0.8,pages=1,pagecommand=\chapter{chapname}]{testpdf} ), gives the following result:

Result of command

The other answer in the same question is to do the following (except it wants to do it section not chapter:

\includepdf[pages=1,pagecommand=\chapter{Chapter Heading}]{appendices/backend-README.pdf}
\includepdf[pages=2-,pagecommand={}]{appendices/backend-README.pdf}

Which gives the same result as above.

Esso
  • 123
  • Please try \includegraphics[options]{appendices/mypdf.pdf} ?

    The options may be used as: page=2,trim={5cm 3cm 3cm 3cm}

    – Sunilkumar KS Nov 11 '15 at 12:33
  • @BMWurm Thanks for the tip! I tried the accepted answer there, but the chapter heading falls over the PDF. Updated my question with the result. – Esso Nov 11 '15 at 13:17
  • @SunilkumarKS Thanks for the tip! Those options pulled the document to the edges of the newpage, and trimmed away content. Tried to scale it together with trim, but I have the same problem. – Esso Nov 11 '15 at 13:21
  • Not a duplicate, but going to be tough to solve with pdfpages. Since that just grabs whole pages from the source PDF, how should it deal with content already on the page? Worse still, if you move the top of the included page below the new chapter header, how should it cleanly crop the content that falls off the bottom of the page and prepend it to the page that follows? – Mike Renfro Nov 11 '15 at 17:27
  • 3
    If your appendix pages are full-sized (in other words, filled with content) pages, then there is no way for you to add a proper title to it. Unless... you change the entire page layout or include the PDF pages in a smaller format rather than it's original full-sized format. Is this what you might be after? – Werner Nov 11 '15 at 18:18
  • @Werner Yes, if that makes it possible to keep the overall layout of the pages. I thought It could just take the content and push it in under the chapter-header until it runs out of spaces, then continue on the next page, but I understand that this might not be possible due to how PDFs work. Thanks! – Esso Nov 11 '15 at 21:54
  • @Esso: You can include only portions of a PDF output, but you'll have to manually break it across the page boundary; it acts just like an image. – Werner Nov 11 '15 at 22:03
  • @Esso Feels like the inserted PDF documents are full-sized and doesn't fit with the chapter titles in a page even after scaling and trimming.

    My suggestions are: increasing the page/text height to fit both items or keep the Chapter heading in a separate page.

    – Sunilkumar KS Nov 12 '15 at 07:30

0 Answers0