1

I'm using the KOMA scrletter package to embed a letter into another document, see the following MWE:

\documentclass[12pt,ngerman]{scrartcl}

\usepackage{fontspec} 
\usepackage{polyglossia} 
\setdefaultlanguage[babelshorthands=true]{german} 

\usepackage{blindtext}

\usepackage{scrletter}

\rohead{My heading \\ Max Mustermann}

\begin{document}

\blindtext[3]

\setkomavar{fromname}{Max Mustermann}
\setkomavar{fromaddress}{Musterstr. 12 \\ 12345~Musterstadt}
\setkomavar{place}{Musterstadt}
\setkomavar{subject}{Subject ..}

\begin{letter}{Martina Musterfrau \\ Musterweg 4 \\ 12346~Musterdorf}
\opening{Sehr geehrte Damen und Herren,}

\closing{Mit freundlichen Grüßen,}
\end{letter}

\blindtext[3]

\end{document}

The surrounding scrartcl document uses an own pagestyle with individual header, defined with \rohead{...}.

However, on the letter page, the header is not displayed.

How can I make the original header to display on all pages, especially on the letter page?

  • pagestyle letter, pagestyle of first page is empty. Use \pagestyle{scrheadings} after \opening. – Johannes_B Mar 14 '16 at 15:26
  • 1
    Use \thispagestyle{scrheadings} after \opening and may be \setkomavar{firsthead}{}`. – esdd Mar 14 '16 at 15:38
2

Package scrletter loads package scrlayer-scrpage and sets page style scrheadings for the document. Additionally new page styles letter and plain.letter are defined. Default for all letter pages except the first letter page is plain.letter that only prints \letterpagemark.

To change the page style for the pages (except the first page) in the letter environment you can use

\renewcommand\letterpagestyle{<page style>}

As page style you could use letter. Then the KOMA-Script variables nexthead and nextfoot define the content of the header and footer on the next pages. You can also use scrheadings as <page style>.

But note that the header and footer on the first page of the letter are not set by a page style. Therefore \opening uses \thispagestyle{empty}. So you have to remove the normal header and footer on the first page using options

firsthead=false,
firstfoot=false

and to use

\opening{...}
\thispagestyle{<page style>}

to get the <page style> on the first letter page too.

\documentclass[12pt,ngerman,headheight=29pt]{scrartcl}[2015/10/03]
\usepackage{fontspec} 
\usepackage{polyglossia} 
\setdefaultlanguage[babelshorthands=true]{german} 
\usepackage{blindtext}

\usepackage[
  firsthead=false,
  firstfoot=false
]{scrletter}

\rohead{My heading \\ Max Mustermann}
\renewcommand\letterpagestyle{scrheadings}

\begin{document}
\blindtext[3]

\setkomavar{fromname}{Max Mustermann}
\setkomavar{fromaddress}{Musterstr. 12 \\ 12345~Musterstadt}
\setkomavar{place}{Musterstadt}
\setkomavar{subject}{Subject ..}

\begin{letter}{Martina Musterfrau \\ Musterweg 4 \\ 12346~Musterdorf}
\opening{Sehr geehrte Damen und Herren,}
\thispagestyle{scrheadings}
\Blindtext
\closing{Mit freundlichen Grüßen,}
\end{letter}

\blindtext[3]
\end{document}

enter image description here


Instead \opening{...}\thispagestyle{<page style>} you could also patch \opening:

\usepackage{xpatch}
\xapptocmd{\opening}{\thispagestyle{scrheadings}}{}{}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.