3

This is a modification of Koma-script / Anhang-B that separates chapters into parts. How would I disable this feature where a new part starts? In the example given, this means removing thumb "Chapitre 2" from page "Deuxième partie:Bar".

\documentclass[oneside]{scrbook}
\usepackage{fontawesome}
\usepackage[french]{babel}
\usepackage{/usr/local/texlive/2018/texmf-dist/doc/latex/koma-script-examples/Anhang-B/source/chapterthumb}
\usepackage{csquotes}
\usepackage[T1]{fontenc}
\usepackage{lipsum}
\usepackage{scrlayer-scrpage}
\AddLayersToPageStyle{@everystyle@}{chapterthumb}
\addtokomafont{chapterthumb}{\bfseries}

\usepackage{hyperref}

\begin{document}
\part{Foo}

\chapter{Pas du tout}

\lipsum[1]

\chapter{Un peu}

\lipsum[2]

\pagestyle{empty}
\part{Bar}

\chapter{Beaucoup}

\lipsum[3]

\chapter{Passionnément}

\lipsum[4]

\end{document}

Output

1
  • 1
    Off topic: remove \pagestyle{empty} before \part{Bar}. It changes the page style of the normal (where no chapter or part starts) pages to empty. And it changes the page style of the page before part »Bar« starts.
    – esdd
    Commented Sep 25, 2019 at 20:09

1 Answer 1

1

The issue comes from \AddLayersToPageStyle{@everystyle@}{chapterthumb}. It adds layer chapterthumb to style @everystyle@. Therefore the chapterthumbs are used with all layer page styles: empty, scrheadings, plain (alias of plain.scrheadings), ...

You can define a new page style for the part pages and add chapterthumbs only to page styles scrheadigs and plain.scrheadings:

\documentclass[oneside]{scrbook}
\usepackage{fontawesome}
\usepackage[french]{babel}
\usepackage{chapterthumb}% http://mirrors.ctan.org/info/examples/KOMA-Script-6/Anhang-B/source/chapterthumb.sty
\usepackage{csquotes}
\usepackage[T1]{fontenc}
\usepackage{lipsum}
\usepackage{scrlayer-scrpage}
\newpairofpagestyles[scrheadings]{part}{}
\renewcommand\partpagestyle{plain.part}

\AddLayersToPageStyle{scrheadings}{chapterthumb}
\AddLayersToPageStyle{plain.scrheadings}{chapterthumb}
\addtokomafont{chapterthumb}{\bfseries}

\usepackage{hyperref}

\begin{document}
\part{Foo}
\chapter{Pas du tout}
\lipsum[1]
\chapter{Un peu}
\lipsum[2]

\part{Bar}
\chapter{Beaucoup}
\lipsum[3]
\chapter{Passionnément}
\lipsum[4]
\end{document}

Result:

enter image description here

Or you can remove layer chapterthumb from @everystyle@ on part pages:

\documentclass[oneside]{scrbook}
\usepackage{fontawesome}
\usepackage[french]{babel}
\usepackage{chapterthumb}% http://mirrors.ctan.org/info/examples/KOMA-Script-6/Anhang-B/source/chapterthumb.sty
\usepackage{csquotes}
\usepackage[T1]{fontenc}
\usepackage{lipsum}
\usepackage{scrlayer-scrpage}
\AddLayersToPageStyle{@everystyle@}{chapterthumb}
\addtokomafont{chapterthumb}{\bfseries}

\newcommand*{\oldpartheadendvskip}{}
\let\oldpartheadendvskip\partheadendvskip
\renewcommand\partheadendvskip{%
  \RemoveLayersFromPageStyle{@everystyle@}{chapterthumb}%
  \oldpartheadendvskip
  \AddLayersToPageStyle{@everystyle@}{chapterthumb}%
}

\usepackage{hyperref}

\begin{document}
\part{Foo}
\chapter{Pas du tout}
\lipsum[1]
\chapter{Un peu}
\lipsum[2]

\part{Bar}
\chapter{Beaucoup}
\lipsum[3]
\chapter{Passionnément}
\lipsum[4]
\end{document}

You must log in to answer this question.

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