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'm using this code for showing an image in landscape mode:

\begin{landscape}

\begin{figure}[H]
\centering
\includegraphics[width=\hsize]{./images/SelectDVA.png}
\caption{DVA part of the Use Case \ref{sec:use_case_2}.}
\end{figure}

\end{landscape}

This causes the output to have a blank page immediately after the rotated page containing the image.

It seems that using landscape causes a page break, is it true?

How can I prevent this behaviour?

share|improve this question
1  
landscape won't leave a blank page but it causes a page break. You can use afterpage to avoid the white space produced thereby. –  Harish Kumar Nov 27 '12 at 15:32
    
Never ever include a figure in landscape! –  Stephan Lehmke Nov 27 '12 at 15:36
add comment

1 Answer

up vote 2 down vote accepted

landscape will not produce blank pages but cause a page break where it is introduced. This will result in undesired white space in the previous page. This can be avoided by using the afterpage package:

\documentclass{article}
\usepackage{lipsum}
\usepackage{graphicx}
\usepackage{afterpage}
\usepackage{lscape}
\begin{document}
\lipsum[1-2]
\afterpage{
\begin{landscape}

\begin{figure}[H]
\centering
\includegraphics[width=\hsize]{example-image-a}
\caption{DVA part of the Use Case \ref{sec:use_case_2}.}
\end{figure}

\end{landscape}
}
\lipsum[3-8]

\end{document}
share|improve this answer
    
can you explain me what is the \lipsum command doing?thks in advance –  Matteo Nov 27 '12 at 15:59
    
@Matteo It's just filler en.wikipedia.org/wiki/Lipsum –  David Carlisle Nov 27 '12 at 16:53
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.