1

I do not understand some of the features the nextfoot variable has in the scrlttr2 KOMA-script class.

\documentclass[]{scrlttr2}

\pagestyle{headings}

\usepackage{fontspec}
\setmainfont{Linux Libertine O}

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

\usepackage{lipsum}

\begin{document}

\setkomafont{pagefoot}{\normalfont}

\setkomavar{nextfoot}{\hspace*{\fill}[Name]\qquad E-Mail: \texttt{[email protected]}\qquad Mobiltelefon: +49 123 45\,67\,89\hspace*{\fill}}

\setlength{\parskip}{1em}
\setlength{\parindent}{0pt}

\begin{letter}{Familie Mustermann}

\opening{Sehr geehrte Familie Mustermann,}

\lipsum

\closing{Mit freundlichen Grüßen}

\end{letter}

\end{document}

Why do I need the line

\setkomafont{pagefoot}{\normalfont}

and

\hspace*{\fill}

to get the desired output? Why is the footer text justified and set in italics by default? And where can I find these definitions? Is there a cleaner way of doing this?

Edit: And how do I get the page number back? Is using \thepage OK?

4
  • Do you really want a page number in a letter? Untested: \renewcommand{\thepage}{\arabic{page}}
    – user31729
    Aug 18, 2014 at 20:41
  • The default output of the scrlttr2 class footer actually is a page number, and accessing it with \thepage works. I was just asking if there is a "cleaner" way to using \thepage, since there also is a pagenumber option where you can specify where the number should go.
    – chaosflaws
    Aug 18, 2014 at 20:45
  • 1
    Your question is not very clear for me. Can you tell us what to want to have? The footer (which one?) on each page of the letter? With or without page number? you are using xelatex?
    – Mensch
    Aug 19, 2014 at 11:14
  • Well... I don't "want" anything regarding the output. The document looks the way it's supposed to look. I am just asking why I need the "hacks" I used in my solution and if there is a cleaner way of doing what I did with \setkomafont{pagefoot}{\normalfont} and \hspace*{\fill}.
    – chaosflaws
    Aug 19, 2014 at 11:17

1 Answer 1

5

Who decided that a spider has 8 legs? I don't know. But i know who is in charge of KOMA-script and scrlttr2, the author and maintainer Markus Kohm.

He decided, for whatever reason, that the footer in a letter should be slanted. The footer is implemented as a parbox, so it is justified by default.

You should not set things manually, let the program work for you. It is most likely, that you will write up more than a single letter, so storing everything in variables and later using them is a good idea. With \usekomavar* you can get the name of the variable, with the unstarred version you get the content of the variable.

Rather then setting a font, it is better to add an attribute by using the addtokomafont-mechanism. KOMA-defines pagemark, which by default does some magic, you can redefine it to show just the pagenumber, but the reader might confuse it. Please have a look at the following:

\documentclass[symbolicnames=true,parskip=half]{scrlttr2}
\pagestyle{headings}
\usepackage{showframe}
\usepackage{fontspec}
\setmainfont{Linux Libertine O}
\usepackage{polyglossia}
\setdefaultlanguage[babelshorthands=true]{german}

\usepackage{lipsum}
\setkomavar{fromname}{Sascha Wolf}
\setkomavar{fromemail}{[email protected]}
\setkomavar{frommobilephone}{+49 123 45\,67\,89}
\begin{document}

\addtokomafont{pagefoot}{\normalfont}

\setkomavar{nextfoot}{\hfill Sascha Wolf\qquad%
    \usekomavar*{fromemail}\usekomavar{fromemail}\qquad%
    \usekomavar*{frommobilephone}\usekomavar{frommobilephone}\hfill\pagemark%
}
%\renewcommand{\pagemark}{{\usekomafont{pagenumber}\rlap{\thepage}}}


\begin{letter}{Familie Mustermann}
    \opening{Sehr geehrte Familie Mustermann,}
    \lipsum
    \closing{Mit freundlichen Grüßen}
\end{letter}

\end{document}

Where can you find those defaults? Either in the documentation of KOMA-script, or if you really want to know whats going on at the code level: The source file scrlttr2.cls.

You must log in to answer this question.

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