3

I have used this answer to include two pdfs in landscape format. It works good for one page but not for two. This is my example:

\documentclass[twoside]{scrartcl}
\usepackage{fancyhdr}
\usepackage{lipsum}
\begin{document}

\pagestyle{fancy}
Some text...
\newpage
\paperwidth=\pdfpageheight
\paperheight=\pdfpagewidth
\pdfpageheight=\paperheight
\pdfpagewidth=\paperwidth
\headwidth=\textheight
\section{New Section}
\begingroup 
\vsize=\textwidth
\hsize=\textheight
\begin{center}
\includegraphics[width=1.3\textwidth,page=1]{bla.pdf} 
\end{center}
\newpage
\begin{center}
\includegraphics[width=1.3\textwidth,page=2]{bla.pdf}
\end{center}
\endgroup
\newpage
\paperwidth=\pdfpageheight
\paperheight=\pdfpagewidth
\pdfpageheight=\paperheight
\pdfpagewidth=\paperwidth
\headwidth=\textwidth
Some Text...
\end{document}

My problem is that I'm using a twosided documentclass and the header is shifted to the left on even numbered pages. In addition I don't get pagenumbers in the footer on landscape pages.

3

1 Answer 1

1

With a KOMA-Script class you can use

\clearpage
\storeareas\mysavedlayout
\KOMAoptions{paper=landscape,headinclude}\recalctypearea
  landscape stuff ...
\clearpage
\mysavedlayout

to switch to landscape locally. To get the header right use scrlayer-scrpage (sets page style scrheadings by default) instead fancyhdr:

\documentclass[twoside]{scrartcl}
\usepackage[demo]{graphicx}
\usepackage[markcase=upper,headsepline]{scrlayer-scrpage}
\automark[section]{section}

\usepackage{lipsum}
\begin{document}
Some text ...

\clearpage
\storeareas\mysavedlayout
\KOMAoptions{paper=landscape,headinclude}\recalctypearea
\section{New Section}

\begin{center}
\includegraphics[width=\textwidth,page=1]{bla.pdf} 
\end{center}
\newpage
\begin{center}
\includegraphics[width=\textwidth,page=2]{bla.pdf}
\end{center}
\clearpage
\mysavedlayout

Some Text...
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .