在蓝色屏幕截图中,是否可以将部分名称前面的这个(I)替换为(部分 I)?!
这是我的 MWE:
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage[utf8]{inputenc}
\begin{document}
\tableofcontents
\addtocontents{toc}{\smallskip \hrule height 3pt \vspace{-4.5ex} \vspace{0.2cm} }
\part{Differential Forms}
\addtocontents{toc}{{ }}
\addtocontents{toc}{\vspace{0.2cm} \nobreak\smallskip \hrule height 2.5pt }
\end{document}
答案1
titlesec
和 的解决方案titletoc
:
\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{geometry}
\usepackage[svgnames]{xcolor}
\usepackage{titlesec}
\usepackage{titletoc}
\usepackage[hidelinks]{hyperref}
\titleformat{\part}[display]
{\scshape\filcenter}
{\large\partname~\thepart}
{2ex}
{\Large}
[\vspace{5ex}]
\titlecontents{part}[0pt]
{\bfseries\protect\addvspace{15pt}\titlerule[1pt]\addvspace{1.2ex}}
{}
{\color{RoyalBlue}\partname~}%numbered, unnumbered
{\hfill\contentspage}
[\addvspace{0.7ex}{\titlerule[1pt]}\addvspace{1.5ex}]
\begin{document}
\tableofcontents
\part{Beginnings}
\section{Things}
\section{More Things}
\end{document}
答案2
tocloft
例如,使用并重新定义\cftpartpresnum
为包含单词Part
(或任何\partname
结果)。为了防止与零件编号发生冲突,使用增加数字框的宽度\addtolength{\cftpartnumwidth}{20pt}
(的值20pt
只是猜测,仅此而已!)
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage[utf8]{inputenc}
\usepackage{tocloft}
\renewcommand{\cftpartpresnum}{\partname{} }
\addtolength{\cftpartnumwidth}{20pt}
\begin{document}
\tableofcontents
\addtocontents{toc}{\smallskip \hrule height 3pt \vspace{-4.5ex} \vspace{0.2cm} }
\part{Differential Forms}
\addtocontents{toc}{{ }}
\addtocontents{toc}{\vspace{0.2cm} \nobreak\smallskip \hrule height 2.5pt }
\end{document}