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

2 Answers 2

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}

If you use pdflscape instead of lscape package,

enter image description here

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
    
This isn't working for me. I still have a blank page before the landscape figure. The code was used exactly as in the example above, except that I am using package 'pdflscape'. –  cryptic0 May 19 at 11:17
    
@cryptic0 Not working isn't useful enough. This code works for me. –  Harish Kumar May 19 at 22:28
    
I am using this code for a landscape figure. The only change I have made is using pdflscape package which actually rotates the page to landscape mode. However, there is still a blank page before every landscape figure. –  cryptic0 May 20 at 1:56

Have you checked this simple solution? I had a big, page-filling table and the landscape environment caused a blank page before the table. I noticed that the option [H] in \begin{table}[H] caused the blank page. If you use \begin{table}[htbp] instead, the annoying blank page is gone. [H] is useful to place the tables exactly where you position the command, but in conjunction with the landscape environment it is unnecessary.

Example:

\usepackage{lscape}

\begin{document}    
% some text    
\begin{landscape}    
\thispagestyle{empty} %if you want to suppress footer and header    
\begin{table}[htbp]    
...    
\end{table}    
\end{landscape}    
% continue with your text    
\end{document}
share|improve this answer
1  
Welcome to TeX.SX! A tip: If you indent lines by 4 spaces or enclose words in backticks `, they'll be marked as code, as can be seen in my edit. You can also highlight the code and click the "code" button (with "{}" on it). –  Adam Liter Jul 2 at 1:56

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.