5

I wish to append some pdf documents to the end of a larger document I'm writing, but find that using the \includepdf command provided by pdfpages always crashes pdflatex.

The following example exibits the behaviour:

First create a test pdf, which we will append to the main doc:

\documentclass{minimal}

\begin{document}

This is some text

\end{document}

Then

\documentclass{minimal}

\usepackage{pdfpages}


\begin{document}

  This is the text in the main doc.

  \includepdf[pages={~}]{test_pdf.pdf}

\end{document}

This causes pdflates to crash with a 'pdflatex has encountered a problem' message. In this case I'm using MikTeX 2.9 on windows XP Pro 32 Bit with Texniccenter 1.0 as my editor (although Texworks also fails, not that I think the editor has anything to do with it, but you never know). I haven't tried on other platforms. In case it's relevent I do not normally have admin access on this PC.

Is this a known problem, and is there a latex work around? I'm aware of other non-latex methods to append the pdfs if necessary.

  • You should be using pages={-} or pages=-, not pages={~}. – egreg May 20 '12 at 11:11
  • Hooray! I'm embarrassed that it was so simple, but also a bit dissappointed that this can actually crash pdflatex. If you put this as an answer below I'll give you the credit. – crobar May 20 '12 at 11:17
6

The error message is

!pdfTeX error: pdflatex (file \protect \unhbox \voidb@x \penalty \@M \ {}.pdf):
 cannot find image file

which is caused by calling the option

pages={~}

rather than the correct

pages=-

I don't think there's a really safe protection against such errors.

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