修改 ToC 后记条目距离

修改 ToC 后记条目距离

我使用类创建了一个简单的文档,memoir如下所示:

\documentclass[12pt,a5paper]{memoir}

\renewcommand\thepart{\arabic{part}}
% modify ToC part
\renewcommand{\cftpartaftersnum}{.}
\renewcommand{\cftpartfont}{\normalsize\bfseries}
\renewcommand{\cftpartpagefont}{\normalsize\bfseries}
\setlength{\cftbeforepartskip}{16pt}
\setlength{\cftpartnumwidth}{2.5em}
% modify ToC chapter
\renewcommand{\cftchapteraftersnum}{.}
\renewcommand{\cftchapterfont}{\normalsize}
\renewcommand{\cftchapterleader}{\cftdotfill{\cftdotsep}}
\renewcommand{\cftchapterpagefont}{\normalsize}
\setlength{\cftbeforechapterskip}{2pt}
\setlength{\cftchapternumwidth}{2.5em}


\begin{document}
\frontmatter
\tableofcontents
\mainmatter

\part{Part One}
\chapter[Chapter Title]{Chapter Title}
\chapter[Chapter Title]{Chapter Title}
\chapter[Chapter Title]{Chapter Title}

\part{Part Two}
\chapter[Chapter Title]{Chapter Title}
\chapter[Chapter Title]{Chapter Title}
\chapter[Chapter Title]{Chapter Title}

\backmatter
\pagestyle{plain}
\chapter[About Writer]{About Writer}

\end{document}

我的结果

我如何About Writer在目录中的 和 最后一章之间(例如Part One和之间的空间)添加更多空间(例如 16pt) Part Two?谢谢。

更新:两者皆有卡尔科勒Johannes_B 的如果我使用 ,答案会很好\chapter[About Writer]{About Writer}。但是当我使用\include{aboutwriter}(如@barbara-beeton)提及),它们没有起作用。

\documentclass[12pt,a5paper]{memoir}

\renewcommand\thepart{\arabic{part}}
% modify ToC part
\renewcommand{\cftpartaftersnum}{.}
\renewcommand{\cftpartfont}{\normalsize\bfseries}
\renewcommand{\cftpartpagefont}{\normalsize\bfseries}
\setlength{\cftbeforepartskip}{16pt}
\setlength{\cftpartnumwidth}{2.5em}
% modify ToC chapter
\renewcommand{\cftchapteraftersnum}{.}
\renewcommand{\cftchapterfont}{\normalsize}
\renewcommand{\cftchapterleader}{\cftdotfill{\cftdotsep}}
\renewcommand{\cftchapterpagefont}{\normalsize}
\setlength{\cftbeforechapterskip}{2pt}
\setlength{\cftchapternumwidth}{2.5em}

% Karlkoeller said:
\usepackage{etoolbox}
\appto{\backmatter}{\addtocontents{toc}{\protect\addvspace{16pt}}}{}{}

\begin{document}
\frontmatter
\tableofcontents
\mainmatter

\part{Part One}
\chapter[Chapter Title]{Chapter Title}
\chapter[Chapter Title]{Chapter Title}
\chapter[Chapter Title]{Chapter Title}

\part{Part Two}
\chapter[Chapter Title]{Chapter Title}
\chapter[Chapter Title]{Chapter Title}
\chapter[Chapter Title]{Chapter Title}

\backmatter
\pagestyle{plain}
% \chapter[About Writer]{About Writer}

% Johannes_B said:
% \addtocontents{toc}{\protect\vspace{16pt}}

\include{aboutwriter} % Include external file

\end{document}

答案1

加载包etoolbox并发布

\preto{\backmatter}{\addtocontents{toc}{\protect\addvspace{16pt}}}

这样,当你发布\backmatter跳过时16pt就会在 ToC 中添加。

梅威瑟:

\documentclass[12pt,a5paper]{memoir}

\renewcommand\thepart{\arabic{part}}
% modify ToC part
\renewcommand{\cftpartaftersnum}{.}
\renewcommand{\cftpartfont}{\normalsize\bfseries}
\renewcommand{\cftpartpagefont}{\normalsize\bfseries}
\setlength{\cftbeforepartskip}{16pt}
\setlength{\cftpartnumwidth}{2.5em}
% modify ToC chapter
\renewcommand{\cftchapteraftersnum}{.}
\renewcommand{\cftchapterfont}{\normalsize}
\renewcommand{\cftchapterleader}{\cftdotfill{\cftdotsep}}
\renewcommand{\cftchapterpagefont}{\normalsize}
\setlength{\cftbeforechapterskip}{2pt}
\setlength{\cftchapternumwidth}{2.5em}

\usepackage{etoolbox}
\preto{\backmatter}{\addtocontents{toc}{\protect\addvspace{16pt}}}


\begin{document}
\frontmatter
\tableofcontents
\mainmatter

\part{Part One}
\chapter[Chapter Title]{Chapter Title}
\chapter[Chapter Title]{Chapter Title}
\chapter[Chapter Title]{Chapter Title}

\part{Part Two}
\chapter[Chapter Title]{Chapter Title}
\chapter[Chapter Title]{Chapter Title}
\chapter[Chapter Title]{Chapter Title}

\backmatter
\pagestyle{plain}
\chapter[About Writer]{About Writer}

\end{document} 

输出:

在此处输入图片描述

答案2

前面部分的空间来自于此\part,而且我认为在这里使用相同的机制而不是简单地依赖空间会更容易,并且会导致更容易理解的目录。

在此处输入图片描述

\documentclass[12pt,a5paper]{memoir}

\renewcommand\thepart{\arabic{part}}
% modify ToC part
\renewcommand{\cftpartaftersnum}{.}
\renewcommand{\cftpartfont}{\normalsize\bfseries}
\renewcommand{\cftpartpagefont}{\normalsize\bfseries}
\setlength{\cftbeforepartskip}{16pt}
\setlength{\cftpartnumwidth}{2.5em}
% modify ToC chapter
\renewcommand{\cftchapteraftersnum}{.}
\renewcommand{\cftchapterfont}{\normalsize}
\renewcommand{\cftchapterleader}{\cftdotfill{\cftdotsep}}
\renewcommand{\cftchapterpagefont}{\normalsize}
\setlength{\cftbeforechapterskip}{2pt}
\setlength{\cftchapternumwidth}{2.5em}


\begin{document}
\frontmatter
\tableofcontents
\mainmatter

\part{Part One}
\chapter[Chapter Title]{Chapter Title}
\chapter[Chapter Title]{Chapter Title}
\chapter[Chapter Title]{Chapter Title}

\part{Part Two}
\chapter[Chapter Title]{Chapter Title}
\chapter[Chapter Title]{Chapter Title}
%\chapter[Chapter Title]{Chapter Title}

\backmatter
\part{The Appendix Bits}
\pagestyle{plain}
\chapter[About Writer]{About Writer}

\end{document}

相关内容