![如何在目录中为章节、节和小节标题提供相同的左对齐缩进](https://linux22.com/image/319428/%E5%A6%82%E4%BD%95%E5%9C%A8%E7%9B%AE%E5%BD%95%E4%B8%AD%E4%B8%BA%E7%AB%A0%E8%8A%82%E3%80%81%E8%8A%82%E5%92%8C%E5%B0%8F%E8%8A%82%E6%A0%87%E9%A2%98%E6%8F%90%E4%BE%9B%E7%9B%B8%E5%90%8C%E7%9A%84%E5%B7%A6%E5%AF%B9%E9%BD%90%E7%BC%A9%E8%BF%9B.png)
如何更改目录中 \section \subsection 的缩进,使它们与章节标题的缩进对齐?我使用的是书籍类格式。
我的代码如下所示
\renewcommand*{\contentsname}{\normalsize Table of Contents}
{\tableofcontents}
\addcontentsline{toc}{chapter} {\trjnfamily{\fontsize{13pt}{13pt}\selectfont PART I THE CODEX AND ITS HISTORY}}
\chapter* {\trjnfamily{\fontsize{18pt}{18pt}\selectfont PART I\\ THE CODEX AND ITS HISTORY}}
\renewcommand{\chaptername}{{\large }}
\include{chapter1} %Physical description
\include{chapter2} %Provenance
\addcontentsline{toc}{chapter}{\trjnfamily{\fontsize{13pt}{13pt}\selectfont PART II LITERARY SOURCES}}
\chapter* {\trjnfamily{\fontsize{18pt}{18pt}\selectfont PART II\\ LITERARY SOURCES}}\
\include{chapter3}%Links
\include{chapter4}%Conventions
\addcontentsline{toc}{chapter}{\trjnfamily{\fontsize{13pt}{13pt}\selectfont
PART III INTERPRETING TEXT AND IMAGE}}
\chapter* {\trjnfamily{\fontsize{18pt}{18pt}\selectfont PART III\\ INTERPRETING THE TEXT}}
\include{chapV}
\include{chapW}
\include{chapY}
答案1
您可以使用包tocflat
选项tocstyle
:
\documentclass{book}
\usepackage{blindtext}
\usepackage[tocflat]{tocstyle}
\usetocstyle{standard}
\begin{document}
\tableofcontents
\Blinddocument
\Blinddocument
\end{document}
使用tocloft
,你可以使用
\cftsetindents{<entry>}{<indent>}{<numwidth}
这里entry
是chapter
,section
等,<indent>
是缩进,<numwidth>
是为排版条目编号保留的宽度。
\documentclass{book}
\usepackage{blindtext}
\usepackage{tocloft}
\cftsetindents{chapter}{0pt}{3em}
\cftsetindents{section}{0pt}{3em}
\cftsetindents{subsection}{0pt}{3em}
\begin{document}
\tableofcontents
\Blinddocument
\Blinddocument
\end{document}