# How do I add a Page X of Y in a KOMA-script class?

I saw the answers to a similar question, but the accepted answer won't take effect in a KOMA-script class.

\usepackage{lastpage}
...
\cfoot{\thepage\ of \pageref{LastPage}}


I am using scrartcl and lastpage. The default page numbering is just the page number itself. I want it to be currentPage / totalPages. How do I modify it?

Remember to specify the page style. This minimal example works, showing "2 of 3" etc. in the page foot:

\documentclass{scrartcl}
\usepackage{lastpage}
\usepackage{scrpage2}
\cfoot{\thepage\ of \pageref{LastPage}}
\begin{document}
text
\newpage
text
\newpage
text
\end{document}

• this time there is a page number on the upper right of each page. I only need the bottom "X of Y" numbering. How do I fix this? – Kit Oct 26 '10 at 15:34
• found it. I added \ohead{} before \cfoot... – Kit Oct 26 '10 at 15:36
• Note that scrpage2 is obsolete. Simply replace \usepacke{scrpage2} by \usepackage{scrlayer-scrpage}. Additionally you can remove \pagestyle{scrheadings}. – Schweinebacke Mar 7 '17 at 10:06

\usepackage{fancyhdr}


\pagestyle{fancy}

• Usage of fancyhdr is not recommended if you are using a KOMA-Script class. – Schweinebacke Mar 7 '17 at 10:07