想居中不带编号的标题,并在目录中显示,但是出现了这种情况
发行版:TeXLive2020
VScode编写
MWE:
\documentclass{article}
\usepackage{ctex}
\usepackage{graphicx,titletoc}
\newcommand*{\song}{\CJKfamily{zhsong}} % 宋体
\newcommand*{\hei}{\CJKfamily{zhhei}} % 黑体
\newcommand*{\kai}{\CJKfamily{zhkai}} % 楷书
\renewcommand{\baselinestretch}{1.25} % 1.5倍行距
\newcommand{\erhao}{\fontsize{22pt}{33pt}\selectfont}
\newcommand{\sanhao}{\fontsize{16pt}{24pt}\selectfont}
\newcommand{\sihao}{\fontsize{14pt}{21pt}\selectfont}
\newcommand{\xiaosi}{\fontsize{12pt}{18pt}\selectfont}
\newcommand{\wuhao}{\fontsize{10.5pt}{\baselineskip}\selectfont}
\ctexset{
section={
format={\zihao{3}\heiti},
name={},
aftername={\hspace{1em}},
number=\arabic{section},
},
subsection={
format={\zihao{4}\heiti},
name={},
aftername={\hspace{1em}},
number={\arabic{section}.\arabic{subsection}},
},
subsubsection={
format={\zihao{-4}\heiti},
name={},
aftername={\hspace{1em}},
number={\arabic{section}.\arabic{subsection}.\arabic{subsubsection}},
},
paragraph={
format={\zihao{-4}\heiti},
name={},
aftername={\hspace{1em}},
number={\arabic{section}.\arabic{subsection}.\arabic{subsubsection}.\arabic{paragraph}}
},
appendix={
name={附录,:},
number=\arabic{section},
}
}
\titlecontents{section}
[0mm]
{\xiaosi \hei \vspace{7.5pt}}%
{\contentslabel{6.35mm}}%
{}%
{{~\titlerule*[0.6pc]{$.$}~\contentspage}}%
\titlecontents{subsection}
[3.175mm]
{\xiaosi \song \vspace{7.5pt}}%
{\contentslabel{9.525mm}}%
{}%
{{~\titlerule*[0.6pc]{$.$}~\contentspage}}%
\titlecontents{subsubsection}
[6.35mm]
{\xiaosi \song \vspace{7.5pt}}%
{\contentslabel{12.7mm}}%
{}%
{{~\titlerule*[0.6pc]{$.$}~\contentspage}}%
\titlecontents{paragraph}
[9.525mm]
{\xiaosi \song \vspace{7.5pt}}%
{\contentslabel{15.875mm}}%
{}%
{{~\titlerule*[0.6pc]{$.$}~\contentspage}}%
\newcommand\specialsectioning{\setcounter{secnumdepth}{-2}}
\title{标题标题标题}
\begin{document}
\section{一级标题}
文本文本
\newpage
\specialsectioning
\centering{ \section{总结与展望} }
文本文本
\end{document}
又看以一下,每当使用
CTEXsetup[format={Largebfseries}]{section}
就会出现这种情况
@u2411
\CTEXsetup
是过时写法谢谢
你说的报错是缺了
[heading = true]
@u33 嗯是的