5

I want to edit header/footer of my document with the scrlayer-scrpage package. Here's the MWE:

\documentclass[english,BCOR=6mm,cdgeometry=twoside,DIV=12,open=right,headsepline]{tudscrbook}
\usepackage{babel}
\usepackage{isodate}
\usepackage{blindtext}
\usepackage{scrlayer-scrpage}
\begin{document}
\mainmatter
\blinddocument
\end{document}

I want header and footer to extend slightly beyond the text width. A similar question was asked yesterday (Adjust header and footer width) but there fancyhdr package is used which is not compatible with scrbook.

Edit: Also, I want to know how to format the chapter titles to look like: enter image description here

1
  • Please do not raise several issues in one question. Ask a separate question for the chapter title formatting (after searching for an existing solution on the site).
    – schtandard
    Jul 26, 2022 at 9:46

1 Answer 1

1

You can use option headwidth=\textwidth+1cm:0pt. The syntax is headwidth=<width>:<offset>:<offset>, see also the KOMA-Script. If there is only one <offset> given (like in the example), this offset is used on both even and odd pages.

To get a prefix line for the chapters add class option chapterprefixline. This works for both classes scrbook and tudscrbook.

Example with scrbook:

\documentclass[english,BCOR=6mm,DIV=12,headsepline,
  chapterprefix% <- added: prefix line for chapters
]{scrbook}

\usepackage{babel}
\usepackage{isodate}
\usepackage{blindtext}

\usepackage{scrlayer-scrpage}
\KOMAoptions{headwidth=\textwidth+1cm:0pt}

\begin{document}
\blinddocument
\end{document}

enter image description here

Example with class tudscrbooks (uses package geometry and loads package scrlayer-scrpage):

\documentclass[english,BCOR=6mm,cdgeometry=twoside,
  %DIV=12,% page layout is calculated by package geometry
  open=right,headsepline,
  chapterprefix% <- added: prefix line for chapters
]{tudscrbook}

\usepackage{babel}
\usepackage{isodate}
\usepackage{blindtext}

\AtBeginDocument{\KOMAoptions{headwidth=\textwidth+1cm:0pt}}

\begin{document}
\blinddocument
\end{document}

enter image description here

5
  • Hello. This is not working as intended. I would like the header and footer to extend slightly beyond the text width on the left side on even pages and on the right side on odd pages. Right now, it extends on both sides on even pages and only on the right side on odd pages. Oct 28, 2021 at 9:45
  • Also, when I compile your code, "Chapter 1" and "Heading on.." is displayed in the same line. Oct 28, 2021 at 9:45
  • @modeltheory Did you really run my code? Note the offset of 0pt in headwidth=\textwidth+1cm:0pt. To get the extra line with »Chapter 1« you have to add option chapterprefix to the class options. This works for both scrbook and tudscrbook.
    – esdd
    Oct 28, 2021 at 13:37
  • Yes, I had. Your previous edit has '0cm' instead of '0pt'. I have added the 'chapterprefix' in the class options but I get "Chapter 1Heading on.." as the title instead of "Chapter 1\\ Heading...". Oct 28, 2021 at 13:42
  • 0pt = 0cm ;-) I have tested my examples using MiKTeX, TeXLive 2018, 2019, 2020 and 2021. The result is shown in the screen shots. Maybe there are additional code in your example overwritting the settings.
    – esdd
    Oct 28, 2021 at 13:50

You must log in to answer this question.

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