This questions explains how you can show the total page number of your document in the footer on each page, i.e. show a “page # of ##” instead of the default “page # of #”.
However, even though someone asked for that in the comments, it does not explain how to do that in a KOMA class. It has been suggested to ask a new question.
I use scrartcl
for a letter (and load scrletter
), so I'd like to do the same here.
So how can I do it there?
The previous question has been asked about scrlttr2 but the best solution there does not work in this case. See example below.
Example code:
\documentclass{scrartcl}
\usepackage{scrletter}
\renewcommand*\pagemark{%
\usekomafont{pagenumber}{\pagename~\thepage~of~\letterlastpage}%
}
\usepackage{xpatch}
\xpatchcmd{\opening}{\thispagestyle{empty}}{\thispagestyle{plain}}{}{\PatchFailed}
\KOMAoptions{firstfoot=false}% disable first footer
\usepackage{lipsum}
\begin{document}
\begin{letter}{Jerry Garcia\\710 Ashbury St\\San Francisco\\CA 94117}
\opening{Dear Friend,}
\lipsum\lipsum
\end{letter}
\begin{letter}{Jerry Garcia\\710 Ashbury St\\San Francisco\\CA 94117}
\opening{Dear Friend,}
\lipsum\lipsum
\end{letter}
\end{document}