2

I am using the following simple document

\documentclass[12pt,a4paper]{report}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{pdfpages}
\begin{document}
Hello world!Hello world!Hello world!Hello world!Hello world!
\includepdf[pages=1,scale=.4]{horn1.pdf}
Hello world!Hello world!Hello world!Hello world!Hello world!
\end{document}

In the output file, 3 pages can be seen:

First page:

  Hello world!Hello world!Hello world!Hello world!Hello world!

Second page:

  PDF file

Third page:

   Hello world!Hello world!Hello world!Hello world!Hello world!

Using the command "scale=.4", I've reduced the PDF file size. Why can not I see the output file in a page?

2
  • 1
    Welcome:) You can search here the needed
    – Saravanan
    Dec 29, 2016 at 16:01
  • & Saravanan, Thanks, can you recommend a simple guide and shorter?
    – Math-Data
    Dec 29, 2016 at 16:17

1 Answer 1

4

You don't need the package pdfpages. \includepdf will always include the pdf as a separate page. Use \includegraphics with the page option instead, from the graphicx package.

\documentclass{report}
\usepackage{graphicx}
\begin{document}
Hello world!Hello world!Hello world!Hello world!Hello world!

\includegraphics[page=1,scale=.4]{horn1.pdf}

Hello world!Hello world!Hello world!Hello world!Hello world!
\end{document}
5
  • Thank you for help. Just one more thing. Using {\centering \includegraphics[page=1,scale=.4]{horn1.pdf}}, PDF file dose not put in center palce. Is there a specific reason?
    – Math-Data
    Dec 29, 2016 at 17:12
  • excuse me, I have another question. For example, if I want to use pages={1,3,5}, error occurs. Is there a specific reason?
    – Math-Data
    Dec 29, 2016 at 17:24
  • 1
    @Farid Regarding centering: I recommend to use \begin{center}\includegraphics[...]{...}\end{center}. If you want to use \centering, you have to include the end of the paragraph into the scope: {\centering\includegraphics[...]{...}\par} (or an empty line instead of \par).
    – gernot
    Dec 29, 2016 at 17:50
  • 1
    @Farid Regarding pages: There is no pages option. An image consists of a single page only. If you want to include several pages, you have to use multiple \includegraphics commands (with different page numbers), and you have to arrange the images the way you want.
    – gernot
    Dec 29, 2016 at 17:53
  • 1
    @Farid By the way, there is always a specific reason as long as the process is deterministic ;-) It may be hidden and not easy to discover, though.
    – gernot
    Dec 29, 2016 at 17:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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