是否可以将章节名称设为全局标题大小写?

是否可以将章节名称设为全局标题大小写?

我不想一个一个地更改它们。我想知道如何使节名称全局变为标题大小写?即“这是一个标题大小写节名称”。

如果您也能给出适用于诸如有关小节的答案,那就太好了。或者使用小型大写字母等……谢谢

我正在使用用于期刊出版物的文章文档类。


编辑:

如图所示本网站,我想要的标题大小写是:

标题大小写例外

少于六个字母的冠词、连词和介词将改为小写,除非它们位于句首。这些包括:

(01)a (02)abaft (03)about (04)above (05)afore (06)after (07)along (08)amid (09)among (10)an (11)apud (12)as (13)aside (14)at (15)atop (16)below (17)but (18)by (19)circa (20)down (21)for (22)from (23)given (24)in (25)into (26)lest (27)like (28)mid (29)midst (30)minus (31)near (32)next (33)of (34)off (35)on (36)onto (37)out (38)over (39)pace (40)past (41)per (42)plus (43)pro (44)qua (45)round (46)sans (47)save (48)since (49)than (50)thru (51)till (52)times (53)to (54)under (55)until (56)unto (57)up (58)upon (59)via (60)vice (61)with (62)worth (63)the (64)and (65)nor (66)or (67)yet (68)so

答案1

这是一种简单的方法sectsty

\documentclass{article}
\usepackage{sectsty}
\usepackage{titlecaps}
\allsectionsfont{\titlecap}
\begin{document}

\section{This should be title case}

\subsection{This should also be title case}

\end{document}

在此处输入图片描述

这将使所有章节标题都采用大写字母。如果您只想对章节字体使用此功能,请使用

\sectionfont{\titlecap}

答案2

正如 Werner 在其评论中提到的,Steven Segletes 的titlecaps包提供了一个名为的宏,可将其参数的每个单词大写。只需在包\titlecap的最后一个强制参数中使用该宏即可将感兴趣的标题排版为标题大小写。\titleformattitlesec

编辑:正如 Gonzalo Medina 所说,不需要explicit包选项。

在此处输入图片描述

\documentclass{article}

\usepackage{titlesec}
\usepackage{titlecaps}

\titleformat{\section}
  {\normalfont\bfseries\Large}
  {\thesection}
  {1em}
  {\titlecap} % <---- leave empty to get the default heading (in article)

\titleformat{\subsection}
  {\normalfont\bfseries\large}
  {\thesubsection}
  {1em}
  {\titlecap} % <---- leave empty to get the default heading (in article)

\begin{document}

\section{this should be title case}

\subsection{this should also be title case}

\end{document}

答案3

您可以使用 titlesectitlecaps包并使用格式化命令:

\titleformat{\section}[hang]{\Large\bfseries}{\thesection}{\titlecap}

[hang] 后的第一个参数描述标签 + 章节标题的全局格式;第二个参数描述特定于标签的命令,第三个参数描述特定于章节标题的命令。

titlecap命令(由@Werner 建议)将文本中相关单词的首字母变为大写。这假设指定了规则来确定哪些单词必须大写,哪些单词不必大写。这是英语的默认设置,并且有一个 \Addlcwords命令可以将单词添加到必须小写的单词列表中。但是,它不适用于法语等语言,因为法语的标题大写规则不那么简单,取决于句子的结构,而不仅仅是单词列表

如果您想要一个小型大写标题,即首字母大写,您可以使用选项加载 titlesec explicit,并用 替换 \titlecap \textsc{\titlecap{#1}}

答案4

备查,

\usepackage{sectsty}
\allsectionsfont{\usefont{T1}{qhv}{b}{n}\selectfont}

应该可以完成这项工作。您还可以使用以下代码修改每个部分、子部分:

\chapterfont{\usefont{T1}{qhv}{b}{n}\selectfont\huge} 
\sectionfont{\usefont{T1}{qhv}{b}{n}\selectfont\LARGE}
\subsectionfont{\usefont{T1}{qhv}{b}{n}\selectfont\Large}

这里是上一个答案

相关内容