# margins with landscape and page header

I use the scrreprt class with a page header. I also use margin notes. It looks good in portrait mode. However, some pages may be rotate. In that case, this looks ugly. Here is a MWE:

\documentclass[a4paper]{scrreprt}

\usepackage{lipsum}
\usepackage{pdflscape}
\usepackage[headsepline]{scrlayer-scrpage}
\pagestyle{scrheadings}
\clearscrheadings
\ohead{\pagemark{}}

\newcommand{\examplepage}{
\lipsum[1]
\marginpar{This is a marginal note.}
\lipsum[2-4]
}

\begin{document}
\examplepage{}

\begin{landscape}
\examplepage{}
\end{landscape}

\end{document}


What can I do to improve the page layout in landscape?

• The problem is not depending on KOMA-Script's scrreprt or scrlayer-scrpage. It also happens with, e.g., report + \pagestyle{headings} + at least one chapter heading. Feb 20 '19 at 6:44

## 1 Answer

You can use \reversemarginpar inside the landscape environment:

\documentclass[a4paper]{scrreprt}

\usepackage{lipsum}
\usepackage{pdflscape}
\usepackage[headsepline]{scrlayer-scrpage}
\pagestyle{scrheadings}
\clearscrheadings
\ohead{\pagemark{}}

\newcommand{\examplepage}{
\lipsum[1]
\marginpar{This is a marginal note.}
\lipsum[2-4]
}

\begin{document}
\examplepage{}

\begin{landscape}
\reversemarginpar
\examplepage{}
\end{landscape}

\end{document}


• Addendum: For twoside documents \ifthispageodd{\reversemarginpar}{}{} would do the same automatically. Without KOMA-Scrpt class, \ifthispageodd needs package scrextend. Other packages provide similar features. Feb 20 '19 at 6:48
• @Schweinebacke: I think the O.P.'s problem comes from being in landscape, so the outer margin is indeed the top margin, which is not large enough. Feb 20 '19 at 9:14
• The outer margin with class option twoside (or scrbook instead of scrreprt) would change between odd and even pages. So it is not longer always the top margin. The OP does not use this option, but maybe another user will and would have the same problem. And if you add twoside to the options and add another landscape environment, the \reversemarginpar` would be wrong in the copy. That's the reason for my addendum. It is not a critic. Your answers is correct and I've already voted for it. Feb 20 '19 at 9:40