I'm trying to change the standard footer of the scrlttr2 class from {page no.} to Page {page no.} of {total}. While searching for a way to do this, I found out that the current accepted method for KOMA classes is to use the scrlayer-scrpage package. However, loading that package raises the following error:

! Missing = inserted for \ifnum.
<to be read again> 
l.7 \end{letter}

Here is the really minimal (non-)working example used to create this error:


This is a MWE.

Any suggestions? Are scrlttr2 and scrlayer-scrpage incompatible or could something be wrong with my package (versions)?

  • 2
    Works for me. Could you please check if your distribution is up-to-date?
    – TeXnician
    Commented Aug 29, 2017 at 16:10

1 Answer 1


Your example does work with old KOMA-Script 3.22, current KOMA-Script release 3.23 or current KOMA-Script prerelease. Nevertheless, you do not need scrlayer-scrpage to change the page mark, you only need to redefine command \pagemark:

\renewcommand*{\pagemark}{\usekomafont{pagenumber}{\thepage\ of
\setkomavar{firstfoot}{\centering \pagemark}

enter image description here

Or if you prefer

enter image description here


\@setplength{firstfootvpos}{\dimexpr 1in+\topmargin+\headheight+\headsep+\textheight+\footskip\relax}

to the document preamble.

  • Thanks, I was using KOMA v3.12. Updating to the current version solved the problem, but your solution also seems to work. Commented Aug 30, 2017 at 16:18

You must log in to answer this question.

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