首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >不成功地将“章节”改为“附件”

不成功地将“章节”改为“附件”
EN

Stack Overflow用户
提问于 2021-03-31 15:14:32
回答 1查看 634关注 0票数 0

我正试图将附录中的标题“章节”改为“附件”,但无法这样做。我查找并找到了\renewcommand\appendixname{Annex}的解决方案,但这并没有解决我的问题,标题仍然显示为“章节”。

我猜想这可能是因为我改变了章节的标题格式(也可能不是因为……)。

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

代码语言:javascript
复制
\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}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-03-31 15:33:15

问题是,您在这里硬编码了单词Chapter

代码语言:javascript
复制
\titleformat{\chapter}[display]
  {\normalfont\LARGE\bfseries\center}{Chapter \thechapter}{0.3em}{\LARGE}

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

\chaptertitlename 它默认为\chaptername,但附录中的\appendixname除外。在定义章节时使用它而不是\chaptername

请记住添加{}使尾随空间具有显着性:

代码语言:javascript
复制
\titleformat{\chapter}[display]
  {\normalfont\LARGE\bfseries\center}{\chaptertitlename{} \thechapter}{0.3em}{\LARGE}
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66890551

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档