若是章需要增加dotfill的话,可以用下面的语句即可:
\usepackage[titles]{tocloft} \renewcommand{\cftdot}{$\cdot$} \renewcommand{\cftdotsep}{1.5} \setlength{\cftbeforechapskip}{10pt} \renewcommand{\cftchapleader}{\cftdotfill{\cftchapdotsep}} \renewcommand{\cftchapdotsep}{\cftdotsep} \makeatletter \renewcommand{\numberline}[1]{% \settowidth\@tempdimb{#1\hspace{0.5em}}% \ifdim\@tempdima<\@tempdimb% \@tempdima=\@tempdimb% \fi% \hb@xt@\@tempdima{\@cftbsnum #1\@cftasnum\hfil}\@cftasnumb} \makeatother
代码如下:
\documentclass[UTF8]{ctexbook} \usepackage[titles]{tocloft} \renewcommand{\cftdot}{$\cdot$} \renewcommand{\cftdotsep}{1.5} \setlength{\cftbeforechapskip}{10pt} \renewcommand{\cftchapleader}{\cftdotfill{\cftchapdotsep}} \renewcommand{\cftchapdotsep}{\cftdotsep} \makeatletter \renewcommand{\numberline}[1]{% \settowidth\@tempdimb{#1\hspace{0.5em}}% \ifdim\@tempdima<\@tempdimb% \@tempdima=\@tempdimb% \fi% \hb@xt@\@tempdima{\@cftbsnum #1\@cftasnum\hfil}\@cftasnumb} \makeatother \begin{document} \contentsline {chapter}{\numberline {第1\ignorespaces 章\hspace {0.3em}} 熟悉\LaTeX{}}{3} \contentsline {section}{\numberline {1.1} \TeX{}历史}{3} \contentsline {section}{\numberline {1.2} \LaTeX{}历史}{4} \contentsline {section}{\numberline {1.3} 关于编码}{9} \contentsline {section}{\numberline {1.4} 中文支持}{13} \contentsline {section}{\numberline {1.5} 基础知识}{13} \contentsline {section}{\numberline {} 习题}{13} \contentsline {chapter}{\numberline {第2\ignorespaces 章\hspace {0.3em}} 文档结构}{15} \contentsline {section}{\numberline {2.1} 章节知识}{16} \contentsline {section}{\numberline {2.2} 章节修改}{18} \contentsline {section}{\numberline {2.3} 计数器}{19} \contentsline {section}{\numberline {2.4} 中文支持}{23} \contentsline {section}{\numberline {2.5} 基础知识}{23} \contentsline {section}{\numberline {} 习题}{23} \end{document}
若是英文基类,添加如下代码即可:
\usepackage{tocloft} \renewcommand\cftchapdotsep{\cftdotsep} \renewcommand\cftchapleader{\cftdotfill{\cftchapdotsep}}
选自:http://bbs.ctex.org/forum.php?mod=viewthread&tid=57586&page=1
发表评论 取消回复