Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a pdf file consisting of four pages (see attached). I want to include it in Latex, but when I use the basic code given below, only the first page of the pdf appears. I want to do is to present one pdf page in each latex file. Suggestions please

\begin{figure}[h!]
\centering
\includegraphics[scale=0.77]{bplot.pdf}

enter image description here

share|improve this question

3 Answers 3

for a single page of a multipage .pdf:

\documentclass{article}
\usepackage{graphicx}
\begin{document}

\includegraphics[page=2,scale=0.75]{bplot.pdf}      

\end{document}

or if you want all pages:

\documentclass{article}
\usepackage{pdfpages}
\begin{document}

\includepdf[pages={1-},scale=0.75]{bplot.pdf}

\end{document}
share|improve this answer
    
Thanks @Herbert. This is what I was after. How could I scale the pdf? \includepdf[pages=1-]{scale=0.51}{bplot.pdf} does not work –  Günal Jan 12 '13 at 12:52
    
I modified my answer, see the example. –  Herbert Jan 12 '13 at 12:53
    
Thanks a million. Perfectly works :) –  Günal Jan 12 '13 at 12:55
    
how can I add a caption? –  Günal Jan 12 '13 at 18:57
    
for every page or the last one? –  Herbert Jan 12 '13 at 19:12

You can use pdfpages package.

\docuemtnclass{article}
\usepackage{pdfpages}

\begin{document}

\includepdf[pages=2]{bplot.pdf}

\end{document}

The [pages=2] displayes the first page. To insert multiple pages, insert a list such as [pages={1,4}] or a range such as [pages={1-4}]. Check the pdfpages manual for details on package and command options.

share|improve this answer
    
This adds only the first page. Is there another package I should be using? –  Günal Jan 12 '13 at 12:41
    
I used \includepdf[pages=2]{bplot.pdf} \includepdf[pages=3]{bplot.pdf} etc. The problem is now the scale. I used \includepdf[pages=3][scale=0.5]{bplot.pdf}, that soes not work. Any suggestions? –  Günal Jan 12 '13 at 12:47
    
@Günal added to the reply. The argument templatesize={width}{height} should provide scaling. See the pdfpages manual for the details. –  Peter Jansson Jan 12 '13 at 12:52

Compile the following code with either pdflatex or xelatex.

\documentclass{article}
\usepackage[a5paper,margin=2cm,showframe]{geometry}
\usepackage{graphicx}
\usepackage{multido}
\usepackage{ifxetex}

\ifxetex
    \newcount\pdflastximagepages
    \def\pdfximage#1{\pdflastximagepages=\XeTeXpdfpagecount"#1"\relax}
\fi

\def\filename{pst-fun-doc.pdf}
\def\scale{0.4}
\pdfximage{\filename}

\begin{document}
    \multido{\i=1+1}{\the\pdflastximagepages}{%
        \begin{center}
        \fbox{\includegraphics[page=\i,scale=\scale]{\filename}}
        \end{center}
        \newpage
    }
\end{document}

Output:

enter image description here

share|improve this answer
    
Top secret note: Compiling it with xelatex produces a weird PDF. Please try! –  Who is crazy first Jan 12 '13 at 13:31
    
I have no problem with xelatex. Current up-to-date TL2012 –  Herbert Jan 12 '13 at 14:23
    
@Herbert: OK. Thanks for confirming. I still get the same weird result. –  Who is crazy first Jan 12 '13 at 14:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.