9

After lots of googling and hair-tearing, I'm turning grey and old, and no wiser...

EDIT : see bottom for a half-cooked solution.

I switched from LaTeX plain classes (article, report, etc.) to Koma-Script. And from fancyhdr to scrpage2/scrheadings for headers and footers.

Problem is, I utterly fails to properly manage the footer position and height. I banged my head on the same problem for the headers, and found the headheight option which solved this point. Not so for the footer.

Minimal example :

\documentclass[headheight=1.2cm,headsepline,footsepline,footbotline]{scrartcl}
\usepackage{scrpage2}
\usepackage{lipsum}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[frenchb]{babel}

\pagestyle{scrheadings}
\setkomafont{pagehead}{\normalfont\sffamily}
\setkomafont{pagefoot}{\normalfont\sffamily}

\ihead{}
\chead{}
\ohead{
  Line 1 \\ Line 2 \\ Line 3\\Line 4
}

\ifoot{}
\cfoot{\scriptsize%
  Line 1 \\ Line 2 \\ Line 3\\Line 4
}
\ofoot{}

\begin{document}
\lipsum[10-20]
\end{document}

Cannot post an image, I'm too new here :(

It should be obvious (even if in real life I do not use the footsepline and footbotline) that the footer height is not properly computed or taken into account.

And it's placed far too high on the page (that's not visible in the image above).

Any idea on how to solve those two problems?

EDIT : After a lots of tries and reading, I found something that gets me closer to my target (while waiting for the next release of KomaScript, as said in comment 1). My documents now start with

\documentclass[headheight=1.2cm,headsepline]{scrartcl}
\usepackage[bottom=2cm,footskip=8mm]{geometry}

It's the bottom abd footskip parameters of geometry package that are relevant. The footer is properly placed (not too high) and I have no overlapping between page text and footer.

5

Since version 3.12 KOMA-Script provides the options

  • footheight – equivalent of the headheight option for the footer
  • footlines – specify number of lines of the footer instead of the height (default is 1.25), equivalent of the option headlines (provided since v3.00, default 1.25).

If used in combination with the scrpage2 successor scrlayer-scrpage which knows about footheight the setup would be

\documentclass[
  headlines=4,
  headsepline,
  footheight=38pt,
  footsepline,
  footbotline
]{scrartcl}

I used footheight=38pt because footlines seems to assume the base font size which is too large since you're using \scriptsize. I found 38pt by using a too small value and looking in the log file at the resulting warning which one is needed...

BTW: I would specify \scriptsize in the pagefoot KOMA-font instead of placing it in \cfoot:

\setkomafont{pagefoot}{\normalfont\sffamily\scriptsize}

enter image description here

enter image description here

\documentclass[
  headlines=4,
  headsepline,
  footheight=38pt,
  footsepline,
  footbotline
]{scrartcl}
\usepackage{scrlayer-scrpage}
\usepackage{lipsum}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[frenchb]{babel}

\pagestyle{scrheadings}
\setkomafont{pagehead}{\normalfont\sffamily}
\setkomafont{pagefoot}{\normalfont\sffamily\scriptsize}

\ihead{}
\chead{}
\ohead{%
  Line 1 \\ Line 2 \\ Line 3\\ Line 4%
}

\ifoot{}
\cfoot{%
  Line 1 \\ Line 2 \\ Line 3\\ Line 4%
}
\ofoot{}

\begin{document}
\lipsum[10-20]
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.