2

This question continues my another.

I have to use weird margins and line spacing for my academic writing. MWE:

\documentclass[
               pagesize,
               usegeometry = on,
               DIV = calc% for the line spacing, KOMA-Script manual, page 40
              ]{scrartcl}

\usepackage[
            left = 25mm,
            bottom = 20mm,
            right = 45mm,
            top = 20mm
           ]{geometry}
\usepackage{scrlayer-scrpage}
\usepackage[onehalfspacing]{setspace}% for the line spacing, KOMA-Script manual, page 40
% for the line spacing, KOMA-Script manual, page 40:
\AfterTOCHead{\singlespacing}
\KOMAoptions{
             DIV = last,
             onpsinit = {\linespread{1}\selectfont}% slightly heaves the page numbers
            }

\begin{document}

  Test.

\end{document}

The result: page numbers Can I have more control of the position of the page numbers? At least one line height of space should be below of the page numbers!

Thank you for your help and effort in advance!

Su-47
  • 2,508

2 Answers2

2

One possibility is to use for example command

\setlength{\footskip}{0.75cm}

to define the distance of the last groundline of text to first groundline of foot. Change the value to your needs ...

With the following MWE

\documentclass[%
  pagesize,
  usegeometry = on,
  DIV = calc,        % for the line spacing, KOMA-Script manual, page 40
]{scrartcl}

\usepackage[%
  left = 25mm,
  bottom = 20mm,
  right = 45mm,
  top = 20mm,
  showframe % <=========================================================
]{geometry}
\usepackage{scrlayer-scrpage}
\usepackage[onehalfspacing]{setspace}% for the line spacing, KOMA-Script manual, page 40
% for the line spacing, KOMA-Script manual, page 40:
\AfterTOCHead{\singlespacing}
\KOMAoptions{%
  DIV = last,
  onpsinit = {\linespread{1}\selectfont}% slightly heaves the page numbers
}
\setlength{\footskip}{0.75cm} % <=======================================


\begin{document}

Test.

\end{document} 

you get the result (see that I used option showframe to visualize the typing area and margins):

enter image description here

Mensch
  • 65,388
1

First of all: Do not use DIV=last after your geometry settings. This KOMA-Script option recalculates the typearea! Load package showframe or use the geometry option showframe to see the difference. Eg. left and right margin will have the same width again.

Load package setspace with option onehalfspacing before the geometry settings. Then you can use geometry options heightrounded and footskip=<length>.

Since KOMA-Script version 3.24 (current is 3.25) there is an option singlespacing for scrlayer-scrpage.

\documentclass[
               usegeometry = on,
               DIV=calc
              ]{scrartcl}

\usepackage[onehalfspacing]{setspace}% before the geometry settings

\usepackage[
            left = 25mm,
            bottom = 20mm,
            right = 45mm,
            top = 20mm,
            includehead,% remove if the header should be inside the 20mm top margin
            heightrounded,
            footskip=30pt% <- adjust to your needs
           ]{geometry}

\usepackage[singlespacing]{scrlayer-scrpage}
\AfterTOCHead{\singlespacing}

% the following packages are only for this example:
\usepackage{showframe}% to show the page layout
\usepackage{layout}% to show the page layout

\begin{document}
\layout%  to show the page layout

Test.
\end{document}

enter image description here

Note that KOMA-Script option pagesize is default. If you remove both options usegeometry=on and DIV=calc in the example above only \marginparwidth changes.


It is also possible to shift all layers in the footer of scrheadings and plain.scrheadings. If the bottom of these layers should be 2\baselineskips above of lower page border, you can use

\documentclass[
               usegeometry = on,
               DIV=calc
              ]{scrartcl}

\usepackage[onehalfspacing]{setspace}% before the geometry settings

\usepackage[
            left = 25mm,
            bottom = 20mm,
            right = 45mm,
            top = 20mm,
            includehead,% remove if the header should be inside the 20mm top margin
            heightrounded,
           ]{geometry}

\usepackage[singlespacing]{scrlayer-scrpage}
\ForEachLayerOfPageStyle*{scrheadings}{%
    \ifstrstart{#1}{scrheadings.foot}
      {\ModifyLayer[voffset=\paperheight-2\baselineskip,align=b]{#1}}
      {}%
}
\ForEachLayerOfPageStyle*{plain.scrheadings}{%
    \ifstrstart{#1}{plain.scrheadings.foot}
      {\ModifyLayer[voffset=\paperheight-3\baselineskip,align=b]{#1}}
      {}%
}
\AfterTOCHead{\singlespacing}

% the following packages are only for this example:
\usepackage{showframe}% to show the page layout
\usepackage{layout}% to show the page layout

\begin{document}
\layout%  to show the page layout

Test.
\end{document}

Result:

enter image description here

esdd
  • 85,675
  • Hello @esdd! Thank you for this great solution! Now the margins are finally like like expected. However there is an another issue now, which doesn't appierd before. Could you please help with it. – Su-47 Jul 21 '18 at 12:35