latex我是用book文档类以下是我定义的生成目录的命令newcommandcontent0 setcountertocdepth3 renewcommandcontentsname目录 titlecontentschapter0emLargebfseriesthecontentslabelquadtitlerule8ptcontentspage titlecontent
您可以使用\titlecontents命令来调整目录中各个级别的缩进。在\titlecontents命令的第三个参数中,可以指定每个级别的缩进量。
例如,如果您希望\subsection的缩进与\section相同,您可以将\titlecontents{subsection}的第三个参数设置为与\section相同的值。以下是一个示例:
\newcommand{\content}[0]{ \setcounter{tocdepth}{3} \renewcommand\contentsname{目录} \titlecontents{chapter}[0em]{\Large\bfseries}{\thecontentslabel\quad}{}{\titlerule*[8pt]{.}\contentspage} \titlecontents{section}[0em]{\bfseries}{\thecontentslabel\quad}{}{\titlerule*[8pt]{.}\contentspage} \titlecontents{subsection}[1.5em]{\normalfont}{\thecontentslabel\quad}{}{\titlerule*[8pt]{.}\contentspage} \tableofcontents }
在这个示例中,\titlecontents{subsection}[1.5em]{\normalfont}{\thecontentslabel\quad}{}{\titlerule*[8pt]{.}\contentspage}指定了\subsection的缩进量为1.5em。
您可以根据需要调整缩进量的数值,直到达到您期望的效果为止
原文地址: http://www.cveoy.top/t/topic/hYbg 著作权归作者所有。请勿转载和采集!