1

I have the following layout:

\documentclass{scrbook}
\usepackage{blindtext}
\usepackage[left=1.9cm, right=1.9cm, bottom=2.23cm, top=2.23cm]{geometry}% specific requirements
\usepackage[markcase=noupper]{scrlayer-scrpage}
\pagestyle{scrheadings}
\clearscrheadfoot
\lohead{\headmark}
\rohead{\pagemark}
\lehead{\pagemark}
\rehead{\headmark}
\rofoot[\pagemark]{}
\setkomafont{pageheadfoot}{\normalfont}

\begin{document}
\chapter{Chapter heading}
\blindtext[18]
\end{document}

On pages which start with a new chapter (like page 1 in the MWE above), I would like the space between the bottom of the page and the page number to be the same (2.23cm) than the space between the bottom of the page and the text on pages other than those on which a new chapter starts (like page 2 in the MWE). If I use the includefoot setting of geometry, then the space is adjusted on all pages, not just those with a page number at the bottom...

So, in essence, what I need is something like includefoot but which is only active on plain.scrheadings pages (new chapter starts) and not on scrheadings pages (other pages). If there is a better way than working with geometry, that's fine, but I have to use these exact margins and also the headings (page number at bottom on pages where chapter starts and otherwise in the header).

1
  • 1
    Sounds odd to have a different \textheight on chapter pages, but if you need it, you should use \enlargethispage{whatever} on such pages. Nov 5, 2018 at 17:41

1 Answer 1

1

To shorten \textheight on chapter pages you can use \enlargethispage as suggested by @Ulrike Fischer in a comment. Therefore you can patch \chapterlinesformat.

\usepackage{xpatch}
\xapptocmd\chapterlinesformat
  {\enlargethispage{-\footskip}}{}{\PatchFailed}
\xapptocmd\chapterlineswithprefixformat
  {\enlargethispage{-\footskip}}{}{\PatchFailed}

With the patch of \chapterlineswithprefixformat it would also work if you add class option chapterprefix or appendixprefix etc.

To shift the page number on plain pages, you can shift all footer layers of page style plain:

\ForEachLayerOfPageStyle*{plain.scrheadings}{%
  \ifstrstart{#1}{plain.scrheadings.foot}
    {\ModifyLayer[addvoffset=-\footskip]{#1}}
    {}%
}

Example:

\documentclass{scrbook}
\usepackage{blindtext}
\usepackage[hmargin=1.9cm, vmargin=2.23cm% specific requirements
  , showframe% to show the page layout
]{geometry}

\usepackage{scrlayer-scrpage}% <- sets style `scrheadings` automatically
\clearpairofpagestyles% <- scrlayer-scrpage macro  
\ihead{\headmark}
\ohead{\pagemark}
\ofoot[\pagemark]{}

\ForEachLayerOfPageStyle*{plain.scrheadings}{%
  \ifstrstart{#1}{plain.scrheadings.foot}
    {\ModifyLayer[addvoffset=-\footskip]{#1}}
    {}%
}
\setkomafont{pageheadfoot}{\normalfont}

\usepackage{xpatch}
\xapptocmd\chapterlinesformat
  {\enlargethispage{-\footskip}}{}{\PatchFailed}
\xapptocmd\chapterlineswithprefixformat
  {\enlargethispage{-\footskip}}{}{\PatchFailed}

\begin{document}
\chapter{Chapter heading}
\blindtext[18]
\end{document}

Result:

enter image description here

But then the footer is shifted for all pages using plain style while text height changes only on chapter pages automatically.

So I would suggest to declare a new page style only for the chapter pages:

\documentclass{scrbook}
\usepackage{blindtext}
\usepackage[hmargin=1.9cm, vmargin=2.23cm% specific requirements
  , showframe% to show the page layout
]{geometry}

\usepackage{scrlayer-scrpage}
\clearpairofpagestyles
\ihead{\headmark}
\ohead{\pagemark}
\ofoot[\pagemark]{}
\setkomafont{pageheadfoot}{\normalfont}

\DeclareNewLayer[
  clone=plain.scrheadings.foot.odd,
  addvoffset=-\footskip,
]{chapterpage.foot.odd}

\DeclarePageStyleByLayers{chapterpage}{chapterpage.foot.odd}
\renewcommand\chapterpagestyle{chapterpage}

\usepackage{xpatch}
\xapptocmd\chapterlinesformat
  {\enlargethispage{-\footskip}}{}{\PatchFailed}
\xapptocmd\chapterlineswithprefixformat
  {\enlargethispage{-\footskip}}{}{\PatchFailed}

\begin{document}
\chapter{Chapter heading}
\blindtext[18]
\end{document}

If other pages with style plain should not get the page number:

\documentclass{scrbook}
\usepackage{blindtext}
\usepackage[hmargin=1.9cm, vmargin=2.23cm% specific requirements
  , showframe% to show the page layout
]{geometry}

\usepackage{scrlayer-scrpage}
\clearpairofpagestyles
\ihead{\headmark}
\ohead{\pagemark}
\setkomafont{pageheadfoot}{\normalfont}

\DeclareNewLayer[
  clone=plain.scrheadings.foot.odd,
  addvoffset=-\footskip,
  contents=\hfill\pagemark
]{chapterpage.foot.odd}

\DeclarePageStyleByLayers{chapterpage}{chapterpage.foot.odd}
\renewcommand\chapterpagestyle{chapterpage}

\usepackage{xpatch}
\xapptocmd\chapterlinesformat
  {\enlargethispage{-\footskip}}{}{\PatchFailed}
\xapptocmd\chapterlineswithprefixformat
  {\enlargethispage{-\footskip}}{}{\PatchFailed}

\begin{document}
\chapter{Chapter heading}
\blindtext[18]
\end{document}

The results are the same as above.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .