2

I am trying to include a a PDF file in my latex file, but it turns to background page and all new text and caption lines are written on the same page as my image from PDF. Here is my code:

\documentclass[12pt]{article}
\usepackage[fleqn]{amsmath}
\usepackage{txfonts}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{color}
\usepackage{gensymb}
\usepackage[ngerman, english]{babel}
\usepackage{blindtext}
\usepackage{notoccite}
\usepackage[final]{pdfpages}

\begin{figure}[ht!]
    \begin{centering}
  \includegraphics[width=68mm, height=55mm]{Fotos/figure1}
  \caption{figure1} 
  \label{fig:figure1}
\end{centering}
\end{figure}
some text
\begin{figure}
\centering
\includepdf[pages=-]{fotos/photo.pdf}\label{fig:photo}
\caption{bla bla bla bla}
\end{figure}

\newpage
\bibliographystyle{ieeetr}
\bibliography{bib}
\end{document}
  • I'm not sure I fully understand, but does \begin{figure}[p] help? It should set the figure on its own page with the [p] option. – Steven B. Segletes Jan 13 '17 at 12:20
  • No, it does not. Also \begin{figure}[ht!] does not help. – Beh Beh Jan 13 '17 at 12:23
  • 1
    do you mind posting a full MWE? this snippet with a sample PDF does work on my machine. – naphaneal Jan 13 '17 at 12:25
  • @naphaneal I just added a photo how it looks like. – Beh Beh Jan 13 '17 at 12:33
  • There is something strange going on there at least, but without a complete example it's probably hard to say what exactly. Does the PDF have only one page? Why are you not using \includegraphics{fotos/photo}? (\includepdf is not really intended for what you seem to be doing I think.) – Torbjørn T. Jan 13 '17 at 12:45
3

\includepdf is not intended for that use I think, it is for adding multi-page PDFs, possibly with several pages of the included PDF on one page (e.g. Put entire thesis on one A0 poster? for a silly example).

Just use \includegraphics from the graphicx package instead, i.e.

\includegraphics{fotos/photo}

(the file ending is not necessary). You can also scale it if needed, e.g. \includegraphics[width=0.7\linewidth]{fotos/photo}.

| improve this answer | |
  • Yes, thank you! '\includegraphics' works perfectly. – Beh Beh Mar 6 '17 at 16:19

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.