0

I am using KOMA scrbook with scrheadings pagestyle

This means that the chapter pages have no header or footer. However, I would like the chapter page to have three-line text in the left side footer and page number in the right side footer.

What I succeeded to do so far is to put

\newpagestyle{MyStyle}{{}{}{}}{{}{first line\\second line\\third line}{}}
\renewcommand*{\chapterpagestyle}{MyStyle}

which actually puts three text lines in the left side footer. However

  • These three lines are too close to the paper edge
  • I don't know where to put \pagemark
  • headsepline also appears in the header

I couldn't find newpagestyle examples how to sort this out. Can you help me out?

MWE:

\documentclass[11pt,parskip=half,open=any]{scrbook}

\usepackage[paperwidth=210mm,paperheight=279mm,top=25mm,bottom=25mm,inner=25mm,outer=62mm,marginparsep=3mm,marginparwidth=48mm,headsep=9mm,headheight=6mm]{geometry}
\usepackage[ilines,headsepline]{scrlayer-scrpage}
\setheadwidth[0pt]{textwithmarginpar}

\usepackage{lipsum}    

\clearscrheadfoot
\lohead{\leftmark}
\rehead{Title}
\ohead{\pagemark}

\pagestyle{scrheadings}
\newpagestyle{MyStyle}{{}{}{}}{{}{first line\\second line\\third line}{}}
\renewcommand*{\chapterpagestyle}{MyStyle}

\begin{document}

\chapter{Test name}

\lipsum

\end{document}
0

1 Answer 1

1

Update

Now I know from a comment below where the page number should be and that the header and footer should be the same width.

To shrink the text on chapter pages you can use

