# \includegraphics forces new page

When I include a PDF diagram, it forces a new page, so I have one blank page and then this diagram, can somebody help me please? I need to remove that blank page.

My document looks like this

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{multirow}
\usepackage{graphicx}
\usepackage{a4wide}
\usepackage{pdfpages}
\usepackage[total={17cm,25cm}, top=2.0cm, bottom=1cm, left=0.0cm, right=0.0cm, includefoot]{geometry}

\begin{document}
\newgeometry{total={17cm,25cm}, top=2.0cm, bottom=1cm, left=2.0cm, right=2.0cm, includefoot}
\includegraphics[width=\textwidth]{diagram.pdf}
\end{document}


and the resulting output is

-
theres a LaTex stack exchange, might be worth getting this moved over there ? –  Luke Dec 4 '11 at 16:36
Reduce the width of the image. It seems that the pdf is to height. –  Marco Daniel Dec 4 '11 at 18:55
I don't think so, because it inserts blank page and on the next page it seems to be ok. –  designerrr Dec 4 '11 at 19:07
There is a completely blank page inserted? Or does the \section* simply stands on its own? Also what do you mean with "seems to be ok"? This is not the normal behavior of \includegraphics, so you either doing something funny or the PDF is too large or maybe defect. –  Martin Scharrer Dec 4 '11 at 19:12
BTW: You don't need package a4wide while you are using geometry. And l2tabu says: a4.sty. a4wide.sty: Do not use these two packages any longer. –  Schweinebacke Dec 7 '11 at 9:56

The image is too large to fit on current page, because there is not much place left. It is also too large to fit on a page of its own, therefore moving to the next (last?) page, where it is apparently placed using some emergency rule even if it doesn't fit there either.

You should include the image using the following options instead:

\includegraphics[width=\textwidth,height=\textheight,keepaspectratio]{diagram.pdf}


This tries to scale it to the textwidth but not larger than the textheight while keeping the aspect-ratio.

To allow enough space for a caption you should reduce the height a little, e.g. either take only .9\textheight or subtract two lines or so from it.

\includegraphics[width=\textwidth,height=\dimexpr\textheight-2\baselineskip\relax,keepaspectratio]{diagram.pdf}


From the look of it it might also belong into a figure environment. There you should add a \centering before the \includegraphics to have it centered.

-
If it shall fit on the same page as the section title, a bit smaller than the \textheight might be appropriate. –  Paŭlo Ebermann Dec 4 '11 at 20:55
I tried what you wrote and still not working. I must probably use scale parameter and make image smaller :(. –  designerrr Dec 4 '11 at 21:40
@designerrr you can also use \includegraphics[width=0.8\textwidth,height=0.8\textheight,keepaspectratio]{dia‌​gram.pdf} to reduce the size –  matth Dec 5 '11 at 13:14
you can also try \linewidth instead of \textwidth –  matth Dec 6 '11 at 22:50