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.

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}
\section*{Diagram případů užití}
\includegraphics[width=\textwidth]{diagram.pdf}
\end{document}

and the resulting output is

output result with blank page

share|improve this question
3  
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
1  
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
1  
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
show 6 more comments

1 Answer

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.

share|improve this answer
2  
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
1  
@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
add comment

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.