目次のセクション番号とタイトルの間隔を広げる

目次のセクション番号とタイトルの間隔を広げる

単純な通常の\tableofcontentsコマンドを使用して目次を作成していますが、セクション番号とセクション タイトルの間の間隔が小さすぎることがわかりました。

ここに画像の説明を入力してください

どなたか、これを修正する方法を教えていただけませんか。私のドキュメントクラスは ですmemoir

答え1

目次のセクション番号の幅は と呼ばれる長さで定義されます\cftKnumwidth。ここで はセクションレベル、つまり、などKに置き換えられます。 で変更できます。例:chaptersection\setlength

\setlength\cftsectionnumwidth{4em}

セクションを参照9.2.2 エントリの組版memoir詳細についてはマニュアルを参照してください。

完全な例:

\documentclass{memoir}
% \setlength\cftsectionnumwidth{4em} % uncomment to see difference
\begin{document}
\tableofcontents
\chapter{A chapter}
\setcounter{section}{999} % just for this example
\section{A section}
\end{document}

または、bookクラスを使用している場合は、https://tex.stackexchange.com/a/336618/50702以下はTorbjørn T.氏のコメントです。

\documentclass{book}
% note you need the subfigure option if you are using the subfigure package
%\usepackage[subfigure]{tocloft}
\usepackage{tocloft}

\setlength\cftsecnumwidth{4em}

\begin{document}
\tableofcontents
\chapter{A chapter}
\setcounter{section}{999} 
\section{A section}
\end{document}

答え2

目次に膨大な数字がある場合は、次の構文で、プリアンブルで\cftsetindentsコマンド ( texdoc memoir、153 ページ) を使用して、数字の前後のスペースを制御できます。

\cftsetindents{親切}{インデント}{}

どこ親切セクションレベル(例:サブセクション)インデントインデントの長さ(数字の前のスペース)と数字のためのスペースですそしてセクションタイトルの分離。

例えば:

\cftsetindents{section}{1em}{3em}

ムウェ

関連情報