1

My document class is scrartcl and I defined the pagemargins with geometry as follows

\documentclass[11pt]{scrartcl}
\usepackage[left=2cm, right=1cm, bottom=2cm, a4paper, twoside]{geometry} 

So the page numbers are in the corners of the pages. I want to put the current date with a preceding text somewhere above the page numbers maybe next to them. I don't know, whatever works at all and looks better. It should be just like this:

Stand: 27.05.2021

I read that fancyhdr should not be used with scrartcl, so I don't really know how to handle footers with koma script.

1 Answer 1

1

You can use the scrlayer-scrpage package in this kind of situation (essentially it replaces fancyhdr for KOMA script classes)

Here is an example:

\documentclass[11pt]{scrartcl}
\usepackage[left=2cm, right=1cm, bottom=2cm, a4paper, twoside]{geometry} 
\usepackage[ngerman]{babel}
\usepackage{scrlayer-scrpage}

\lofoot{\upshape Stand: \today}
\begin{document}
    Inhalt...
\end{document}

Where upshape makes sure it is not in italics and babel ensures the date is typeset in German rather than US american.

If, like you asked, the date should be above the pagenumber, you can do this:

\documentclass[11pt]{scrartcl}
\usepackage[left=2cm, right=1cm, bottom=2.5cm, a4paper, twoside]{geometry} 
\usepackage[ngerman]{babel}
\usepackage{scrlayer-scrpage}

\rofoot{\upshape Stand: \today \\ \thepage}
\begin{document}
    Inhalt...
\end{document}

Note that in this case, your bottom margin was to small and I added .5cm.

For more information on this package, read chapter 5 of the KOMA-manual, which explains all of the options.

3
  • This does not put the date on every page though, only the last page has it. Could it be because I am using xltabular, which stretches a table over several pages? Actually my whole document is a single very long table.
    – Namal
    Commented May 27, 2021 at 8:17
  • You are right, \lofoot will only affect every other page. Try \ofoot instead. You may need to define empty footers first or the page number may be displayed twice.
    – Markus G.
    Commented May 27, 2021 at 8:22
  • That works! It was actually the twoside option which put the \lofoot date on the odd pages only.
    – Namal
    Commented May 27, 2021 at 8:26

You must log in to answer this question.

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