微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

将“章节”更改为“附件”失败

如何解决将“章节”更改为“附件”失败

我正在尝试将附录中的标题“章节”更改为“附件”,但无法这样做。我抬头并找到了解决方\renewcommand\appendixname{Annex} 但这并不能解决我的问题,标题仍然显示为“章节”。

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

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

\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}

解决方法

问题是您在此处硬编码了单词 {​​{1}}:

Chapter

要使用正确的词,无论您是在主要内容中还是在附录中,请在 \titleformat{\chapter}[display] {\normalfont\LARGE\bfseries\center}{Chapter \thechapter}{0.3em}{\LARGE} 包文档(第 4 页)中使用 \chaptertitlename 作为 documented

titlesec

默认为 \chaptertitlename,除了在附录中为 \chaptername。定义章节时使用它代替 \appendixname

记得添加 \chaptername 以使尾随空格有意义:

{}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。