# KOMA landscape/portrait

Got an problem regarding landscape pages in a portrait report. The first sheet is according to the koma manual and works fine. The second with the same code won't.

Example:

\documentclass[ 12pt,
paper=a4,
pagesize,
DIV=calc,
liststotocnumbered,
footsepline]
{scrreprt}

%langue settings

\begin{document}

First page in portrait\\

\storeareas\myvalues
\KOMAoptions{pagesize, paper=landscape, DIV=20}
Second page in landscape\\
\clearpage
\myvalues

Third page in portrait again\\

\KOMAoptions{pagesize, paper=landscape, DIV=20}
Fourth page NOT in landscape!!!!\\
\clearpage

\end{document}


Some ideas?

best regards

-
Your example does not compile on my machine. The macro \storeareas is undefined. – Ian Thompson Jun 19 '12 at 14:16
mh strange, I tested it on my machine before I posted the code. Try the latest version of the koma class. Some say it is in the \usepackage{typearea} package. – Florian Jun 19 '12 at 14:37
Koma-eng Page 280-281 – Florian Jun 19 '12 at 14:50
You are right; I have version 3.09 which does not have \storeareas. The current version on ctan is 3.11. – Ian Thompson Jun 19 '12 at 14:57

This seems like a bug to me, involving a conflict between the storeareas command and the KOMAoptions. Here are a few workarounds.

I have simplified the example a little. The one change I have made is to add a clearpage after each page. Otherwise, in some cases the wrong page is affected or pages are joined together.

You can get it to work by using a second storeareas command:

\documentclass[pagesize,paper=a4]{scrreprt}
\begin{document}

First page in portrait\\
\clearpage

\storeareas\myvalues
\KOMAoptions{pagesize,paper=landscape,DIV=20}
\storeareas\landscapevalues
Second page in landscape\\
\clearpage

\myvalues
Third page in portrait again\\
\clearpage

\landscapevalues
Fourth page IS in landscape!!!!\\

\end{document}


Or, you can scrap the storeareas command altogether:

\documentclass[pagesize,paper=a4]{scrreprt}
\begin{document}

First page in portrait\\
\clearpage

\KOMAoptions{pagesize,paper=landscape,DIV=20}
Second page in landscape\\
\clearpage

\KOMAoptions{pagesize,paper=portrait,DIV=calc}
Third page in portrait again\\
\clearpage

\KOMAoptions{pagesize,paper=landscape,DIV=20}
Fourth page IS in landscape!!!!\\

\end{document}


The simplest change is hacky and shows how fragile things are. You can change the paper "back" to a4 right before the second landscape declaration. (It actually also works to simply change the second paper=landscape to paper=a4, but this seems even hackier.)

\documentclass[pagesize,paper=a4]{scrreprt}
\begin{document}

First page in portrait\\
\clearpage

\storeareas\myvalues
\KOMAoptions{pagesize,paper=landscape,DIV=20}
Second page in landscape\\
\clearpage

\myvalues
Third page in portrait again\\
\clearpage

\KOMAoptions{paper=a4}
\KOMAoptions{pagesize, paper=landscape,DIV=20}
Fourth page IS in landscape!!!!\\

\end{document}

-
Thank you for your early reply. To the first solution: I already tried it, it was not working. To solution 2, yes it is working but after restoring portrait, all other settings will be lost (especially the geometry settings) And the lastone: Adding the Komaoption will create a new page. I don't know why but then there will be two pages in landscape! Finally can't use the 6th page as a portrait again^^ – Florian Jun 19 '12 at 21:07
Ok, tried the first solution again and added a third storecommand (gets nasted now..) – Florian Jun 19 '12 at 21:23