TransWikia.com

Setting up headers with `scrbook`

TeX - LaTeX Asked by user211673 on June 21, 2021

How to setup automark in order to select a section if there is one and select the chapter instead of empty text if there is no section?

documentclass[listof=totoc,bibliography=totoc,a5paper,7pt,openright,twoside=true]{scrbook}
usepackage{blindtext}
usepackage[headsepline=true, autooneside = false]{scrlayer-scrpage}
AfterTOCHead{pagestyle{plain}}
AfterStartingTOC{clearpage}

pagestyle{scrheadings}
lohead{leftmark}
lohead{}
rohead{rightmark}

cofoot[]{}
rofoot[pagemark]{pagemark}

automark[section]{chapter}


begin{document}
    chapter{Test}
    blindtext[20]
end{document}

2 Answers

I think this might be what you want:

automark[chapter]{chapter}
automark*[section]{section}

Answered by Ingmar on June 21, 2021

You can use

automark[chapter]{chapter}
automark*[section]{}

Example:

documentclass[
  listof=totoc,bibliography=totoc,
  a5paper,
  fontsize=7pt,% changed!
  %openright,% default
  %twoside=true% default
]{scrbook}
usepackage{blindtext}% only for dummy text
usepackage[headsepline=true,
  %autooneside = false% not needed with the default twoside=true
]{scrlayer-scrpage}% sets page style scrheadings automatically
AfterTOCHead{pagestyle{plain}}
AfterStartingTOC{clearpage}

automark[chapter]{chapter}
automark*[section]{}

begin{document}
chapter{Test}
Blindtext[20]
Blinddocument
end{document}

Answered by esdd on June 21, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP