Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
1  
There is no official option since there is no \footheight in LaTeX2e so a manual solution is needed, maybe placing the footer entry in an appropriate box. Markus Kohm plans to add corresponding options to the next release of KOMA-Script, though. –  cgnieder May 16 '13 at 10:47
    
You can use "titleps". See tex.stackexchange.com/questions/114548/… –  sandu May 23 '13 at 9:46

2 Answers 2

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}
share|improve this answer

Nuits, Knuth once said that with \vbox and \hbox you can make TeX do almost everything that Ben Franklin could do in his printer’s shop.

I can see the reason of your frustration and how you said hair-tearing, but everytime you have headers and footers, whether in this case for the koma class, or even with ConTeXt, remember to use \vbox and problem solved, finito, done.

Here is your document:

enter image description here

So I went ahead and removed footsepline, and footbotline from the options. And the rest was done with \vbox.

Like this:



\documentclass[headheight=1.2cm,headsepline,,]{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{}
\rohead{%
  \vbox{Line 1 \\ Line 2 \\ Line 3 \\ Line 4
}}

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

}
\ofoot{}

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


\end{document}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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