Menu

#73 Cannot adjust space between header and text

KOMA-Script 3.42
closed
2024-08-06
2024-08-06
No

Using current KOMA script classes, I cannot find a way to adjust the space between the page header and the text (this would probably be headsep in the standard LaTeX classes or in geometry. This can be important because certain font choices and page sizes make the default separation a bit too thin unless you use a separation line. Particularly when you use a large line skip with setspaceenhanced (e.g. 1 line + 1/2) the default separation is thin.

It looks to me that the separation is somehow hardwired to something slightly larger than an empty line. Is it the case? Or is the value adjustable?

Discussion

  • Markus Kohm

    Markus Kohm - 2024-08-06

    typearea sets headsep to 1.5\baselineskip. So a large font isn't a problem, because larger font sizes result in larger \baselineskip. For the same reason a large lineskip using setspace or setspaceenhanced or \linespread isn't a problem at all. Maybe you've not read the examples using setspace in the typearea chapter. They would be the same using setspaceenhanced, e.g.:

    \documentclass[10pt,twoside,BCOR=12mm,DIV=calc]
    {scrbook}% class replaced to see a heading
    \usepackage{setspaceenhanced}
    \onehalfspacing
    \AfterTOCHead{\singlespacing}
    \KOMAoptions{DIV=last}
    \usepackage{blindtext}% added to see a heading
    \begin{document}
    \title{Title}
    \author{Markus Kohm}
    \begin{spacing}{1}
    \maketitle
    \end{spacing}
    \tableofcontents
    \chapter{Ok}
    Head separation is \the\headsep.% added for information
    \blinddocument% added to see a heading
    \end{document}
    

    Instead of \KOMAoptions{DIV=last} you can alternatively use \recalctypearea.

    However, if you really want to change the head separation space, you can use \AfterCalculatingTypearea:

    \documentclass[10pt,twoside,BCOR=12mm,DIV=calc]
    {scrbook}% class replaced to see a heading
    \AfterCalculatingTypearea{%
       \addtolength{\headsep}{2in}%
       \addtolength{\textheight}{-2in}%
     }
    \usepackage{setspace}
    \onehalfspacing
    \AfterTOCHead{\singlespacing}
    \KOMAoptions{DIV=last}
    \usepackage{blindtext}% added to see a heading
    \begin{document}
    \title{Title}
    \author{Markus Kohm}
    \begin{spacing}{1}
    \maketitle
    \end{spacing}
    \tableofcontents
    \chapter{Ok}
    Head separation is \the\headsep.% added for information
    \blinddocument% added to see a heading
    \end{document}
    

    or even geometry (which is also recommended in the manual, when you want changes to the calculation of typearea):

    \documentclass[10pt,twoside,BCOR=12mm,DIV=calc,usegeometry]
    {scrbook}% class replaced to see a heading
    \usepackage{setspaceenhanced}
    \onehalfspacing
    \AfterTOCHead{\singlespacing}
    \usepackage[top=3in,headsep=2.5in]{geometry}
    \usepackage{blindtext}% added to see a heading
    \begin{document}
    \title{Title}
    \author{Markus Kohm}
    \begin{spacing}{1}
    \maketitle
    \end{spacing}
    \tableofcontents
    \chapter{Ok}
    Head separation is \the\headsep.% added for information
    \blinddocument% added to see a heading
    \end{document}
    

    Because of this, I see no need to change anything.

     

    Last edit: Markus Kohm 2024-08-06
  • Markus Kohm

    Markus Kohm - 2024-08-06
    • labels: --> nothing to do
    • status: open --> closed
    • assigned_to: Markus Kohm
     
  • Markus Kohm

    Markus Kohm - 2024-08-06
    • labels: nothing to do --> nothing to do, typearea
     
  • Sergio Callegari

    Thanks, I had completely missed the existence of the \AfterCalculatingTypearea hook.
    Let me add that I am always impressed not just by the helpfulness but also by your speed in providing advice!

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.