[Tex/LaTex] Page numbers in landscape

header-footerlandscapepage-numbering

I use report class, and now I need to change page orientation (portrait/lanscape) for some pages in my document. I have tried pdflscape for that, but there is a problem: page numbers preserve original orientation, instead of being rotated as I have expected. I had tried lscape and faced with the same problem. What may cause this strange behavior?

Here is an example:

\documentclass{report}
\usepackage{indentfirst}
\usepackage{pdflscape}

\begin{document}

\chapter{Main chapter}
\section{Ut convallis pharetra augue at aliquet.}

It's all portrait. Some text Lorem ipsum dolor sit amet, consectetur adipisci veliturea
adipiscing elit. Ut convallis pharetra augue at aliquet.

%% Landscape area 
\begin{landscape}
 It's all landscape. Some text Lorem ipsum dolor sit amet, consectetur adipisci veliturea
 adipiscing elit. Ut convallis pharetra augue at aliquet.
\end{landscape}

\end{document}

Best Answer

Faced the same problem on the weekend then switched to koma-class -> problems with header, footer and the numbers were solved. But bit difficult at the beginning, so here is a small example. Hope it will help to switch to koma ;)

\documentclass[     12pt,                   %fontsize
                    paper=a4,               %papersize
                    pagesize,               %area
                    DIV=calc,               %relation colls and rows see koma manual
                    liststotocnumbered,     %numbered toc (best solution report sucks over here
                    headsepline,            %header with line
                    footsepline]            %foot with line
                    {scrreprt}              %equals to report

%pagemargins
\usepackage[left=1.5cm,right=1.5cm,top=1cm,bottom=1cm,includeheadfoot]{geometry}


%Chapter caption is somewhere in the center of the page, so move the shit ;)
\renewcommand*\chapterheadstartvskip{\vspace*{-1cm}}

%If you have a new chapter, the pagestyle will be plain (only pagenumber) according to koma
%To use ur setting redefine the chaperstyle
\renewcommand*{\chapterpagestyle}{scrheadings} 

%Settings for head and foot
\usepackage{scrpage2} 
\clearscrheadfoot
\pagestyle{scrheadings}
\ihead{top left}
\chead{top center}
\ohead{top right}       
\ifoot{bottom left} 
\cfoot{bottom center}
\ofoot{bottom right}

\begin{document}
\tableofcontents

\clearpage 
\chapter{First chap}
\section{First sec}
some blank text page is still in portrait

%Save area all setting in myvalues
\storeareas\myvalues

%Change pagestyle to landscape (will create a nee page)
\KOMAoptions{paper=landscape, DIV=20} 

some blank text in landscape

%Recover settings
\clearpage
\myvalues

some blank text page is still in portrait

\end{document}
Related Question