The easiest way to change the format is by means of a set of package options and a couple of commands. If you feel happy with the functionality provided by this set of tools, you need not go further in this manual. Just read this section and ignore the subsequent ones.
更改格式的最简方法是使用宏包提供的一系列选项和命令。如果您对这些工具提供的功能感到满意,则无需进一步阅读本手册。只需阅读本节,忽略后面的内容。
2.1. 格式
There are three option groups controlling font, size and align. You need not set all of these groups, since a default is provided for each one; however, you must use at least an option from them if you want this easy setup."
有三组选项用于控制字体、大小、对齐。并不需要设置所有选项,因为每组选项都设有默认值;尽管如此,如果你希望使用这种 “简单设置”,则至少要使用其中的一个选项。
-
rm·sf·tt·md·bf·up·it·sl·sc
Select the corresponding family/series/shape. Default is bf.
选择相应的字体/衬线/样式。默认为 bf。 -
big·medium·small·tiny
Set the size of titles. Default is big, which gives the size of standard classes. With tiny, sections (except chapters) are typed in the text size. medium and small are intermediate layouts.
设置标题的大小。默认为 big,它是标准文档类的大小。使用 tiny 的话,节(章除外)会按照文本的大小打印。 medium 和 small 是介于两者之间的布局。 -
raggedleft·center·raggedright
Control the alignment.
控制对齐方式。
2.2. 间距
-
compact
This option is independent from those above and reduces the spacing above and below the titles.
此选项独立于上面的选项,用于减少标题上方和下方的间距。
2.3. 大写
-
uppercase
Uppercases titles. Depending on the class, it might not work in\chapter
and\part
.
大写标题。根据类的不同,它可能无法在\chapter
和\part
中工作。
2.4. 工具
-
\titlelabel{<label-format>}
Changes the label format in sections, subsections, etc. A \thetitle command is provided which is respectively \thesection, \thesubsection, etc. The default value in standard classes is
更改节、子节等的标签格式。\thetitle命令的可选值为\thesection、
\thesubsection 等。标准类中的默认值为
\titlelabel{\thetitle\quad}
and you may add a dot after the counter simply with
您可以在计数器后面添加一个点
\titlelabel{\thetitle.\quad}
-
\titleformat*{<command>}{<format>}
This command allows to change the <format> of a sectioning command, as for example:
这个命令允许变更分节命令的<format>,比如下面的例子:
\titleformat*{\section}{\itshape}
2.5 示例
键入如下代码,其显示效果附后。
\documentclass[12pt,a4]{report} % 文档类声明
\usepackage[]{titlesec} %引入宏包
\begin{document}
\tableofcontents %列出目录
\chapter{Advanced Interface}
\section{Format}
\section{Spacing}
\section{Spacing related tools}
\section{Rules}
\chapter{Advanced Interface}
\section{Breaks}
\section{Other Package}
\section{Extended Settings}
\section{Creating new levels}
\end{document}
为\usepackage{titlesec}
命令加入选项,效果附后
\usepackage[sf,small,raggedleft,compact,uppercase]{titlesec}%引入宏包
加入
\titleformat
命令:
\usepackage[sf,small,raggedleft,compact,uppercase]{titlesec}%引入宏包
\titleformat{\section}{\LARGE\sffamily\slshape}
{\thesection.\quad}{1em}{}
网友评论