1

\documentclass{scrartcl}
\usepackage{scrletter}
\usepackage{scrlayer-scrpage}
\ofoot{A}
\pagestyle{scrheadings}
\clearpairofpagestyles
\chead{- \thepage\ -}
\begin{document}
\begin{letter}{}
page1
\newpage
page2
\end{letter}
\end{document}

The header and footer seems to have no effect. Probably because it is overwritten by scrletter? If I removed the letter environment, the defined pagestyle would be active

2
  • 1
    Yes, the letter uses a plain.letter style. IIRC you can override it with \renewcommand*{\letterpagestyle}{}. Note also that putting \ofoot before changing the page style and clearing it will do nothing.
    – campa
    Jun 9, 2021 at 17:08
  • Thank you. That worked
    – weltio
    Jun 9, 2021 at 17:12

1 Answer 1

2

First of all: If the result should be a letter with a first letter page, you have to use \opening{...}! Then you will get a warning because of the empty mandantory argument in \begin{letter}{}. To avoid this warning use \begin{letter}[addrfield=false]{} if there is no recipient.


The second, third etc. page of the letter uses the page style saved in \letterpagestyle. By default this is plain.letter. You can redefine both styles plain.letter and letter by

\renewpairofpagestyles{letter}{%
  \clearpairofpagestyles%
  \ofoot*{A}
  \chead*{\pagemark}
}

Example:

\documentclass{scrartcl}
\usepackage{blindtext}% only for dummy text
\usepackage{scrletter}% loads scrlayer-scrpage and sets page style scrheadings automatically
\renewpairofpagestyles{letter}{%
  \clearpairofpagestyles%
  \ofoot*{A}
  \chead*{\pagemark}
}

\renewcommand*\pagemark{\usekomafont{pagenumber}{- \thepage{} -}}
\let\letterpagemark\pagemark

\setkomavar{fromname}{Max Mustermann}

\begin{document}
\begin{letter}[addrfield=false]{}%<- option addrfield=false added, because there is no recipient given
\opening{Hello}% <- added!!
\Blindtext
\closing{Bye}
\end{letter}
\end{document}

enter image description here

Or you could redefine \letterpagestyle in the preamble to a page style of your choice. If \letterpagestyle is empty, then the page style of the document is used on these pages too.

\documentclass{scrartcl}
\usepackage{blindtext}% only for dummy text
\usepackage{scrletter}% loads scrlayer-scrpage and sets page style scrheadings automatically
\clearpairofpagestyles
\ofoot{A}
\chead{\pagemark}

\renewcommand*\pagemark{\usekomafont{pagenumber}{- \thepage{} -}}
\let\letterpagemark\pagemark
\renewcommand*{\letterpagestyle}{scrheadings}% <- page style of the second, third etc. page of the letter

\setkomavar{fromname}{Max Mustermann}

\begin{document}
\begin{letter}[addrfield=false]{}%<- option addrfield=false added, because there is no recipient given
\opening{Hello}% <- added!!
\Blindtext
\closing{Bye}
\end{letter}
\end{document}

The result is the same as above.


The first letter page uses page style empty. If you want to use an other page style on the first letter page, you have to add \thispagestyle{...} next to \opening{...}. If this page style defines a page header, you have to add KOMA option firsthead=false to disable the default first page header.

Example:

\documentclass{scrartcl}
\usepackage{blindtext}% only for dummy text
\usepackage{scrletter}% loads scrlayer-scrpage and sets page style scrheadings automatically
\clearpairofpagestyles
\ofoot{A}
\chead{\pagemark}

\renewcommand*\pagemark{\usekomafont{pagenumber}{- \thepage{} -}}
\let\letterpagemark\pagemark
\renewcommand*{\letterpagestyle}{scrheadings}% <- page style of the second, third etc. page of the letter

\setkomavar{fromname}{Max Mustermann}

\begin{document}
\begin{letter}[
  addrfield=false,%<- option addrfield=false added, because there is no recipient given
  firsthead=false% <- disable the default header of the first letter page
]{}
\opening{Hello}% <- added!!
\thispagestyle{\letterpagestyle}%<- change page style of the first letter page
\Blindtext
\closing{Bye}
\end{letter}
\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 .