[Tex/LaTex] Sideways figure with rotated page number

floatspage-numberingrotating

The submission requirements require that any landscaped image have the page number on the 11" side of the page, at the bottom and centered. I can't figure out how to do this.

I'm using sidewaysfigure for my landscaped images. They are on their own page.

Best Answer

Some extra packages are needed, although it is possible:

  • floatpag for specifying page styles for "ordinary" floats; and
  • fancyhdr for easily defining page styles

enter image description here

\documentclass{article}
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\usepackage{rotating}% http://ctan.org/pkg/rotating
\usepackage{floatpag}% http://ctan.org/pkg/floatpag
\usepackage{fancyhdr}% http://ctan.org/pkg/fancyhdr
\fancypagestyle{floatpage}{%
  \fancyhf{}% Clear page header/footer
  \renewcommand{\headrulewidth}{0pt}% No header rule
  \fancyfoot[C]{\makebox[\textwidth][r]{%
    \smash{\raisebox{\dimexpr\footskip+.5\textheight}{\rotatebox{90}{\thepage}}}}}%
}
\begin{document}
\section{A section}\lipsum[1-3]

\begin{sidewaysfigure}
  \centering\thisfloatpagestyle{floatpage}%
  \rule{.8\textheight}{.5\textwidth}
  \caption{A sideways figure.}
\end{sidewaysfigure}
\section{Another section}\lipsum[4-6]
\end{document}

The newly created floatpage page style is created and used as \thisfloatpagestyle inside sidewaysfigure (provided by the rotating package). The footer is subsequently made of a right-aligned box of zero height (\smashed) with \thepage pushed up to the middle of the text block (\footskip+.5\textheight) and rotated by 90 degrees (\rotatebox{90}).

lipsum was merely used to populate the document with dummy text, Lorem Ipsum style.