这是这个帖子。无论采用哪种解决方案,都会导致冲突。也就是说,幻影部分的缩略图(在本例中为“索引”)将显示最后一章。我怎样才能让它显示“索引”或什么都不显示?
\clearpage
\pagestyle{empty}
\phantomsection
\addcontentsline{toc}{chapter}{Index}
\label{index}
\chapter*{Index}
以下是第一个解决方案的完整代码:
\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}
第二点:
\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}
答案1
如果索引应在后记中,则使用\backmatter
删除章节缩略图。
\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}
结果:
但你也可以重新定义\chapterthumbformat
以获得一个空的 chapterthumb
\renewcommand\chapterthumbformat{}
或章节缩略图中的 »索引«:
\renewcommand\chapterthumbformat{Index}
例子:
\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}