Page LayoutGetting undesired pagebreak when using sidewaysfigure.

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
gustavo_v
Posts: 1
Joined: Tue Mar 29, 2011 3:47 pm

Getting undesired pagebreak when using sidewaysfigure.

Post by gustavo_v »

Hello world,

I'm experiencing an issue when trying to create a page with several stacked sideway graphics: Latex insists in doing a page break and leaving a blank page before inserting the desired content. Here is a MWE for my problem (I'm compiling with pdfTeX, Version 3.1415926-1.40.11 ).

Code: Select all

\documentclass[a4paper]{report}

\usepackage[top=25mm, bottom=35mm, left=25mm, right=25mm]{geometry}
\usepackage{rotating}
\usepackage{lastpage}
\usepackage{changepage}

\begin{document}

Some text in a page with nice headers and footers.

% And here should come my huge sideway figure that will
% take a full page
\newpage
\thispagestyle{empty}
\addtolength{\textwidth}{2.0cm}
\addtolength{\linewidth}{2.0cm}

% Just to emulate my real graphics with some space, let's
% define some lengths
\newlength{\graphicone}
\setlength{\graphicone}{0.33\textwidth}
\newlength{\othergraphics}
\setlength{\othergraphics}{0.2\textwidth}

% Finally the content
\begin{adjustwidth*}{-1.0cm}{-1.0cm}
	\begin{sidewaysfigure}
		\centering
		\parbox[m]{\textheight}{HEADER \hfill CONTENTS \hfill HERE}\\
		\vspace{\baselineskip}
		\fbox{\parbox[m]{\textheight}{\raisebox{\graphicone}{} \hfill figure \hfill .}}
		\fbox{\parbox[m]{\textheight}{\raisebox{\othergraphics}{} \hfill narrowsubfigures \hfill .}}
		\fbox{\parbox[m]{\textheight}{\raisebox{\othergraphics}{} \hfill narrowsubfigures \hfill .}}\\
		\vspace{2\baselineskip}
		\centerline{\scriptsize{This should be \thepage\ of \pageref{LastPage}}}
	\end{sidewaysfigure}
\end{adjustwidth*}

\end{document}
As you can see, I am trying hard to make everything fit in one sheet (by enlarging the width of the page), but I still cannot avoid having a blank page before my graphics. What am I doing wrong? Is there a better approach? I am trying to avoid the lscape environment since I don't seem to be able to enlarge the page as easily.

Thanks for your attention!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Getting undesired pagebreak when using sidewaysfigure.

Post by localghost »

Drop the adjustwidth* environment and additional blank page will disappear. If you want to change the page geometry within the document, try the geometry package. But side effects cannot be ruled out here, too. And by the way, you should pay attention to the warnings in the log file.


Thorsten
Post Reply