My document has the following 2 features:
- Some page(s) are displayed in landscape mode and multi-columns, whereas the rest are in portrait
- Each page has a "fancy" header/footer
I found a neat solution to address 1 in a related post here, which involves changing the dimensions of the page to make it landscape. However, the problem is that given the geometry of my page, the header/footer on the landscape page looks off (i.e. footer not centered and running off the page, header not in the very upper top right). And no matter how much I played with \setlength
or \vsize
, \hsize
, my landscape page still looks like this (see below).
How can I make sure my multicolumns are centered, my footer is centered at the bottom, and my header is in the very upper right hand corner?
\documentclass{article}
\usepackage{fancyhdr}
\usepackage{lipsum}
\usepackage{multicol}
\usepackage{geometry}
\geometry{
left=0.5in, right=0.5in, top=0.6in, bottom=1.25in
}
\begin{document}
\pagestyle{fancy}
\fancyfoot[C]{my footer}
\fancyhead[R]{my header\\ \\ Page \thepage}
\lipsum[1]
\newpage
\newlength{\mtL}
\setlength{\mtL}{.8\paperheight}% the next hsize
\addtolength\mtL{-\headwidth}
\newpage
\addtolength\headwidth{\mtL}
\paperwidth=\pdfpageheight
\paperheight=\pdfpagewidth
\pdfpageheight=\paperheight
\pdfpagewidth=\paperwidth
\headwidth=\textheight
\begingroup
\vsize=.8\pdfpageheight % do what you like
\hsize=.8\pdfpagewidth % do what you like
\textwidth=\hsize
\textheight=\vsize
\begin{multicols}{2}
\lipsum[1-10]
\end{multicols}
\endgroup
\newpage
\paperwidth=\pdfpageheight
\paperheight=\pdfpagewidth
\pdfpageheight=\paperheight
\pdfpagewidth=\paperwidth
\headwidth=\textwidth
\lipsum[3]
\end{document}
Best Answer
Here is a suggestion using a combination of packages
typearea
andgeometry
:Result: