将 'Chapter' 更改为 'Annex' 失败

Unsuccessful changing 'Chapter' to 'Annex'

我正在尝试将附录中的标题 'Chapter' 更改为 'Annex',但我无法这样做。我抬头找到了解决方案 \renewcommand\appendixname{Annex} 但这并没有解决我的问题,标题仍然显示为 'Chapter'.

我猜可能是因为我更改了章节的标题格式(也可能不是因为它....)

如果有人可以帮助我解决这个问题。我在序言中的代码如下所示:

\usepackage[titletoc]{appendix}
\titleformat{\chapter}[display]
  {\normalfont\LARGE\bfseries\center}{Chapter \thechapter}{0.3em}{\LARGE}
\titlespacing*{\chapter}{0pt}{-15pt}{15pt}
\renewcommand{\thechapter}{\Roman{chapter}}
\renewcommand{\thesection}{\arabic{chapter}.\arabic{section}}
\renewcommand{\thetable}{\arabic{chapter}.\arabic{table}}
\renewcommand{\thefigure}{\arabic{chapter}.\arabic{figure}}
\titleformat{\section}
  {\normalfont\fontsize{14}{10}\bfseries}{\thesection}{1em}{\fontsize{14}{10}}
\renewcommand{\appendixname}{Annex}

\begin{document}
All contents that matters.....

\begin{appendices}
    \chapter{Some Annex}
    \input{Chapters/Appendix}
\end{appendices}

\end{document}

问题是您在此处硬编码了单词 Chapter

\titleformat{\chapter}[display]
  {\normalfont\LARGE\bfseries\center}{Chapter \thechapter}{0.3em}{\LARGE}

要使用正确的词,无论您是在主要内容中还是在附录中,请在 titlesec 包文档(第 4 页)中将 \chaptertitlename 用作 documented ):

\chaptertitlename

It defaults to \chaptername except in appendices where it is \appendixname. Use it instead of \chaptername when defining a chapter.

记得添加 {} 使结尾的 space 有意义:

\titleformat{\chapter}[display]
  {\normalfont\LARGE\bfseries\center}{\chaptertitlename{} \thechapter}{0.3em}{\LARGE}