When using pdflscape
and fancyhdr
, the headers also get rotated. Whilst it's a normal behaviour in most cases (especially when the document has to be printed), I am dealing with a report which will never be printed, so this default behaviour is more annoying.
Here is a MWE of a document dealing with portrait and landscape pages:
\documentclass[a4paper, 10pt]{article}
\usepackage{graphicx}
\usepackage{pdflscape}
\usepackage{fancyhdr}
\usepackage{lipsum}
\usepackage[left=2cm, right=2cm, bottom=2cm, top=2cm]{geometry}
\setlength{\headheight}{32pt}
\lhead{\includegraphics[scale=.5]{tt}\\Foo}
\rhead{\includegraphics[scale=.5]{tt}\\\thepage}
\cfoot{}
\fancypagestyle{customlandscape}{%
\fancyhf{}
\newgeometry{left=1cm, right=1cm, bottom=1cm, top=1cm}
% ??
}
\pagestyle{fancy}
\begin{document}
\lipsum[1-10]
\newpage
\pagestyle{customlandscape}
\begin{landscape}
Here is the landscaped content, the header of this page should look like the rest...
\end{landscape}
\newpage
\pagestyle{plain}
\lipsum[1-10]
\end{document}
Note : you will have to provide 2 images called tt
for it to compile, sorry for that. So, if we look a bit closer, the header of the portrait pages look like this :
How can I manage for my landscape pages to look like this ? :
Currently, by compiling my MWE, you'll notice that the header is on the right on the landscape page.
PS : There is another problem in this MWE, after switching back to portrait, it seems I'm not able to restore the default pagestyle (with the images in the header).
Best Answer
Without lscap package you change page format to landscape by
here the problem was to adapt the headwidth length
edit for more pagestyle{fancy}