2

This is a follow up to this post. With either of the proposed solutions, this causes a conflict. Namely, the thumb for the phantom section, in this case 'Index', will show the last chapter. How can I make it show 'Index' or nothing?

\clearpage
\pagestyle{empty}
\phantomsection
\addcontentsline{toc}{chapter}{Index}
\label{index}
\chapter*{Index}

Here's the full code for the first solution:

\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}

\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]

\pagestyle{empty}
\part{Bar}

\chapter{Beaucoup}

\lipsum[3]

\chapter{Passionnément}

\lipsum[4]

\clearpage
\pagestyle{empty}
\phantomsection
\addcontentsline{toc}{chapter}{Index}
\label{index}
\chapter*{Index}

\end{document}

And for the second:

\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}

\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]

\pagestyle{empty}
\part{Bar}

\chapter{Beaucoup}

\lipsum[3]

\chapter{Passionnément}

\lipsum[4]

\clearpage
\pagestyle{empty}
\phantomsection
\addcontentsline{toc}{chapter}{Index}
\label{index}
\chapter*{Index}

\end{document}
Jhor
  • 4,179
Erwann
  • 2,100

1 Answers1

1

If the index should be in backmatter, then use \backmatter to remove the chapterthumbs.

\documentclass[oneside]{scrbook}
\usepackage{fontawesome}
\usepackage[french]{babel}
\usepackage{chapterthumb}
\usepackage{csquotes}
\usepackage[T1]{fontenc}
\usepackage{lipsum}
\usepackage{scrlayer-scrpage}
%\AddLayersToPageStyle{@everystyle@}{chapterthumb}
\addtokomafont{chapterthumb}{\bfseries}

\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]

\pagestyle{empty}
\part{Bar}

\chapter{Beaucoup}

\lipsum[3]

\chapter{Passionnément}

\lipsum[4]

\backmatter% <- added
\chapter{Index}\label{index}% <- changed

\end{document}

Result:

enter image description here

But you can also redefine \chapterthumbformat to get an empty chapterthumb

\renewcommand\chapterthumbformat{}

or »Index« in the chapterthumb:

\renewcommand\chapterthumbformat{Index}

Example:

\documentclass[oneside]{scrbook}
\usepackage{fontawesome}
\usepackage[french]{babel}
\usepackage{chapterthumb}
\usepackage{csquotes}
\usepackage[T1]{fontenc}
\usepackage{lipsum}
\usepackage{scrlayer-scrpage}
%\AddLayersToPageStyle{@everystyle@}{chapterthumb}
\addtokomafont{chapterthumb}{\bfseries}

\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]

\pagestyle{empty}
\part{Bar}

\chapter{Beaucoup}

\lipsum[3]

\chapter{Passionnément}

\lipsum[4]

%\backmatter
\addchap{Index}\label{index}% <- changed
\renewcommand\chapterthumbformat{Index}% <- added
\lipsum
\end{document}

enter image description here

esdd
  • 85,675