如何在目录中实现:当编号过长时,编号条目悬挂缩进

发布于 2026-06-29 23:17:02

希望对目录条目作如下图的修改,使(用一、二、三个字符编号的)条目悬挂缩进:

Screenshot_20260629-230958.png

\documentclass[UTF8,punct=banjiao,fontset=fandol]{ctexart}
%% 载入各种宏包 -----------------------------
\usepackage{tocloft,zhlipsum,geometry}
%% 自定义命令 -------------------------------
\newcommand{\setsecpage}[2]{
  \setcounter{section}{#1}
  \setcounter{page}{#2}}
%% ctex 相关设定 ----------------------------
\ctexset{
  section/number={\zhdigits{\arabic{section}}},
  section/format={\bfseries}}
%% geometry 相关设定 ------------------------
\geometry{a6paper, hmargin=5mm, vmargin=1cm, headsep=2.5mm, footskip=7.5mm, marginparwidth=5mm, marginparsep=0pt, showframe}%
%% 页眉页脚相关设定 --------------------------
\makeatletter
\renewcommand{\@oddhead}{}
\renewcommand{\@evenhead}{}
\renewcommand{\@oddfoot}{\hfill\thepage}
\renewcommand{\@evenfoot}{\thepage\hfill}
\makeatother
%% 目录相关设定 ------------------------------
%% 目录标题名 : 
\renewcommand{\contentsname}{\bfseries 目\quad 录}
\renewcommand\cfttoctitlefont{\null\hfill}
\renewcommand\cftaftertoctitle{\hfill\null}
%% 目录页码 : 
\renewcommand{\cftsecpagefont}{}
\renewcommand{\cftsecafterpnum}{}
%% 目录引导点 : 
\renewcommand\cftdot{$\cdot$}
\renewcommand{\cftdotsep}{0}
\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}
%% 目录条目 : 
\renewcommand{\cftsecfont}{}
\begin{document} 

\tableofcontents

\setsecpage{3}{5}
\section{“挨”在“挨着坐”和“挨到天亮”中的读音}
\zhlipsum[1-2]

\setsecpage{17}{35}
\section{“屏”在“屏除杂念”中的读音}
\zhlipsum[1-2]

\setsecpage{101}{78}
\section{“空地”“空缺”中的“空”读四声 kòng,不读一声kōng}
\zhlipsum[1-2]

\setsecpage{128}{158}
\section{“宁缺勿滥”“宁死不屈”中的“宁”读四声nìng,不读二声níng}
\zhlipsum[1-2]

\setsecpage{188}{259}
\section{“肖像”“生肖”中的“肖”读四声 xiào,不读一声xiāo}
\zhlipsum[1-2]

\end{document}

查看更多

关注者
0
被浏览
17
0 个回答
暂无答案,快来添加答案吧

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览