5

I would like to append the several-pages .pdf directly after the section-heading.

\subsection{Kopie des Projektantrages}
\includepdf[pages=-, fitpaper=true]{\antrag} // my PDF file-command

... but it's inserting the pdf on a new page...

Do you know what i try to achive? Hope someone can help me.

Second Try:

    \includepdf[pages=1,pagecommand=\subsection{Kopie des Projektantrages}, fitpaper=true]{\antrag}
\includepdf[pages=2-,pagecommand={}, fitpaper=true]{\antrag}

Now the Headlines of the latex document and the pdf are colliding...

  • 1
    Hi. Is this a page or several pages? If it is only a page you can include it with \includegraphics[]{Something.pdf} – Dolphin Jan 28 '15 at 14:30
  • serval pages... tried it with pagecommand to add subsection but then the headline of the latex-document is colliding with the pdfs headline... – regetskcob Jan 28 '15 at 14:33
7

This solves the problem :-)

\includepdf[pages=1,pagecommand={\subsection{Kopie des Projektantrages} \thispagestyle{empty}}, fitpaper=true]{\antrag}
\includepdf[pages=2-,pagecommand={\thispagestyle{empty}}, fitpaper=true]{\antrag}
3

\inlcludepdf always inserts the content on separate pages, because it inserts the pdf-document into your document. If you want the pdf to appear on a page within your document you have to use \includegraphics, which works perfectly fine with pdf files as images in pdflatex.

\usepackage{graphicx}
\subsection{Kopie des Projektantrages}
\includegraphics{antrag.pdf}

Edit: In regard to Dolphins comment: Yes, I think that only works when the pdf file has only one page.

  • this don't help with several pages. – regetskcob Jan 28 '15 at 14:34
  • @DanielBocksteger I see, but I think what you want to achieve is not so easy then. As I understand it you want to include a pdf of your application in another document. Have you considered not to insert a header in the document but only in your document toc (and maybe pdf-toc) by manually setting an anchor to the first page of the pdf? – Manuel Weinkauf Jan 28 '15 at 14:39
  • Solved this :-) Look @ my answer :) – regetskcob Jan 28 '15 at 14:47
0

I had the same issue and tried various suggestions out there include this: https://tex.stackexchange.com/a/176188/104699. It is either that they do not work as they claim or are too complicated to follow (e.g. the link above). If you are a beginner or use Lyx because you love the GUI, you know how frustrating it is to spend time hacking with tex code. Here is a very simple solution that I found:

  1. Include the first page as a graphic using INSERT>GRAPHICS
  2. include the rest of the pages as pdf via INSERT>FILE>EXTERNALMATERIAL

    \section{NAME OF SECTION}
    \includegraphics[height=0.8\textheight]{\string"FILENAME".pdf}
    \includepdf[pagecommand={\thispagestyle{plain}}, pages={2-last},scale=0.8]{LINKTOFILE}
    

That simple.

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.