如上所述,我需要扩大目录部分项目标签和内容之间的空间(\l@part
准确地说)。我输入了命令\setlength\labelsep{10em}
;但它不起作用。见下文,我想扩大红色矩形标记的空间
.cls
上述输出格式对应的文件
\renewcommand*\l@part[2]{%
\ifnum \c@tocdepth >-2\relax
\addpenalty{-\@highpenalty}%
\addvspace{2.25em \@plus\p@}%
\setlength\@tempdima{3em}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
{\leavevmode
\large \bfseries #1
\leaders\hbox{$\m@th\mkern 1.5mu\cdot\mkern 1.5mu$}
\hfil \hb@xt@\@pnumwidth{\hss #2}}\par
\nobreak
\global\@nobreaktrue
\everypar{\global\@nobreakfalse\everypar{}}%
\endgroup
\fi}
提供了一个最小的例子:
\documentclass[10pt]{report}
\usepackage{minitoc,lipsum}
\begin{document}
\tableofcontents
\part{I want to enlarge the space between the label and the content}
\chapter{Introduction}
\section{Just a sample section}
\lipsum[2]
\subsection{Explain}
\lipsum[3-8]
\section{Second}
\lipsum[9]
\chapter{Manual}
section{dddddn}
\subsection{cccExplain}
\end{document}
答案1
\part
设置其 ToC 条目\@part
(从report.cls
):
\def\@part[#1]#2{%
\ifnum \c@secnumdepth >-2\relax
\refstepcounter{part}%
\addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
\else
\addcontentsline{toc}{part}{#1}%
\fi
\markboth{}{}%
{\centering
\interlinepenalty \@M
\normalfont
\ifnum \c@secnumdepth >-2\relax
\huge\bfseries \partname\nobreakspace\thepart
\par
\vskip 20\p@
\fi
\Huge \bfseries #2\par}%
\@endpart}
要增加空间,请使用etoolbox
修补并调整1em
空间:
\documentclass{report}
\usepackage{etoolbox,lipsum}
\makeatletter
% \patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}
\patchcmd{\@part}{1em}{2em}{}{}
\makeatother
\begin{document}
\tableofcontents
\part{I want to enlarge the space between the label and the content}
\chapter{Introduction}
\section{Just a sample section}
\lipsum[2]
\subsection{Explain}
\lipsum[3-8]
\section{Second}
\lipsum[9]
\chapter{Manual}
\section{dddddn}
\subsection{cccExplain}
\end{document}
上面我已将空间更新为2em
(加倍)。
答案2
\def\@pardis{9em}%
\def\@part[#1]#2{%
\ifnum \c@secnumdepth >-2\relax
\refstepcounter{part}%
\addcontentsline{toc}{part}{\CTEXthepart\hspace{\@pardis}#1}%
\else
\addcontentsline{toc}{part}{#1}%
\fi
\@endpart}
赋予它新的定义
\def\@pardis{9em}%
您可以设置您想要的任意值,然后它就可以工作了!