Combining PDF files

Combining the source code of two LaTeX documents can be pretty hard, especially if they are based on different classes. However, combining their PDF output is pretty easy.

How to do it...

We will use the pdfpages package.

You can test it with the flyer example from Chapter 1, The Variety of Document Types, together with the form example from the current chapter. Let's get going:

  1. Open a document and choose any class:
    \documentclass{article}
  2. Load the pdfpages package:
    \usepackage{pdfpages}
  3. Begin the document:
    \begin{document}
  4. Include the first PDF file by using the command \includepdf. It takes the page range as an option. Use a dash (-) for the whole page range:
    \includepdf[pages=-]{flyer}
  5. Include the second PDF file:
    \includepdf[pages=-]{form} ...

Get LaTeX Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.