3

It is known that KOMA-Script has more flexibility than standard classes. One example is the ability to use any font size (e.g., 11.5pt). One problem appears though, which is headers and footers placing. In the standard classes, page numbers, e.g., in the bottom are placed wisely but in KOMA it is too close to the paper edge.

The question is how to force KOMA use the same distance for footers, headers, rules and margins as standard classes. Here is a MWE:

\documentclass[12pt,a4paper]{article}
\usepackage[margin=2cm]{geometry}
\begin{document}
A test document
\end{document}

which outputs the footer correctly:

enter image description here

Whereas using KOMA-Script:

\documentclass[12pt,a4paper]{scrartcl}
\usepackage[margin=2cm]{geometry}
\begin{document}
A test document
\end{document}

outputs this (undesired) behavior:

enter image description here

Any idea? Thank you.

EDIT:

The strange behavior in headers also can be shown by this example:

\documentclass[12pt,a4paper,headsepline,twoside=false]{scrbook}
\usepackage[left=3.50cm, right=2.50cm, top=2.5cm, bottom=2.5cm]{geometry}
\usepackage{pagegrid}
\begin{document}

\mainmatter
\chapter{Test Chapter}
\noindent 
Some plain text just to fill paragraph lines. Some plain text just to fill paragraph lines.

\newpage     
\noindent 
Some plain text just to fill paragraph lines. Some plain text just to fill paragraph lines. Some plain text just to fill paragraph lines. Some plain text just to fill paragraph lines. Some plain text just to fill paragraph lines. Some plain text just to fill paragraph lines. Some plain text just to fill paragraph lines. Some plain text just to fill paragraph lines. Some plain text just to fill paragraph lines. 

\end{document}

Problems in the header are shown in the following image:

enter image description here

  • You might want to use the includehead and includefoot options of geometry. But if possible you shouldn't use geometry with koma script, but the included typearea. – Juri Robl Jun 15 '15 at 14:21
  • Try the global option emulatestandardclasses to get as close to the standard classes as possible. Adding package showframe will give you an idea where head and foot actually are. – Johannes_B Jun 15 '15 at 14:22
  • @Johannes_B The option emulatestandardclasses unfortunately affects also font size. – AboAmmar Jun 15 '15 at 14:38
  • @AboAmmar Yes, it does. As close as possible. ;-) – Johannes_B Jun 15 '15 at 14:41
4

If you want the same footskip as ​used by the standard class article then change it to 30pt:

\documentclass[12pt,a4paper]{scrartcl}
\usepackage[margin=2cm,
  footskip=30pt% <- added
]{geometry}
\begin{document}
A test document: \the\footskip
\end{document}

enter image description here


Explanation:

With a KOMA-Script class the \footskip is set to 3.5\baselineskip. The standard classes article and report use 30pt as \footskip while the book class uses .35in with fontsize 10pt, .38in with 11pt and 30pt with fontsize 12pt. If you change only the margins using package geometry the \footskip is not changed even if you use a standard class. See the following example:

\documentclass[12pt,a4paper]{article}
\usepackage[
  margin=30pt,
  showframe% to show the page layout
  ]{geometry}
\begin{document}
A test document: \the\footskip
\end{document}

Result:

enter image description here

As you can see the page number can be also too close to the paper edge even if the standard class article is used. Hence the page number is not placed wisely by the standard class - its baseline is simple placed 30pt below the text body.

So if you change the margins manually it is your task to manually adjust the footskip.

If the baseline of the page number should be in the middle of the white space you can use footskip=1cm (= half of the bottom margin). Or choose something like footskip=\dimexpr1cm+.7ex\relax if the page number should be nearly centered in the white space at the bottom.


Update/Addition (regarding the changed question and a comment)

Here is your second example using the packages showframe and layout:

\documentclass[12pt,a4paper,headsepline,twoside=false]{scrbook}
\usepackage[left=3.50cm, right=2.50cm, top=2.5cm, bottom=2.5cm,
%includehead,
]{geometry}
\usepackage{pagegrid}
\pagegridsetup{tl,firstcolor=blue!50}
\usepackage{showframe}
\usepackage{layout}
\usepackage{lipsum}
\begin{document}
\layout
\chapter{Test Chapter}
\lipsum[10]
\clearpage
\noindent\lipsum[10]
\end{document}

Result:

enter image description here

As you can see the text body starts 2.5cm below of the paper edge. Note that the KOMA option headsepline sets the KOMAoption headinclude for the KOMA package typearea. But you change your layout using geometry. So you have to tell this package that the header should be included. If you uncomment its option includehead in the example you get

enter image description here

Now the top of the header is 2.5cm below of the paper edge.

The command \layout from the package layout shows us the exact values

enter image description here

The top of the header is 1inch+\voffset+\topmargin below of the paper edge. Note that \voffset is normally 0pt. With option includehead this results in your 2.5cm (set by geometry).

The text body starts 1inch+\voffset+\topmargin+\headheight+\headskip below of the paper edge. Without option includehead this results in 2.5cm (set by geometry).

Using geometry you can controll:

  • the distance to the text body (without includehead) or the distance to the top of the header by the geometry option top
  • the height of the head by the geometry option headheight
  • the sep between header and text body by the geometry option headsep

See the documentation of geometry for more Information.

  • This is exactly what I want to avoid, manual calculations. How do you know it is 30pt? Why doesn't KOMA place footers/headers automatically in a sane way? in the middle of the white space, for example. – AboAmmar Jun 15 '15 at 14:47
  • 2
    @AboAmmar If you want to have an automatic calculation of a sane textarea along with margiin settings, have a look at chapter 2 of the KOMA-documentation. As soon as you load geometry stuff is going on, and as soon as you manually set a margin size, you can do the rest by hand as well ;-) – Johannes_B Jun 15 '15 at 14:53
  • @Johannes_B Yes, but KOMA has its own philosophy regarding page layout, it assumes, e.g., that header:footer = 1:2, which is not always the case. So, how can we force it use equal head and foot? If we remove geometry and use typearea and \areaset[]{}{} it automatically chooses this 1:2 logic. – AboAmmar Jun 15 '15 at 15:14
  • @AboAmmar You can use marginratio={1:1,1:1} for geometry to make the horizontal as well as the vertical margins equal. But this will not even slightly change the fact that the author of KOMA-script decided the footskip to be dynamically calculated in dependence of the font size; whereas the standard classes define a footskip of 30 pt in the clo files. – Johannes_B Jun 15 '15 at 15:57
  • @AboAmmar I have extended my answer. – esdd Jun 15 '15 at 20:27
3

I'd suggest not to use the package geometry. If you remove it, you'll see that your pagination moves to a better position. If you need to adjust the margin, do so by using KOMA's capabilities, changing the division (by using the KOMA option DIV=) and giving a small piece of the type area to the margins e.g.

\documentclass[fontsize=12pt, paper=a4, DIV=11]{scrartcl}

\AfterCalculatingTypearea{
    \addtolength{\evensidemargin}{0.1\textwidth}
    \setlength{\textwidth}{0.9\textwidth}
    \setlength{\marginparwidth}{%
        \dimexpr 1.5\evensidemargin+0.5\marginparsep\relax}
    \setlength{\marginparsep}{0.5\marginparsep}
}
\KOMAoptions{DIV=last}

Some information about adjusting the division and the type area can be found in chapter 2 of the KOMA documentation, esp. 2.2 and 2.6.

HTH, Dario

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.