我一直在尝试实现这种目录:
是的,这是 D&D 基本规则手册的一个片段。据我所知,此目录具有以下几个特点:
- 双列
- 居中且自定义的“目录”标题
- 在页码中添加“B”前缀
- 前导点
- 章节前缀为“PART n”
- 缩进部分
我确实尝试过 titletoc,但失败了,结果也不一样(委婉地说,它们真的很糟糕)。如果有人能提供一些线索,我将不胜感激——谢谢!
更新:发布问题后,我找到了一些帮助,让我找到了一个接近的解决方案(和你去看医生时的效果一样:你开始感觉好些了)。这是最小工作示例:
\documentclass{book}
\usepackage{multicol}
\usepackage{titletoc}
\usepackage{xcolor}
% something similar to the original
\definecolor{colortoc}{RGB}{47,107,167}
% only display chapters and sections
\setcounter{tocdepth}{1}
% add B prefix to number page
\renewcommand\thepage{B\arabic{page}}
% custom TOC name
% https://tex.stackexchange.com/questions/142445/how-do-i-center-the-table-of-contents-title-using-tocloft
\renewcommand{\contentsname}%
{\hfill\bfseries\Large TABLE OF CONTENTS \hfill}
% titletoc stuff
\titlecontents{chapter}[0mm]{\normalsize\bfseries}{PART\space\thecontentslabel:\space\MakeUppercase}{}{\normalfont\dotfill\makebox[1em][l]{\thecontentspage}}
\titlecontents{section}[3mm]{\normalsize\relax}{}{}{\dotfill\makebox[1em][l]{\thecontentspage}}
\begin{document}
% some help from % https://tex.stackexchange.com/questions/389319/making-the-second-column-of-the-table-of-contents-clear-the-page-header
\makeatletter
\begingroup % start a TeX group
\color{colortoc}% or whatever color you wish to use
\chapter*{\contentsname
\@mkboth{%
\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}
% If you want to turn off columns being forced to equal height, use the starred version \begin{multicols*}{2}.
\begin{multicols}{2}
\@starttoc{toc}
\end{multicols}
\endgroup % end of TeX group
\makeatother
\chapter{Literature Study}
\section{Section Alpha}
\section{Section Beta}
\section{Section Gamma}
\section{Section Delta}
\section{Section Epsilon}
\section{Section Zeta}
\chapter{More Chapter Alpha}
\section{Section Alpha}
\section{Section Beta}
\section{Section Gamma}
\section{Section Delta}
\section{Section Epsilon}
\section{Section Zeta}
\chapter{More Chapter Beta}
\section{Section Alpha}
\section{Section Beta}
\section{Section Gamma}
\section{Section Delta}
\section{Section Epsilon}
\section{Section Zeta}
\end{document}
我猜和原版很接近。我现在的问题是有没有更好的方法来改善结果。