# Stretching sidewaysfigure to the max

I am experimenting with the sidewaysfigure as I need to have a graphic wider than the normal \textwidth. I tried \paperwidth but is it possible to stretch the figure to fill in e.g. 95% of the whole page?

\begin{sidewaysfigure}
\thispagestyle{empty}
\includegraphics[width=\paperwidth]{...}
\end{sidewaysfigure}


in normal scape, the following does the trick:

\begin{center}
\makebox[\textwidth]{\includegraphics[width=0.95\paperwidth]{...}}
\end{center}


But with sideways it stretches only to textwidth anyhow.

Another question is, how do I avoid the pagestyle, meaning chapter title and pagenumbering on the page of the sideway? The following gets ignored.

\thispagestyle{empty}


Help is highly appreciated, thank you

Caruso

You can do the same for the rotated figure as in normal portrait layout. sidewaysfigure only rotates the figure and not the page, so the normal page distances are the same. If you use \paperheight in your command it works.

The \thispagestyle{empty} is not ignored, but I think it is on the wrong page. The environment sidewaysfigure is set on a separate page as a float and therefore \thispagestyle{empty} ends up where the code is given, and not on the float page.

\documentclass{article}
\usepackage{rotating}
\usepackage{graphicx}
\begin{document}

\begin{sidewaysfigure}
\centering
\makebox[\textwidth]{\includegraphics[width=0.95\paperheight,height=10em]{example-image}}
\end{sidewaysfigure}

\end{document}


EDIT

There are probably easier ways to do this than what is coming here. Since sideways is an environment that rotates the contents 90 degrees I understand the question now as you like a separate page with one centered picture that might be bigger than the text block. In my tests this does not work with sideways since it puts the contents on a line that does not stretch below the text block. So instead I rotate the picture with \rotatebox and put it inside a \raisebox where I set the height to \baselinestretch. That means its upper border is the same as the upper border for the text block. Then what is left up to the page border is 1in+\voffset+\topmargin+\headheight+\headsep. That gives a way to center the picture vertically on the page. Then using the same horizontal centering as in the question gives the following.

\documentclass{article}
\usepackage{rotating}
\usepackage{graphicx}
\usepackage{lipsum}
%%%%%
\newcommand\bigsidewaysimg[3]{% {width}{height}{image file}
\newpage
\thispagestyle{empty}
\noindent
\makebox[\textwidth]{%
\raisebox{%
-0.5\dimexpr 0pt+\paperheight-#2\relax\relax}[\baselineskip][0pt]{%
\rotatebox{90}{%
\makebox[0pt][r]{%
\includegraphics[width=#2,height=#1]{#3}}}}
}%
\newpage}
%%%%%
\begin{document}

\lipsum[1]
\bigsidewaysimg{0.9\paperwidth}{0.9\paperheight}{example-image-c}
\bigsidewaysimg{10cm}{10cm}{example-image-a}
\lipsum[2]

\end{document}


• fantastic \paperheight works marvellous. Any idea how to avoid the chapter title and pagenumbering on the page of the sideway? – Caruso33 Jan 20 '17 at 15:23
• I have updated with \thispagestyle{empty} inside the sidewaysfigure. That should remove header and footer. – StefanH Jan 20 '17 at 15:41
• sorry to bother, for some reason that doesn't work in the sideways environment. – Caruso33 Jan 20 '17 at 16:06
• Is it removing the page number or stretching the image that does not work in sideways? – StefanH Jan 20 '17 at 19:03
• @Caruso33 You are right, \thispagestyle{empty} does not work with sidewaysfigure since it behaves like a float on a separate page. I removed it again. And sideways is not on a separate page so it does not behave the same way. – StefanH Jan 21 '17 at 11:16