| 1 |
\PassOptionsToPackage{svgnames}{xcolor} |
| 2 |
\documentclass[load-preamble+]{cnltx-doc} |
| 3 |
|
| 4 |
\usepackage[fontset = fandol]{ctex} |
| 5 |
\usepackage |
| 6 |
{ |
| 7 |
enumitem,indentfirst,tabularray, |
| 8 |
fancyvrb,geometry,hologo,changelog,calc |
| 9 |
} |
| 10 |
\definecolorscheme{blue} |
| 11 |
{ |
| 12 |
cs => violet, |
| 13 |
option => DarkGreen, |
| 14 |
cnltx => DarkBlue, |
| 15 |
link => DeepPink, |
| 16 |
module => FireBrick, |
| 17 |
beginend => FireBrick, |
| 18 |
meta => black, |
| 19 |
versionnote => black |
| 20 |
} |
| 21 |
\setcnltx |
| 22 |
{ |
| 23 |
name = easybook, |
| 24 |
color-scheme = blue, |
| 25 |
title = EASYBOOK使用手册, |
| 26 |
version = v2025ae, |
| 27 |
date = 2025/08/01, |
| 28 |
authors = 瞿毅, |
| 29 |
info = 简便地排版中文学位论文或书籍, |
| 30 |
email = [email protected], |
| 31 |
url = https://gitee.com/texno3/easybook, |
| 32 |
abstract = |
| 33 |
{ |
| 34 |
\easybook{} 是基于 \cls*{ctexbook} 书籍文档类创建的纯净学术模板,同时兼具 \cls*{book} 与 \cls*{article} 文档类的功能。结合中国许多高校学位论文的通用框架设计,提供多个命令和接口可以使用户简便地定制论文模板。它的基础宏包 \pkg*{easybase} 还可以搭配 \CTeX 和标准文档类使用。 |
| 35 |
}, |
| 36 |
arg-format = \normalfont\small\kaishu\xeCJKVerbAddon, |
| 37 |
abstract-format = \small, |
| 38 |
module-sep = \,$\Rightarrow$\,, |
| 39 |
title-format = \huge\sffamily |
| 40 |
} |
| 41 |
\KOMAoptions{numbers = noenddot} |
| 42 |
\setfootnoterule[0.5pt]{0.4\columnwidth} |
| 43 |
\addtokomafont{headsepline}{\color{DarkBlue}} |
| 44 |
\addtokomafont{footnoterule}{\color{DarkBlue}} |
| 45 |
\addtokomafont{section}{\normalfont\sffamily} |
| 46 |
\addtokomafont{subsection}{\normalfont\sffamily} |
| 47 |
\addtokomafont{subsubsection}{\normalfont\sffamily} |
| 48 |
\setkomafont{pagehead}{\normalfont\kaishu} |
| 49 |
\DeclareTOCStyleEntry[entryformat = \sffamily]{default}{section} |
| 50 |
\DeclareFieldFormat[book]{title}{\textsf{#1}} |
| 51 |
\geometry{margin = 1in,marginparwidth = 0.6in,footskip = 0.5in} |
| 52 |
\renewlist{cnltxlist}{description}{2} |
| 53 |
\SetEnumitemValue{label}{textbullet}{\color{DarkBlue}\textbullet} |
| 54 |
\setlist{nosep,topsep = \smallskipamount,labelsep = 0.5em} |
| 55 |
\setlist[1]{labelindent = \parindent,leftmargin = *} |
| 56 |
\setlist[itemize,1]{label = textbullet} |
| 57 |
\setlist[cnltxlist] |
| 58 |
{ |
| 59 |
leftmargin = 0pt, |
| 60 |
itemindent = -1em, |
| 61 |
listparindent = \parindent, |
| 62 |
topsep = \smallskipamount, |
| 63 |
itemsep = \smallskipamount, |
| 64 |
partopsep = 0ex, |
| 65 |
parsep = 0ex |
| 66 |
} |
| 67 |
\setcounter{tocdepth}{2} |
| 68 |
\SetTblrInner[longtblr]{columns = c,hline{1,Z} = {1pt,DarkBlue}} |
| 69 |
\SetTblrOuter[longtblr]{presep = \bigskipamount,postsep = \bigskipamount} |
| 70 |
\DefTblrTemplate{caption-tag}{default}{表\thetable} |
| 71 |
\DefTblrTemplate{caption-sep}{default}{\quad} |
| 72 |
\DefTblrTemplate{remark-sep}{default}{\space} |
| 73 |
\SetTblrStyle{caption-tag}{font = \bfseries} |
| 74 |
\SetTblrStyle{remark}{font = \small\normalfont} |
| 75 |
|
| 76 |
\ExplSyntaxOn\makeatletter |
| 77 |
% * Do not add entries to the index |
| 78 |
% + Canceling the \item command in the list environment |
| 79 |
% - Leave the option value blank |
| 80 |
\NewDocumentCommand{\kvsplit}{st+t-mm} |
| 81 |
{ |
| 82 |
\IfBooleanF{#2}{\item} |
| 83 |
\code |
| 84 |
{ |
| 85 |
\IfBooleanTF{#1}{\option*{#4}}{\option{#4}} |
| 86 |
\cnltx@isvalue |
| 87 |
\IfBooleanTF{#3}{#5}{\splitmarg{#5}} |
| 88 |
} |
| 89 |
\cnltx@checkdefault{\hfill\newline} |
| 90 |
} |
| 91 |
% Traversal output parameters |
| 92 |
\newcommand{\splitmeta}[2][\code{,}] |
| 93 |
{ |
| 94 |
\clist_clear:N \l_tmpa_clist |
| 95 |
\clist_map_inline:nn {#2} { \clist_put_right:Nn \l_tmpa_clist { \meta{##1} } } |
| 96 |
\clist_use:Nn \l_tmpa_clist {#1} |
| 97 |
} |
| 98 |
% Add delimiters to parameters |
| 99 |
\newcommand{\newsplitarg}[4][\code{,}] |
| 100 |
{ |
| 101 |
\newcommand{#2}[1] |
| 102 |
{\code{\textcolor{argument}{#3\textnormal{\splitmeta[#1]{##1}}#4}}} |
| 103 |
} |
| 104 |
\newsplitarg{\splitoarg}{[}{]} |
| 105 |
\newsplitarg{\splitdarg}{(}{)} |
| 106 |
\newsplitarg{\splitmarg}{\{}{\}} |
| 107 |
\newsplitarg[\code{|}]{\baroarg}{[}{]} |
| 108 |
\newcommand{\harg}{\textcolor{argument}{\code{-}}} |
| 109 |
\newcommand{\HoLogo@TeXLive}[1]{\hologo{TeX}\HOLOGO@space\HOLOGO@mbox{Live}} |
| 110 |
\renewcommand{\cnltxpackagenameformat}[1]{\textcolor{cnltx}{\textsf{#1}}} |
| 111 |
% Remove default braces of values |
| 112 |
\RenewDocumentCommand{\key}{s} |
| 113 |
{ |
| 114 |
\IfBooleanTF{#1}{\cnltx@key@aux*}{\cnltx@key@aux{}} |
| 115 |
\meta |
| 116 |
} |
| 117 |
\RenewDocumentCommand{\keyis}{s} |
| 118 |
{ |
| 119 |
\IfBooleanTF{#1}{\cnltx@key@aux*}{\cnltx@key@aux{}} |
| 120 |
\@firstofone |
| 121 |
} |
| 122 |
% A tag that distinguishes the options for different paths |
| 123 |
\newcommand{\hface}{$\symbol{"263A}$} |
| 124 |
\newcommand{\sface}{$\symbol{"263B}$} |
| 125 |
\NewDocumentCommand{\dtag}{sO{\hface}} |
| 126 |
{ |
| 127 |
\begingroup |
| 128 |
\reversemarginpar |
| 129 |
\marginnote{\hfill\llap{#2}} |
| 130 |
\endgroup |
| 131 |
\IfBooleanF{#1}{\cnltx@checkdefault{\hfill\newline}} |
| 132 |
} |
| 133 |
\newnote{\newtag}[1][New]{\fbox{#1}} |
| 134 |
\newnote{\newtagv}[2][New]{#1\\#2} |
| 135 |
\NewDocumentCommand{\optpath}{sm} |
| 136 |
{ |
| 137 |
\IfBooleanF{#1}{\item} |
| 138 |
\code{\textcolor{SlateGray}{#2}} |
| 139 |
} |
| 140 |
% Multi-row values alignment when there are many choices |
| 141 |
\newcommand{\leftfillchoice}[2] |
| 142 |
{ |
| 143 |
\hspace*{\widthof{\option*{#1}}+\widthof{\code{\cnltx@isvalue}}-1em} |
| 144 |
\code{\choices{#2}} |
| 145 |
} |
| 146 |
% Use a separate module margin marker to prevent overlap |
| 147 |
\newcommand{\smodule}[1]{{\normalsize\cnltx@module@text*{#1}}} |
| 148 |
\renewcommand{\cnltx@package@abstract@width}{0.85\linewidth} |
| 149 |
\renewcommand{\cnltx@write@lastname}{} |
| 150 |
\newcommand{\cstext}[1]{\code{\textcolor{cs}{#1}}} |
| 151 |
\newcounter{ctexexam} |
| 152 |
\define@key{FV}{labelref}{\def\ctexexamlabelref{\label{#1}}} |
| 153 |
\let\ctexexamlabelref\empty |
| 154 |
\fvset |
| 155 |
{ |
| 156 |
formatcom = \xeCJKVerbAddon, |
| 157 |
baselinestretch = 1.2, |
| 158 |
gobble = 2, |
| 159 |
fontsize = \small, |
| 160 |
rulecolor = \color{DarkBlue}, |
| 161 |
framerule = 0.5pt, |
| 162 |
frame = single, |
| 163 |
framesep = 8pt |
| 164 |
} |
| 165 |
\DefineVerbatimEnvironment{frameverb}{Verbatim} |
| 166 |
{ |
| 167 |
listparameters = |
| 168 |
{ |
| 169 |
\setlength{\topsep}{1.2\bigskipamount} |
| 170 |
\appto\FV@EndList{\nointerlineskip} |
| 171 |
} |
| 172 |
} |
| 173 |
\DefineVerbatimEnvironment{ctexexam}{Verbatim} |
| 174 |
{ |
| 175 |
label = \rule{0pt}{12pt}\textnormal{\bfseries 例~\arabic{ctexexam}}, |
| 176 |
listparameters = |
| 177 |
{ |
| 178 |
\setlength{\topsep}{1.2\bigskipamount} |
| 179 |
\appto\FV@EndList{\nointerlineskip} |
| 180 |
\refstepcounter{ctexexam}\ctexexamlabelref |
| 181 |
} |
| 182 |
} |
| 183 |
\def\command{\cnltx@command} |
| 184 |
\def\environment{\cnltx@environment} |
| 185 |
\def\opt{\@cnltx@option@item\option} |
| 186 |
\def\keyval{\@cnltx@option@item\key} |
| 187 |
\def\keylit{\@cnltx@option@item\keyis} |
| 188 |
\def\keychoice{\@cnltx@option@item\choicekey} |
| 189 |
\def\keybool{\@cnltx@option@item\boolkey} |
| 190 |
\renewenvironment{changelogdescription} |
| 191 |
{\begin{description}[leftmargin = \parindent]} |
| 192 |
{\end{description}} |
| 193 |
\renewenvironment{changelogitemize} |
| 194 |
{\begin{itemize}[leftmargin = *]} |
| 195 |
{\end{itemize}} |
| 196 |
\makeatother\ExplSyntaxOff |
| 197 |
\labelformat{section}{节#1} |
| 198 |
\labelformat{subsection}{小节#1} |
| 199 |
\labelformat{subsubsection}{小节#1} |
| 200 |
\labelformat{ctexexam}{例#1} |
| 201 |
\labelformat{table}{表#1} |
| 202 |
|
| 203 |
\begin{document} |
| 204 |
\section{准备开始} |
| 205 |
您在使用 \easybook{} 文档类编写文档前可能需要具备以下的条件: |
| 206 |
\begin{itemize} |
| 207 |
\item 使用 \hologo{XeLaTeX}(推荐)或 \hologo{LuaLaTeX} 两种编译方式之一。 |
| 208 |
\item 由于文档类用到了一些 \hologo{LaTeX} 和依赖宏包较新的功能,需要版本至少在\textbf{2021/11/15}以后的 \hologo{LaTeX} 内核支持。建议您安装最新的 \hologo{TeX} 发行版。 |
| 209 |
\item 虽然手册对基本用法做了介绍,但这并不是入门教程,所涉及到宏包的用法与命令并未进行详细介绍,需要对它们有所了解。您应当具有一定的 \hologo{LaTeX} 使用基础,可以在 \hologo{TeX} 综合网站 \href{https://www.ctan.org/}{CTAN} 查看相关资源。 |
| 210 |
\end{itemize} |
| 211 |
|
| 212 |
\subsection{前言} |
| 213 |
对于排版外文文档已有诸如 \cls*{KOMA-Script} 和 \cls*{memoir} 等应用广泛的文档类,但这些文档类并不是为中文用户设计的,难免有些水土不符,且用户手册繁杂,对于普通用户来说学习成本高,难以快速上手。中文文档的解决方案 \CTeX 宏集解决了中文输出和章节标题格式的设置问题,但在编写文档过程中往往需要更多基本的定制功能,例如目录、图表标题、页眉页脚、脚注和页面边距等,这往往需要额外加载不同功能的宏包。\easybook{} 文档类在 \cls*{ctexbook} 基础上载入了一些使用频率较高且基本稳定的宏包,对它们的功能进行整合并优化联动使用,模块化的改装提供统一的接口兼容 \CTeX 文档类,可以满足学术类文档例如中国学位论文模板的基本需求。\easybook{} 提供了与 \CTeX 相同现代化风格的键值设置,支持不同类型的选项与层次化的选项设置。 |
| 214 |
|
| 215 |
\subsection{基本用法} |
| 216 |
\label{subsec:basic usage} |
| 217 |
以下一份简单的 \TeX 文档演示了 \easybook{} 的最基本用法,在导言区进行宏包载入与文档设置,一些详细的使用样例会不定期上传在 \href{https://www.latexstudio.net/}{\hologo{LaTeX} 工作室} 的网站。或者直接使用 \pkg*{easybase} 宏包,目前适用于 \cls*{ctexbook}、\cls*{ctexrep}、\cls*{ctexart} 以及标准文档类,包含了\ref{sec:interface options} 所示各个模块接口命令的功能。当在\textbf{标准文档类}后载入时还可以使用 \pkg*{ctex} 宏包的选项,将会传递给 \pkg*{ctex} 宏包。文档类和宏包支持的全局选项见\ref{sec:document class options}。 |
| 218 |
\begin{frameverb} |
| 219 |
\documentclass[全局选项]{easybook} |
| 220 |
% \documentclass[全局选项]{ctexbook} |
| 221 |
|
| 222 |
% \usepackage[全局选项]{easybase} |
| 223 |
\ctexset{键值列表} |
| 224 |
\usepackage{宏包列表} |
| 225 |
|
| 226 |
\begin{document} |
| 227 |
\chapter{hello :)} |
| 228 |
\section{Welcome to easybook} |
| 229 |
Hello, \LaTeX |
| 230 |
\end{document} |
| 231 |
\end{frameverb} |
| 232 |
|
| 233 |
\subsection{编译方式} |
| 234 |
假设您的 \TeX 源文件名为 \code{easybook-demo.tex},需要使用参考文献和索引功能,并使用 \hologo{XeLaTeX} 和 \hologo{biber} 引擎编译文档,那么需要在命令行中执行: |
| 235 |
\begin{frameverb} |
| 236 |
xelatex -shell-escape easybook-demo |
| 237 |
biber easybook-demo |
| 238 |
makeindex easybook-demo |
| 239 |
xelatex -shell-escape easybook-demo |
| 240 |
xelatex -shell-escape easybook-demo |
| 241 |
\end{frameverb} |
| 242 |
当然也可以使用 \code{latexmk} 及一些软件自带的编译工具,这里就不做介绍。 \\ |
| 243 |
$\blacktriangleright$需要注意正确\textbf{编译索引}要增加 \code{-shell-escape} 命令行选项。 |
| 244 |
|
| 245 |
\subsection{依赖宏包} |
| 246 |
\ref{table:package list} 为 \pkg*{easybase} 直接调用的关键宏包清单,通常情况下它们是常用且稳定的。\colorbox{PaleTurquoise}{蓝色}背景的宏包表示修改了或依赖它们的内部命令。\colorbox{GreenYellow}{绿色}背景的宏包表示并未调用它们,但做了一些预配置,可在导言区手动载入以实现相关的功能。 |
| 247 |
\begin{longtblr} |
| 248 |
[caption = 依赖的宏包清单,label = table:package list] |
| 249 |
{ |
| 250 |
cells = {cmd = \pkg*}, |
| 251 |
cell{1}{3,4} = PaleTurquoise, |
| 252 |
cell{2}{5} = PaleTurquoise, |
| 253 |
cell{4}{5} = PaleTurquoise, |
| 254 |
cell{5}{2} = PaleTurquoise, |
| 255 |
cell{5}{1} = GreenYellow, |
| 256 |
cell{1}{2} = GreenYellow, |
| 257 |
cell{3}{1} = GreenYellow, |
| 258 |
cell{4}{2} = GreenYellow |
| 259 |
} |
| 260 |
amsthm & bicaption & ctex & caption & chemformula \\ |
| 261 |
enumitem & etoolbox & fancyhdr & geometry & hyperref \\ |
| 262 |
indextools & listings & marginnote & graphicx & multicol \\ |
| 263 |
pifont & pdfpages & siunitx & spbmark & thmtools \\ |
| 264 |
tcolorbox & titletoc & tabularray & xcolor |
| 265 |
\end{longtblr} |
| 266 |
|
| 267 |
\section{全局选项} |
| 268 |
\label{sec:document class options} |
| 269 |
全局选项应当在使用 \easybook{} 文档类或 \pkg*{easybase} 宏包(部分支持)时指定,可见\ref{subsec:basic usage} 的例子。选项前带有\hface 符号表示只可用于文档类,否则文档类与宏包都适用。文档类选项除了下面额外增加的以外,还支持标准和 \CTeX 文档类的选项。 |
| 270 |
|
| 271 |
\subsection{基本选项} |
| 272 |
\begin{cnltxlist} |
| 273 |
\opt{draft} |
| 274 |
开启草稿模式会加快编译速度,表现有显示页面边框、行溢出的地方显示黑色方块、图片变成占位方框、行间代码隐藏、显示当前日期和关闭超链接渲染。不使用绘图宏包及依赖 \pkg*{tcolorbox} 宏包的盒子环境也会增快编译速度,详情见\ref{subsec:box}。 |
| 275 |
\opt{newline}\dtag |
| 276 |
部分和章标题的样式为另起一行,符合一般英文书籍的习惯。 |
| 277 |
\keychoice{scheme}{\fbox{chinese},plain}\dtag |
| 278 |
文档主题方案选项 \option{scheme} 扩展了 \CTeX 文档类中同名选项原有的作用范围,选项值 \code{plain} 可使各类标题变为英文形式。包括章节标题、图表标题和定理名等。 |
| 279 |
\opt{enmode}\dtag |
| 280 |
同时开启 \option{newline} 和 \keyis{scheme}{plain} 选项以符合英文原生风格。 |
| 281 |
\keychoice{paper}{\fbox{a4paper},b5paper,c5paper,letterpaper,\optpath*{other paper}} |
| 282 |
文档页面尺寸选项将参数交给 \pkg*{geometry} 宏包处理,可使用它支持的所有标准纸张规格。 |
| 283 |
\keyval{configs}{配置文件列表}\dtag |
| 284 |
载入用户配置的文件名列表,文件列表以花括号包裹并以英文逗号分隔。文件名应包含如 \code{tex}、\code{def} 或 \code{cfg} 等扩展名。若配置文件不在当前文件夹则文件名需要包含路径,即 \code{path/file.cfg}。 |
| 285 |
\keychoice{floatpage}{true,\fbox{false}} |
| 286 |
开启这个选项后浮动环境 \env{table} 和 \env{figure} 的比例参数会使用默认值。关闭它则尽可能避免出现浮动页,使图表环境与正文段落更加紧凑,减少多余的空白版面。 |
| 287 |
\keychoice{theorem}{\fbox{thmtools},keytheorems,false}\newtagv[Changed]{2024ea}% |
| 288 |
是否提供定理功能支持,定理模块的介绍可见\ref{subsec:theorem}。选项 \code{thmtools} 会载入 \pkg*{amsthm} 和 \pkg*{thmtools} 宏包,选项 \code{keytheorems} 会载入 \pkg*{keytheorems} 宏包,选项 \code{false} 不载入定理功能宏包。 |
| 289 |
\keychoice{chem}{\fbox{chemformula},mhchem,false}\newtagv{2024ef}% |
| 290 |
是否提供化学式功能支持。选项 \code{chemformula} 会载入 \pkg*{chemformula} 宏包,选项 \code{mhchem} 会载入 \pkg*{mhchem} 宏包,选项 \code{false} 不载入化学式功能宏包。\pkg*{chemformula} 的工作原理与 \pkg*{mhchem} 非常相似,但对化合物、化学计量数和箭头的输入方式控制更为严格。 |
| 291 |
\command{ch}[\oarg{键值列表}\marg{化学式}] |
| 292 |
\pkg*{chemformula} 的无机化学式书写命令。化合物表达式中的原子数不需要加下标符号,化学计量数与表达式间隔一个空格。 |
| 293 |
\begin{ctexexam} |
| 294 |
\ch{[Cu(NH3)4]^2+} |
| 295 |
\ch{Cu2S + 2 O2 - 2 e^- == 2 Cu^2+ + SO4^2-} |
| 296 |
\end{ctexexam} |
| 297 |
\end{cnltxlist} |
| 298 |
|
| 299 |
\subsection{配置字体} |
| 300 |
\begin{cnltxlist} |
| 301 |
\keychoice{cjkfont}{adobe,fandol,founder,mac,macnew,macold,ubuntu,windows,none}\dtag |
| 302 |
中文字体采用 \CTeX 宏集包含的字库并与其一致,具体配置方案可以查看 \CTeX 使用手册。它与 \option*{fontset} 选项是等效的,如果没有指定 \option{cjkfont} 的值,将会自动检测操作系统并选择相应的字体。 |
| 303 |
|
| 304 |
如果需要使用其它中文字体,可以在启用选项 \keyis{cjkfont}{none} 后,再使用 \pkg*{xeCJK} 宏包的相关命令设置字体以及声明字体族: |
| 305 |
\begin{ctexexam} |
| 306 |
\setCJKmainfont{SimSun}[BoldFont = SimHei,ItalicFont = KaiTi] |
| 307 |
\setCJKsansfont{SimHei} |
| 308 |
\setCJKmonofont{FangSong} |
| 309 |
\newCJKfontfamily[song]\songti{SimSun} |
| 310 |
\end{ctexexam} |
| 311 |
|
| 312 |
如果用 \textsf{Overleaf} 或 \textsf{TeXPage} 等在线平台编译文档,则只有 \code{fandol} 字体可用。使用其它字体可将字体文件上传至项目文件夹,例如上传至 \code{font} 文件夹设置正文和无衬线字体: |
| 313 |
\begin{ctexexam} |
| 314 |
\setCJKmainfont{simsun.ttc}[Path = ./font/] |
| 315 |
\setCJKsansfont{simhei.ttf}[Path = ./font/] |
| 316 |
\end{ctexexam} |
| 317 |
\keychoice{font}{noto,times,times*,ebgaramond,libertine,palatino,\fbox{auto}}\dtag |
| 318 |
预置的英文字体相关配置方案如\ref{table:english font} 所示。这些字体已经包含在了 \hologo{TeXLive} 发行版中,所以通常不需要再专门安装。如果您想使用默认的Latin Modern或其它英文字体,可以使用 \code{auto} 选项配合 \pkg*{fontspec} 宏包的相关命令进行设置。 |
| 319 |
\begin{longtblr} |
| 320 |
[ |
| 321 |
caption = 英文字体预设方案, |
| 322 |
label = table:english font, |
| 323 |
remark{$\blacktriangleright$} = \code{times*} 方案为 \textsf{windows} 系统的预置字体。, |
| 324 |
postsep = \bigskipamount-\itemsep |
| 325 |
]{ |
| 326 |
hline{2} = {0.5pt,DarkBlue}, |
| 327 |
row{1} = {font = \sffamily}, |
| 328 |
column{1} = {cmd = \code} |
| 329 |
} |
| 330 |
& 正文字体 & 无衬线字体 & 等宽字体 \\ |
| 331 |
noto & Noto Serif & Noto Sans & Noto Sans Mono \\ |
| 332 |
times & XITS & TG Heros & TG Cursor \\ |
| 333 |
times* & Times New Roman & Arial & Courier New \\ |
| 334 |
ebgaramond & EB Garamond & Libertinus Sans & LM Mono \\ |
| 335 |
palatino & TG Pagella & Libertinus Sans & LM Mono \\ |
| 336 |
libertine & Libertinus Serif & Libertinus Sans & LM Mono |
| 337 |
\end{longtblr} |
| 338 |
\keychoice{mathfont}{\fbox{times},noto,notosans,nc,ncf,stix2,charter,ebgaramond,libertine}\dtag |
| 339 |
\leftfillchoice{mathfont}{minion,garamondx,baskervaldx,baskerville,none} \\ |
| 340 |
选择合适的数学字体,将会加载 \pkg*{newtxmath} 和 \pkg*{bm} 宏包。使用选项 \code{none} 时可以使用 \pkg*{unicode-math} 等其它数学字体宏包定义字体。 |
| 341 |
\end{cnltxlist} |
| 342 |
|
| 343 |
\subsection{文类模式} |
| 344 |
\begin{cnltxlist} |
| 345 |
\keychoice{class}{\fbox{book},article} |
| 346 |
使用 \easybook{} 文档类可以有两种模式,默认为 \cls*{book} 模式。选用 \code{article} 可用于短篇幅的文章,文档会变为 \option{oneside} 单面排版,同时标题编号和封面等与标准 \cls*{article} 文档类相似,若使用 \cs{chapter} 命令会报错。如果使用 \cls*{ctexart} 配合 \pkg*{easybase} 宏包,则选项值 \code{book} 会失效。 |
| 347 |
\opt{book} |
| 348 |
开启 \cls*{book} 书籍模式,与 \keyis*{class}{book} 等效。 |
| 349 |
\opt{article} |
| 350 |
开启 \cls*{article} 文章模式,与 \keyis*{class}{article} 等效。 |
| 351 |
\end{cnltxlist} |
| 352 |
|
| 353 |
\section{模块选项} |
| 354 |
\label{sec:interface options} |
| 355 |
\begin{cnltxlist} |
| 356 |
\command{ctexset}[\oarg{模块名}\marg{键值列表}] |
| 357 |
\easybook{} 扩展了 \CTeX 宏集 \hologo{LaTeX3} 风格键值的通用控制命令 \cs{ctexset},模块选项同样可用它设置,原有的 \meta{键值列表} 仍然可用。本文档类目前有10个模块用于实现常规的排版功能,如\ref{table:module List} 所示。 |
| 358 |
\begin{longtblr} |
| 359 |
[caption = 模块功能和名称清单,label = table:module List] |
| 360 |
{ |
| 361 |
hline{3} = {0.5pt,DarkBlue}, |
| 362 |
row{1,3} = {font = \sffamily}, |
| 363 |
row{2,4} = {cmd = \module*} |
| 364 |
} |
| 365 |
\hyperref[subsec:tools]{工具} & \hyperref[subsec:font]{部件字体} & \hyperref[subsec:space]{间距} & \hyperref[subsec:hyperlinks]{超链接} & \hyperref[subsec:reference]{参考文献} \\ |
| 366 |
tools & font & space & ref & bib \\ |
| 367 |
\hyperref[subsec:theorem]{定理} & \hyperref[subsec:page margins]{页面尺寸} & \hyperref[subsec:header and footer]{页眉页脚} & \hyperref[subsec:contents]{目录} & \hyperref[subsec:caption]{图表题注} \\ |
| 368 |
thmt & geo & hdr & toc & cap |
| 369 |
\end{longtblr} |
| 370 |
|
| 371 |
\ref{exam:kv setting} 使用\ref{subsec:tools} 介绍的工具模块 \module*{tools} 举例三种键值列表设置方式:1. 各 \meta{模块名} 是统一接口 \cs{ctexset} 的键路径。2. 不同模块还具有单独的接口命令 \cs*{eb}\meta{模块名}\cstext{set}。3. \meta{模块名} 也可以使用 \cs{ctexset} 命令的可选参数设置。路径名与所属下级选项之间可以 \code{/} 或 \code{=} 号分开,斜线 \code{/} 后不能有空格或者换行。 |
| 372 |
\begin{ctexexam}[labelref = exam:kv setting] |
| 373 |
\ctexset |
| 374 |
{ |
| 375 |
tools/color = seaside, |
| 376 |
tools = |
| 377 |
{ |
| 378 |
fntnumwith = page, |
| 379 |
uppercase = first |
| 380 |
} |
| 381 |
} |
| 382 |
\ctexset[tools]{spcmd = \color{red}} |
| 383 |
\ebtoolsset{hyphen-figure = {-}} |
| 384 |
\end{ctexexam} |
| 385 |
|
| 386 |
\easybook{} 文档类有四种选项:1. 布尔型 \choicekey*{key}{true,false} 选项的值为真 \code{true} 或假 \code{false},如果不指定默认为真。2. 键值型 \key*{key}{value} 需要为选项指定值,后面 \code{=} 号不能省略。3. 键型 \option*{key} 不需要为选项指定值。4. 选择型 \choicekey*{key}{one,\fbox{two},three} 根据提供的可选值进行设定。 |
| 387 |
\end{cnltxlist} |
| 388 |
|
| 389 |
\subsection[工具]{工具\smodule{tools}} |
| 390 |
\label{subsec:tools} |
| 391 |
工具模块 \module*{tools} 主要用于综合设置各类杂项的排版元素。 |
| 392 |
\begin{cnltxlist} |
| 393 |
\keychoice{color}{\fbox{none},seaside,energy,cyberpunk} |
| 394 |
\easybook{} 预置了四种颜色主题,默认主题 \code{none} 为黑白页面,颜色主题不包括超链接。 |
| 395 |
\command{DeclareThemeColor}[\marg{风格名称}\splitmarg{颜色1,颜色2,颜色3}]\newtagv[Changed]{2024eu}% |
| 396 |
声明新的颜色主题命令。颜色参数的三个部分为 \code{HTML} 颜色代码,构成主题颜色列表,其中 \meta{颜色1} 为标题标签,\meta{颜色2} 为列表编号、定理标签和公式编号括号,\meta{颜色3} 为代码抄录。类似地更改超链接颜色见\ref{subsec:hyperlinks}。 |
| 397 |
\begin{ctexexam} |
| 398 |
\DeclareThemeColor{fancy}{2acb25,60aacc,ebc01c} |
| 399 |
\ctexset{tools/color = fancy} |
| 400 |
\end{ctexexam} |
| 401 |
\keyval{color-every}{HTML颜色代码} |
| 402 |
统一设置主题的各部分颜色。参数是6个十六进制数字组成的 \code{HTML} 颜色代码,任意颜色的代码可以在常见的图片处理工具拾色器中查看。 |
| 403 |
\keyval{multoc}{整数}\Default{2} |
| 404 |
设置目录的排版栏数,与\ref{subsec:directory command} 中目录命令的同名选项有相同效果。 |
| 405 |
\keychoice{withpart}{true,\fbox{false}} |
| 406 |
使章标题跟随部分计数器编号,仅在导言区有效。当开启新的部分标题时章编号从1开始。 |
| 407 |
\keychoice{fntnumwith}{part,\fbox{chapter},page} |
| 408 |
设置脚注重置编号的方式,仅在导言区有效。默认跟随章计数器,即开启新的章标题时脚注编号从1开始。选项 \code{page} 代表的是换页而不是页计数器,这是由于在一些排版情况下换页后页计数器仍为上页的值。 |
| 409 |
\keychoice{uppercase}{\fbox{all},first,none,none*} |
| 410 |
使用 \cs{rightmark} 和 \cs{leftmark} 等标题标记命令获取标题内容用于页眉页脚时其中英文的大小写类型。\code{all} 为标题标记中的英文字母全部大写。\code{first} 为标记以英文起始时仅第一个字母大写。\code{none} 不改变标记中英文字母的大小写形式,变体 \code{none*} 则强制标记的字母均为小写形式。 |
| 411 |
\kvsplit{tagform}{左括号,右括号}\Default{\Marg{(,)}} |
| 412 |
设置行间公式标签的括号及格式,以英文逗号分隔,分别代表左右括号。\meta{左括号} 的末尾可以是带有一个参数的命令,用于接受公式编号。将标签括号设置为方括号,并给编号使用无衬线字体: |
| 413 |
\begin{ctexexam} |
| 414 |
\newcommand{\bracketsf}[1]{[\textsf{#1}} |
| 415 |
\ebtoolsset{tagform = {\bracketsf,]}} |
| 416 |
\end{ctexexam} |
| 417 |
\kvsplit-{figurepath}{\marg{路径名1}\marg{路径名2}$\cdots$\marg{路径名n}}\newtagv[Changed]{2024cd}% |
| 418 |
设置插入图片的文件夹路径名。每个路径需包含在花括号内,只有一个路径时括号可以省略。 |
| 419 |
\begin{ctexexam} |
| 420 |
\ctexset{tools/figurepath = path1} |
| 421 |
\ctexset{tools/figurepath = {path2}{path3}} |
| 422 |
\end{ctexexam} |
| 423 |
|
| 424 |
以下几个选项用于设置题注编号的连字符,\code{chapter} 计数器的值大于0时连字符才有意义。若需更改题注编号的输出格式可在正文中重新定义 \cs*{the}\meta{计数器} 命令。 |
| 425 |
\keyval{hyphen-figure}{图片连字符}\Default{\Marg{.}} |
| 426 |
设置图片题注编号的连字符。 |
| 427 |
\keyval{hyphen-table}{表格连字符}\Default{\Marg{.}} |
| 428 |
设置表格题注编号的连字符。 |
| 429 |
\keyval{hyphen-lstlisting}{代码连字符}\Default{\Marg{.}} |
| 430 |
设置代码题注编号的连字符。\pkg*{listings} 宏包的 \option{numberbychapter} 选项失效。 |
| 431 |
\keyval{hyphen-equation}{公式连字符}\Default{\Marg{.}} |
| 432 |
设置公式题注编号的连字符。 |
| 433 |
\keyval{hyphen-every}{连字符}\Default{\Marg{.}} |
| 434 |
统一设置上述所有编号的连字符。 |
| 435 |
\end{cnltxlist} |
| 436 |
|
| 437 |
\subsection[超链接]{超链接\smodule{ref}} |
| 438 |
\label{subsec:hyperlinks} |
| 439 |
模块 \module*{ref} 将超链接选项交给 \pkg*{hyperref} 宏包处理,除了下面描述的选项,也支持宏包全局和接口命令 \cs*{hypersetup} 可用的选项。 |
| 440 |
\begin{cnltxlist} |
| 441 |
\keychoice{linktype}{\fbox{edge},colors,none} |
| 442 |
超链接类型。\code{edge} 使超链接形式为边框,\code{colors} 使超链接字体为彩色,\code{none} 关闭超链接边框与颜色,此时 \option{linkcolor} 选项无效。 |
| 443 |
\keychoice{linkcolor}{fresh,cutepink,\fbox{navyblue},crimson} |
| 444 |
当超链接类型为 \code{colors} 时文本的颜色样式。预置了四种超链接颜色风格,默认为海军蓝 \code{navyblue}。 |
| 445 |
\command{DeclareLinkColor}[\marg{风格名称}\splitmarg{颜色1,颜色2,颜色3}]\newtagv[Changed]{2024eu}% |
| 446 |
声明新的超链接颜色样式命令。颜色参数的三个部分为 \code{HTML} 颜色代码,构成超链接颜色列表,其中 \meta{颜色1} 为普通链接,\meta{颜色2} 为网址,\meta{颜色3} 为参考文献引用。 |
| 447 |
\keyval{linkcolor-every}{HTML颜色代码} |
| 448 |
统一设置超链接的各部分颜色。参数是6个十六进制数字组成的 \code{HTML} 颜色代码,任意颜色的代码可以在常见的图片处理工具拾色器中查看。 |
| 449 |
\keychoice{linktoc}{none,section,page,\fbox{all}} |
| 450 |
将目录中的超链接取消、置于标题上、置于页码上或置于标题和页码上。 |
| 451 |
\end{cnltxlist} |
| 452 |
|
| 453 |
\subsection[间距]{间距\smodule{space}} |
| 454 |
\label{subsec:space} |
| 455 |
间距模块 \module*{space} 用于调整段落中的间距。带有 \option*{spread} 的选项可以设置行距倍数,\meta{数值} 是不带有长度单位的浮点数。各类行距既可以在导言区全局设置,也可以在正文中设置对后面生效。 |
| 456 |
\begin{cnltxlist} |
| 457 |
\keyval{linespread}{数值}\Default{1.354} |
| 458 |
正文行距因子。中文主题下行距因子初始值为 \code{1.354}(相当于 \textsf{Word} 的1.25倍行距),如果设置了文类或 \pkg*{ctex} 宏包的全局行距选项 \option{linespread} 则初始值设为它的值。 |
| 459 |
\keyval{capfig-spread}{数值}\Default{1.2} |
| 460 |
图片题注的行距因子。 |
| 461 |
\keyval{captab-spread}{数值}\Default{1.2} |
| 462 |
表格题注的行距因子。 |
| 463 |
\keyval{caplst-spread}{数值}\Default{1.2} |
| 464 |
代码题注的行距因子。 |
| 465 |
\keyval{caption-spread}{数值}\Default{1.2} |
| 466 |
同时设置图片、表格和代码题注的行距因子。 |
| 467 |
\keyval{fntspread}{数值}\Default{1.2} |
| 468 |
脚注内容整体的行距因子。可以使用 \module*{hdr} 模块 \option{fnpara-format} 选项的代码单独覆盖每个脚注的行距,从而使脚注间和内容文本自身的行距不同。 |
| 469 |
\begin{ctexexam} |
| 470 |
\ebspaceset{fntspread = 1.3} |
| 471 |
\ebhdrset{fnpara-format = \usestretch{1.2}} |
| 472 |
\end{ctexexam} |
| 473 |
\keyval{everyspread}{数值} |
| 474 |
统一设置上述所有的行距因子。 |
| 475 |
\keyval{abovedisplayskip}{弹性长度}\Default{0.5ex plus .1ex minus .1ex} |
| 476 |
行间公式与上面正文间的额外距离。 |
| 477 |
\keyval{belowdisplayskip}{弹性长度}\Default{0.5ex plus .1ex minus .1ex} |
| 478 |
行间公式与下面正文间的额外距离。 |
| 479 |
\begin{cnltxlist} |
| 480 |
\command{usestretch}[\marg{数值}]\newtagv{2024dt}% |
| 481 |
设置之后文本的行距。可在任意地方使用,作用范围为局部。 |
| 482 |
\environment{usespace}[\marg{数值}]\newtagv{2024dt}% |
| 483 |
设置环境内文本的行距。可包含行间公式和表格等环境。 |
| 484 |
\begin{ctexexam} |
| 485 |
\begin{usespace}{1.5}\nointerlineskip |
| 486 |
\ebspaceset{belowdisplayskip = 6pt} |
| 487 |
\begin{align} |
| 488 |
\cos 2x &= \cos^2 x - \sin^2 x \\ |
| 489 |
&= 2\cos^2 x - 1 |
| 490 |
\end{align} |
| 491 |
\end{usespace} |
| 492 |
\end{ctexexam} |
| 493 |
\end{cnltxlist} |
| 494 |
\end{cnltxlist} |
| 495 |
|
| 496 |
\subsection[部件字体]{部件字体\smodule{font}} |
| 497 |
\label{subsec:font} |
| 498 |
部件字体模块 \module*{font} 用于设置除了正文外其它排版元素的字体。 |
| 499 |
\begin{cnltxlist} |
| 500 |
\keyval{caption-table}{字体命令}\Default{\cs*{sffamily}\cs*{small}} |
| 501 |
设置表格题注的字体,包括字体族、字体系列、字体尺寸和字体形状命令。 |
| 502 |
\keyval{caption-figure}{字体命令}\Default{\cs*{sffamily}\cs*{small}} |
| 503 |
设置图片题注的字体,包括字体族、字体系列、字体尺寸和字体形状命令。 |
| 504 |
\keyval{caption-lstlisting}{字体命令}\Default{\cs*{sffamily}\cs*{small}} |
| 505 |
设置代码题注的字体,包括字体族、字体系列、字体尺寸和字体形状命令。 |
| 506 |
\keyval{caption-every}{字体命令}\Default{\cs*{sffamily}\cs*{small}} |
| 507 |
同时设置图片、表格和代码题注的字体命令。 |
| 508 |
\keyval{footnote}{字体命令} |
| 509 |
设置脚注标记与内容的字体,包括字体族、字体系列和字体形状命令。 |
| 510 |
\keyval{marginpar}{字体命令}\Default{\cs*{footnotesize}} |
| 511 |
设置边注的字体,包括字体族、字体系列、字体尺寸和字体形状命令。 |
| 512 |
\command{ebaddtofont}[\marg{字体类型}\marg{字体命令}] |
| 513 |
用于在上述各种字体原有的格式上附加代码。其中 \meta{字体命令} 也可以包括行距命令且相对于 \module*{space} 模块具有优先性,不同题注的 \meta{字体类型} 则为相应选项的后缀名。 |
| 514 |
\begin{ctexexam} |
| 515 |
\ebaddtofont{every}{\usestretch{1.5}} |
| 516 |
\ebaddtofont{footnote}{\sffamily} |
| 517 |
\end{ctexexam} |
| 518 |
\end{cnltxlist} |
| 519 |
|
| 520 |
\subsection[参考文献]{参考文献\smodule{bib}} |
| 521 |
\label{subsec:reference} |
| 522 |
\begin{cnltxlist} |
| 523 |
\keychoice{backend}{bibtex,\fbox{biblatex}} |
| 524 |
参考文献处理后端。选择 \code{bibtex} 时使用传统的 \hologo{BibTeX} 引擎处理参考文献,加载 \pkg*{natbib} 宏包。选择 \code{biblatex} 时使用 \hologo{biber} 引擎,加载 \pkg*{biblatex} 宏包。若自动载入参考文献宏包则位于导言区末尾,但在 \pkg*{hyperref} 宏包之前。 |
| 525 |
\keychoice{bibstyle}{\fbox{numerical},authoryear,\optpath*{other sty}} |
| 526 |
参考文献格式使用中国参考文献推荐标准GB/T 7714-2015,对应顺序编码制和著者—出版年制两种风格。若使用其它格式,使用 \hologo{BibTeX} 处理时需确保正确的 \code{bst} 文件,使用 \hologo{biber} 处理可使用 \pkg*{biblatex} 宏包支持的参考文献风格名称。 |
| 527 |
\keyval{citestyle}{标注风格} |
| 528 |
标注参考文献的风格。后端为 \code{bibtex} 时可使用 \option{super}(数字上标标注,默认)或 \option{numbers}(数字标注)等 \pkg*{natbib} 宏包带有的标注风格,后端为 \code{biblatex} 时可使用 \pkg*{biblatex} 宏包支持的标注风格。 |
| 529 |
\keyval{datafile}{数据库列表} |
| 530 |
参考文献数据库的文件名列表,文件列表以花括号包裹并以英文逗号分隔。使用 \hologo{biber} 处理时文件名要带 \code{bib} 扩展名,若参考文献文件不在当前文件夹则文件名需要包含路径,即 \code{path/file.bib}。不设置参考文献数据库名时 \module*{bib} 模块中的选项会失效,即不自动载入 \pkg*{natbib} 或 \pkg*{biblatex} 宏包,此时需要手动载入相关宏包配置参考文献。 |
| 531 |
\command{printbibliography}[\oarg{键值列表}] |
| 532 |
两种方式\textbf{均使用}此命令打印参考文献,不同处理后端此命令的 \meta{键值列表} 不同。使用 \hologo{BibTeX} 处理时选项与\ref{subsec:directory command} 目录命令的选项相同,使用 \hologo{biber} 处理时常用的选项如下: |
| 533 |
\keychoice*{heading}{bibliography,subbibliography,\fbox{bibintoc},subbibintoc} |
| 534 |
参考文献通常有一个章标题或者节标题,该选项选择由 \cs{defbibheading} 定义的标题名。 |
| 535 |
\keyval{title}{参考文献标题名} |
| 536 |
如果标题定义支持的话,该选项覆盖由 \option*{heading} 选项提供的缺省标题名。 |
| 537 |
\keyval{prenote}{参考文献前注} |
| 538 |
该选项选择由 \cs{defbibnote} 所定义的前注,缺省状态下不打印任何前注。 |
| 539 |
\keyval{section}{整数}\Default{0} |
| 540 |
只打印第 \meta{整数} 文节中引用的条目。该参考文献节从1开始编号,所有在 \env*{refsection} 环境外给出的引用标记为第零节。 |
| 541 |
\keyval{type}{条目类型} |
| 542 |
只打印名为 \meta{条目类型} 的文献条目。 |
| 543 |
\keyval{filter}{过滤器名} |
| 544 |
使用由 \cs{defbibfilter} 定义的 \option*{filter} 来过滤条目。 |
| 545 |
|
| 546 |
可能在一些情况下您希望更加灵活地设置参考文献或有更多需求,下面举一个在导言区手动配置 \pkg*{biblatex} 宏包并使一个条目输出双语对照格式文献的例子: |
| 547 |
\begin{ctexexam} |
| 548 |
\usepackage[style = gb7714-2015]{biblatex} |
| 549 |
\addbibresource{reference.bib} |
| 550 |
\defbibheading{bibliography}[参考文献] % 定义参考文献标题 |
| 551 |
{\chapter*{#1}\markboth{#1}{#1}} |
| 552 |
\defbibentryset{Zhang2022}{张三2022,ZhangSan2022} |
| 553 |
\cite{Zhang2022} % 在正文中引用 |
| 554 |
\end{ctexexam} |
| 555 |
\end{cnltxlist} |
| 556 |
|
| 557 |
\subsection[定理]{定理\smodule{thmt}} |
| 558 |
\label{subsec:theorem} |
| 559 |
定理模块 \module*{thmt} 根据全局选项 \option{theorem} 的设置可以由 \pkg*{thmtools} 或 \pkg*{keytheorems} 宏包提供支持。\pkg*{keytheorems} 宏包使用 \hologo{LaTeX3} 编写,它的定理功能更完善并且提供了 \pkg*{thmtools} 宏包大部分的功能,但发布日期较新(2024年9月)还未被广泛使用,下面主要介绍传统的 \pkg*{thmtools} 宏包的功能。\pkg*{thmtools} 提供了定理环境和样式声明两个命令,文档类未预声明任何定理环境,如果声明定理环境时不指定样式,则使用默认定理样式 \code{default},可以对它重新定义。 |
| 560 |
\begin{cnltxlist} |
| 561 |
\command{declaretheorem}[\oarg{键值列表1}\marg{环境名列表}\oarg{键值列表2}] |
| 562 |
\pkg*{thmtools} 的定理环境声明命令。\pkg*{thmtools} 宏包中此命令实际相当于 \cs{newtheorem},无法强制创建定理环境,这里修复了这个问题。可选参数的 \meta{键值列表1} 与 \meta{键值列表2} 等效,常用的选项如下: |
| 563 |
\keyval{name}{定理名} |
| 564 |
定理环境的标题名称,默认为英文首字母大写的环境名。 |
| 565 |
\keychoice{numbered}{no,\fbox{yes},unless unique} |
| 566 |
定理可以被编号、不被编号或者只有在文档中多次出现时才被编号。 |
| 567 |
\keychoice{within}{\fbox{chapter},section,\optpath*{empty},\optpath*{counter}} |
| 568 |
定理编号跟随的计数器。当计数器值递增时定理编号会从零开始,通常这是一个章节计数器。 |
| 569 |
\keyval{numberlike}{计数器} |
| 570 |
定理将使用此 \meta{计数器} 进行编号,通常这是另一个定理环境的名称。 |
| 571 |
\keyval{qed}{证毕符号} |
| 572 |
证毕符号。位于定理段落末尾行的版心右边,可以设置成 \cs{qedsymbol} 默认是空心方块。 |
| 573 |
\keyval{style}{定理样式}\Default{default} |
| 574 |
选项的值为使用 \cs{declaretheoremstyle} 命令新定义的定理样式。 |
| 575 |
|
| 576 |
使用 \cs{declaretheorem} 命令以\ref{exam:new theorem sty} 中的定理样式 \code{fancy} 新建一个定理环境 \env*{lemma},然后用一个基于 \pkg*{tcolorbox} 宏包的预置彩色盒子 \env{easyboxi} 增加背景: |
| 577 |
\begin{ctexexam}[labelref = exam:new theorem env] |
| 578 |
\declaretheorem[style = fancy,name = 引理]{lemma} |
| 579 |
\addtotcbstyle{tc-easyboxi}{colback = GreenYellow} |
| 580 |
\tcolorboxenvironment{lemma}{tc-easyboxi} |
| 581 |
\end{ctexexam} |
| 582 |
\command{declaretheoremstyle}[\oarg{键值列表1}\marg{定理样式}\oarg{键值列表2}] |
| 583 |
\pkg*{thmtools} 的定理样式声明命令,键值列表支持自身以及定理声明命令 \cs{declaretheorem} 的所有选项。为命令增加了可选参数 \meta{键值列表2},与 \meta{键值列表1} 等效,常用的选项如下: |
| 584 |
\keyval{headfont}{字体命令}\Default{\cs*{sffamily}} |
| 585 |
定理标题部分(包括题注)的字体,包括字体族、字体系列、字体尺寸和字体形状命令。 |
| 586 |
\keyval{notefont}{字体命令}\Default{\cs*{sffamily}} |
| 587 |
定理题注部分的字体,包括字体族、字体系列、字体尺寸和字体形状命令。 |
| 588 |
\keyval{bodyfont}{字体命令}\Default{\cs*{normalfont}} |
| 589 |
定理内容部分的字体,包括字体族、字体系列、字体尺寸和字体形状命令。 |
| 590 |
\keyval{headpunct}{代码} |
| 591 |
紧随定理标题末尾的标记代码,位于定理第一段内容的间距 \option{postheadspace} 之前,可以是字符或插入换行符 \cs*{newline} 等命令。 |
| 592 |
\keyval{headindent}{刚性长度}\Default{0pt} |
| 593 |
定理标题的缩进。默认无缩进,可用 \cs*{parindent} 命令设置为段落缩进。 |
| 594 |
\keyval{postheadspace}{刚性长度}\Default{1em} |
| 595 |
定理标题后与定理第一段内容的间距。 |
| 596 |
\keyval{spaceabove}{弹性长度}\Default{0ex plus .1ex} |
| 597 |
定理环境前的间距,使用 \pkg*{tcolorbox} 的盒子环境包装后被覆盖。 |
| 598 |
\keyval{spacebelow}{弹性长度}\Default{0ex plus .1ex} |
| 599 |
定理环境后的间距,使用 \pkg*{tcolorbox} 的盒子环境包装后被覆盖。 |
| 600 |
\kvsplit-{notebraces}{\marg{左括号}\marg{右括号}}\Default{\Marg{(}\Marg{)}} |
| 601 |
设置定理题注两边的括号,两个必选参数分别代表左括号和右括号。 |
| 602 |
\keyval{headformat}{标题排列} |
| 603 |
定理标题各组成元素的位置排列和格式。定理标题由定理名、编号和题注组成,\meta{标题排列} 中命令 \cs*{NAME}、\cs*{NUMBER} 和 \cs*{NOTE} 分别代表定理名、编号和题注。也可以设置值为 \code{margin} 或 \code{swapnumber},它们的编号均在定理名前方,其中 \code{margin} 的编号在左页边距中。 |
| 604 |
|
| 605 |
下面定义一个名为 \code{fancy} 的定理样式用于 \cs{declaretheorem} 的 \option*{style} 选项: |
| 606 |
\begin{ctexexam}[labelref = exam:new theorem sty] |
| 607 |
\declaretheoremstyle{fancy}[ |
| 608 |
within = chapter, |
| 609 |
spaceabove = 6pt, |
| 610 |
spacebelow = 6pt, |
| 611 |
headfont = \normalfont\bfseries, |
| 612 |
notefont = \sffamily, |
| 613 |
notebraces = {[}{]}, |
| 614 |
bodyfont = \itshape |
| 615 |
] |
| 616 |
\end{ctexexam} |
| 617 |
\begin{cnltxlist}[itemsep = 0ex] |
| 618 |
\command{listoftheorems}[\sarg\oarg{键值列表}]\nonl |
| 619 |
\keyval{listtheoremname}{定理目录标题名}\nonl |
| 620 |
\command{settheoremtocline}[\sarg\marg{环境名列表}\marg{标题定义}]\newtagv{2024bb}% |
| 621 |
对 \pkg*{thmtools} 宏包的定理环境目录命令 \cs{listoftheorems} 进行了适配调整\footnote{也对 \pkg*{keytheorems} 宏包作为兼容提供的这个命令进行了适配。},\ref{subsec:directory command} 和\ref{subsec:contents} 中的选项机制均可用,但标题定义选项 \option{tocline} 较为特殊,需用 \cs{settheoremtocline} 命令单独设置。在 \meta{标题定义} 中有三个命令 \cs{thmtname}、\cs{thmtenvname} 和 \cs{thmtnote} 分别代表定理名、定理环境名和题注用于排版目录条目。 |
| 622 |
\end{cnltxlist} |
| 623 |
\optpath{thmt/}\key{loeskip}{弹性长度}\Default{10pt} |
| 624 |
定理目录中每章第一个条目上方增加的垂直距离。与 \CTeX 的表格和图片目录中每章间的条目距离选项 \option*{lotskip} 和 \option*{lofskip} 类似,在 \cls*{article} 模式中此选项失效。 |
| 625 |
\command{thmtifnote}[\marg{存在题注代码}\marg{不存在题注代码}] |
| 626 |
如果标题没题注即定理环境不用可选参数,则标题不加入定理目录,这是默认且合理的行为。若需要将无题注的标题加入目录可将 \meta{环境名} 传给目录风格的 \option{show} 选项或使用 \cs*{settheoremtocline}\code{*} 命令。是否存在题注需要在 \meta{标题定义} 中使用 \cs{thmtifnote} 命令判定,从而输出不同的内容。 |
| 627 |
\command{thmtifname}[\marg{存在编号代码}\marg{不存在编号代码}] |
| 628 |
在 \meta{标题定义} 中测试当前定理是否有编号从而输出不同的内容,定理风格选项 \keyis{numbered}{no} 设置当前定理环境没有编号。 |
| 629 |
\begin{ctexexam} |
| 630 |
\contentsuse{lemma}{loe} |
| 631 |
\RegisterTocName{lemma} |
| 632 |
\setlisttheoremstyle{ignoreall,show = lemma} |
| 633 |
\settheoremtocline{lemma} |
| 634 |
{ |
| 635 |
\listnumberline{\thmtenvname} |
| 636 |
\thmtname\thmtifnote{[\thmtnote]}{} |
| 637 |
} |
| 638 |
\end{ctexexam} |
| 639 |
|
| 640 |
如果使用 \pkg*{keytheorems} 宏包创建定理环境,它的目录样式同样可以用 \module*{toc} 模块的命令注册后定制,其中 \option{tocline} 可用目录命令自带的 \option{format-code} 选项设置: |
| 641 |
\begin{ctexexam} |
| 642 |
\newkeytheorem{corollary}[name = 推论] |
| 643 |
\contentsuse{corollary}{thlist} |
| 644 |
\RegisterTocName{corollary} |
| 645 |
\begin{document} |
| 646 |
\keytheoremlistset{format-code = \numberline{#2}#1#3} |
| 647 |
\listofkeytheorems % 在正文中输出定理目录 |
| 648 |
\end{ctexexam} |
| 649 |
\end{cnltxlist} |
| 650 |
|
| 651 |
\subsection[页面尺寸]{页面尺寸\smodule{geo}} |
| 652 |
\label{subsec:page margins} |
| 653 |
页面尺寸模块 \module*{geo} 用于设置纸张大小和各种页面边距,它将选项交给页面尺寸宏包 \pkg*{geometry} 处理,支持通用接口 \cs{geometry} 的键值列表,预置的页面尺寸与 \textsf{Word} 的默认值接近。下面列举几种 \pkg*{geometry} 不同键值输入方式的选项,前面有\hface 符号的选项为额外附加,其它选项可查阅宏包帮助文档。当用此模块设置纸张规格时,会覆盖全局选项 \option{paper} 的设置。模块 \module*{geo} 的通用接口命令只能在导言区中使用。 |
| 654 |
\begin{cnltxlist}[itemsep = 0ex] |
| 655 |
\keyval{headruleskip}{页眉线间距}\dtag\Default*{0pt} |
| 656 |
\keyval{footruleskip}{页脚线间距}\dtag\Default*{3.5pt} |
| 657 |
\kvsplit{hdivide}{左边距,版心宽度,右边距}\nonl |
| 658 |
\kvsplit{hmargin}{左边距,右边距}\nonl |
| 659 |
\keyval{textheight}{版心高度}\nonl |
| 660 |
\keychoice{nofoot}{true,\fbox{false}}\nonl |
| 661 |
\begin{ctexexam} |
| 662 |
\ctexset[geo] |
| 663 |
{ |
| 664 |
headruleskip = 3pt, |
| 665 |
vscale = 0.9, |
| 666 |
hdivide = {2cm,15cm,*}, |
| 667 |
vcentering |
| 668 |
} |
| 669 |
\end{ctexexam} |
| 670 |
|
| 671 |
\pkg*{geometry} 宏包支持在文档中部改变页面尺寸,提供了新建和保存页面布局的命令。需要注意的是,\pkg*{fancyhdr} 宏包配置页面标记是以文档开始的页面尺寸为参考,若中途更改页面布局后需用标记偏移命令 \cs{fancyhfoffset} 重置参考的尺寸,以确保标记位置正确。 |
| 672 |
\begin{cnltxlist} |
| 673 |
\command{newgeometry}[\marg{键值列表}] |
| 674 |
在正文中更改页面布局,\meta{键值列表} 为 \pkg*{geometry} 宏包通用接口的各种页面尺寸选项。 |
| 675 |
\command{restoregeometry} |
| 676 |
恢复正文开始时的页面布局。 |
| 677 |
\command{savegeometry}[\marg{布局名}] |
| 678 |
保存当前页面布局名为 \meta{布局名}。 |
| 679 |
\command{loadgeometry}[\marg{布局名}] |
| 680 |
载入保存的名为 \meta{布局名} 的页面布局。 |
| 681 |
\begin{ctexexam} |
| 682 |
L1 |
| 683 |
\newgeometry{left = 3cm,right = 1cm,bottom = 0.1cm} |
| 684 |
\savegeometry{L2} |
| 685 |
L2 (new, saved) |
| 686 |
\restoregeometry |
| 687 |
L1 (restored) |
| 688 |
\newgeometry{margin = 1cm,includefoot} |
| 689 |
L3 (new) |
| 690 |
\loadgeometry{L2} |
| 691 |
\fancyhfoffset{0pt} |
| 692 |
L2 (loaded) |
| 693 |
\end{ctexexam} |
| 694 |
\end{cnltxlist} |
| 695 |
\end{cnltxlist} |
| 696 |
|
| 697 |
\subsection[图表题注]{图表题注\smodule{cap}} |
| 698 |
\label{subsec:caption} |
| 699 |
模块 \module*{cap} 用于设置图表等浮动体的题注格式。题注主要由三部分组成:标题标签即图表名与题注编号的组合,标题文本本身通常是内容的简短描述,以及将文本与标签分开的题注分隔符。可以在导言区设置整体格式,也可以在正文使用局部更改格式。模块 \module*{cap} 由 \pkg*{caption} 宏包提供支持,接口选项与 \pkg*{caption} 宏包完全一致,但写法为 \meta{条目名}\code{/}\meta{选项}。\pkg*{caption} 宏包提供了多种方法来定制浮动环境(例如 \env{figure} 和 \env{table})中的题注,并可与许多其它宏包配合使用。功能包括旋转题注、侧向题注和连续题注等。下面列举几个题注选项的用法,\ref{exam:caption set} 中两种设置题注的方法是等效的,更多选项和创建方法可查看宏包文档: |
| 700 |
\begin{cnltxlist}[itemsep = 0ex] |
| 701 |
\keyval{table/labelsep}{标签分隔符}\nonl |
| 702 |
\keyval{figure/format}{题注格式}\nonl |
| 703 |
\keyval{lstlisting/font}{题注字体}\nonl |
| 704 |
\begin{ctexexam}[labelref = exam:caption set] |
| 705 |
\ctexset[cap] |
| 706 |
{ |
| 707 |
table/labelsep = space, |
| 708 |
figure/format = plain |
| 709 |
} |
| 710 |
\captionsetup[table]{labelsep = space} |
| 711 |
\captionsetup[figure]{format = plain} |
| 712 |
\end{ctexexam} |
| 713 |
\begin{cnltxlist} |
| 714 |
\command{RegisterCapOptions}[\marg{条目名列表}] |
| 715 |
给模块 \module*{cap} 注册题注类型为 \meta{条目名} 的 \pkg*{caption} 接口选项。已预注册 \module*{figure}、\module*{table} 和 \module*{lstlisting} 三种类型的题注选项。可以搭配 \pkg*{newfloat} 宏包创建更多类型的浮动环境并设置相应题注。 |
| 716 |
\end{cnltxlist} |
| 717 |
\command{caption}[\sarg\oarg{目录标题}\marg{标题}]\nonl |
| 718 |
\command{captionof}[\sarg\marg{条目名}\oarg{目录标题}\marg{标题}]\nonl |
| 719 |
\command{bicaption}[\sarg\oarg{目录中文标题}\marg{中文标题}\oarg{目录英文标题}\marg{英文标题}] |
| 720 |
题注命令 \cs{caption} 用于在图表上下方插入题注,需要在浮动环境 \env*{figure} 和 \env*{table} 中使用。在浮动环境外可以使用 \cs{captionof} 命令,第一个参数指定条目名。\cs{bicaption} 命令可以实现中英文双语题注,需要在导言区载入 \pkg*{bicaption} 宏包,具体用法见宏包文档。 |
| 721 |
\end{cnltxlist} |
| 722 |
|
| 723 |
\subsection[页眉页脚]{页眉页脚\smodule{hdr}} |
| 724 |
\label{subsec:header and footer} |
| 725 |
模块 \module*{hdr} 设置的命令由 \pkg*{fancyhdr} 宏包提供支持。标题标记由标签和标题组成,选项中参数 \code{\#1} 代表当前章、节或小节的标题。在 \cls*{book} 模式时使用标题标记选项 \option{chapter-mark} 和 \option{section-mark},在 \cls*{article} 模式时使用 \option{section-mark} 和 \option{subsection-mark} 选项,这与标准文档类的行为一致。重新设置标题标记选项时标记大小写选项 \option{uppercase} 会失效。 |
| 726 |
\begin{cnltxlist} |
| 727 |
\keyval{chapter-mark}{标题标记} |
| 728 |
\code{chapter} 级别标题标记的内容,包含了标签选项 \option{chapter-label} 和章标题 \code{\#1}。 |
| 729 |
\keyval{section-mark}{标题标记} |
| 730 |
\code{section} 级别标题标记的内容,包含了标签选项 \option{section-label} 和节标题 \code{\#1}。 |
| 731 |
\keyval{subsection-mark}{标题标记} |
| 732 |
\code{subsection} 级别标题标记的内容,包含了标签选项 \option{subsection-label} 和小节标题 \code{\#1}。 |
| 733 |
\kvsplit-{chapter-label}{\oarg{编号输出命令}\marg{距离命令}}\Default{\cs*{hspace}\Marg{1em}} |
| 734 |
\code{chapter} 级别标题标记的标签(标题有编号时)。比标题标记选项更常用,可选参数是对应章编号计数器值的输出命令,必选参数是标题标签与内容之间的距离命令: |
| 735 |
\begin{ctexexam} |
| 736 |
\ebhdrset |
| 737 |
{ |
| 738 |
chapter-label = [\thechapter]{\hspace{1em}}, |
| 739 |
section-mark = \CTEXifname{\CTEXthesection——}{}#1 |
| 740 |
} |
| 741 |
\end{ctexexam} |
| 742 |
\kvsplit-{section-label}{\oarg{编号输出命令}\marg{距离命令}}\Default{\cs*{hspace}\Marg{0.5em}} |
| 743 |
\code{section} 级别标题标记的标签,用法与 \option{chapter-label} 类似。 |
| 744 |
\kvsplit-{subsection-label}{\oarg{编号输出命令}\marg{距离命令}}\Default{\cs*{hspace}\Marg{0.5em}} |
| 745 |
\code{subsection} 级别标题标记的标签,用法与 \option{chapter-label} 类似。 |
| 746 |
\keyval{headrule}{横线命令} |
| 747 |
绘制页眉横线的选项,可以使用 \cs*{hrule} 或\ref{exam:markrule} 所述 \cs{markrule} 等画线命令来绘制横线。 |
| 748 |
\keyval{footrule}{横线命令} |
| 749 |
绘制页脚横线的选项,可以使用 \cs*{hrule} 或\ref{exam:markrule} 所述 \cs{markrule} 等画线命令来绘制横线。 |
| 750 |
\keyval{footnoterule}{横线命令} |
| 751 |
绘制脚注横线的选项,可以使用 \cs*{hrule} 或\ref{exam:markrule} 所述 \cs{markrule} 等画线命令来绘制横线。 |
| 752 |
\keyval{headrulewd}{刚性长度}\Default{0.5pt} |
| 753 |
页眉横线默认的粗细,使用 \option{headrule} 选项绘制横线后失效。 |
| 754 |
\keyval{footnoterulewd}{刚性长度}\Default{0.5pt} |
| 755 |
脚注横线默认的粗细,使用 \option{footnoterule} 选项绘制横线后失效。 |
| 756 |
\command{fancypagestyle}[\marg{风格名}\oarg{基础风格}\marg{风格定义}] |
| 757 |
定义名为 \meta{风格名} 的页面风格。\meta{风格定义} 中可包含设置页眉页脚不同位置格式的命令,如果为空则等于 \code{fancy} 风格。如果存在 \meta{基础风格},则在它的基础上进行定义。 |
| 758 |
\begin{ctexexam} |
| 759 |
\fancypagestyle{plain} |
| 760 |
{ |
| 761 |
\fancyhf{} |
| 762 |
\fancyfoot[C]{\textbf{--~\thepage~--}} |
| 763 |
\ebhdrset{headrule = {}} |
| 764 |
} |
| 765 |
\end{ctexexam} |
| 766 |
\command{pagestyle}[\marg{风格名}]\Default{fancy} |
| 767 |
设置 \meta{风格名} 为当前及之后页的页面风格。 |
| 768 |
\begin{cnltxlist}[itemsep = 0ex] |
| 769 |
\command{fancyhead}[\oarg{位置}\marg{内容}]\nonl |
| 770 |
\command{fancyfoot}[\oarg{位置}\marg{内容}] |
| 771 |
为了确保页面显示正确,使用 \cs{fancyhead} 和 \cs{fancyfoot} 等命令设置页眉页脚时需要在页边距的命令之后。默认设置的是一个名为 \code{fancy} 的页面风格。\pkg*{fancyhdr} 将页眉页脚分成了左中右和奇数页(odd)、偶数页(even)共12个部分,可选参数中 \code{E} 和 \code{O} 代表偶数和奇数,\code{L}、\code{C} 和 \code{R} 代表左、中和右部分。单面排版时,可选参数含有偶数位置的命令无效。 |
| 772 |
\end{cnltxlist} |
| 773 |
\begin{cnltxlist}[itemsep = 0ex] |
| 774 |
\command{markboth}[\marg{左页标题标记}\marg{右页标题标记}]\nonl |
| 775 |
\command{markright}[\marg{右页标题标记}]\nonl |
| 776 |
\command{markdouble}[\marg{双页标题标记}] |
| 777 |
这三个命令用于手动设置当前页标题标记,特殊情况下可以使用它们定义与标题不同的页眉页脚标记。其中 \cs{markdouble} 根据是否是双面排版设置相应标记,如果是单面排版,则 \meta{右页标题标记} 为空。标题标记选项 \meta{级别}\option*{-mark} 定义的是它们的参数,左右页标记规则已经进行了优化调整,若需更改可以重定义 \code{\textbackslash}\meta{级别}\cstext{mark} 命令。 |
| 778 |
\begin{ctexexam} |
| 779 |
\makeatletter |
| 780 |
\renewcommand{\sectionmark}[1]{\markright{\eb@mark@section@whole{#1}}} |
| 781 |
\makeatother |
| 782 |
\end{ctexexam} |
| 783 |
\end{cnltxlist} |
| 784 |
\command{markrule}[\oarg{长度}\darg{颜色名}\marg{高度}\oarg{深度}] |
| 785 |
实线命令 \cs{markrule} 既可在 \meta{横线命令} 中用于绘制页眉页脚横线,也可以在正文中使用。实线的 \meta{长度} 默认为版心的宽度,\meta{高度} 为线向上的粗细需要指定,\meta{深度} 为线向下的粗细默认为 \code{0pt}。它们均为刚性长度且可以为负值,支持数学表达式,通过控制 \meta{高度} 和 \meta{深度} 的正负值可以决定实线上下偏移量。下面举一个设置页眉内容的例子: |
| 786 |
\begin{ctexexam}[labelref = exam:markrule] |
| 787 |
\ebhdrset{headrule = \markrule(DarkOrchid){2pt + 1pt}[-2pt]} |
| 788 |
\fancyhead[ER]{\FirstMark{2e-left}} % 来自ltmarks的标记机制 |
| 789 |
\fancyhead[OL]{\rightmark} |
| 790 |
\fancyhead[EL,OR]{\textbf{\thepage}} |
| 791 |
\end{ctexexam} |
| 792 |
\end{cnltxlist} |
| 793 |
|
| 794 |
\subsection[脚注]{脚注\smodule{hdr}} |
| 795 |
模块 \module*{hdr} 还可以灵活调整脚注编号和内容的格式。格式主要包括脚注标记的编号类型、字体、附加符号和对齐方式等,以及脚注内容的首行缩进、行距和字体等。基本思想是提供常规(\code{fnnormal})和自定义(\code{fncustom})两种脚注标记,常规脚注标记又分为正文(\code{fnmark})和内容(\code{fntext})标记,默认情况下正文和内容标记编号类型分离但格式一致,自定义标记与常规标记格式分离。目前脚注模块基本兼容 \pkg*{footmisc} 宏包。 |
| 796 |
\begin{cnltxlist} |
| 797 |
\keychoice{footnotetype}{plain,\fbox{hang},flush,bottom} |
| 798 |
脚注的类型。悬挂缩进 \code{hang} 是默认值,\code{plain} 是原始的类型,\code{flush} 使脚注内容标记位于脚注首行边缘外侧并右对齐。当存在浮动环境排版时,脚注可能位于页面中间,\code{bottom} 使脚注始终位于页面底端。其中 \code{bottom} 是复合选项,可以与前三种类型重复或复合使用: |
| 799 |
\begin{ctexexam} |
| 800 |
\ebhdrset{footnotetype = plain,footnotetype = bottom} |
| 801 |
\ebhdrset{footnotetype = {hang,bottom}} |
| 802 |
\end{ctexexam} |
| 803 |
\command{PushFntBottom}\newtagv[Changed]{2025z}% |
| 804 |
默认情况下当具有 \code{b} 参数的底部浮动体与脚注同时存在时,脚注将位于浮动体上部。此命令可使脚注始终位于页面底部,与 \keyis{footnotetype}{bottom} 作用相同。\hologo{LaTeX} 在 \textbf{2025/06/01} 之后的版本中为脚注提供了套接字(socket)机制,此命令为过时命令,相当于分配插头 \code{floats-space-footnotes},且在早期版本中不再提供功能。设置底部浮动体与脚注排列方式的插座共有6种插头: |
| 805 |
\begin{ctexexam} |
| 806 |
\AssignSocketPlug{build/column/outputbox}{space-footnotes-floats} |
| 807 |
\AssignSocketPlug{build/column/outputbox}{floats-space-footnotes} |
| 808 |
\AssignSocketPlug{build/column/outputbox}{footnotes-space-floats} |
| 809 |
\AssignSocketPlug{build/column/outputbox}{space-floats-footnotes} |
| 810 |
\AssignSocketPlug{build/column/outputbox}{footnotes-floats} |
| 811 |
\AssignSocketPlug{build/column/outputbox}{floats-footnotes} |
| 812 |
\end{ctexexam} |
| 813 |
\keyval{fnfirstindent}{刚性长度}\Default{1em} |
| 814 |
每个脚注首段的首行缩进(悬挂缩进 \code{hang} 为整段缩进),等于长度 \cs{fnfirstindent} 的值。 |
| 815 |
\keyval{fnafterindent}{刚性长度}\Default{2em} |
| 816 |
每个脚注第二段及之后段落的首行缩进,等于长度 \cs{fnafterindent} 的值。 |
| 817 |
\keyval{fnparskip}{弹性长度}\Default{0ex plus .1ex} |
| 818 |
不同脚注自身的段落间距,脚注内容文本分段时生效,等于长度 \cs{fnparskip} 的值。 |
| 819 |
\keyval{footnotesep}{刚性长度} |
| 820 |
不同脚注之间的距离,默认情况下它自适应 \module*{space} 模块脚注行距选项 \option{fntspread} 的值。 |
| 821 |
\keychoice{fntext-pos}{normal,\fbox{super}} |
| 822 |
设置脚注内容标记的位置,正常文本或是上标形式。 |
| 823 |
\keychoice{fnmark-num}{\fbox{plain},pifont,pifont*,pisans,pisans*,\optpath*{short num}} |
| 824 |
脚注正文标记编号的类型。默认为原生样式 \code{plain},还可以改为 \code{pifont} 的各个版本,从左往右依次为普通版、阴文衬线版、阳文无衬线版和阴文无衬线版,缺点是它们的编号仅包括1-10。 |
| 825 |
|
| 826 |
短编号的参数与列表环境类似,有 \code{1}、\code{A}、\code{a}、\code{I} 和 \code{i},除此之外还增加了中文数字 \code{c} 和符号 \code{s} 格式。原生样式 \code{plain} 等同于单独使用数字 \code{1} 参数。这个选项可以用在正文中改变其后脚注编号类型。 |
| 827 |
\command{footref}[\marg{脚注标签名}] |
| 828 |
在当前位置对自动编号的脚注进行引用,与被引用的正文标记共享一个编号与格式。 |
| 829 |
\begin{ctexexam} |
| 830 |
\ebhdrset{fnmark-num = 1} % 等于编号类型plain |
| 831 |
\ebhdrset{fnmark-num = (a)} |
| 832 |
\end{ctexexam} |
| 833 |
\begin{cnltxlist}[itemsep = 0ex] |
| 834 |
\command{SetFntSymbsList}[\marg{符号表名}\marg{符号数量}\marg{符号列表}]\nonl |
| 835 |
\command{UseFntSymbsList}[\marg{符号表名}] |
| 836 |
这两个命令用于设置自定义符号型脚注短编号 \code{s} 的符号列表。\cs{SetFntSymbsList} 命令用于定义名为 \meta{符号表名} 的符号列表,\cs{UseFntSymbsList} 命令用于启用已定义的符号列表。预置了一个脚注符号列表 \code{fnsymbol},与 \hologo{LaTeX} 的数字转换命令 \cs{fnsymbol} 一致,只支持9个编号。注意使用符号型标记的脚注时计数器 \code{footnote} 的值仍然递增,以及定义新列表时 \meta{符号列表} 的写法和命令顺序: |
| 837 |
\begin{ctexexam} |
| 838 |
\SetFntSymbsList{fancy}{2}{{1}{*}{2}{\P}} |
| 839 |
\UseFntSymbsList{fancy} |
| 840 |
\ebhdrset{fnnormal-num = s} |
| 841 |
\end{ctexexam} |
| 842 |
\end{cnltxlist} |
| 843 |
\keychoice{fntext-num}{\fbox{plain},pifont,pifont*,pisans,pisans*,\optpath*{short num}} |
| 844 |
脚注内容标记编号的类型。用法与 \option{fnmark-num} 一样,所以脚注内容与正文标记编号类型\textbf{可以不同}。 |
| 845 |
\keychoice{fnnormal-num}{\fbox{plain},pifont,pifont*,pisans,pisans*,\optpath*{short num}} |
| 846 |
同时设定脚注正文标记编号 \option{fnmark-num} 与脚注内容标记编号 \option{fntext-num} 的类型。目前脚注编号类型选项对于迷你页环境 \env*{minipage} 无效,其中的脚注保持默认英文字母的编号类型。 |
| 847 |
\keychoice{fnmark-vmove}{\optpath*{fixed length},match}\Default{0pt} |
| 848 |
脚注正文标记的垂直偏移。可以设为刚性长度,或用 \code{match} 匹配 \option{spvmove} 全局的值。 |
| 849 |
\keychoice{fnmark-hmove}{\optpath*{fixed length},match}\Default{0pt} |
| 850 |
脚注正文标记的水平偏移。可以设为刚性长度,或用 \code{match} 匹配 \option{sphmove} 全局的值。 |
| 851 |
\keychoice{fntext-vmove}{\optpath*{fixed length},match}\Default{0pt} |
| 852 |
脚注内容标记的垂直偏移。可以设为刚性长度,或用 \code{match} 匹配 \option{spvmove} 全局的值。 |
| 853 |
\keychoice{fnnormal-format}{\optpath*{format code},match} |
| 854 |
常规脚注标记的格式,选项 \code{match} 可以匹配 \option{spcmd} 全局的值。一般配合 \keyis{fnnormal-num}{plain} 原生编号形式使用,例如用 \pkg*{circledtext} 宏包的带圈字符命令 \cs{circledtext} 给脚注标记添加圆圈: |
| 855 |
\begin{ctexexam} |
| 856 |
\usepackage{circledtext} |
| 857 |
\circledtextset{resize = real,width = 0.5em} |
| 858 |
\ebhdrset |
| 859 |
{ |
| 860 |
fntext-pos = normal, |
| 861 |
fnnormal-format = \circledtext |
| 862 |
} |
| 863 |
\end{ctexexam} |
| 864 |
\command{defupfntmark}[\marg{正文标记格式}] |
| 865 |
定义脚注正文标记的格式,与正文标记编号命令 \cs{theupfootnote} 配合使用。 |
| 866 |
\command{defdownfntmark}[\marg{内容标记格式}] |
| 867 |
定义脚注内容标记的格式,与内容标记编号命令 \cs{thedownfootnote} 配合使用。 |
| 868 |
\command{deffntpara}[\marg{段落文本格式}] |
| 869 |
定义脚注段落文本的格式的命令。脚注段落文本由脚注内容标记和文本两部分组成,段落格式定义中参数 \code{\#1} 代表内容文本。 |
| 870 |
\command{notminipage}[\marg{普通页内容}\marg{迷你页内容}] |
| 871 |
用于在定义脚注标记的命令中判断当前脚注是否处于迷你页而输出不同的内容。 |
| 872 |
\command{ifnormalfnt}[\marg{常规标记内容}\marg{自定义标记内容}]\newtagv{2024eo}% |
| 873 |
用于在定义脚注标记的命令中判断当前是否为常规标记而输出不同的内容。 |
| 874 |
\command{theupfootnote} |
| 875 |
保存正文标记编号类型选项 \option{fnmark-num} 指定的正文标记。 |
| 876 |
\command{thedownfootnote} |
| 877 |
保存内容标记编号类型选项 \option{fntext-num} 指定的内容标记。 |
| 878 |
\begin{ctexexam} |
| 879 |
\defupfntmark{\super[vmove = 2pt]{\theupfootnote}} |
| 880 |
\defdownfntmark{\notminipage{\textcolor{blue}{\thedownfootnote}}{}} |
| 881 |
\deffntpara{\makebox[2em][r]{\thefootnote}#1} |
| 882 |
\end{ctexexam} |
| 883 |
\keychoice{fncustom-format}{\optpath*{format code},match} |
| 884 |
单独设定自定义脚注标记的格式,选项 \code{match} 可以匹配 \option{spcmd} 全局的值。自定义脚注内容和正文标记的命令与用法可以见下方和\ref{exam:custom footnote markers} 的介绍。 |
| 885 |
\begin{cnltxlist}[itemsep = 0ex] |
| 886 |
\command{Footnote}[\oarg{内容标记}\marg{正文标记}\marg{脚注文本}]\nonl |
| 887 |
\command{Footnotetext}[\marg{内容标记}\marg{脚注文本}]\nonl |
| 888 |
\command{Footnotemark}[\marg{正文标记}] |
| 889 |
这些是自定义标记且不影响正常编号的脚注命令,用法与它们对应首字母小写的命令类似。\meta{内容标记} 默认与 \meta{正文标记} 一致,这也是最常见的情况,也可以定义为不同符号或格式。如果当前标记为空,那么将会使用上一个脚注标记。 |
| 890 |
\begin{ctexexam}[labelref = exam:custom footnote markers] |
| 891 |
\Footnote{*}{这是可以自定义标记的脚注。} |
| 892 |
\end{ctexexam} |
| 893 |
\end{cnltxlist} |
| 894 |
\keychoice{fnboth-format}{\optpath*{format code},match} |
| 895 |
同时设定常规脚注标记 \option{fnnormal-format} 和自定义脚注标记 \option{fncustom-format} 的格式。两种脚注标记匹配上标格式 \option{spcmd} 的值是独立的,使用 \code{match} 则可以同时匹配。会覆盖 \module*{font} 模块脚注字体选项 \option{footnote} 相同类型的命令,最后一个格式命令可以带有一个参数接受脚注标记。 |
| 896 |
\keyval{fnpara-format}{格式代码} |
| 897 |
脚注内容文本的格式。会覆盖 \module*{font} 模块脚注字体选项 \option{footnote} 相同类型的命令,最后一个格式命令可以带有一个参数接受脚注内容文本。 |
| 898 |
\kvsplit{fntext-code}{前代码,后代码} |
| 899 |
可以用 \meta{前代码} 与 \meta{后代码} 额外增加脚注内容标记前后的代码。也可以只有前部分,\meta{前代码} 中最后一个格式命令可以带有一个参数接受脚注内容标记。由于脚注标记处于水平模式,可以配合盒子命令设置脚注内容标记的对齐方式,或在标记与脚注首行间插入一点距离。 |
| 900 |
\begin{ctexexam} |
| 901 |
\ebhdrset |
| 902 |
{ |
| 903 |
footnotetype = hang, |
| 904 |
fntext-code = {\hspace{1em}\llap,\enskip} |
| 905 |
} |
| 906 |
\end{ctexexam} |
| 907 |
\end{cnltxlist} |
| 908 |
|
| 909 |
\subsection[目录]{目录\smodule{toc}} |
| 910 |
\label{subsec:contents} |
| 911 |
模块 \module*{toc} 将使用 \pkg*{titletoc} 宏包处理目录样式。默认包括 \module*{part}$\longrightarrow$\module*{subparagraph}、\module*{figure}、\module*{table} 和 \module*{lstlisting} 条目名的键路径。选项前带有\hface 符号表示支持所有相应\textbf{条目名}的路径,其它选项则处于 \module*{toc} 键路径下。目录选项均支持标题编号判定命令 \cs{CTEXifname}\footnote{此功能需要\textbf{2023/06/01}以后的 \hologo{LaTeX} 内核支持。}。目前支持多数学术论文目录样式,更复杂的样式可以查看 \pkg*{titletoc} 的相关用法。 |
| 912 |
\begin{cnltxlist} |
| 913 |
\keyval{tocformat}{条目格式}\dtag |
| 914 |
目录中各类型条目的格式。可以设置条目字体和加入垂直间距等,垂直间距最好使用防止垂直间距重合的 \cs*{addvspace} 命令。如果是段落型目录,格式代码仅在段落中当前级别条目前执行一次。也可以用 \cs{CTEXifname} 命令或 \option{tocformat*} 选项给有无编号的标题分别设置格式。 |
| 915 |
\keyval{tocformat+}{条目格式}\dtag |
| 916 |
与选项 \option{tocformat} 用法一样,只是在已有的格式命令后附加代码。 |
| 917 |
\keyval{tocformat*}{条目格式}\dtag |
| 918 |
没有编号/名字标题的附加格式代码。目录中判断标题是否有编号/名字的依据为:如果在 \option{tocline} 选项中使用了 \cs{numberline} 命令输出标签,则判定为有编号/名字。格式最后的命令可带有一个参数,用于接受标题内容。 |
| 919 |
\keyval{tocindent}{刚性长度}\dtag |
| 920 |
目录条目左边的缩进距离,通常标题级别越低缩进越大。如果是段落型目录,仅在当前条目级别为段落中最高时有效。 |
| 921 |
\keyval{tocrule}{引导线定义}\dtag\newtagv[Changed]{2024et}% |
| 922 |
目录条目引导线和页码的定义。其中引导线可以使用基于 \cs*{xleaders} 命令的 \cs{tocrule} 绘制(同时输出页码),参数 \code{\#1} 代表页码 \cs{thecontentspage}。如果是一般不需要引导线的段落型目录,则可以使用参数 \code{\#1} 输出页码。 |
| 923 |
\command{tocrule}[\sarg\harg\oarg{引导点间距}\darg{放大因子}\marg{引导点}\oarg{页码格式}] |
| 924 |
生成目录引导线的命令,需要在 \option{tocrule} 选项中使用。带有星号的命令与 \keyis{dotalign}{false} 效果相同。命令带 \harg{} 号参数不输出目录页码,此时无格式的页码被保存在 \option{tocrule} 选项的参数 \code{\#1} 中,可以配合盒子命令设置不同的页码左右间距和对齐方式。\meta{放大因子} 为 \meta{引导点} 的放大倍数。\meta{页码格式} 中最后一个命令可以带有一个参数用于接受页码。 |
| 925 |
\keyval{toclabel}{标题标签定义}\dtag\newtagv{2024as}% |
| 926 |
目录中各类型标题条目标签的定义,可与 \option{tocline} 选项联用设置标题。其中参数 \code{\#1} 代表标签的编号 \cs{thecontentslabel},参数 \code{\#2} 代表 \meta{条目名}。定义最后的命令可带有一个参数,用于接受标题内容,一些特殊情况例如需要将标题内容放在标签前,可以通过定义命令实现: |
| 927 |
\begin{ctexexam} |
| 928 |
\newcommand{\seqentry}[2]{#2-#1} % #2为标题内容 |
| 929 |
\ctexset{chapter/toclabel = \seqentry{#1}} |
| 930 |
\end{ctexexam} |
| 931 |
\command{hytoclink}[\marg{目录条目元素}]\newtagv{2024eb}% |
| 932 |
给目录条目元素增加超链接,主要用于 \option{toclabel} 选项中的标签。使用 \pkg*{titletoc} 宏包时标题条目的标签超链接会缺失,这个命令可修复此问题。 |
| 933 |
\keyval{tocafter}{距离命令}\dtag\Default{\cs*{hspace}\Marg{1em}} |
| 934 |
目录条目标签与标题间的代码,默认为插入 \code{1em} 横向距离。 |
| 935 |
\keyval{tocbelow}{距离命令}\dtag |
| 936 |
在目录条目下方执行的代码,可以插入垂直距离等命令。 |
| 937 |
\keyval{tocline}{标题定义}\dtag[\sface] |
| 938 |
这个选项在章节标题基础上扩展了浮动环境的题注标题在目录文件中的定义。章节和题注标题选项中参数 \code{\#1} 代表标题编号 \cs*{the}\meta{计数器} 对应的计数器名称,参数 \code{\#2} 则代表相应标题内容。 |
| 939 |
\begin{ctexexam} |
| 940 |
\ctexset |
| 941 |
{ |
| 942 |
chapter = |
| 943 |
{ |
| 944 |
tocformat = \CTEXifname{\addvspace{8pt}\large}{}, |
| 945 |
tocindent = \CTEXifname{2em}{1.5em}, |
| 946 |
tocrule = \tocrule[0.6pc](1.1){.}[\zihao{5}], |
| 947 |
tocline = \CTEXnumberline{#1}#2 |
| 948 |
}, |
| 949 |
section/toclabel = \contentspush{\hytoclink{#1}\hspace{0.5em}}, |
| 950 |
section/tocrule = \tocrule-{}\makebox[1cm]{\rlap{#1}}, |
| 951 |
toc/pagenumwd = 0pt |
| 952 |
} |
| 953 |
\end{ctexexam} |
| 954 |
\command{RegisterTocName}[\sarg\marg{条目名列表}]\newtagv[Changed]{2024bo}% |
| 955 |
给 \meta{条目名列表} 中的每个 \meta{条目名} 标题注册用于设置目录样式的选项,即选项前有符号\hface 表示需要注册后使用。前面提到的条目类型均已注册,新类型的条目注册后默认格式与图表条目相同。这个命令可以重复使用,会重置目录条目为默认格式。带有星号参数的命令使注册目录的条目形成一个段落,此时多出下面三个选项可用: |
| 956 |
\keyval{tocbegin}{开始代码}\dtag\newtagv{2024as}% |
| 957 |
当前级别目录条目第一个标题前的代码,仅在存在更高级别的条目时有效。 |
| 958 |
\keyval{tocsep}{中间代码}\dtag\Default{\Marg{.—}}\newtagv{2024as}% |
| 959 |
当前级别目录条目每个标题之间的代码。 |
| 960 |
\keyval{tocend}{结束代码}\dtag\Default{\Marg{.}}\newtagv{2024as}% |
| 961 |
当前级别目录条目最后一个标题后的代码。 |
| 962 |
\command{contentsuse}[\oarg{目录层次}\marg{条目名列表}\marg{扩展名}]\newtagv[Changed]{2024et}% |
| 963 |
激活条目类型为 \meta{条目名} 的目录定制功能,目录文件后缀为 \meta{扩展名},若 \meta{扩展名} 为 \code{toc} 则条目会自动激活。可选参数 \meta{目录层次} 为条目在目录中的层次深度,默认值为 \code{-1000},当它大于目录深度计数器 \code{tocdepth} 时不显示。图表等标题的目录条目无深度因此为默认值,章节标题 \module*{part}$\longrightarrow$\module*{subparagraph} 的深度则从 \code{-1} 到 \code{5} 依次递增。需要在激活条目后再使用命令 \cs{RegisterTocName} 注册选项。 |
| 964 |
\command{DeclareFloatList}[\marg{条目名}\marg{扩展名}] |
| 965 |
声明一种条目类型的目录命令 \cs*{listof}\meta{条目名}\cstext{s},并且支持\ref{subsec:directory command} 中图表目录命令的机制。使用这个命令要确保将条目加入目录的机制已经存在,例如搭配 \pkg*{newfloat} 宏包创建新的浮动环境。选项前有实心符号\sface(仍包含空心符号\hface 选项的性质)表示在声明后可用。下面举一个声明算法环境和对应题注目录的例子: |
| 966 |
\begin{ctexexam} |
| 967 |
\usepackage{newfloat} |
| 968 |
\DeclareFloatingEnvironment[ |
| 969 |
fileext = loa, |
| 970 |
listname = 算法清单, |
| 971 |
name = 算法 |
| 972 |
]{algorithm} |
| 973 |
\DeclareFloatList{algorithm}{loa} |
| 974 |
\begin{document} |
| 975 |
\listofalgorithms[multoc] % 在正文中输出双栏算法目录 |
| 976 |
\end{ctexexam} |
| 977 |
\command{AssignCaptionExt}[\marg{条目名列表}\marg{扩展名}] |
| 978 |
给条目类型名称为 \meta{条目名} 的标题分配目录文件 \meta{扩展名},注意 \meta{扩展名} 需要被定义在 \cs*{ext@}\meta{条目名} 命令中才有效(\pkg*{caption} 宏包的默认定义形式)。可以使不同的 \meta{条目名} 共享一个目录: |
| 979 |
\begin{ctexexam} |
| 980 |
\AssignCaptionExt{table}{lof} |
| 981 |
\newcommand{\listoffiguretables}{\listoffigures} % 同时输出图表目录的命令 |
| 982 |
\end{ctexexam} |
| 983 |
\command{AssignPartialExt}[\marg{扩展名1}\marg{扩展名2}]\newtagv{2024bk} |
| 984 |
给目录文件扩展名为 \meta{扩展名1} 的目录分配扩展名为 \meta{扩展名2} 的局部目录\footnote{此功能需要\textbf{2023/06/01}以后的 \hologo{LaTeX} 内核支持。},预注册的条目均无需再分配。用于搭配题注标题 \cs{caption} 命令和 \pkg*{titletoc} 宏包的局部题注目录命令。 |
| 985 |
\begin{ctexexam} |
| 986 |
\AssignPartialExt{loa}{pla} |
| 987 |
\startlist[fancy]{loa} |
| 988 |
\captionof{algorithm}{算法标题} |
| 989 |
\stoplist[fancy]{loa} |
| 990 |
\printlist[fancy]{loa}{}{} |
| 991 |
\end{ctexexam} |
| 992 |
\command{SetTocStyle}[\marg{条目名列表}\marg{风格名}\marg{键值列表}] |
| 993 |
定义条目类型名称为 \meta{风格名} 的目录风格。使用 \cs{ctexset} 命令设置目录样式时,除了标题条目定义选项 \option{tocline},其它选项只有在目录输出命令前设置才有效,定义完目录风格后用 \cs{UseTocStyle} 命令可以在正文中任意位置生效。如果是没有\hface 符号的选项,\meta{条目名} 设置为 \module*{toc}。 |
| 994 |
\command{UseTocStyle}[\marg{条目名列表}\marg{风格名}\marg{扩展名}] |
| 995 |
使用对应条目类型名称为 \meta{风格名} 的目录风格,随后标题在目录中的格式会改变。本命令导言区和正文区均可使用,第三个必选参数还需要指定标题条目加入目录文件的 \meta{扩展名}。此命令仅对涉及目录条目排版格式的选项有效。 |
| 996 |
\begin{ctexexam} |
| 997 |
\SetTocStyle{chapter}{fancy}{tocformat = \color{red}\zihao{3}} |
| 998 |
\UseTocStyle{chapter}{fancy}{toc} |
| 999 |
\end{ctexexam} |
| 1000 |
\command{listnumberline}[\marg{计数器名}] |
| 1001 |
在图表等浮动环境的题注目录中插入条目标签,默认标签的名字可以由格式命令 \cs{labelformat} 设置。其中 \meta{计数器名} 一般与 \meta{条目名} 相同,可以用参数 \code{\#1} 指定或用对应计数器名称显式指定。 |
| 1002 |
\begin{ctexexam} |
| 1003 |
\ctexset |
| 1004 |
{ |
| 1005 |
lstlisting/tocline = \listnumberline{#1}#2, |
| 1006 |
figure/tocline = \protect\numberline{图\thefigure\hspace{1em}}#2 |
| 1007 |
} |
| 1008 |
\end{ctexexam} |
| 1009 |
\command{RegisterCapIfname}[\sarg\oarg{文件名}\marg{扩展名列表}]\newtagv[Changed]{2025p}% |
| 1010 |
给 \pkg*{caption} 宏包支持的题注注册目录选项中 \cs{CTEXifname} 命令的编号判断功能,判断的依据是题注标签格式 \option{labelformat} 是否为空。使用星号参数可以避免重复注册。\meta{文件名} 为题注目录文件的名字,默认为 \code{\string\jobname}。 |
| 1011 |
\begin{ctexexam} |
| 1012 |
\RegisterCapIfname{loa} |
| 1013 |
\bgroup |
| 1014 |
\captionsetup{labelformat = empty} % 局部取消标签 |
| 1015 |
\captionof{algorithm}{算法标题1} |
| 1016 |
\egroup |
| 1017 |
\addtocounter{algorithm}{-1} % 恢复连续编号 |
| 1018 |
\captionof{algorithm}{算法标题2} |
| 1019 |
\end{ctexexam} |
| 1020 |
\command{contentsmargin}[\oarg{修正距离}\marg{右边距}] |
| 1021 |
设置目录中引导线到版心右边的距离,用于条目页码的精细调整。当设计条目页码对齐方式或数字较大时,可以设置适当的 \meta{右边距}。\meta{修正距离} 是在过长而换行的标题右侧 \meta{右边距} 基础上附加的距离。此命令可在导言区全局使用或在 \option{tocformat} 选项给特定条目类型单独使用。 |
| 1022 |
\keychoice{hang}{\fbox{true},false} |
| 1023 |
悬挂缩进选项 \option{hang} 使目录条目为悬挂缩进形式。缩进距离为条目标签及其与标题内容间距的长度和。通常情况下会统一设置标题条目是否悬挂缩进,因此这个选项被设计为对所有类型条目生效。 |
| 1024 |
\keyval{lolskip}{弹性长度}\Default{10pt} |
| 1025 |
代码目录中每章第一个条目上方增加的垂直距离。与 \CTeX 的表格和图片目录中每章间的条目距离选项 \option*{lotskip} 和 \option*{lofskip} 类似,在 \cls*{article} 模式中此选项失效。 |
| 1026 |
\keyval{between}{格式代码}\dtag[\sface] |
| 1027 |
目录标题与条目内容间的局部钩子(作用于标题下方间距之后),如果是 \cls*{book} 模式则默认插入 \code{-10pt} 垂直距离抵消首行目录的额外垂直间距,这是由于图表和 由 \pkg*{newfloat} 宏包所创建环境的目录默认每使用一次章标题在题注目录中插入 \code{10pt} 距离。除了条目名的键路径外,此选项也可用于 \module*{toc} 路径中,表示章节标题目录的标题代码钩子,如果是 \cls*{book} 模式则默认插入 \code{-1pc} 垂直距离。 |
| 1028 |
\keyval{bibetween}{格式代码} |
| 1029 |
与选项 \option{between} 类似,是英文章节标题目录(如果启用)的标题代码钩子。 |
| 1030 |
\keychoice{dotalign}{\fbox{true},false} |
| 1031 |
将目录页码装进一个右对齐的水平盒子里。这样可以使目录引导线右端对齐并与页码保持一定间距,否则会与页码相连。 |
| 1032 |
\keyval{pagenumwd}{刚性长度}\Default{1.55em} |
| 1033 |
设置开启 \option{dotalign} 选项时页码水平盒子的宽度。 |
| 1034 |
\keyval{tocafter-every}{距离命令}\Default{\cs*{hspace}\Marg{1em}} |
| 1035 |
统一设置所有类型条目编号与标题间的代码。 |
| 1036 |
\keyval{tocindent-every}{刚性长度} |
| 1037 |
统一设置所有类型条目的左边缩进。 |
| 1038 |
\keyval{tocrule-every}{引导线命令} |
| 1039 |
统一设置所有类型的目录引导线样式。 |
| 1040 |
\command{ExcludeEveryTocName}[\marg{条目名列表}]\newtagv{2024bn} |
| 1041 |
用于指定带有 \option*{every} 后缀选项排除的条目类型。 |
| 1042 |
\end{cnltxlist} |
| 1043 |
|
| 1044 |
\section{环境和命令} |
| 1045 |
|
| 1046 |
\subsection{封面和文区} |
| 1047 |
\begin{cnltxlist} |
| 1048 |
\command{maketitle}[\oarg{键值列表}]\newtagv{2024dh}% |
| 1049 |
重新改写了默认的封面标题命令,在保证原生风格的前提下使用 \pkg*{xtemplate} 宏包将封面抽象为由实例组成的模板。并为命令增加了可选参数,选项的含义与标准文档类一致: |
| 1050 |
\keyval{title}{文档标题} |
| 1051 |
设置文档的标题,可以包含格式命令。如果没有设置标题而输出封面会报错。 |
| 1052 |
\keyval{author}{文档作者} |
| 1053 |
设置文档的作者,可以包含格式命令。多位作者之间可以用 \cs*{and} 命令分隔,每个作者后可用 \cs*{thanks} 命令添加致谢脚注。 |
| 1054 |
\keyval{date}{文档日期}\Default{\cs*{today}} |
| 1055 |
设置文档的日期,可以包含格式命令。默认的文档日期为当前日期 \cs*{today}。 |
| 1056 |
\command{DeclareInstance}[\Marg{easybook}\marg{位置}\Marg{cover}\marg{键值列表}] |
| 1057 |
封面模板可用 \pkg*{xtemplate} 提供的实例声明命令进行自由定制,\ref{exam:cover instance} 举例说明了定制页面中部的内容。模板由页面上、中和下三个位置的实例组成,它们的 \meta{位置} 名字分别为 \code{top}、\code{middle} 和 \code{bottom}。每个实例的属性可用 \meta{键值列表} 修改,包含的选项如下: |
| 1058 |
\keyval{content}{实例内容} |
| 1059 |
设置实例内容,可以包含任何记号列表。通常为格式和排版内容的命令,作用范围为局部。 |
| 1060 |
\keyval{beforecode}{实例前代码} |
| 1061 |
设置实例内容前的代码,可以包含任何记号列表。通常为换页和垂直距离的命令。 |
| 1062 |
\keyval{aftercode}{实例后代码} |
| 1063 |
与 \option{before} 选项类似,设置实例内容后的代码。 |
| 1064 |
\keychoice{align}{l,\fbox{c},r,n} |
| 1065 |
设置实例内容的对齐方式,分别为左、中、右和自然对齐,自然对齐即正常的段落文本。 |
| 1066 |
\begin{ctexexam}[labelref = exam:cover instance] |
| 1067 |
\DeclareInstance{easybook}{middle}{cover} |
| 1068 |
{ |
| 1069 |
content = |
| 1070 |
{ |
| 1071 |
\thispagestyle{empty} |
| 1072 |
\begin{tblr} |
| 1073 |
{ |
| 1074 |
columns = c, |
| 1075 |
hline{2-4} = {2}{0.5pt,solid}, |
| 1076 |
column{1} = {rightsep = 0pt} |
| 1077 |
} |
| 1078 |
标题:& 一个文档标题 \\ |
| 1079 |
作者:& 张三 \\ |
| 1080 |
日期:& \today |
| 1081 |
\end{tblr} |
| 1082 |
}, |
| 1083 |
beforecode = \null\vspace{3cm}, |
| 1084 |
aftercode = \clearpage |
| 1085 |
} |
| 1086 |
\end{ctexexam} |
| 1087 |
\command{frontmatter}[\sarg\oarg{编号格式}]\Default{Roman} |
| 1088 |
前言区命令。使部分和章标题不编号。带有星号参数不使用清双页命令 \cs{cleardoublepage},但在双面排版时可能产生连续的奇数页。页码 \meta{编号格式} 可设置为 \code{arabic}、\code{Alph}、\code{alph}、\code{Roman}、\code{roman} 和 \code{chinese} 形式。 |
| 1089 |
\command{mainmatter}[\sarg] |
| 1090 |
主文区命令。章标题正常编号且页码为从1开始计数的阿拉伯数字。带有星号参数不使用清双页命令 \cs{cleardoublepage},但在双面排版时可能产生连续的奇数页。 |
| 1091 |
\command{backmatter} |
| 1092 |
后记区命令。页码格式与编号保持不变,章标题不编号。 |
| 1093 |
\command{cleardoublepage}[\oarg{页面风格}]\Default{empty} |
| 1094 |
在 \option{twoside} 双面排版时,清双页命令可以确保下一页文本总在奇数页开始,在奇数页使用它会产生空白偶数页。文区命令 \cs{frontmatter} 和 \cs{mainmatter} 会用到清双页命令,在启用文类选项 \option*{openright} 时标题命令 \cs*{part} 和 \cs*{chapter} 也会默认用到清双页命令。 |
| 1095 |
\command{blankpagestyle}[\marg{页面风格}] |
| 1096 |
多出空白页的 \meta{页面风格} 用空白页面风格命令 \cs{blankpagestyle} 全局指定,或使用清双页命令的可选参数局部指定。空白页默认的风格为 \code{empty},即空的页眉页脚。 |
| 1097 |
\end{cnltxlist} |
| 1098 |
|
| 1099 |
\subsection{目录命令} |
| 1100 |
\label{subsec:directory command} |
| 1101 |
\easybook{} 改进了标准文档类中定制性较低的章节标题和图表标题目录命令。现在目录命令带有可选参数用于设置标题格式和栏数等,并且与标准文档类不同的是目录命令可在正文中\textbf{重复}使用\footnote{此功能需要\textbf{2023/06/01}以后的 \hologo{LaTeX} 内核支持。}。更多目录命令的创建和样式设置可参考\ref{subsec:contents}。 |
| 1102 |
\begin{cnltxlist} |
| 1103 |
\command{tableofcontents}[\sarg\oarg{键值列表}\darg{代码钩子}] |
| 1104 |
章节标题目录命令,支持中英文双语标题目录输出。带有星号参数不输出目录条目上方的标题。\meta{代码钩子} 是当输出方案 \keyis{plan}{both} 时中文与英文目录之间执行的代码,可以插入设置目录样式和换页等命令。 |
| 1105 |
\keychoice{plan}{\fbox{cn},bi,both} |
| 1106 |
章节标题目录的输出方案。\code{cn} 只输出中文目录,\code{bi} 只输出英文目录。\code{both} 同时连续输出中文和英文目录,可以与标题命令选项 \option{level} 和双语标题选项 \option{title} 配合使用。 |
| 1107 |
\keyval{bicontentsname}{英文目录标题}\Default{Contents} |
| 1108 |
英文目录的标题,为通用接口命令 \cs{ctexset} 的选项。 |
| 1109 |
\command{listoffigures}[\sarg\oarg{键值列表}] |
| 1110 |
输出图片目录命令。带有星号参数的命令不输出目录标题。 |
| 1111 |
\command{listoftables}[\sarg\oarg{键值列表}] |
| 1112 |
输出表格目录命令。带有星号参数的命令不输出目录标题。 |
| 1113 |
\command{listoflstlistings}[\sarg\oarg{键值列表}] |
| 1114 |
输出代码目录命令。带有星号参数的命令不输出目录标题。 |
| 1115 |
|
| 1116 |
如果需要局部而不是全文范围的目录或其它类型的目录,可以查看\ref{subsec:contents} 和 \pkg*{titletoc} 宏包的相关示例。如果需要双语图表目录,可以查看 \pkg*{bicaption} 宏包的相关示例。上面目录命令的可选参数改进了原本单一的功能,也提供了配置命令 \cs{SetTocOuter} 在目录命令外设置选项默认值。 |
| 1117 |
\command{SetTocOuter}[\oarg{扩展名}\marg{键值列表}]\newtagv[Changed]{2025b}% |
| 1118 |
设置上述不同类型目录可选参数的默认值。若不指定目录文件的 \meta{扩展名},则除了 \option{title} 和章节标题目录的 \option{level} 选项外对所有目录生效。对于索引和参考文献列表 \meta{扩展名} 分别为 \code{idx} 和 \code{bbl}。必选参数中的 \meta{键值列表} 选项如下: |
| 1119 |
\keyval{level}{标题命令} |
| 1120 |
设定输出目录标题的命令。如果使用 \option{title} 选项设置了双语标题则需要配合双语标题命令。 |
| 1121 |
\begin{ctexexam} |
| 1122 |
\tableofcontents[level = \chapter*] |
| 1123 |
\listoffigures[level = \bichapter,title = {图片索引,List of Figures}] |
| 1124 |
\end{ctexexam} |
| 1125 |
\opt{chapter} |
| 1126 |
设置目录标题级别为 \code{chapter},与 \keyis{level}{\cs{bichapter}*} 等效。 |
| 1127 |
\opt{section} |
| 1128 |
设置目录标题级别为 \code{section},与 \keyis{level}{\cs{bisection}*} 等效。 |
| 1129 |
\opt{none} |
| 1130 |
不输出目录标题,与带星号参数的目录命令等效。 |
| 1131 |
\keyval{multoc}{整数}\Default{2} |
| 1132 |
设置目录的排版栏数。\meta{整数} 代表目录栏数,不指定栏数的值则默认为双栏。 |
| 1133 |
\kvsplit{title}{中文目录标题,英文目录标题} |
| 1134 |
用于更改目录的双语标题。标题之间用一个英文逗号分开,对章节标题目录来说前部分为中文目录标题,后部分为英文目录标题,对图表和代码目录来说后部分则是加入英文目录的条目。也可以只有一部分,表示中文目录的标题。 |
| 1135 |
\keychoice{bilist}{mix,\fbox{new}} |
| 1136 |
确定章节标题目录中双语标题条目的输出排列方式。选项 \code{mix} 使每个英文标题条目在中文目录中跟随对应的中文标题输出,\code{new} 则在新建的英文目录中输出英文标题,此新目录的扩展名为 \code{tec}。这是个全局选项,在所有目录的可选参数中使用均可生效,但推荐在章节标题目录中使用。 |
| 1137 |
\command{ebifbitoc}[\marg{英文目录代码}\marg{中文目录代码}] |
| 1138 |
启用混合双语目录条目即 \keyis{bilist}{mix} 时,在设置目录样式时可以配合 \cs{ebifbitoc} 命令判断当前条目是否为英文,从而输出不同的代码。 |
| 1139 |
\begin{ctexexam} |
| 1140 |
\SetTocStyle{section}{fancy} |
| 1141 |
{ |
| 1142 |
tocformat = \ebifbitoc{\color{red}}{\small}, |
| 1143 |
tocindent = \ebifbitoc{1em}{2em} |
| 1144 |
} |
| 1145 |
\UseTocStyle{section}{fancy}{toc} |
| 1146 |
\tableofcontents[bilist = mix] |
| 1147 |
\end{ctexexam} |
| 1148 |
|
| 1149 |
除了上述选项还支持 \CTeX 键值列表所有路径的章节标题样式选项,下面仅列举几个选项例子。需要注意的是标题样式选项根据 \option{level} 选项中的\textbf{最后}一个标题命令判断键路径,所以这个标题命令名必须存在于 \CTeX 键值列表路径中,或带有 \cstext{bi} 前缀表示双语标题。 |
| 1150 |
\keyval{format}{目录标题格式} |
| 1151 |
设置目录标题的格式。 |
| 1152 |
\begin{ctexexam} |
| 1153 |
\tableofcontents[ |
| 1154 |
level = \clearpage\bisection*, |
| 1155 |
format = \centering\sffamily\Large |
| 1156 |
] |
| 1157 |
\end{ctexexam} |
| 1158 |
\keyval{aftername}{标签后代码} |
| 1159 |
目录标题的标签与内容之间插入的代码。 |
| 1160 |
\keyval{aftertitle}{标题后代码} |
| 1161 |
目录标题内容之后插入的代码。 |
| 1162 |
\keyval{break}{格式命令} |
| 1163 |
控制章节标题与之前正文的分隔关系。一般用于设置是否在标题之前分页或者设置行间罚点。 |
| 1164 |
\keyval{pagestyle}{页面风格}\Default{empty} |
| 1165 |
目录标题所在页的页面格式,仅当目录以 \code{chapter} 级别输出时有效。 |
| 1166 |
\end{cnltxlist} |
| 1167 |
|
| 1168 |
\subsection{双语章节标题和新建标题} |
| 1169 |
双语目录标题命令将中文标题正常输出,并使中英文标题加入双语目录。目前设置了常用的三个级别,这个功能是为国内一些高校的学位论文模板的要求设计。类似于标准文档类,这三个标题命令分别具有独立的计数器\footnote{默认情况下与普通标题命令共享使用计数器。},并对应 \cs*{the}\meta{计数器} 的值,可以用于 \option{number} 选项更改英文目录中标题的编号格式。 |
| 1170 |
\begin{cnltxlist} |
| 1171 |
\command{bichapter}[\sarg\oarg{目录中文标题}\marg{中文标题}\marg{目录英文标题}] |
| 1172 |
\code{chapter} 章级别的双语目录标题命令,具有独立的 \code{bichapter} 计数器。 |
| 1173 |
\command{bisection}[\sarg\oarg{目录中文标题}\marg{中文标题}\marg{目录英文标题}] |
| 1174 |
\code{section} 节级别的双语目录标题命令,具有独立的 \code{bisection} 计数器。 |
| 1175 |
\command{bisubsection}[\sarg\oarg{目录中文标题}\marg{中文标题}\marg{目录英文标题}] |
| 1176 |
\code{subsection} 小节级别的双语目录标题命令,具有独立的 \code{bisubsection} 计数器。 |
| 1177 |
|
| 1178 |
命令的星号参数使正文中的标题不编号,但是仍然加入双语目录,若英文标题为空那么仅加入中文目录,这一特点与 \cs*{chapter}\sarg{} 等命令的行为不太一样,在一些情况下会用到。可选参数是目录中的中文条目,默认与中文标题一致,正文标题过长时可用它设置在目录中显示的标题。默认情况下双语目录条目的格式是一致的,共享使用 \module*{toc} 模块的设置。提供了两个选项 \option{biname} 和 \option{binumber} 修改英文目录章标题条目的名字及编号: |
| 1179 |
\optpath{chapter/}\kvsplit+{biname}{英文目录前名字,英文目录后名字}\Default{Chapter\cs*{space}} |
| 1180 |
更改英文目录 \code{chapter} 级别的标题条目编号前后名字,类似于 \CTeX 的 \option*{name} 选项。 |
| 1181 |
\optpath{chapter/}\key{binumber}{英文目录编号输出命令}\Default{\cs*{arabic}\Marg{chapter}} |
| 1182 |
更改英文目录 \code{chapter} 级别的标题条目编号输出格式,类似于 \CTeX 的 \option*{number} 选项。下面两种设置英文目录中章标题编号的方式等效: |
| 1183 |
\begin{ctexexam} |
| 1184 |
\ctexset{chapter/binumber = \arabic{chapter}} |
| 1185 |
\BeforeAddtoBitoc{\ctexset{chapter/nmuber = \arabic{chapter}}} |
| 1186 |
\end{ctexexam} |
| 1187 |
\command{appendix}[\splitoarg{前名字,后名字}\darg{编号输出命令}] |
| 1188 |
附录起始命令,其后的章节标题变为附录形式。\meta{前名字} 和 \meta{后名字} 分别为英文目录中附录标题条目的前和后名字,前后名字之间用一个半角逗号分开,也可以只有一部分,表示英文目录中附录标题前名字。\meta{编号输出命令} 为附录标题计数器在英文目录中的编号命令。注意这两个参数仅对 \code{chapter} 级别的标题生效。 |
| 1189 |
\command{BeforeAddtoBitoc}[\sarg\marg{格式代码}] |
| 1190 |
英文目录中标题条目的格式钩子,\meta{格式代码} 在英文标题加入目录前执行,作用范围为局部。可以插入设置标题名字或编号等命令临时改变英文目录中条目的格式,带有星号参数的命令会重置之前的代码。这个命令设置英文目录中标题条目的格式具有最高优先级,放置在导言区或 \cs{bichapter} 等双语标题命令前生效。举一个在英文目录节标题条目编号前添加 \code{Section} 字符串的例子: |
| 1191 |
\begin{ctexexam} |
| 1192 |
\BeforeAddtoBitoc{\ctexset{section/name = Section\space}} |
| 1193 |
\bisection{中文标题}{English title} |
| 1194 |
\end{ctexexam} |
| 1195 |
\command{RegisterBititle}[\marg{条目名列表}] |
| 1196 |
根据已有章节标题命令注册一个双语标题命令 \cs*{bi}\meta{条目名}。\meta{条目名} 应当是 \module*{part}$\longrightarrow$\module*{subparagraph} 等已经存在的标题命令名,或是用 \cs{NewTitleCommand} 创建的标题命令名。 |
| 1197 |
\command{NewTitleCommand}[\oarg{基础标题}\marg{条目名}\marg{章节层次}]\newtagv{2024aw}% |
| 1198 |
新创建一个名为 \meta{条目名} 的章节标题命令,支持 \CTeX 中的标题样式选项机制。指定可选参数后标题格式除了编号/名字会与 \meta{基础标题} 相同,否则默认为空。同时创建一个名为 \meta{条目名} 的计数器和标记命令 \code{\textbackslash}\meta{条目名}\cstext{mark}。同时还需指定标题的 \meta{章节层次},例如标准文档类中 \code{chapter} 级别为 \code{0}。 |
| 1199 |
\command{NewTitleEntryCommand}[\oarg{扩展名}\marg{条目名}]\newtagv{2024aw}% |
| 1200 |
创建一个命令 \code{\textbackslash}\meta{条目名}\cstext{entry}\marg{标题},仅将 \meta{标题} 加入文件扩展名为 \meta{扩展名} 的目录中,而不在正文中输出标题,默认扩展名为 \code{toc}。 |
| 1201 |
\begin{ctexexam} |
| 1202 |
\NewTitleCommand[chapter]{lchapter}{0} |
| 1203 |
\NewTitleEntryCommand{lchapter} |
| 1204 |
\contentsuse[0]{lchapter}{toc} |
| 1205 |
\RegisterTocName{lchapter} |
| 1206 |
\ctexset |
| 1207 |
{ |
| 1208 |
lchapter/runin = true, |
| 1209 |
lchapter/number = \thelchapter |
| 1210 |
} |
| 1211 |
\lchapter{正常标题} |
| 1212 |
\lchapterentry{加入目录的标题} |
| 1213 |
\end{ctexexam} |
| 1214 |
\command{CopyTitleFormat}[\marg{条目名1}\marg{条目名2}]\newtagv{2024cq}% |
| 1215 |
将名为 \meta{条目名2} 的章节标题命令除了编号/名字外的格式复制给名为 \meta{条目名1} 的标题命令。 |
| 1216 |
\begin{ctexexam} |
| 1217 |
\ctexset{section/format = \sffamily\color{blue}} |
| 1218 |
\CopyTitleFormat{subsection}{section} |
| 1219 |
\end{ctexexam} |
| 1220 |
\end{cnltxlist} |
| 1221 |
|
| 1222 |
\subsection[上标和下标]{上标和下标} |
| 1223 |
上标和下标的功能来自 \pkg*{spbmark} 宏包,可以使用键值列表的形式对上下标格式进行局部设置或用 \cs{spbset} 命令全局设置。所有选项也支持用 \module{tools} 模块设置,更多选项可见宏包文档。 |
| 1224 |
\begin{cnltxlist} |
| 1225 |
\command{super}[\sarg\oarg{键值列表1}\marg{内容}\oarg{键值列表2}] |
| 1226 |
输出上标的命令,可用于文本和数学模式,在数学模式中可代替 \code{\^{}} 符号和 \cs*{sp} 命令。命令中两个可选参数的键值列表等效。 |
| 1227 |
\command{sub}[\sarg\oarg{键值列表1}\marg{内容}\oarg{键值列表2}] |
| 1228 |
输出下标的命令,可用于文本和数学模式,在数学模式中可代替 \code{\_{}} 符号和 \cs*{sb} 命令。命令中两个可选参数的键值列表等效。 |
| 1229 |
\command{supersub}[\sarg\oarg{键值列表1}\marg{上标内容}\marg{下标内容}\oarg{键值列表2}] |
| 1230 |
同时输出上标和下标的命令,与简短命令 \cs{spb} 等效。命令中两个可选参数的键值列表等效。 |
| 1231 |
\command{spbifmath}[\marg{数学模式代码}\marg{文本模式代码}] |
| 1232 |
根据上下标处于数学还是文本模式分别设置不同的值,应当在格式命令或偏移距离选项中使用。 |
| 1233 |
|
| 1234 |
上下标命令的可选参数中部分共同的选项如下所示。当下面的选项用 \module*{tools} 模块全局设置时,三个上下标命令对应的标记将被同时设定。 |
| 1235 |
\keyval{vmove}{刚性长度}\Default{0pt} |
| 1236 |
上标或下标的垂直偏移。如果是上下标命令使用则代表上标和上标间的额外垂直距离 \option{vsep}。 |
| 1237 |
\keyval{hmove}{刚性长度}\Default{0pt} |
| 1238 |
上标或下标的水平偏移。如果是上下标命令使用则代表上标和上标的共同偏移。 |
| 1239 |
\keyval{cmd}{格式命令} |
| 1240 |
上标或下标的格式命令选项。最后一个命令可以带有一个参数,这个参数用于接受上标或下标。下面两种设置方式是等效的: |
| 1241 |
\begin{ctexexam} |
| 1242 |
\spbset{spcmd = \color{red}} |
| 1243 |
\ctexset[tools]{spcmd = \color{red}} |
| 1244 |
\end{ctexexam} |
| 1245 |
\keyval{height}{刚性长度} |
| 1246 |
段落中当前行上标或下标的基线与前一行的间距。 |
| 1247 |
\keyval{depth}{刚性长度} |
| 1248 |
段落中当前行上标或下标的基线与下一行的间距。 |
| 1249 |
\keychoice{mode}{text,math,\fbox{match}} |
| 1250 |
上标或下标的输出格式。可以为文本 \code{text} 或数学 \code{math} 模式。当使用选项 \code{match} 时可以根据当前段落所处的模式自动匹配。 |
| 1251 |
\end{cnltxlist} |
| 1252 |
|
| 1253 |
\subsection{公式} |
| 1254 |
\begin{cnltxlist}[itemsep = 0ex] |
| 1255 |
\environment{equation}\nonl |
| 1256 |
\environment{multline}\nonl |
| 1257 |
\environment{gather}\nonl |
| 1258 |
\environment{align} |
| 1259 |
\pkg*{amsmath} 宏包提供了一系列行间数学环境,它们可以排布各种对齐或不对齐的公式组。\env{multline} 环境用于一行无法放下的长公式,\env{gather} 环境用于每行居中的公式组,\env{align} 环境用于多列对齐的公式组。还有例如 \pkg*{mathtools} 等对数学功能进行扩展的宏包,提供了更全面的数学命令与环境。 |
| 1260 |
\end{cnltxlist} |
| 1261 |
|
| 1262 |
\subsection{表格} |
| 1263 |
\begin{cnltxlist}[itemsep = 0ex] |
| 1264 |
\environment{tabular}[\marg{列格式}]\nonl |
| 1265 |
\environment{tblr}[\marg{键值列表}] |
| 1266 |
\pkg*{tabularray} 是一个强大且全面的表格宏包,不依赖其它表格宏包所以同时使用不会产生冲突。不仅提供了各种传统表格宏包的功能,还实现了用键值列表方式简便地设置表格样式。具体用法可见宏包的说明文档,下面演示一个 \env{tblr} 表格的用法: |
| 1267 |
\begin{ctexexam} |
| 1268 |
\begin{tblr} |
| 1269 |
{ |
| 1270 |
colspec = {X[2,l]XX[LimeGreen]X}, |
| 1271 |
rowspec = {Q[t]Q[m]Q[b,Magenta]Q[t]Q[m]Q[b]}, |
| 1272 |
hline{1,6} = {1pt,solid}, |
| 1273 |
hline{3-5} = {LightBlue,dashed}, |
| 1274 |
vline{1,5} = {3-4}{dotted}, |
| 1275 |
rows = {1cm,abovesep = 2pt}, |
| 1276 |
column{1} = {font = \sffamily,mode = math} |
| 1277 |
} |
| 1278 |
Alpha & Beta & Gamma & Delta \\ |
| 1279 |
Epsilon & Zeta & Eta & Theta \\ |
| 1280 |
Iota & Kappa & \SetCell[r = 2]{h,c,Cyan}Lambda & Mu \\ |
| 1281 |
Nu & Xi & Omicron & Pi \\ |
| 1282 |
Rho & Sigma & Tau & Upsilon |
| 1283 |
\end{tblr} |
| 1284 |
\end{ctexexam} |
| 1285 |
\end{cnltxlist} |
| 1286 |
|
| 1287 |
\subsection{列表} |
| 1288 |
列表宏包 \pkg*{enumitem} 为系统预置的三个列表环境提供了灵活的标签以及间距控制。 |
| 1289 |
\begin{cnltxlist} |
| 1290 |
\command{setlist}[\sarg\splitoarg{列表类型,级别}\marg{键值列表}] |
| 1291 |
设置列表环境的通用接口命令。带有星号参数的命令在原有格式上补充。\meta{列表类型} 是排序列表 \code{enumerate}、常规列表 \code{itemize} 和主题列表 \code{description} 三个基本类型,也可以是 \cs{newlist} 新建的定理环境,若不指定则设置所有列表类型的格式。若不指定 \meta{级别} 则设置所有列表级别的格式。 |
| 1292 |
\command{newlist}[\marg{列表名}\marg{列表类型}\marg{最大级别}] |
| 1293 |
克隆基本的 \meta{列表类型} 在其基础上新建一个名为 \meta{列表名} 的列表环境。不要将 \meta{最大级别} 设置过大以避免创建过多的计数器和相关宏。 |
| 1294 |
\begin{ctexexam} |
| 1295 |
\setlist{} % 清除所有列表共享的格式 |
| 1296 |
\setlist[1]{labelindent = \parindent} |
| 1297 |
\setlist[itemize,1]{label = $\triangleleft$} |
| 1298 |
\setlist[enumerate]{labelsep = *,leftmargin = 1.5pc} |
| 1299 |
\newlist{steps}{enumerate}{2} |
| 1300 |
\setlist[steps,1,2]{label = (\alph*)} |
| 1301 |
\end{ctexexam} |
| 1302 |
\end{cnltxlist} |
| 1303 |
|
| 1304 |
\begin{cnltxlist}[itemsep = 0ex] |
| 1305 |
\environment{enumerate}[\oarg{键值列表}]\nonl |
| 1306 |
\environment{itemize}[\oarg{键值列表}]\nonl |
| 1307 |
\environment{description}[\oarg{键值列表}] |
| 1308 |
已为三种列表各自预置了三个级别。同种列表或不同种列表间的不同级别可相互嵌套,可以使用短编号的形式,带有星号的环境为行内列表。默认列表标签与标准文档类一致,下面举几个更改列表标签以及其它格式的例子: |
| 1309 |
\begin{ctexexam} |
| 1310 |
\setlist*{wide = 0pt} % 取消所有列表的左边距 |
| 1311 |
\begin{enumerate}[label = (\arabic*),leftmargin = 1cm,resume] |
| 1312 |
\begin{enumerate*}[(1)] % 短编号形式 |
| 1313 |
\begin{itemize}[label = \textbullet,labelsep = *] |
| 1314 |
\begin{description}[font = \sffamily\bfseries,style = nextline] |
| 1315 |
\end{ctexexam} |
| 1316 |
\end{cnltxlist} |
| 1317 |
|
| 1318 |
\subsection{悬挂缩进} |
| 1319 |
\begin{cnltxlist} |
| 1320 |
\command{hangpara}[\marg{缩进长度}\marg{缩进开始行数}] |
| 1321 |
悬挂缩进命令 \cs{hangpara} 使其后的一个段落保持悬挂缩进。参数与 \env{hangparas} 环境相同,不过只有一个段落。\meta{缩进长度} 可以是带单位的数值或由文本长度测定命令 \cs{widthof} 提供。 |
| 1322 |
\command{hangfrom}[\sarg\oarg{缩进长度}\marg{悬挂内容}\oarg{缩进开始行数}] |
| 1323 |
指定首行的 \meta{悬挂内容},其后一个段落保持悬挂缩进。\meta{缩进长度} 默认为 \meta{悬挂内容} 文本长度 \cs{hangwd} 的值,支持数学表达式。\meta{缩进开始行数} 默认为 \code{1}。如果是带有星号参数的命令,则首行不输出 \meta{悬挂内容},以等于 \meta{缩进长度} 长度的空白代替。 |
| 1324 |
\begin{ctexexam} |
| 1325 |
\hangfrom[\hangwd + 1em]{悬挂标签\hspace{0.5em}}[1] |
| 1326 |
\hangfrom*[3em]{} |
| 1327 |
\ctexset[section] % 与\ctexset{section/hang = true}等效 |
| 1328 |
{ |
| 1329 |
hang = false, |
| 1330 |
nameformat+ = \hangfrom[\hangwd + 0.5em] |
| 1331 |
} |
| 1332 |
\end{ctexexam} |
| 1333 |
\environment{hangparas}[\marg{缩进长度}\marg{缩进开始行数}] |
| 1334 |
悬挂缩进环境 \env{hangparas} 有两个必选参数,使其中的段落均保持悬挂缩进。每个段落的缩进将以 \meta{缩进长度} 从 \meta{缩进开始行数} 开始。 |
| 1335 |
\end{cnltxlist} |
| 1336 |
|
| 1337 |
\subsection{计数器} |
| 1338 |
\begin{cnltxlist}[itemsep = 0ex] |
| 1339 |
\command{newcounter}[\marg{计数器}\oarg{父计数器}]\nonl |
| 1340 |
\command{renewcounter}[\marg{计数器}\oarg{父计数器}]\nonl |
| 1341 |
\command{providecounter}[\marg{计数器}\oarg{父计数器}]\nonl |
| 1342 |
\command{declarecounter}[\marg{计数器}\oarg{父计数器}]\newtagv[Changed]{2024eu}% |
| 1343 |
创建一个初始值为0的计数器,若指定 \meta{父计数器} 则将它加入 \meta{父计数器} 的递增归零清单。不同命令前缀之间的区别是若计数器已存在 \cstext{new} 会报错,若计数器不存在 \cstext{renew} 会报错,若计数器不存在 \cstext{provide} 才会创建计数器,无论计数器是否存在 \cstext{declare} 均会强制创建。需要注意的是,重复创建计数器时已存在的计数器绑定关系并不会重置。 |
| 1344 |
\end{cnltxlist} |
| 1345 |
\begin{cnltxlist} |
| 1346 |
\command{setcounter}[\marg{计数器}\marg{整数}] |
| 1347 |
将计数器的值设定为指定值。 |
| 1348 |
\command{stepcounter}[\marg{计数器}] |
| 1349 |
使计数器的值递增1,同时它的递增归零清单中的子计数器值归零。 |
| 1350 |
\command{addtocounter}[\marg{计数器}\marg{整数}] |
| 1351 |
将计数器与 \meta{整数} 的值相加,再将其和赋予计数器。 |
| 1352 |
\command{counterwithin}[\sarg\oarg{格式}\marg{计数器}\oarg{连字符}\marg{父计数器}] |
| 1353 |
对计数器进行绑定的命令。将 \meta{计数器} 绑定于 \meta{父计数器},即 \meta{父计数器} 的值递增时 \meta{计数器} 的值会归零。输出格式 \cs*{the}\meta{计数器} 被定义为 \cs*{the}\meta{父计数器}\meta{连字符}\meta{格式}\marg{计数器}。\meta{格式} 一般为更改计数器编号形式的命令,默认为 \cs*{arabic}。带有星号参数的命令仅进行绑定不更改输出格式。 |
| 1354 |
\command{counterwithout}[\sarg\oarg{格式}\marg{计数器}\marg{父计数器}] |
| 1355 |
对计数器关系进行解绑的命令。将 \meta{计数器} 解绑于 \meta{父计数器},同时输出格式被改为 \meta{格式}\marg{计数器}。带有星号参数的命令仅进行解绑不更改输出格式。 |
| 1356 |
\begin{ctexexam} |
| 1357 |
\counterwithin[\Roman]{child}[-]{parent} |
| 1358 |
\counterwithout*{child}{parent} |
| 1359 |
\end{ctexexam} |
| 1360 |
\end{cnltxlist} |
| 1361 |
|
| 1362 |
\section{扩展功能} |
| 1363 |
|
| 1364 |
\subsection{盒子} |
| 1365 |
\label{subsec:box} |
| 1366 |
文档类预置了两个行间盒子环境和两个行内盒子命令,需要在导言区\textbf{手动载入} \pkg*{tcolorbox} 宏包提供支持。它们 \meta{配置选项} 的键值列表可见宏包文档的Option Keys一节,可以进行边距、字体及背景颜色等各种个性化设置。如果 \meta{配置选项} 较长且希望在原有基础上改为全局固定的样式,可以使用 \cs{addtotcbstyle} 命令设置,第一个参数为 \code{tc-}\meta{环境/命令名}。 |
| 1367 |
\begin{cnltxlist} |
| 1368 |
\command{deftcbstyle}[\marg{盒子风格}\marg{键值列表}] |
| 1369 |
新建或重置一个名称为 \meta{盒子风格} 的 \pkg*{tcolorbox} 宏包盒子风格,可以与 \cs{addtotcbstyle} 命令联用。 |
| 1370 |
\command{addtotcbstyle}[\marg{盒子风格}\marg{键值列表}] |
| 1371 |
修改已存在的 \pkg*{tcolorbox} 宏包盒子风格。这个命令可以调整以下即将介绍的预置盒子风格,对于预置盒子来说参数 \meta{盒子风格} 即为它们对应的环境或命令名。 |
| 1372 |
\begin{ctexexam} |
| 1373 |
\deftcbstyle{fancy} % 新建一个盒子风格fancy |
| 1374 |
{ |
| 1375 |
colback = Snow,colframe = LimeGreen,coltext = Coral, |
| 1376 |
fontupper = \bfseries,arc = 6pt, |
| 1377 |
boxrule = 5pt,boxsep = 5pt, |
| 1378 |
borderline = {2pt}{2pt}{white} |
| 1379 |
} |
| 1380 |
\newtcolorbox{mytcbox}[1][]{enhanced,fancy,title = #1} |
| 1381 |
\begin{tcolorbox}[fancy,enhanced] |
| 1382 |
盒子内容 |
| 1383 |
\end{tcolorbox} |
| 1384 |
\begin{mytcbox}[盒子标题] |
| 1385 |
盒子内容 |
| 1386 |
\end{mytcbox} |
| 1387 |
\end{ctexexam} |
| 1388 |
\environment{easyboxi}[\sarg\oarg{颜色名}\darg{段落标题}\oarg{配置选项}] |
| 1389 |
行间环境 \env{easyboxi} 创建一个带有三个可选参数的扁平盒子。使用星号参数时给盒子添加边框,\meta{颜色名} 选项设置背景颜色,\meta{段落标题} 选项可以设置标题,默认标题为空。 |
| 1390 |
\begin{ctexexam} |
| 1391 |
\addtotcbstyle{tc-easyboxi}{arc = 6pt} |
| 1392 |
\begin{easyboxi}*[DarkCyan](段落标题) |
| 1393 |
上半盒子内容 |
| 1394 |
\tcblower % 盒子上下部分分界线 |
| 1395 |
下半盒子内容 |
| 1396 |
\end{easyboxi} |
| 1397 |
\end{ctexexam} |
| 1398 |
\environment{easyboxii}[\sarg\oarg{颜色名}\darg{段落标题}\oarg{配置选项}] |
| 1399 |
环境 \env{easyboxii} 用法与 \env{easyboxi} 类似,同样带有三个可选参数。盒子的左边带有一条粗竖线,背景颜色为竖线颜色的浅色。\meta{颜色名} 选项可以设置竖线的颜色。使用星号参数则盒子无背景颜色。 |
| 1400 |
\command{eboxi}[\oarg{颜色名}\marg{内容}\oarg{配置选项}] |
| 1401 |
行内盒子命令 \cs{eboxi} 具有模糊边缘类似高亮的效果。 |
| 1402 |
\command{eboxii}[\oarg{颜色名}\marg{内容}\oarg{配置选项}] |
| 1403 |
行内盒子命令 \cs{eboxii} 则有直角边缘和四周框线,效果类似带背景色的 \cs*{fbox} 盒子。 |
| 1404 |
\end{cnltxlist} |
| 1405 |
|
| 1406 |
\subsection{代码} |
| 1407 |
代码抄录宏包 \pkg*{listings} 提供了完善的代码排版功能,并且不需要前端处理器。 |
| 1408 |
\begin{cnltxlist} |
| 1409 |
\command{lstdefinestyle}[\marg{代码风格}\marg{键值列表}] |
| 1410 |
代码风格定义命令,提供大量选项对代码样式进行高度定制。可以根据需要的代码语言定义多种风格,默认使用的 \meta{代码风格} 为适用于\TeX 语言的 \code{lst-latex}。 |
| 1411 |
\command{lstinline}[\oarg{键值列表}\marg{行内代码}] |
| 1412 |
行内代码抄录命令。较原生的 \cs*{verb} 命令有较大改进,具有代码语言和样式支持。 |
| 1413 |
\environment{lstlisting}[\oarg{键值列表}] |
| 1414 |
行间代码抄录环境。支持多种语言库,默认使用 \code{LaTeX} 代码语言,可使用 \meta{键值列表} 局部修改代码样式。另外还提供了 \cs{lstnewenvironment} 命令包装自定义名称的代码环境。 |
| 1415 |
\begin{ctexexam} |
| 1416 |
\lstdefinestyle{lst-pascal} |
| 1417 |
{ |
| 1418 |
language = Pascal, |
| 1419 |
numbers = left, |
| 1420 |
firstnumber = last, |
| 1421 |
frame = shadowbox, |
| 1422 |
backgroundcolor = \color{MistyRose}, |
| 1423 |
rulesepcolor = \color{DarkGray} |
| 1424 |
} |
| 1425 |
\lstnewenvironment{mypascal}[1][]{\lstset{style = lst-pascal,#1}}{} |
| 1426 |
\end{ctexexam} |
| 1427 |
\begin{cnltxlist}[itemsep = 0ex] |
| 1428 |
\keyval{listlstlistingname}{代码目录标题名}\nonl |
| 1429 |
\keyval{lstlistingname}{代码题注标题名} |
| 1430 |
代码目录名与代码环境题注名选项 \option{listlstlistingname} 和 \option{lstlistingname} 用法与 \CTeX 使用手册标题汉化一节类似,可以看作对这节的扩展。 |
| 1431 |
\end{cnltxlist} |
| 1432 |
\end{cnltxlist} |
| 1433 |
|
| 1434 |
\subsection{物理量} |
| 1435 |
使用 \pkg*{siunitx} 宏包提供国际单位制的物理量支持。\pkg*{siunitx} 宏包旨在为 \hologo{LaTeX} 用户提供一种统一的方法,以便正确、轻松地排版数字和单位。\pkg*{siunitx} 的设计理念是默认遵循约定的规则,但允许通过选项设置进行更改。 |
| 1436 |
\begin{cnltxlist} |
| 1437 |
\command{num}[\oarg{键值列表}\marg{数字}] |
| 1438 |
\cs{num} 命令可以输出以科学计数法表示的数值。 |
| 1439 |
\command{unit}[\oarg{键值列表}\marg{单位}] |
| 1440 |
单位格式化命令 \cs{unit} 包含文字元素(例如字母或数字)时,使用 \Marg{.} 和 \code{\~{}} 放置在单元乘积中间,并使用 \code{\_{}} 和 \code{\^{}} 正确放置指定的下标和上标。格式化方法可在数学和文本模式下使用。 |
| 1441 |
\command{qty}[\oarg{键值列表}\marg{数字}\oarg{前缀}\marg{单位}] |
| 1442 |
命令 \cs{qty} 可用来输出带有单位的量。 |
| 1443 |
\command{qtyrange}[\oarg{键值列表}\marg{起始数字}\marg{结束数字}\marg{单位}] |
| 1444 |
命令 \cs{qtyrange} 可以输出带有范围和单位的量。 |
| 1445 |
\begin{ctexexam} |
| 1446 |
\numproduct{-21x3e5} |
| 1447 |
\unit{mL~min^{-1}} |
| 1448 |
\qty{5}{\mole} |
| 1449 |
\qtyrange[unit-color = green]{1.5}{4}{kg} |
| 1450 |
\end{ctexexam} |
| 1451 |
\end{cnltxlist} |
| 1452 |
|
| 1453 |
\subsection{标签引用} |
| 1454 |
\begin{cnltxlist} |
| 1455 |
\command{labelformat}[\marg{计数器}\marg{标签引用格式}] |
| 1456 |
标签格式命令 \cs{labelformat} 可以设置标签引用格式。\meta{标签引用格式} 中 \code{\#1} 代表 \cs*{the}\meta{计数器},可以设置引用序号的前缀和后缀。也可以使用 \pkg*{cleveref} 宏包或 \code{ltproperties} 机制,它们充分扩展了 \cs{label} 和 \cs{ref} 命令,提供了更强的标签功能。 |
| 1457 |
\command{AtEndPreamble}[\marg{格式代码}] |
| 1458 |
导言区末尾的钩子命令。为了保证兼容性 \pkg*{hyperref} 宏包被设计在导言区末尾载入,一些情况下需要钩子命令在 \pkg*{hyperref} 宏包后方执行 \meta{格式代码},例如载入 \pkg*{cleveref} 宏包。 |
| 1459 |
\begin{ctexexam} |
| 1460 |
\labelformat{chapter}{第#1章} |
| 1461 |
\labelformat{chapter}{第\thechapter 章} |
| 1462 |
\AtEndPreamble{\usepackage{cleveref}} |
| 1463 |
\end{ctexexam} |
| 1464 |
\end{cnltxlist} |
| 1465 |
|
| 1466 |
\subsection{索引} |
| 1467 |
\pkg*{indextools} 宏包增强了索引的功能,可使用户在制作和排版文档的同时制作一个或多个索引。它是在 \pkg*{imakeidx} 基础上进行复刻,并进行了一些改进和问题修复。 |
| 1468 |
\begin{cnltxlist} |
| 1469 |
\command{indexsetup}[\marg{键值列表}] |
| 1470 |
设置索引表整体格式的通用接口命令,它的 \option{level} 和 \option{headers} 选项失效。 |
| 1471 |
\command{index}[\oarg{索引名}\marg{标签}] |
| 1472 |
索引标签命令的可选参数可以用不同的 \meta{索引名} 给多个索引表设置标签。 |
| 1473 |
\command{makeindex}[\oarg{键值列表}] |
| 1474 |
用于导言区开启索引收集的命令。这个命令可以重复使用收集多个索引表,以不同的 \meta{索引名} 作为区分,如果仅打印一个索引表没必要重复使用。 |
| 1475 |
\command{printindex}[\sarg\oarg{键值列表}] |
| 1476 |
打印不同索引表的命令。这个命令被重新定义,\meta{键值列表} 中的选项与\ref{subsec:directory command} 其它目录命令相同,并多出 \option{name} 选项用于指定打印索引的名字。 |
| 1477 |
\keyval{name}{索引名} |
| 1478 |
指定输出名为 \meta{索引名} 的索引表,如果只使用一个索引表则默认为项目文件名不需要指定。 |
| 1479 |
\end{cnltxlist} |
| 1480 |
|
| 1481 |
\subsection{边注} |
| 1482 |
\begin{cnltxlist} |
| 1483 |
\command{marginnote}[\oarg{左文本}\marg{右文本}\oarg{垂直偏移}] |
| 1484 |
边注命令用于在两侧页边空白添加标注。如果只给定了 \meta{右文本},那么边注在奇偶数页文字相同。如果同时给定了 \meta{左文本},则偶数页使用 \meta{左文本} 的文字。 |
| 1485 |
\command{reversemarginpar} |
| 1486 |
边注位置设置命令,用于将边注排版到与默认边空位置相反的边空中。 |
| 1487 |
\end{cnltxlist} |
| 1488 |
|
| 1489 |
\subsection{公式符号对照} |
| 1490 |
\begin{cnltxlist} |
| 1491 |
\environment{eqcomp}[\oarg{键值列表1}\darg{键值列表2}] |
| 1492 |
一些公式之后可以使用基于列表环境的 \env{eqcomp} 进行符号对照。对照列表的 \meta{键值列表2} 与 \pkg*{enumitem} 的选项相同,一般较少用到,可以用于设置垂直间距等。 |
| 1493 |
\begin{ctexexam} |
| 1494 |
\seteqcomp{intro = 上式中} |
| 1495 |
\begin{eqcomp}[width = 1.5em] |
| 1496 |
\symb{Ab}[$\to$] 符号说明 |
| 1497 |
\symb{C}[---] 符号说明 |
| 1498 |
\end{eqcomp} |
| 1499 |
\end{ctexexam} |
| 1500 |
\command{symb}[\sarg\marg{符号}\oarg{引导符}] |
| 1501 |
符号条目命令 \cs{symb} 类似 \cs*{item},需要在环境内使用,带有星号的命令可在文本段落单独使用。 |
| 1502 |
\command{seteqcomplist}[\marg{键值列表2}] |
| 1503 |
对照列表条目格式的 \meta{键值列表2} 可以使用 \cs{seteqcomplist} 全局设置。 |
| 1504 |
\command{seteqcomp}[\marg{键值列表1}] |
| 1505 |
对照环境的 \meta{键值列表1} 可以使用 \cs{seteqcomp} 全局设置,它的选项如下: |
| 1506 |
\keyval{width}{符号宽度}\Default{10pt} |
| 1507 |
设置适当的符号宽度可以防止文字重叠和边界溢出等问题。 |
| 1508 |
\keyval{delim}{引导符}\Default{——} |
| 1509 |
全局的符号对照引导符。\cs{symb} 命令局部 \meta{引导符} 的对齐方式是基于这个符号的宽度。 |
| 1510 |
\keyval{space}{符号间隙}\Default{0.25em} |
| 1511 |
符号间隙为引导符两侧与符号和说明文字间的距离。 |
| 1512 |
\keychoice{item-align}{l,c,\fbox{r}} |
| 1513 |
符号的对齐方式,分为左 \code{l}、中 \code{c} 和右 \code{r} 三种对齐方式。 |
| 1514 |
\keychoice{delim-align}{l,\fbox{c},r} |
| 1515 |
引导符的对齐方式,分为左 \code{l}、中 \code{c} 和右 \code{r} 三种对齐方式。 |
| 1516 |
\keyval{enumitem}{键值列表2} |
| 1517 |
可以使用选项 \option{enumitem} 或命令 \cs{seteqcomplist} 调整对照列表的水平和垂直间距。 |
| 1518 |
\keyval{intro}{首行文字} |
| 1519 |
符号对照的说明文字。应当为简短的几个字,只显示在第一行,其后为悬挂缩进的对照列表。 |
| 1520 |
\keyval{font}{符号字体} |
| 1521 |
符号的字体。数学和文本符号模式应采用不同的字体命令,最后一个命令可以接受一个参数,这个参数为符号。 |
| 1522 |
\keychoice{mode}{\fbox{math},text} |
| 1523 |
符号字体模式,可以为数学字体或者文本字体。 |
| 1524 |
\end{cnltxlist} |
| 1525 |
|
| 1526 |
\subsection{插入文档} |
| 1527 |
\begin{cnltxlist} |
| 1528 |
\command{includepdf}[\oarg{键值列表}\marg{文档名}] |
| 1529 |
该命令由文档宏包 \pkg*{pdfpages} 提供。可以将其它 \code{pdf} 文档插入当前文档,比如插入其它软件制作的封面。可选参数可以指定插入页数、逻辑页和横向页面等,详情查看宏包文档。 |
| 1530 |
\end{cnltxlist} |
| 1531 |
|
| 1532 |
\appendix |
| 1533 |
\setlist[1]{} |
| 1534 |
\begin{changelog}[title = 更新日志] |
| 1535 |
\shortversion{v = 1.45,date = 2022/01/08,changes = 经过前期各模块的功能调整和错误修复,稳定版本正式发布。} |
| 1536 |
\begin{version}[v = 1.46,date = 2022/01/12] |
| 1537 |
\added |
| 1538 |
\item 增加定义脚注正文和内容标记格式的命令 \cs{defupfntmark} 和 \cs{defdownfntmark}。 |
| 1539 |
\item 新增章节标题目录中双语标题条目的输出排列方式选项 \option{bilist}。 |
| 1540 |
\end{version} |
| 1541 |
\begin{version}[v = 1.55,date = 2022/01/28] |
| 1542 |
\added |
| 1543 |
\item 新增文类选项 \option{theorem} 用于提供定理功能支持。 |
| 1544 |
\deprecated |
| 1545 |
\item 由于命令存在一些无法解决的问题弃用定理环境定义命令 \cs*{deftheorem}。 |
| 1546 |
\item 文档类移除预置的定理环境,改为由用户自行定义环境。 |
| 1547 |
\item 考虑到功能性和实用性不强弃用摘要环境 \env*{outline} 和习题环境 \env*{exercise}。 |
| 1548 |
\end{version} |
| 1549 |
\begin{version}[v = 1.62,date = 2022/02/16] |
| 1550 |
\added |
| 1551 |
\item 增加目录条目下方执行的代码选项 \option{tocbelow}。 |
| 1552 |
\changed |
| 1553 |
\item 目录改用标题级别选项 \option{level} 设定标题命令,不输出标题则使用星号参数。 |
| 1554 |
\end{version} |
| 1555 |
\begin{version}[v = 1.636,date = 2022/03/03] |
| 1556 |
\added |
| 1557 |
\item \cs{tableofcontents} 命令增加输出方案选项 \option{plan},不再使用 \parg{} 参数输出英文目录。 |
| 1558 |
\item 增加英文主文档目录钩子选项 \option{bibetween}。 |
| 1559 |
\end{version} |
| 1560 |
\shortversion{v = 1.638,date = 2022/03/04,changes = 增加目录条目样式选项注册命令 \cs{RegisterTocName}。} |
| 1561 |
\shortversion{v = 1.644,date = 2022/03/10,changes = 增加浮动环境目录声明命令 \cs{DeclareFloatList} 配合 \pkg*{caption} 宏包。} |
| 1562 |
\shortversion{v = 1.682,date = 2022/05/01,changes = 将迷你页判断命令 \cs{notminipage} 改为被保护命令兼容 \pkg*{circledtext} 宏包。} |
| 1563 |
\begin{version}[v = 2024ap,date = 2024/03/15] |
| 1564 |
\fixed |
| 1565 |
\item 修复图表等浮动环境题注目录中条目标签编号的计数器值显示错误问题。 |
| 1566 |
\item 修复附录命令 \cs{appendix} 的可选参数设置英文目录中条目名字和编号失效的问题。 |
| 1567 |
\item 修复 \pkg*{biblatex} 宏包对脚注打补丁失效的问题。 |
| 1568 |
\added |
| 1569 |
\item 新增目录风格定义命令 \cs{SetTocStyle} 和使用命令 \cs{UseTocStyle}。 |
| 1570 |
\item 新增目录配置命令 \cs{SetTocOuter} 和双语目录判断命令 \cs{ebifbitoc}。 |
| 1571 |
\item 新增脚注段落文本格式定义命令 \cs{deffntpara} 和脚注间距离选项 \option{footnotesep}。 |
| 1572 |
\item 新增悬挂缩进命令 \cs{hangfrom}。 |
| 1573 |
\item 新增行间公式与正文上下间距选项 \option{abovedisplayskip} 和 \option{belowdisplayskip}。 |
| 1574 |
\item 新增目录文件扩展名分配命令 \cs{AssignCaptionExt}。 |
| 1575 |
\end{version} |
| 1576 |
\shortversion{v = 2024aq,date = 2024/03/31,changes = 修复命令 \cs{ebifbitoc} 用于条目缩进选项 \option{tocindent} 失效的问题。} |
| 1577 |
\begin{version}[v = 2024as,date = 2024/04/19] |
| 1578 |
\changed |
| 1579 |
\item 目录条目样式注册命令 \cs{RegisterTocName} 增加星号参数,支持设置段落型目录。 |
| 1580 |
\added |
| 1581 |
\item 新增目录标题条目标签定义的选项 \option{toclabel}。 |
| 1582 |
\item 新增段落型目录条目附加代码的选项 \option{tocbegin}、\option{tocsep} 和 \option{tocend}。 |
| 1583 |
\end{version} |
| 1584 |
\shortversion{v = 2024aw,date = 2024/04/22,changes = 新增新建章节标题命令 \cs{NewTitleCommand} 和 \cs{NewTitleEntryCommand}。} |
| 1585 |
\shortversion{v = 2024bb,date = 2024/04/26,changes = 增加对 \pkg*{thmtools} 宏包定理环境目录 \cs{listoftheorems} 的支持。} |
| 1586 |
\shortversion{v = 2024bk,date = 2024/05/07,changes = 新增局部题注目录分配命令 \cs{AssignPartialExt}。} |
| 1587 |
\begin{version}[v = 2024bn,date = 2024/05/10] |
| 1588 |
\fixed |
| 1589 |
\item 修复 \module*{toc} 模块中带有 \option*{every} 后缀的选项不对所有已注册条目有效的问题。 |
| 1590 |
\added |
| 1591 |
\item 新增统一设置所有目录格式时的条目类型排除命令 \cs{ExcludeEveryTocName}。 |
| 1592 |
\end{version} |
| 1593 |
\shortversion{v = 2024cd,date = 2024/06/14,changes = 修复全局选项 \option{class} 无法正确切换单双面排版的问题。} |
| 1594 |
\begin{version}[v = 2024cf,date = 2024/06/16] |
| 1595 |
\fixed |
| 1596 |
\item 修复和改进新建章节/图表标题时目录层次深度的问题。 |
| 1597 |
\changed |
| 1598 |
\item \module*{tools} 模块的图片路径选项 \option{figurepath} 可在正文中使用。 |
| 1599 |
\end{version} |
| 1600 |
\shortversion{v = 2024ci,date = 2024/06/22,changes = 修复使用 \code{flush} 类型脚注报错。} |
| 1601 |
\shortversion{v = 2024co,date = 2024/07/06,changes = 目录命令的可选参数支持 \CTeX 键值列表所有路径的章节标题样式选项。} |
| 1602 |
\shortversion{v = 2024cq,date = 2024/07/12,changes = 新增章节标题格式复制命令 \cs{CopyTitleFormat}。} |
| 1603 |
\shortversion{v = 2024cu,date = 2024/07/20,changes = 修复无编号的定理环境标签命令 \cs*{p@}\meta{定理名} 缺失导致报错的问题。} |
| 1604 |
\shortversion{v = 2024cx,date = 2024/07/28,changes = 新增将脚注置于页面底部的命令 \cs{PushFntBottom}。} |
| 1605 |
\begin{version}[v = 2024dh,date = 2024/08/06] |
| 1606 |
\changed |
| 1607 |
\item 取消默认载入 \pkg*{ulem} 下划线宏包。 |
| 1608 |
\added |
| 1609 |
\item 使用 \pkg*{xtemplate} 宏包将封面标题命令 \cs{maketitle} 抽象为由实例组成的模板。 |
| 1610 |
\item 新增图表题注模块 \module*{cap}。 |
| 1611 |
\end{version} |
| 1612 |
\shortversion{v = 2024dq,date = 2024/09/16,changes = 修复脚注重置编号的方式为 \code{page} 时在一些换页情况下失败的问题。} |
| 1613 |
\shortversion{v = 2024dt,date = 2024/09/22,changes = 新增用于设置行距的命令 \cs{usestretch} 和环境 \env{usespace}。} |
| 1614 |
\shortversion{v = 2024ea,date = 2024/09/28,changes = 定理模块 \module*{thmt} 支持使用 \pkg*{keytheorems} 宏包。} |
| 1615 |
\begin{version}[v = 2025f,date = 2025/01/26,simple] |
| 1616 |
\item 索引功能支持由适配 \pkg*{imakeidx} 宏包改为适配 \pkg*{indextools} 宏包。 |
| 1617 |
\item \pkg*{caption} 宏包支持的图表等题注的目录选项支持 \cs{CTEXifname} 编号判断命令。 |
| 1618 |
\end{version} |
| 1619 |
\shortversion{v = 2025n,date = 2025/02/12,changes = 优化 \module*{ref} 模块,修复选项 \keyis{linktype}{none} 失效的问题。} |
| 1620 |
\shortversion{v = 2025z,date = 2025/07/16,changes = 取消对底部浮动体与脚注排列方式的改动,使用 \hologo{LaTeX} 新增的套接字机制。} |
| 1621 |
\end{changelog} |
| 1622 |
\nocite{*} |
| 1623 |
% \AddToHook{cmd/printindex/before}{\clearpage} |
| 1624 |
|
| 1625 |
\end{document} |