\AddtoDoHook{heading/endgroup/chapter}{\shrinkthisheadingpage{2\baselineskip}}
\newcommand*\shrinkthisheadingpage[2]{\enlargethispage{-#1}}

Example:

\documentclass[11pt,parskip=half,open=any]{scrbook}
\usepackage{lipsum}
\usepackage[paperwidth=210mm,paperheight=279mm,top=25mm,bottom=25mm,inner=25mm,outer=62mm,marginparsep=3mm,marginparwidth=48mm,headsep=9mm,headheight=6mm]{geometry}

\usepackage[ilines,headsepline]{scrlayer-scrpage}
\KOMAoptions{headwidth=textwithmarginpar,footwidth=head}% changed

\clearpairofpagestyles
\lohead{\leftmark}
\rehead{Title}
\ohead{\pagemark}

\newpairofpagestyles[scrheadings]{MyStyle}{%
  \clearpairofpagestyles
  \ofoot*{\pagemark}
  \ifoot*{\smash{% hides the hight of the argument
    \begin{tabular}[b]{@{}l@{}}first line\\second line\\third line\end{tabular}% changed
  }}
}
\renewcommand*{\chapterpagestyle}{plain.MyStyle}

\AddtoDoHook{heading/endgroup/chapter}{\shrinkthisheadingpage{2\baselineskip}}
\newcommand*\shrinkthisheadingpage[2]{\enlargethispage{-#1}}

\begin{document}
\chapter{Test name}
\lipsum[1-10]
\chapter{Test name}
\lipsum
\end{document}

enter image description here

But I would suggest to use the same height on both chapter and other pages. Therefore you could enlarge option bottom to 35mm and use class option footlines=3.25. Then \smash could be removed:

\documentclass[11pt,parskip=half,open=any,footlines=3.25]{scrbook}
\usepackage{lipsum}
\usepackage[paperwidth=210mm,paperheight=279mm,top=25mm,bottom=35mm,inner=25mm,outer=62mm,marginparsep=3mm,marginparwidth=48mm,headsep=9mm,headheight=6mm]{geometry}

\usepackage[ilines,headsepline]{scrlayer-scrpage}
\KOMAoptions{headwidth=textwithmarginpar,footwidth=head}% changed

\clearpairofpagestyles
\lohead{\leftmark}
\rehead{Title}
\ohead{\pagemark}

\newpairofpagestyles[scrheadings]{MyStyle}{%
  \clearpairofpagestyles
  \ofoot*{\pagemark}
  \ifoot*{\begin{tabular}[b]{@{}l@{}}first line\\second line\\third line\end{tabular}}
}
\renewcommand*{\chapterpagestyle}{plain.MyStyle}

\begin{document}
\chapter{Test name}
\lipsum[1-10]
\chapter{Test name}
\lipsum[1-10]
\end{document}

enter image description here


Original answer

You did not say, if and where the footer should be printed on even chapter pages and where the page number should be printed. IMHO the page bottom is too small for three lines. \setheadwidth is deprecated, replace it by \KOMAoptions{headwidth=...}. Additionally \clearscrheadfoot should be replaced by \clearpairofpagestyles.

In your MWE page style plain is empty. If there are no other pages using this empty plain style, you can redefine it and use plain on chapter pages (default):

\documentclass[11pt,parskip=half,open=any]{scrbook}
\usepackage{lipsum}% only for dummy text in the example
\usepackage[paperwidth=210mm,paperheight=279mm,top=25mm,bottom=25mm,inner=25mm,outer=62mm,marginparsep=3mm,marginparwidth=48mm,headsep=9mm,headheight=6mm]{geometry}

\usepackage[ilines,headsepline]{scrlayer-scrpage}% sets pagestyle scrheadings automatically
\KOMAoptions{headwidth=textwithmarginpar}% changed

\clearpairofpagestyles% changed
\lohead{\leftmark}
\rehead{Title}
\ohead*{\pagemark}% short version of \ohead[pagemark]{\pagemark}
\ifoot[\smash{% hides the hight of the argument
  \begin{tabular}[c]{@{}l@{}}first line\\second line\\third line\end{tabular}%
}]{}

\begin{document}
\chapter{Test name}
\lipsum[1-10]
\chapter{Test name}
\lipsum
\end{document}

If you need new page styles, then define it with \newpairofpagestyle and use the plain style of this pair for the chapter pages. Then there will be no rule below the header.

\documentclass[11pt,parskip=half,open=any]{scrbook}
\usepackage{lipsum}% only for dummy text in the example
\usepackage[paperwidth=210mm,paperheight=279mm,top=25mm,bottom=25mm,inner=25mm,outer=62mm,marginparsep=3mm,marginparwidth=48mm,headsep=9mm,headheight=6mm]{geometry}

\usepackage[ilines,headsepline]{scrlayer-scrpage}% sets pagestyle scrheadings automatically
\KOMAoptions{headwidth=textwithmarginpar}% changed

\clearpairofpagestyles% changed
\lohead{\leftmark}
\rehead{Title}
\ohead{\pagemark}

\newpairofpagestyles[scrheadings]{MyStyle}{%
  \clearpairofpagestyles
  \ohead*{\pagemark}
  \ifoot[\smash{% hides the hight of the argument
    \begin{tabular}[c]{@{}l@{}}first line\\second line\\third line\end{tabular}%
  }]{}
}
\renewcommand*{\chapterpagestyle}{plain.MyStyle}

\begin{document}
\chapter{Test name}
\lipsum[1-10]
\chapter{Test name}
\lipsum
\end{document}

enter image description here

9
  • Thanks for the answer. The page number should be below on outer side and three lines of text should be below on the inner side. That probably won't be problem for me to change. However, as you mentioned, there is not enough space for three lines. Would it be possible to shrink text on the bottom of chapter pages only - or perhaps translate text a bit higher?
    – Pygmalion
    Jun 16, 2020 at 9:18
  • I changed \KOMAoptions{headwidth=textwithmarginpar,footwidth=textwithmarginpar} and \ofoot*{\pagemark}. Now it is in principle OK, but I would still chapter header page to have more space for footer. Can you just do that?
    – Pygmalion
    Jun 16, 2020 at 10:49
  • See my updated answer.
    – esdd
    Jun 16, 2020 at 13:00
  • Thanks a lot. First, what I find confusing that using footlines=3.25 does not change anything visually. Secondly, I was thinking to shrink text on the chapter page to move three line text away from the edge of the page, not to increase space between footer and text. Hopefully I will find that in KOMA manual.
    – Pygmalion
    Jun 16, 2020 at 13:19
  • And \shrinkthisheadingpage probably doesn't need two parameters?
    – Pygmalion
    Jun 16, 2020 at 13:22

You must log in to answer this question.

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