Friday, May 11, 2012

Including pages from PDF documents in a LaTeX documents

via http://texblog.org/: Including pages from PDF documentsBy tom

The package pdfpages let’s you include a complete PDF or any combination of pages into a LaTeX document.

First load the package in the preamble.
\usepackage{pdfpages}

Now use any of the possible options below to include pages from a PDF.

Include the first page
\includepdf{file}

The whole document
\includepdf[pages=-]{file}

A forward or backward range
\includepdf[pages=2-8]{file}
\includepdf[pages=8-2]{file}
\includepdf[pages=last-1]{file}

You never know when that may come in handy. However, the keyword last actually can be quite useful in case the number of pages in the document may change.

Several single pages with/without blanks
\includepdf[pages={3, 6, 1}]{file}
\includepdf[pages={3, {}, 9}]{file}

Copies of the same page
\includepdf[pages={5, 5, 5}]{file}

And finally, a bit of everything
\includepdf[pages={3-6, {}, 1, 7}]{file}

The package also provides the option nup=axb to print several logical pages on a single physical page (the parameter a being the number of columns and b the number of rows). LaTeX scales the logical pages to fit within the margin of the physical page. In the example below the first 4 logical pages will be placed on the first physical page and the rest on the next.

\includepdf[nup=2x2, pages=1-7]{file}

Pdfpages package documentation.


No comments:

Post a Comment