From 342f2e1be699f5ec70b5b1c35d9cd59798d37304 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Tue, 4 May 2021 03:01:16 +0000 Subject: CTAN sync 202105040301 --- macros/latex/contrib/easybook/easybook.dtx | 191 ++++++++++++++--------------- 1 file changed, 91 insertions(+), 100 deletions(-) (limited to 'macros/latex/contrib/easybook/easybook.dtx') diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx index 73f3c1ead7..538b1cedf8 100644 --- a/macros/latex/contrib/easybook/easybook.dtx +++ b/macros/latex/contrib/easybook/easybook.dtx @@ -6,38 +6,9 @@ % conditions of the CC-BY 4.0 License. % The latest version of this license is in % https://creativecommons.org/licenses/by/4.0/legalcode -%<*driver> -\def\nameofplainTeX{plain} -\ifx\fmtname\nameofplainTeX -\else - \expandafter\begingroup -\fi -%<*install> -\input ctxdocstrip -\keepsilent -\askforoverwritefalse -% -\preamble -Copyright (C) 2021 by Qu Yi - -This work may be distributed and/or modified under the -conditions of the CC-BY 4.0 License. -The latest version of this license is in - https://creativecommons.org/licenses/by/4.0/legalcode -\endpreamble -% -\generate - { - \usedir{tex/latex/\jobname} - \file{\jobname.cls}{\from{\jobname.dtx}{class}} - } -% -\ifx\fmtname\nameofplainTeX - \expandafter\endbatchfile -\else - \expandafter\endgroup -\fi -% +% \fi +% +% \iffalse %<*driver> \documentclass{ctxdoc} \OnlyDescription @@ -53,40 +24,57 @@ The latest version of this license is in % \changes{v1.20}{2021/01/09}{修改和完善用户文档。} % \changes{v1.20}{2021/01/09}{模板更改为使用 CC-BY 许可协议。} % \changes{v1.23}{2021/03/19}{修复在 \pkg{ctex} v2.5.6 更新后 \cls{easybook} 与 \pkg{hyperref} 冲突问题。} +% \changes{v1.25}{2021/05/03}{取消附带的示例文件,可查看历史版本及其它来源的使用样例。} % % \title{\sffamily easybook 文档类手册} % \author{瞿毅} -% \date{2021/05/02\hskip\ccwd\relax v1.24z\thanks{\url{https://gitee.com/texl3/easybook}}} +% \date{2021/05/03\hskip\ccwd\relax v1.25\thanks{\url{https://gitee.com/texl3/easybook}}} % % \maketitle % \begin{abstract} -% \cls{easybook} 是基于 \cls{ctexbook} 书籍文档类创建以极简为风格的模板,可以看作对 \cls{ctexbook} 的进一步包装。虽然\CTeX 文档类提供了较好的中文支持,但想实现个性化功能一般需要在其基础上载入更多宏包来定制。\cls{easybook} 考虑了一些细节并已载入一些常用宏包用于实现一般的排版需求,同时也具有 \cls{article} 文档类的功能,使用户可以简便地进行设置。它适用于排版中英文学术书籍、笔记或者是学位论文。 +% \cls{easybook} 是基于 \cls{ctexbook} 书籍文档类创建以极简为风格的模板,可以看作对 \cls{ctexbook} 的进一步包装与增强。虽然 \CTeX 文档类提供了较好的中文支持,但想实现个性化功能一般需要在其基础上载入更多宏包来定制。\cls{easybook} 考虑了一些细节并已载入一些常用宏包用于实现一般的排版需求,同时也具有 \cls{article} 文档类的功能,使用户可以简便地进行设置。它适用于排版中英文学术书籍、笔记或者是学位论文。 % \end{abstract} % \tableofcontents % -% \begin{documentation} -% \section{编译方式} -% 编译文档类的一个使用示例文件 \opt{easybook-demo.tex} 前建议满足以下的条件 +% \section{使用说明} +% 使用 \cls{easybook} 文档类编写文档前您可能需要满足以下的条件 % \begin{itemize} % \item 使用 \hologo{XeLaTeX}(推荐)或 \hologo{LuaLaTeX} 两种编译方式。 -% \item 由于用到了一些\LaTeX 和宏包较新的功能,建议安装最新的\TeX 发行版,例如 \TeX Live 2021或 \hologo{MiKTeX} 21.2之后的版本。 +% \item 由于用到了一些 \LaTeX 和宏包较新的功能,建议安装最新的 \TeX 发行版,例如 \TeX Live 2021或 \hologo{MiKTeX} 21.2之后的版本。 % \end{itemize} % -% \subsection{编译步骤} +% \subsection{基本用法} +% 以下一份简单的 \TeX 文档演示了 \cls{easybook} 的最基本用法,在导言区进行宏包载入与文档设置,一些详细的使用样例会不定期上传在 \href{https://www.latexstudio.net/}{\LaTeX 工作室} 的网站。 % \begin{frameverb} -% xelatex -shell-escape easybook-demo -% bibtex easybook-demo -% makeindex easybook-demo -% xelatex -shell-escape easybook-demo -% xelatex -shell-escape easybook-demo +% \documentclass{easybook} +% +% \ctexset{键值列表} +% \usepackage{宏包列表} +% +% \begin{document} +% \chapter{欢迎} +% \section{Welcome to easybook} +% Hello, \LaTeX +% \end{document} % \end{frameverb} +% +% \subsection{编译方式} +% 假设您的 \TeX 源文件名为 \opt{easybook.tex},需要使用参考文献和索引功能,并使用 \hologo{XeLaTeX} 和 \hologo{BibTeX} 引擎编译文档,那么需要在命令行中执行 +% \begin{frameverb} +% xelatex -shell-escape easybook +% bibtex easybook +% makeindex easybook +% xelatex -shell-escape easybook +% xelatex -shell-escape easybook +% \end{frameverb} +% 当然也可以使用 \opt{latexmk} 及一些软件自带的编译工具,这里就不做介绍。 \\ % \ding{72} 需要注意正确\textbf{编译索引}要增加 \opt{-shell-escape} 命令行选项。 % % \subsection{字体设置} % \label{subsec:font settings} -% 默认使用\CTeX 预置中文字库,当开启 \opt{font = noto} 选项时需要安装开源字体,中文使用方正系列的{\songti 方正书宋}、{\heiti 方正黑体}、{\kaishu 方正楷体}和{\fangsong 方正仿宋},英文使用思源系列的{\rmfamily Noto Serif}、{\sffamily Noto Sans}和{\ttfamily Noto Sans Mono},数学字体使用 \pkg{notomath}。相关选项可以见节 \ref{sec:document class options} 中的 \opt{font} 选项,字体点击此处下载\href{https://wws.lanzous.com/b01ns361i}{下载地址}。 +% 默认使用 \CTeX 预置中文字库,当开启 \opt{font = noto} 选项时需要安装开源字体,中文使用方正系列的{\songti 方正书宋}、{\heiti 方正黑体}、{\kaishu 方正楷体}和{\fangsong 方正仿宋},英文使用思源系列的{\rmfamily Noto Serif}、{\sffamily Noto Sans}和{\ttfamily Noto Sans Mono},数学字体使用 \pkg{notomath}。相关选项可以见节 \ref{sec:document class options} 中的 \opt{font} 选项,字体点击此处下载\href{https://wws.lanzous.com/b01ns361i}{下载地址}。 % -% 如果您不想使用\CTeX 默认字体和方正、思源字体,\textbf{自定义字体}需启用选项 \opt{font = none},并可在导言区设置中文字体,粗体与斜体不设置会产生警告。 +% 如果您不想使用 \CTeX 默认字体和方正、思源字体,\textbf{自定义字体}需启用选项 \opt{font = none},并可在导言区设置中文字体,粗体与斜体不设置会产生警告。 % \begin{ctexexam} % \setCJKmainfont{SimSun}[BoldFont = SimHei,ItalicFont = KaiTi] % \setCJKsansfont{SimHei} @@ -98,7 +86,7 @@ The latest version of this license is in % 标准 \cls{book} 文类与 \cls{ctexbook} 文类的选项同样适用于本文档。除此之外选项分为两类 % \begin{itemize} % \item 带有 \rexptarget\rexpstar{} 号的选项,需要在引入文档类的时候设定。 -% \item 带有 \exptarget\expstar{} 号的选项,需要通过\CTeX 宏集提供的用户接口命令 \tn{ctexset} 或节 \ref{sec:interface options} 中此选项所属模块接口命令设定。 +% \item 带有 \exptarget\expstar{} 号的选项,需要通过 \CTeX 宏集提供的用户接口命令 \tn{ctexset} 或节 \ref{sec:interface options} 中此选项所属模块接口命令设定。 % \end{itemize} % % \begin{function}[rEXP,added = 2021-01-05]{draft} @@ -117,7 +105,7 @@ The latest version of this license is in % \begin{syntax} % scheme = <(chinese)|plain> % \end{syntax} -% \opt{scheme} 代表文档的主题,扩展了此选项在\CTeX 文档类中原有的作用范围,\opt{plain} 选项可使各类标题变为英文形式。包括章节标题、图表标题和定理标题等。如\textbf{第一章}变为\textbf{Chapter 1},\textbf{图1.1} 变为 \textbf{Table 1.1}。 +% \opt{scheme} 代表文档的主题,扩展了此选项在 \CTeX 文档类中原有的作用范围,\opt{plain} 选项可使各类标题变为英文形式。包括章节标题、图表标题和定理标题等。如\textbf{第一章}变为\textbf{Chapter 1},\textbf{图1.1} 变为 \textbf{Table 1.1}。 % \end{function} % % \begin{function}[rEXP,added = 2021-01-05,updated = 2021-04-29]{enmode} @@ -129,7 +117,7 @@ The latest version of this license is in % font = % \end{syntax} % 传递给 \cls{ctexbook} 设置字体,最好不要使用原有的 \opt{fontset} 选项,默认情况下使用自定义字体而不开启这个选项,可根据安装的字体及电脑系统选取。\opt{noto} 与 \opt{none} 选项的相关描述见小节 \ref{subsec:font settings},\opt{overleaf} 是一个各系统通用选项,会检测系统环境选取对应字体。 -% \changes{v1.21}{2021/01/12}{默认字体与\CTeX 一致,不再是自定义字体。} +% \changes{v1.21}{2021/01/12}{默认字体与 \CTeX 一致,不再是自定义字体。} % \end{function} % % \begin{function}[rEXP,added = 2021-01-05,updated = 2021-01-13]{paper} @@ -180,7 +168,7 @@ The latest version of this license is in % \end{syntax} % \opt{multoc} 与 \opt{style/multoc} 选项具有相同的效果,但是具有优先性且可单独设置不同目录是否双栏排版。已经预置了中英文的目录标题,可以使用 \opt{title} 选项更改目录标题的名称。\opt{book} 选项使目录标题按照 \opt{chapter} 级别输出,\opt{article} 选项使目录标题按照 \opt{article} 级别输出,默认为 \opt{chapter} 级别。 % \changes{v1.23}{2021/03/15}{为几个目录增加键值列表的选项,可设置标题输出级别以及是否加入主目录。} -% \changes{v1.24z}{2021/04/04}{目录命令的可选参数增加标题键值。} +% \changes{v1.24}{2021/04/04}{目录命令的可选参数增加标题键值。} % \end{function} % % \section{接口选项} @@ -189,7 +177,7 @@ The latest version of this license is in % \begin{syntax} % \tn{ctexset}\marg{键值列表} % \end{syntax} -% \cls{easybook} 扩展了\CTeX 宏集\LaTeX 3风格键值的通用控制命令 \tn{ctexset},接口选项同样可用它设置, 原有的键值列表仍然可用。本文档类目前有九个模块用于实现常规的排版功能,如下表所示,它们既是统一接口 \tn{ctexset} 的路径,也是相关模块的接口命令名 +% \cls{easybook} 扩展了 \CTeX 宏集\LaTeX 3风格键值的通用控制命令 \tn{ctexset},接口选项同样可用它设置, 原有的键值列表仍然可用。本文档类目前有九个模块用于实现常规的排版功能,如下表所示,它们既是统一接口 \tn{ctexset} 的路径,也是相关模块的接口命令名 % \begin{center} % \begin{tabular}{*{5}{c}} % \toprule @@ -263,7 +251,7 @@ The latest version of this license is in % \ding{229} 以上选项路径为 \opt{link/...} \\ % \opt{link} 将超链接选项(包括以上选项)交给 \pkg{hyperref} 处理,除了一些关于 pdf 书签的选项可能会失效,其它由键值选项命令 \tn{hypersetup} 支持的多数选项可用。 % \changes{v1.10}{2021/01/08}{修复了 \opt{linktopage} 选项关闭时目录中标题编号无超链接的问题。} -% \changes{v1.24z}{2021/04/05}{增加 \pkg{hyperref} 超链接选项完整的支持。} +% \changes{v1.24}{2021/04/05}{增加 \pkg{hyperref} 超链接选项完整的支持。} % \end{function} % % \begin{optdesc} @@ -284,12 +272,12 @@ The latest version of this license is in % \label{subsec:spacing} % \begin{function}[EXP,added = 2021-01-05,updated = 2021-04-19]{line,table,math,caption,footnote,spread-all} % \begin{syntax} -% line = <(1.3)> -% table = <(1.05)> -% math = <(1.05)> -% caption = <(1)> -% footnote = <(1)> -% spread-all = <(empty)> +% line = <数值|(1.3)> +% table = <数值|(1.05)> +% math = <数值|(1.05)> +% caption = <数值|(1)> +% footnote = <数值|(1)> +% spread-all = <数值|(empty)> % \end{syntax} % \ding{229} 以上选项路径为 \opt{spread/...} \\ % 行距因子用于设置各种行距倍数,只能是浮点数,不能带有长度单位。各行距既可在导言区全局设置也可正文中设置对后面生效,行距的意义为 @@ -342,7 +330,7 @@ The latest version of this license is in % \ding{229} 以上选项路径为 \opt{bibset/...} % \changes{v1.21}{2021/01/11}{增加 \opt{bibset} 选项,可以使用 \hologo{BibTeX} 或 \hologo{biber} 编译参考文献。} % \changes{v1.23}{2021/02/23}{使用 \opt{bibset} 选项时可设置标注风格。} -% \changes{v1.24z}{2021/04/09}{可以不载入参考文献包手动配置参考文献格式。} +% \changes{v1.24}{2021/04/09}{可以不载入参考文献包手动配置参考文献格式。} % \end{function} % % \begin{optdesc} @@ -380,9 +368,9 @@ The latest version of this license is in % \begin{syntax} % thmbox = % within = <(chapter)|section|其它环境|空置> -% headpunct = <(未设置)> -% bodyfont = <(未设置)> -% notefont = <(未设置)> +% headpunct = <(empty)> +% bodyfont = <(empty)> +% notefont = <(empty)> % headfont = <(\tn{color}\marg{ctex@emph}\tn{sffamily})> % headindent = <(0\tn{ccwd})> % spaceabove = <(0.75ex plus .1ex)> @@ -414,7 +402,7 @@ The latest version of this license is in % \end{syntax} % 文档类已预置8个定理环境,环境名及对应的定理标题名见小节 \ref{subsec:theorem},如果需要新的定理标题名或定理样式可使用这两个命令。 % \changes{v1.23}{2021/03/12}{重新定义了新定理环境命令 \tn{newtheorem}。} -% \changes{v1.24z}{2021/04/25}{增加定义定理环境命令 \tn{EbNewtheorem}。} +% \changes{v1.24}{2021/04/25}{增加定义定理环境命令 \tn{EbNewtheorem}。} % \end{function} % % \begin{optdesc} @@ -471,10 +459,11 @@ The latest version of this license is in % \begin{ctexexam} % \geoset % { -% top = 2.5cm, -% bottom = 2.5cm, -% left = 3.2cm, -% right = 3.2cm +% top = 2.5cm, +% bottom = 2.5cm, +% left = 3.2cm, +% right = 3.2cm, +% ignoreall % } % \end{ctexexam} % @@ -498,7 +487,7 @@ The latest version of this license is in % \changes{v1.21}{2021/01/13}{增加配置页眉页脚的选项。} % \changes{v1.23}{2021/03/08}{优化页眉页脚设置,增加 \opt{chap-mark} 和 \opt{sec-mark} 标志选项。} % \changes{v1.23}{2021/03/14}{可以手动绘制页眉、页脚和脚注的横线。} -% \changes{v1.24z}{2021/04/09}{增加 \opt{subsec-mark} 标志选项,仅在 \opt{article} 模式生效。} +% \changes{v1.24}{2021/04/09}{增加 \opt{subsec-mark} 标志选项,仅在 \opt{article} 模式生效。} % \end{function} % % \begin{function}[added = 2021-01-13,updated = 2021-03-14]{\easyhead,\easyfoot} @@ -518,8 +507,8 @@ The latest version of this license is in % \easyhead[OL]{\rightmark} % \easyhead[EL,OR]{\textbf{\thepage}} % }, -% sec-mark = \CTEXthesection\hspace{0.5\ccwd}#1, -% headrule = \hrule width \textwidth height 1pt +% sec-mark = \CTEXthesection\hspace{0.5\ccwd}#1, +% headrule = \hrule width \textwidth height 1pt % } % \end{ctexexam} % @@ -538,7 +527,7 @@ The latest version of this license is in % % \opt{format} 是目录中标题的格式,可以设置字体和加入垂直间距等,垂直间距最好使用无间距重合的 \tn{addvspace} 命令,带有加号的 \opt{format+} 选项用于在已有的格式命令后附加内容。\opt{indent} 是目录中标题在页面左侧的缩进距离,应该有长度单位。\opt{rule} 选项中一般应当使用 \tn{tocrule} 命令,将会在接下来介绍。\opt{numsep} 是有编号的标题在目录中编号与标题的间距。 % \changes{v1.21}{2021/01/13}{增加配置目录样式的选项。} -% \changes{v1.24z}{2021/04/20}{增加目录中编号与标题的间距选项 \opt{numsep}。} +% \changes{v1.24}{2021/04/20}{增加目录中编号与标题的间距选项 \opt{numsep}。} % \end{function} % % \begin{function}[added = 2021-01-13,updated = 2021-04-20]{\tocrule,\EbNumberline} @@ -548,7 +537,7 @@ The latest version of this license is in % \end{syntax} % \tn{tocrule} 命令生成目录引导线,需要在 \opt{rule} 选项中使用。带有星号的命令会使当前级别的目录引导线右边与页码连接而不是对齐。引导点间距需带有长度单位,引导点大小不带单位,为引导点符号正常大小的倍数,引导点一般为英文句号或 \tn{cdot} 中心点符号。页码格式的内容位于页码前面,可以设置页码字体、距离。 % -% \tn{EbNumberline} 命令类似\CTeX 的 \tn{CTEXnumberline} 命令,用于 \opt{tocline} 选项中设置目录标签的编号。区别是它需要在 \opt{tocset/hang = false} 时使用,否则目录中无法显示标题编号,使用它的时候 \opt{numsep} 选项仍然有效。\meta{编号类型} 为 \opt{chapter} 和 \opt{section} 等,也可用参数\#1代替当前级别类型,标题名用参数\#2代替一般不变。 +% \tn{EbNumberline} 命令类似 \CTeX 的 \tn{CTEXnumberline} 命令,用于 \opt{tocline} 选项中设置目录标签的编号。区别是它需要在 \opt{tocset/hang = false} 时使用,否则目录中无法显示标题编号,使用它的时候 \opt{numsep} 选项仍然有效。\meta{编号类型} 为 \opt{chapter} 和 \opt{section} 等,也可用参数\#1代替当前级别类型,标题名用参数\#2代替一般不变。 % \end{function} % % \begin{ctexexam} @@ -556,9 +545,9 @@ The latest version of this license is in % { % chapter = % { -% format = \addvspace{8pt}\large, -% indent = 1.5\ccwd, -% rule = \tocrule[0.6pc](1.1){.}[\zihao{5}] +% format = \addvspace{8pt}\large, +% indent = 1.5\ccwd, +% rule = \tocrule[0.6pc](1.1){.}[\zihao{5}] % } % } % \end{ctexexam} @@ -578,20 +567,20 @@ The latest version of this license is in % rule-all = <目录引导线样式> % \end{syntax} % \ding{229} 以上选项路径为 \opt{tocset/list/...} 或 \opt{tocset/...} -% \changes{v1.24z}{2021/04/05}{可以设置图、表和代码目录的标签。} -% \changes{v1.24z}{2021/04/06}{增加目录引导线右边对齐方式。} -% \changes{v1.24z}{2021/04/19}{给目录增加 \opt{hang} 样式选项。} -% \changes{v1.24z}{2021/05/01}{给目录增加 \opt{format+} 和 \opt{rule-all} 选项。} +% \changes{v1.24}{2021/04/05}{可以设置图、表和代码目录的标签。} +% \changes{v1.24}{2021/04/06}{增加目录引导线右边对齐方式。} +% \changes{v1.24}{2021/04/19}{给目录增加 \opt{hang} 样式选项。} +% \changes{v1.24}{2021/05/01}{给目录增加 \opt{format+} 和 \opt{rule-all} 选项。} % \end{function} % % \begin{optdesc} -% \item[lolskip] \opt{lolskip} 是代码目录中章之间的代码标题的距离,与\CTeX 的表格目录和图片目录中章之间的标题距离选项 \opt{lotskip} 和 \opt{lofskip} 类似,它们的值均默认0.8 pc,在 \opt{article} 模式中此选项失效。 +% \item[lolskip] \opt{lolskip} 是代码目录中章之间的代码标题的距离,与 \CTeX 的表格目录和图片目录中章之间的标题距离选项 \opt{lotskip} 和 \opt{lofskip} 类似,它们的值均默认0.8 pc,在 \opt{article} 模式中此选项失效。 % \item[belowoffset] \opt{belowoffset} 选项为主目录标题 \tn{contentsname} 后的间距补偿,一般为负值,用于抵消 \opt{format} 中设置的垂直间距。\opt{list} 中的 \opt{belowoffset} 与之意义类似,但是一般为正值,可以在 \opt{article} 模式中使用。建议 \opt{list/lolskip(0.8pc) + list/format/addvspace(0.2pc) + list/belowoffset(0pc) = belowoffset(-1pc)}。 % \item[tocline] 目录标签整体使用 \opt{tocline} 设置,在图表标签的参数中\#1代表编号,代码标签中则是 \tn{thelstlisting} 代表编号,标签中还可包含标签名称,默认标签名称与图、表和代码环境的标题名称一致。下面举个设置标签的例子 % \begin{ctexexam} % \tocset % { -% hang = false, +% hang = false, % tocline-fig = 图#1\hspace{\ccwd}, % tocline-lst = 代码\thelstlisting\hspace{\ccwd} % } @@ -623,7 +612,7 @@ The latest version of this license is in % \tn{end}\marg{环境名} % \end{syntax} % \pkg{enumitem} 宏包为系统预置的列表环境 \env{enumerate}、\env{itemize}和 \env{description} 提供了更灵活的标签以及间距的控制,可使用 \tn{setlist} 命令设置原有的三种列表格式,也可以直接使用可选参数的键值列表,具体选项见 \pkg{enumitem} 宏包文档。已为三种列表预置了三个级别的格式可相互嵌套,默认标签与 \cls{book} 文档类相同,若自定义标签可例如 -% \changes{v1.24z}{2021/04/08}{重新优化列表环境的配置。} +% \changes{v1.24}{2021/04/08}{重新优化列表环境的配置。} % \end{function} % % \begin{ctexexam} @@ -742,7 +731,7 @@ The latest version of this license is in % \tn{end}\marg{ebparbox} % \end{syntax} % 环境 \env{ebparbox} 与 \env{easybox} 类似,同样带有三个可选参数。当使用星号参数时盒子左边带有一条竖线,\meta{颜色名} 选项可以自定义竖线颜色,使用不带有星号的环境则盒子带有竖线颜色的浅色背景。\meta{段落标题} 选项可以设置标题,默认无标题。 -% \changes{v1.24z}{2021/04/19}{优化盒子环境的选项,增加可带有标题的扁平盒子 \env{ebparbox}。} +% \changes{v1.24}{2021/04/19}{优化盒子环境的选项,增加可带有标题的扁平盒子 \env{ebparbox}。} % \end{function} % % \subsubsection{行内盒子} @@ -764,7 +753,7 @@ The latest version of this license is in % \ <行间代码> % \tn{end}\marg{lstlisting} % \end{syntax} -% 加载 \pkg{listings} 宏包以对代码格式进行高度定制,代码样式可使用 \tn{lstset} 命令设置,预置的代码样式名为 \opt{easy-listings}。\opt{lstlistlistingname} 和 \opt{lstlistingname} 分别是代码目录名与代码环境标题名,与\CTeX 使用手册中标题汉化一节用法相同,可使用 \tn{ctexset} 直接定义。 +% 加载 \pkg{listings} 宏包以对代码格式进行高度定制,代码样式可使用 \tn{lstset} 命令设置,预置的代码样式名为 \opt{easy-listings}。\opt{lstlistlistingname} 和 \opt{lstlistingname} 分别是代码目录名与代码环境标题名,与 \CTeX 使用手册中标题汉化一节用法相同,可使用 \tn{ctexset} 直接定义。 % \end{function} % % \subsection{物理量} @@ -800,8 +789,8 @@ The latest version of this license is in % \tn{ref}\marg{标签} % \tn{labelformat}\marg{计数器}\marg{标签引用格式} % \end{syntax} -% 使用 \tn{ref} 命令进行引用将会自动检测环境并添加相应的前缀,\tn{labelformat} 可以设置标签引用格式,第二个参数中\#1代表 \tn{the}\meta{计数器},可以设置引用序号的前缀和后缀。 -% \changes{v1.24z}{2021/04/11}{取消载入 \pkg{cleveref} 宏包来交叉引用。} +% 使用 \tn{ref} 命令引用 \tn{label} 设置的标签,将会自动检测环境并添加相应的前缀,比如图表、章节标题和定理等。\tn{labelformat} 可以设置标签引用格式,第二个参数中\#1代表 \tn{the}\meta{计数器},可以设置引用序号的前缀和后缀。 +% \changes{v1.24}{2021/04/11}{取消载入 \pkg{cleveref} 宏包来交叉引用。} % \end{function} % % \subsubsection{索引} @@ -811,7 +800,7 @@ The latest version of this license is in % \tn{printindex*+}\parg{索引名}\oarg{键值列表} % \end{syntax} % \pkg{imakeidx} 宏包可使用索引的功能,重新定义了它的 \tn{printindex} 命令用于生成索引目录,键值列表及用法与小节 \ref{subsec:document command} 相同,但 \opt{multoc} 选项和 \pkg{imakeidx} 原本的接口命令 \tn{indexsetup} 部分选项失效。仅做了简单的设置如将索引设为双栏并加入目录,其他选项可另外配置。 -% \changes{v1.24z}{2021/05/01}{重新定义 \tn{printindex} 命令与文档适配。} +% \changes{v1.24}{2021/05/01}{重新定义 \tn{printindex} 命令与文档适配。} % \end{function} % % \subsubsection{自定义脚注} @@ -909,13 +898,12 @@ The latest version of this license is in % \item[\ding{75} mathtools] 增强 \pkg{amsmath} 的数学功能。 % \item[\ding{75} unicode-math] 处理使用 unicode 编码的数学字体。 % \end{description} -% \end{documentation} % % \StopEventually{} %<*class> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e,etoolbox} -\ProvidesExplClass{easybook}{2021/05/02}{1.24z}{beta} +\ProvidesExplClass{easybook}{2021/05/03}{1.25}{beta} \cs_generate_variant:Nn \eb_ctex_define:nn { nx } \cs_generate_variant:Nn \int_to_arabic:n { v } @@ -1070,8 +1058,10 @@ The latest version of this license is in equation-sep .tl_set:N = \l__eb_equation_separator_tl, number-sep .meta:n = { - figure-sep = #1,table-sep = #1, - listing-sep = #1,equation-sep = #1 + figure-sep = #1, + table-sep = #1, + listing-sep = #1, + equation-sep = #1 }, number-sep .initial:n = { . } } @@ -1289,7 +1279,7 @@ The latest version of this license is in chap-mark .cs_set:Np = \eb_fancyhf_chapter_mark:n #1, chap-mark .initial:n = { - \int_compare:nT { \c@secnumdepth > -1 } + \int_compare:nNnT { \c@secnumdepth } > { -1 } { \ifbool{@mainmatter} { @@ -1301,7 +1291,7 @@ The latest version of this license is in sec-mark .cs_set:Np = \eb_fancyhf_section_mark:n #1, sec-mark .initial:n = { - \int_compare:nT { \c@secnumdepth > 0 } + \int_compare:nNnT { \c@secnumdepth } > { 0 } { \int_if_odd:nT { \CTEX@section@numbering } { \CTEXthesection\hspace{0.5\ccwd} } @@ -1310,7 +1300,7 @@ The latest version of this license is in subsec-mark .cs_set:Np = \eb_fancyhf_subsection_mark:n #1, subsec-mark .initial:n = { - \int_compare:nT { \c@secnumdepth > 1 } + \int_compare:nNnT { \c@secnumdepth } > { 1 } { \int_if_odd:nT { \CTEX@subsection@numbering } { \CTEXthesubsection\hspace{0.5\ccwd} } @@ -1580,7 +1570,8 @@ The latest version of this license is in { \addcontentsline{lol}{lstlisting} {\protect\numberline{\thelstlisting}\lst@@caption} - }{ + } + { \addcontentsline{lol}{lstlisting} { \ifbool{eb@titletoc@hang@fix}{\protect\numberline}{} @@ -1848,7 +1839,7 @@ The latest version of this license is in \cs_new:Npn \eb_arabic:n #1 { \int_to_arabic:v { c@#1 } } \cs_gset:cpn { thesection } { - \int_compare:nT { \c@chapter > 0 } { \thechapter. } + \int_compare:nNnT { \c@chapter } > { 0 } { \thechapter. } \eb_arabic:n { section } } \seq_const_from_clist:Nn \c__eb_serial_number_counter_seq @@ -1857,7 +1848,7 @@ The latest version of this license is in { \cs_set:cpn { the#1 } { - \int_compare:nT { \c@chapter > 0 } + \int_compare:nNnT { \c@chapter } > { 0 } { \thechapter \use:c { l__eb_#1_separator_tl } @@ -2050,7 +2041,7 @@ The latest version of this license is in headindent = \l__eb_thm_headindent_tl, headfont = \l__eb_thm_headfont_tl, notefont = \l__eb_thm_notefont_tl, - notebraces = {}{}, + notebraces = { }{ }, bodyfont = \l__eb_thm_bodyfont_tl, headpunct = \l__eb_thm_headpunct_tl, postheadspace = \l__eb_thm_spacepost_tl, @@ -2160,7 +2151,7 @@ The latest version of this license is in \cs_gset:Npn \tagform@ #1 { \maketag@@@{\color{ctex@emph}(\ignorespaces #1\unskip\@@italiccorr)} } \ctex_at_end_package:nn { unicode-math } - {\msg_redirect_module:nnn { unicode-math } { warning } { none } } + { \msg_redirect_module:nnn { unicode-math } { warning } { none } } \ctex_at_end_package:nn { tcolorbox } { @@ -2475,7 +2466,7 @@ The latest version of this license is in rulecolor = \color{ctex@frame}, commentstyle = \color{SlateGray}, emphstyle = \color{ctex@emph}, - emph = {caption,multirow,subcaption,tabularx}, + % emph = {}, morekeywords = { includegraphics,setmainfont,setsansfont,setmonofont,setCJKmainfont,setCJKsansfont,setCJKmonofont,setCJKfamilyfont,RequirePackage -- cgit v1.2.3