I feel like this is somewhat of a common problem where most people just give up on. What I want, is to reduce the space between the the text area and the footer. So there is less white space between the text area and the blue line.
Btw, why is there no box around the footer?
What I don't want to do:
-
Not using
koma-script
. See here. -
Use
geometry
package, because from what I understand, it doesn't go well withkoma-script
. What is even to point to use koma then? I know that there is theusegeometry
option in the newer versions. Like in this question. -
Use
enlargefirstpage
, because this only works on the first page. See here.
Looking through $texdoc koma-script
:
I found this nice picture of the page geometry and from there it looks like the value to change here is \footskip
.
Additionally,
scrlayer-scrpage
interprets\footskip
to be the distance from the last baseline of the text area to the first normal baseline of the footer.
Good to know, so if I could set \footskip
to 0
there should be no space between the text area and the footer. But would this space be added to the text area or would the footer just move up?
footskip
This composite option sets hoffset, voffset, width, height, and align so that the layer spans the vertical distance between the text area and the page footer over the width of the text area. Note, however, that although the height of this area depends on\footskip
, it is not the same. This option does not expect or allow a value.
That is in some table for layer options with scrlayer-scrpage
. I'm not rally sure how this could help, because as it says: This option does not expect or allow a value.
What I tried so far:
- I played with
\setlength{\textheight}{1.1\textheight}
(after\typearea[current]{last}
) and theKOMAoptions
footheight
. This doesn't change\footskip
at all, but could be used to select where the space would be added.
My Solution \setlength{\footskip}{0\baselineskip}
For some unknown reason, the footer ends up overlapping the end of the text area. So \footskip
should be \TheFootSkipDescribedInTheKomaDocs + \footheigh + \BottomRuleWith
(2mm in my example).
With this it is possible to move the footer up and down, but the text area won't expand. Now \setlength{\textheight}{1.1\textheight}
comes into play as well, and we have a complete solution.
Because of how everything 'works', I can't help but feel like, that I've done a hack-job here and there is probably a much cleaner way of doing this and if not this would at least help some other person on the internet, because I searched for hours.
The still open questions:
- Is there a better solution?
- Why is there no show box around the footer with
\usepackage{showframe}
? - Why doesn't
\setlength{\footskip}{0\baselineskip}
result in this: "[…] if I could set\footskip
to0
there should be no space between the text area and the footer." I think it is the same reason as Question 2, because latex thinks the footer is empty or something and uses the length from the text area to the "box" that has no height at the bottom as\footskip
. But why?
\documentclass[fontsize=12pt, paper=a4, ngerman, listof=numbered, headinclude, headsepline, parskip=half, DIV=19]{scrreport}
\usepackage{scrhack}
\RequirePackage[ngerman]{babel}
\RequirePackage[utf8]{inputenc}
\RequirePackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{setspace}
\onehalfspacing
\let\raggedsection\centering
\RedeclareSectionCommands[
beforeskip=0mm,
runin=false,
afterskip=-0.5\parskip
]{section,paragraph,subparagraph}
\usepackage{scrlayer-scrpage}
\usepackage[table,xcdraw]{xcolor}
\definecolor{red}{HTML}{D01010}
\definecolor{blue}{HTML}{1010D0}
\setkomafont{headsepline}{\color{red}}
\setkomafont{footsepline}{\color{blue}}
\KOMAoptions{
onpsinit={\linespread{1}\selectfont},
headheight=20mm,
footinclude,
footheight=25mm,
footwidth=foot
}
\newpagestyle{mystyle}
{ % header
% optional - top rule
{} % two-side - left page
{} % two-side - right page
{ % one-side
Header
}
% optional - bottom rule
(\textwidth,2mm)
}
{ % footer
% optional - top rule
(\textwidth,2mm)
{} % two-side - left page
{} % two-side - right page
{ % one-side
{
Footer
}
}
% optional - bottom rule
}
% recalc typearea
\typearea[current]{last}
\pagestyle{mystyle}
\usepackage{showframe}
\usepackage{lipsum}
\begin{document}
\section*{Test 1}
\lipsum[1-2]
\section*{Test 2}
\lipsum[3-4]
\section*{Test}
\lipsum[5-6]
\end{document}
Best Answer
\enlargefirstpage
and the pseudolengthfirstfootvpos
(shown in the picture in the question) are provided by classscrlttr2
and packagescrletter
. They are not relevant withscrreprt
. As you mentioned,\footskip
is the distance from the last baseline of the text area to the first normal baseline of the footer. The position of this first normal baseline of the footer is shown by packageshowframe
.showframe
does not show a box around the footer, because eg. standard classes do not provide an opitonfootheight
and the length\footheight
. Packagetypearea
sets\footskip
to\footheight+2.25\baselineskip
. Therefore the space between the text area and your footer in your example ca. 2.25\baselineskip.mystyle
):So the KOMA-Script documentation itself suggests to use package
geometry
if you have special requirements for the page layout. Additionally, you should use class optionusegeometry
. (It is not recommended to change\textheight
and\footskip
manually.)Example: