在我的目录中,我有常规章节,其中包含章节和小节等,还有章节作为前言和后记的一部分,没有任何章节。每组章节和小节之间的间距始终相同。但是,我想减少所有非常规章节之间的间距,因为我必须优化目录的总体构成。
因此,我基本上在寻找一种方法来在目录中的某个点切换不同的间距。我希望以下 MWE 能够说明这一点。
平均能量损失
\documentclass{scrbook}
\usepackage{titletoc}
\begin{document}
\tableofcontents
\chapter{Regular Chapter 1}
\section{title}
\section{title}
\chapter{Regular Chapter 2}
\section{title}
\section{title}
\chapter{Regular Chapter 3}
\section{title}
\section{title}
\chapter{Postface Chapter 1 - spacing after entry should be reduced}
\chapter{Postface Chapter 2 - spacing after entry should be reduced}
\chapter{Postface Chapter 3 - spacing after entry can be reduced}
\end{document}
知道如何实现这个吗?
答案1
您可以在目录中添加一行,在其中更改空格\DeclareTOCStyleEntry[beforeskip=<space>]{default}{chapter}
\documentclass{scrbook}
\begin{document}
\tableofcontents
\chapter{Regular Chapter 1}
\section{title}
\section{title}
\chapter{Regular Chapter 2}
\section{title}
\section{title}
\chapter{Regular Chapter 3}
\section{title}
\section{title}
\chapter{Postface Chapter 1 - spacing after entry should be reduced}
% Place this after the first chapter of the block
\addtocontents{toc}{\DeclareTOCStyleEntry[beforeskip=1ex]{default}{chapter}}
\chapter{Postface Chapter 2 - spacing after entry should be reduced}
\chapter{Postface Chapter 3 - spacing after entry can be reduced}
\end{document}