来自Eureka的答案:
\documentclass[fontset=fandol]{ctexart}
\ctexset{section/format+={\raggedright}}
\renewcommand*{\tableofcontents}{%
{\hfill\textbf{\Large\contentsname}\hfill}
\UseName{@mkboth}%
{\MakeUppercase\contentsname}%
{\MakeUppercase\contentsname}%
\UseName{@starttoc}{toc}%
}
\parindent=0pt
\begin{document}
\tableofcontents
\section{aaaa}
\section{bbbb}
\section{cccc}
\section*{ddd}
\end{document}
不过这里添加的代码量也相比稍长...
BTW,这里的样式为了保持一致,需要用到:
latexdef \section
\section:
\long macro:->\@startsection {section}{1}{\z@ }{-3.5ex \@plus -1ex \@minus -.2ex}{2.3ex \@plus .2ex}{\normalfont \Large \bfseries }
















问 在ctexart框架中,希望不借助tocloft的设置修改「目录」的对齐情况而不影响`\section*`