include number - Inserting a pdf file in latex

includegraphics pages (5)

Use the pdfpages package.


To include all the pages in the PDF file:


To include just the first page of a PDF:


Run texdoc pdfpages in a shell to see the complete manual for pdfpages.

I am trying to insert a PDF or doc file as an appendix in my latex file. Do you know how I can do this?

I don't think there would be an automatic way. You might also want to add a page number to the appendix correctly. Assuming that you already have your pdf document of several pages, you'll have to extract each page first of your pdf document using Adobe Acrobat Professional for instance and save each of them as a separate pdf file. Then you'll have to include each of the the pdf documents as images on an each page basis (1 each page) and use newpage between each page e,g,

\section{Quiz 1}\label{sec:Quiz}
\begin{figure}[htp] \centering{
\caption{Experiment 1}

\section{Sample paper}\label{sec:Sample}
\begin{figure}[htp] \centering{
\caption{Experiment 2}

Now each page will appear with 1 pdf image per page and you'll have a correct page number at the bottom. As shown in my example, you'll have to play a bit with the scale factor for each image to get it in the right size that will fit on a single page. Hope that helps...

There is an option without additional packages that works under pdflatex

Adapt this code

    \caption{Schematical view of Spearman's theory.}

"diagrama-spearman.pdf" is a plot generated with TikZ and this is the code (it is another .tex file different from the .tex file where I want to insert a pdf)

\newcommand{\at}{\makeatletter @\makeatother}


\tikzset{venn circle/.style={draw,circle,minimum width=5cm,fill=#1,opacity=1}}
\node [venn circle = none, name path=A] (A) at (45:2cm) { };
\node [venn circle = none, name path=B] (B) at (135:2cm) { };
\node [venn circle = none, name path=C] (C) at (225:2cm) { };
\node [venn circle = none, name path=D] (D) at (315:2cm) { };
\node[above right] at (barycentric cs:A=1) {logical}; 
\node[above left] at (barycentric cs:B=1) {mechanical}; 
\node[below left] at (barycentric cs:C=1) {spatial}; 
\node[below right] at (barycentric cs:D=1) {arithmetical}; 
\node at (0,0) {G};    


This is the diagram I included

For putting a whole pdf in your file and not just 1 page, use:



Expanding lolo's answer from above, here is a little more automation if you have to include a lot of files:

    var includes = $('[data-include]');
    jQuery.each(includes, function(){
      var file = 'views/' + $(this).data('include') + '.html';

And then to include something in the html:

<div data-include="header"></div>
<div data-include="footer"></div>

Which would include the file views/header.html and views/footer.html

pdf latex include