0

I want to create a footer on all pages except the first.

After I had failed I tried with creating the same footer as on the first page and it still looks different.

It seems to only show a footer at all when I add \pagestyle{myheadings}

\documentclass{scrlttr2}

\renewcommand\familydefault{\sfdefault}
\usepackage{tgheros}

\setkomavar{firstfoot}{\hrulefill\\%
    \footnotesize \usekomavar{subject} \hfill \usekomavar{fromname}%
    }

\setkomavar{nextfoot}{\usekomavar{firstfoot}}

\pagestyle{myheadings}

\usepackage{Blindtext}

\begin{document}
    \begin{letter}{recipient}
        \setkomavar{subject}{Evaluation\\ student}
        
        \opening{Hello}
        
        \Blindtext
        
    \end{letter}
\end{document}

What am I doing wrong?

P.S.: Just to be sure: I only dsiplay the firstfoot to see if my definition was right and to show that the display is different between firstfoot and nextfoot even though they are identical...

14

1 Answer 1

3

To print a footer with foot separation line at all pages but the first one, can for example use \setkomavar{nextfoot}{<footer definition>} and KOMA-Script option footsepline. But in this case note, that the foot line of the page style is specified to be a single line (inside horizontal box). So paragraphs, line breaks etc. won't work, unless you put them explicitly into a vertical box:

\documentclass[footsepline]{scrlttr2}

\renewcommand\familydefault{\sfdefault}
\usepackage{tgheros}

\setkomafont{pagefoot}{\footnotesize}
\setkomavar{nextfoot}{%
  \parbox{\linewidth}{% because it seems you want so have line breaks using \\
    \usekomavar{subject} \hfill \usekomavar{fromname}
  }%
}


\pagestyle{myheadings}

\usepackage{blindtext}% Note: Changed because Blindtext.sty cannot be found with case sensitive file names.

\begin{document}
    \begin{letter}{recipient}
        \setkomavar{subject}{Evaluation\\ student}
        
        \opening{Hello}
        
        \Blindtext
        
    \end{letter}
\end{document}

Alternatively you could set the page footer using the recommended KOMA-Script package scrlayer-scrpage as already shown before, e.g., in scrlttr2: make second page footer match first page footer.

Note from the KOMA-Script author: Package scrletter, resp. class scrletter, which is a wrapper for class scrartcl and package scrletter, are not affected by the restriction to one line headers and footers. So another alternative would be:

\documentclass[footsepline,manualmark,footlines=2]{scrletter}

\renewcommand\familydefault{\sfdefault}
\usepackage{tgheros}

\setkomafont{pagefoot}{\footnotesize}
\setkomavar{nextfoot}{%
  \usekomavar{subject} \hfill \usekomavar{fromname}%
}

\renewcommand*{\letterpagestyle}{letter}

\usepackage{blindtext}% Note: Changed because Blindtext.sty cannot be found with case sensitive file names.

\begin{document}

    \begin{letter}{recipient}

        \setkomavar{subject}{Evaluation\\ student}
        
        \opening{Hello}
        
        \Blindtext
        
    \end{letter}
\end{document}
1
  • Thank you for your help and your determination! Commented Apr 24, 2023 at 11:05

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