include pdf in latex

# include pdf in latex

StartLaTeX faqLaTeX topicsLaTeX course
< logical and, or, not    > colored frames latex

## include pdf in latex

There are two possibilities (of course there are more ways) to include a pdf file into LaTeX:
1. usepackage pdfpages
2. usepackage graphicx

### example pdfpages

\documentclass{article}
\usepackage{pdfpages}
...
\begin{document}
include the first page from pdf file Test.pdf
\includepdf[pages=1]{Test}
...
\end{document}


### example graphicx

\documentclass{article}
\usepackage{graphicx}
...
\begin{document}
include the first page from pdf file Test.pdf
\includegraphics[page=1]{Test}
...
\end{document}


### put more then one page on a page

By using option nup from usepackage pdfpages, it is also possible to put more then one page from the origin pdf file on one page of the new document.

### example pdfpages 2

\documentclass{article}
\usepackage{pdfpages}
...
\begin{document}
include all pages from pdf file Test.pdf, but put allways four of them on one single page.
\includepdf[pages=-, nup=2x2]{Test}
...
\end{document}


### How to deal with blanks in file names?

Sometimes you got file with blanks in the file name. The problem now is pdfpages could not handle this, but usepackage grffile could.

### example pdfpages 3

\documentclass{article}
\usepackage{grffile}
\usepackage{pdfpages}
\begin{document}
\includepdf[pages=-]{Test X}
\end{document}