2

I would like to have one horizontal page with charts. I try to this using pdflscape, but I have blank rotated page before page I would like rotate. How can I fix it? My code below, pdf file here

\documentclass{article}
\usepackage[utf8] {inputenc}
\usepackage {polski}
\usepackage{geometry}
\usepackage{graphicx}
\usepackage{float}
\usepackage{pdflscape}
\begin {document}
\newgeometry{tmargin=3cm, bmargin=3cm, lmargin=3cm, rmargin=3cm}

\section {Section on vertical pages before horizontal page with graphics}
\section {Section on vertical pages before horizontal page with graphics}
\begin{landscape}
\section {Graphics on the new horizontal page}
\begin{figure}[H]
\includegraphics[width=\linewidth]{wykres1.png}
\includegraphics[width=\linewidth]{wykres2.png}
\includegraphics[width=\linewidth]{wykres3.png}
\caption {Caption}
\end{figure}
\end{landscape}


\section {Section on pages afrer horizontal page with graphics}
\section {Section on pages afrer horizontal page with graphics}
\section {Section on pages afrer horizontal page with graphics}


\end {document}

1 Answers1

2

Change from portrait to landscape always start new page. Consequently if changes is requested somewhere middle of the page, then this page is from this point further empty. This can be avoided with use \afterpage command from the package afterpage . It fill this empty space with text, which follows to landscape page(s). you can eliminate white space before page in landscape orientation::

\documentclass{article}
\usepackage[margin=3cm]{geometry}
\usepackage[demo]{graphicx} % in real document delete option `demo`
\usepackage{pdflscape}
\usepackage{afterpage}

\usepackage{lipsum} % for dummy text

\begin {document}

\section {Section on vertical pages before horizontal page with graphics}
\lipsum[1]
\section {Section on vertical pages before horizontal page with graphics}
\lipsum[2]
    \afterpage{\clearpage  % <---------------- 
\begin{landscape}
\section {Graphics on the new horizontal page}
\begin{figure}[ht]
\includegraphics[width=\linewidth]{wykres1.png}

\medskip
\includegraphics[width=\linewidth]{wykres2.png}

\medskip
\includegraphics[width=\linewidth]{wykres3.png}
\caption {Caption}
\end{figure}
\end{landscape}
    }
\lipsum[3-7]

\end {document}

enter image description here

Zarko
  • 296,517
  • Thank you, it's working, but now instead of charts I have black rectangles, although graphic files are in the same folder – mateuszm Sep 08 '19 at 12:06
  • 1
    @mateuszm, in real document remove option demo from package graphicx – Zarko Sep 08 '19 at 12:49