
amsbook を使用して、目次の水平方向の間隔を少し調整したいと思います。「第 1 章」とそのタイトルの間の水平方向の間隔が大きすぎると思います。同様に、セクションとサブセクション、およびその番号とタイトルも大きすぎます。この間隔を変更する方法を教えてください。私の MWE では、このサイトで見つけた目次のその他の小さな調整をいくつか行いました。
\documentclass[12pt]{amsbook}
\usepackage{etoolbox}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
% Uppercase 'CHAPTER' label in toc
\patchcmd{\tocchapter}{#1}{\MakeUppercase{#1}}{}{}
\makeatletter
% dots leading to the page number in toc
\renewcommand\@pnumwidth{1em}
\patchcmd{\@tocline}
{\hfil}
{\leaders\hbox{\,.\,}\hfil}
{}{}
% modify spacing in toc
\def\l@chapter{\@tocline{3}{5pt plus1pt}{0pc}{0pt}{}}
\def\l@section{\@tocline{2}{1pt plus1pt}{1.5pc}{0pt}{}}
\def\l@subsection{\@tocline{1}{1pt plus1pt}{4.5pc}{0pt}{}}
\makeatother
\renewcommand{\thesection}{\thechapter.\arabic{section}}
\begin{document}
\frontmatter
\title{My Book}
\author{Me}
% \date{}
\maketitle
\tableofcontents
\mainmatter
\chapter{Preliminaries}
\section{Section One}
\subsection{Subsection One}
\section{Section Two}
\subsection{Subsection One}
\subsection{Subsection Two}
\chapter{Results}
\section{Section One}
\subsection{Subsection One}
\subsection{Subsection Two}
\section{Section Two}
\subsection{Subsection One}
\subsection{Subsection Two}
\end{document}
'''
答え1
次のようにすると、\quad
挿入されたbyの代わりに通常の単語間スペースが得られます。amsbook
\patchcmd{\tocchapter}{\quad}{ }{}{}
\patchcmd{\tocsection}{\quad}{ }{}{}
\patchcmd{\tocsubsection}{\quad}{ }{}{}
実験してみるのもいいでしょう
\patchcmd{\tocchapter}{\quad}{\enspace}{}{}
\patchcmd{\tocsection}{\quad}{\enspace}{}{}
\patchcmd{\tocsubsection}{\quad}{\enspace}{}{}
または\hspace{<whatever you like>}
の代わりに\enspace
。