summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-03-16 22:16:16 +0000
committerKarl Berry <karl@freefriends.org>2021-03-16 22:16:16 +0000
commit2ca606b41366967129514d78b3f2c1c53c257b8a (patch)
tree11994bf09ed92390d53459f76ce0c76be9a27bf7
parent82efe2bcfe309c2aef7b6d72ab09aaf39ee38938 (diff)
easybook (16mar21) (branch)
git-svn-id: svn://tug.org/texlive/branches/branch2020.0@58453 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/easybook/easybook-demo.pdfbin287471 -> 287470 bytes
-rw-r--r--Master/texmf-dist/doc/latex/easybook/easybook-demo.tex19
-rw-r--r--Master/texmf-dist/doc/latex/easybook/easybook.pdfbin245151 -> 254673 bytes
-rw-r--r--Master/texmf-dist/doc/latex/easybook/easybook.tex168
-rw-r--r--Master/texmf-dist/tex/latex/easybook/easybook.cls254
5 files changed, 295 insertions, 146 deletions
diff --git a/Master/texmf-dist/doc/latex/easybook/easybook-demo.pdf b/Master/texmf-dist/doc/latex/easybook/easybook-demo.pdf
index 0217ebec007..b4c9858e551 100644
--- a/Master/texmf-dist/doc/latex/easybook/easybook-demo.pdf
+++ b/Master/texmf-dist/doc/latex/easybook/easybook-demo.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/easybook/easybook-demo.tex b/Master/texmf-dist/doc/latex/easybook/easybook-demo.tex
index 9ad0b579c1e..a8a4d2e0e92 100644
--- a/Master/texmf-dist/doc/latex/easybook/easybook-demo.tex
+++ b/Master/texmf-dist/doc/latex/easybook/easybook-demo.tex
@@ -1,4 +1,5 @@
\documentclass[
+ class = book,
zihao = -4,
font = noto,
paper = a4paper,
@@ -10,14 +11,14 @@
style =
{
color = seaside,
- % capdash = true,
% multoc = true,
% withpart = true,
% perpart = true,
perpage = true,
% notomath = false,
rulewidth = 0.75pt,
- % uppercase = false
+ % uppercase = false,
+ number-sep = {.}
},
link =
{
@@ -33,7 +34,7 @@
caption = 1,
footnote = 1
},
- elfont =
+ elsefont =
{
table-cap = \sffamily\zihao{5},
figure-cap = \sffamily\zihao{5},
@@ -97,11 +98,11 @@
\url{https://latexstudio.net} \\
\url{https://gitee.com/texl3/easybook}\thanks{Gitee为项目的主要发布地址。}
}
-\date{2021/03/14\hskip\ccwd\relax v1.23q}
+\date{2021/03/16\hskip\ccwd\relax v1.23s}
\frontmatter[roman]
\maketitle
-\tableofcontents
+\tableofcontents[book,multoc = false]
\mainmatter*
\part{使用示例}
@@ -111,9 +112,9 @@
\include{appendix}
\backmatter
-\printbibliography
-\listoffigures
-\listoftables
-\listoflistings
+\printbibliography[book,multoc = false]
+\listoffigures[book,multoc = false]
+\listoftables[book,multoc = false]
+\listoflistings[book,multoc = false]
\printindex
\end{document} \ No newline at end of file
diff --git a/Master/texmf-dist/doc/latex/easybook/easybook.pdf b/Master/texmf-dist/doc/latex/easybook/easybook.pdf
index 25192edcd6e..7ff104be61e 100644
--- a/Master/texmf-dist/doc/latex/easybook/easybook.pdf
+++ b/Master/texmf-dist/doc/latex/easybook/easybook.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/easybook/easybook.tex b/Master/texmf-dist/doc/latex/easybook/easybook.tex
index b8b375c3335..bd6c66ebc8b 100644
--- a/Master/texmf-dist/doc/latex/easybook/easybook.tex
+++ b/Master/texmf-dist/doc/latex/easybook/easybook.tex
@@ -2,7 +2,7 @@
\title{\sffamily easybook书籍文档类}
\author{瞿毅}
-\date{2021/03/14\hskip\ccwd\relax v1.23q\thanks{\url{https://gitee.com/texl3/easybook}}}
+\date{2021/03/16\hskip\ccwd\relax v1.23s\thanks{\url{https://gitee.com/texl3/easybook}}}
\begin{document}
\maketitle
@@ -36,8 +36,8 @@
\end{frameverb}
\subsection{字体设置}
-\label{font settings}
-默认使用\CTeX 预置中文字库,当开启 \opt{font = noto} 选项时需要安装开源字体,中文使用方正系列的{\songti 方正书宋}、{\heiti 方正黑体}、{\kaishu 方正楷体}和{\fangsong 方正仿宋},英文使用思源系列的{\rmfamily Noto Serif}、{\sffamily Noto Sans}和{\ttfamily Noto Sans Mono},数学字体使用 \pkg{notomath}。相关选项可以见小节 \ref{document class options} 中的 \opt{font} 选项,字体点击此处下载\href{https://wws.lanzous.com/b01ns361i}{下载地址}。
+\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 默认字体和方正、思源字体,\textbf{自定义字体}需启用选项 \opt{font = none},并可在导言区设置中文字体,粗体与斜体不设置会产生警告。
\begin{ctexexam}
@@ -47,7 +47,7 @@
\end{ctexexam}
\section{文档类选项}
-\label{document class options}
+\label{sec:document class options}
标准 \cls{book} 文类与 \cls{ctexbook} 文类的选项同样适用于本文档。除此之外选项分为两类
\begin{itemize}
\item 带有 \rexptarget\rexpstar{} 号的选项,需要在引入文档类的时候设定。
@@ -80,7 +80,7 @@
\begin{syntax}
font = <adobe|founder|mac|windows|linux|(overleaf)|noto|none>
\end{syntax}
-传递给 \cls{ctexbook} 设置字体,最好不要使用原有的 \opt{fontset} 选项,默认情况下使用自定义字体而不开启这个选项,可根据安装的字体及电脑系统选取。\opt{noto} 与 \opt{none} 选项的相关描述见小节 \ref{font settings},\opt{overleaf} 是一个各系统通用选项,会检测系统环境选取对应字体。
+传递给 \cls{ctexbook} 设置字体,最好不要使用原有的 \opt{fontset} 选项,默认情况下使用自定义字体而不开启这个选项,可根据安装的字体及电脑系统选取。\opt{noto} 与 \opt{none} 选项的相关描述见小节 \ref{subsec:font settings},\opt{overleaf} 是一个各系统通用选项,会检测系统环境选取对应字体。
\changes{v1.21}{2021/01/12}{默认字体与\CTeX 一致,不再是自定义字体。}
\end{function}
@@ -91,14 +91,37 @@
设置页面大小,交给 \pkg{geometry} 宏包处理,可使用它支持的所有规格。建议选项 \opt{b5paper} 和 \opt{zihao = 5},选项 \opt{a4paper} 和 \opt{zihao = -4} 配合。
\end{function}
+\subsection{article 风格}
+\begin{function}[rEXP,added = 2021-03-16]{class}
+\begin{syntax}
+ class = <(book)|article>
+\end{syntax}
+设置文类风格,默认为 \opt{book} 文档类。选用 \opt{article} 使文档编号、结构等与 \cls{article} 文档类的特性相似,可用于短篇幅的文章,不要再使用 \tn{chapter} 命令,此时设置双栏目录的 \opt{style/multoc} 选项、小节 \ref{subsec:document command} 中打印目录命令的 \opt{multoc} 及 \opt{book} 选项均会失效,会以 \opt{section} 标题级别输出目录。
+\changes{v1.23s}{2021/03/16}{增加 article 文章风格,可用于短篇幅的文章。}
+\end{function}
+
\subsection{文档命令}
-\begin{function}[added = 2021-02-20]{\frontmatter,\mainmatter,\backmatter,\listoffigures,\listoftables,\listoflistings}
+\label{subsec:document command}
+\begin{function}[added = 2021-02-20,updated = 2021-03-15]{\frontmatter,\mainmatter,\backmatter,\tableofcontents,\listoffigures,\listoftables,\listoflistings}
\begin{syntax}
- \tn{frontmatter}\oarg{编号格式|(Roman)}
- \tn{printindex}\oarg{索引名}
+ \tn{frontmatter*}\oarg{编号格式|(Roman)}
+ \tn{mainmatter*}
+ \tn{backmatter}
+ \tn{tableofcontents}\oarg{键值列表}
+ \tn{listoffigures*}\oarg{键值列表}
+ \tn{listoftables*}\oarg{键值列表}
+ \tn{listoflistings*}\oarg{键值列表}
+\end{syntax}
+\tn{frontmatter} 为前言区命令,章标题不编号,页码可设置为例如 \opt{roman}、\opt{Alph} 等格式,带有星号的命令 \tn{frontmatter*} 不使用 \tn{cleardoublepage}。\tn{mainmatter} 为主文区命令,章标题正常编号且页码为从1开始计数的阿拉伯数字,\tn{mainmatter*} 命令不使用 \tn{cleardoublepage}。\tn{backmatter} 为后记区命令,页码格式与编号保持不变,章标题不编号。\tn{listoffigures} 命令输出图片目录,\tn{listoftables} 命令输出表格目录,\tn{listoflistings} 命令输出代码目录。带有星号的目录命令不会添加进主文档目录中,目录的键值列表选项如下
+\changes{v1.23s}{2021/02/20}{重新定义文档结构划分命令。}
+\end{function}
+
+\begin{function}{multoc,book,article}
+\begin{syntax}
+ multoc = <true|(false)>
\end{syntax}
-\tn{frontmatter} 为前言区命令,章标题不编号,页码可设置为例如 \opt{roman}、\opt{Alph} 等格式,带有星号的命令 \tn{frontmatter*} 不使用 \tn{cleardoublepage}。\tn{mainmatter} 为主文区命令,章标题正常编号且页码为从1开始计数的阿拉伯数字,\tn{mainmatter*} 命令不使用 \tn{cleardoublepage}。\tn{backmatter} 为后记区命令,页码格式与编号保持不变,章标题不编号。\tn{listoffigures} 命令输出图片目录,\tn{listoftables} 命令输出表格目录,\tn{listoflistings} 命令输出代码目录。
-\changes{v1.23q}{2021/02/20}{重新定义文档结构划分命令。}
+\opt{multoc} 与 \opt{style/multoc} 选项具有相同的效果,但是具有优先性且可单独设置不同目录是否双栏排版。\opt{book} 选项使目录标题按照 \opt{chapter} 级别输出,\opt{article} 选项使目录标题按照 \opt{article} 级别输出,默认为 \opt{chapter} 级别。
+\changes{v1.23s}{2021/03/15}{为几个目录增加键值列表的选项,可设置标题输出级别以及是否加入主目录。}
\end{function}
\section{接口选项}
@@ -118,10 +141,10 @@
\end{function}
\subsection{风格}
-\begin{function}[EXP,added = 2021-01-05,updated = 2021-02-27]{style/color,style/capdash,style/multoc,style/withpart,style/perpart,style/perpage,style/notomath,style/rulewidth,style/uppercase}
+\begin{function}[EXP,added = 2021-01-05,updated = 2021-03-15]{style/...,color,multoc,withpart,perpart,perpage,notomath,rulewidth,uppercase,figure-sep,table-sep,listing-sep,equation-sep,number-sep}
\begin{syntax}
+ 以下选项路径为 \tn{ctexset}\marg{style/...}
color = <(none)|seaside|energy|cyberpunk>
- capdash = <true|(false)>
multoc = <true|(false)>
withpart = <true|(false)>
perpart = <true|(false)>
@@ -129,11 +152,16 @@
notomath = <(true)|false>
rulewidth = <(0.75pt)>
uppercase = <(true)|false>
+ figure-sep = <(.)>
+ table-sep = <(.)>
+ listing-sep = <(.)>
+ equation-sep = <(.)>
+ number-sep = <(.)>
\end{syntax}
-\opt{style} 选项控制文章的风格。
\changes{v1.10}{2021/01/08}{更改颜色实现方式与选项名。}
-\changes{v1.23q}{2021/02/02}{noto风格的数学字体独立出来,可自定义设置。}
-\changes{v1.23q}{2021/02/09}{增加控制页面横线粗细的选项。}
+\changes{v1.23s}{2021/02/02}{noto风格的数学字体独立出来,可自定义设置。}
+\changes{v1.23s}{2021/02/09}{增加控制页面横线粗细的选项。}
+\changes{v1.23s}{2021/03/15}{增加控制编号连接符的选项。}
\end{function}
\begin{optdesc}
@@ -142,10 +170,9 @@
\begin{syntax}
\tn{definecolor}\oarg{类型}\marg{名称}\marg{模式列表}\marg{参数列表}
\end{syntax}
- 主题颜色用到这三个颜色,可以使用 \tn{definecolor} 命令进行更改,类似地更改超链接颜色见小节 \ref{hyperlinks}。
+ 主题颜色用到这三个颜色,可以使用 \tn{definecolor} 命令进行更改,类似地更改超链接颜色见小节 \ref{subsec:hyperlinks}。
\changes{v1.10}{2021/01/08}{可以自定义主题颜色。}
\end{function}
- \item[capdash] 将图表代码标题风格由例如\textbf{图1.1}变为\textbf{图1\textendash 1}的形式。
\item[multoc] 开启双栏目录,可与 \opt{onecolumn} 和 \opt{twocolumn} 选项配合出单栏正文、单栏目录,双栏正文、单栏目录,单栏正文、双栏目录和双栏正文、双栏目录四种方式 。
\item[withpart] 使章跟随每一部分编号,默认不跟随。
\item[perpart] 使脚注跟随每一部分编号,默认不跟随。
@@ -153,12 +180,18 @@
\item[notomath] 使用 \opt{noto} 风格的数学字体,将会加载 \pkg{newtxmath} 宏包。
\item[rulewidth] 调整页眉、定理盒子以及代码框线条的粗细。
\item[uppercase] 使用 \tn{rightmark} 及 \tn{leftmark} 获取标题内容设置页眉页脚时英文是否大小写。
+ \item[figure-sep] 图片标题编号的连接符。
+ \item[table-sep] 表格标题编号的连接符。
+ \item[listing-sep] 代码标题编号的连接符。
+ \item[equation-sep] 公式编号的连接符。
+ \item[number-sep] 统一设置所有编号的连接符。
\end{optdesc}
\subsection{超链接}
-\label{hyperlinks}
-\begin{function}[EXP,added = 2021-01-05,updated = 2021-01-08]{link/hyperlink,link/linkcolor,link/linktopage}
+\label{subsec:hyperlinks}
+\begin{function}[EXP,added = 2021-01-05,updated = 2021-01-08]{link/...,hyperlink,linkcolor,linktopage}
\begin{syntax}
+ 以下选项路径为 \tn{ctexset}\marg{link/...}
hyperlink = <(edge)|various|none>
linkcolor = <(fresh)|cutepink|skyblue|crimson>
linktopage = <true|(false)>
@@ -180,17 +213,18 @@
\end{optdesc}
\subsection{行距}
-\begin{function}[EXP,added = 2021-01-05,updated = 2021-02-13]{spread/line,spread/table,spread/math,spread/caption,spread/footnote}
+\begin{function}[EXP,added = 2021-01-05,updated = 2021-02-13]{spread/...,line,table,math,caption,footnote}
\begin{syntax}
+ 以下选项路径为 \tn{ctexset}\marg{link/...}
line = <(1.3)>
table = <(1.05)>
math = <(1.05)>
caption = <(1)>
footnote = <(1)>
\end{syntax}
-行距因子用于设置各种行距倍数,只能是浮点数,不能带有长度单位。\tn{ctexset} 原有的行距选项\opt{linespread}失效。各行距既可在导言区全局设置也可正文中设置对后面生效,行距的意义为
+行距因子用于设置各种行距倍数,只能是浮点数,不能带有长度单位。\tn{ctexset} 原有的行距选项 \opt{linespread} 失效。各行距既可在导言区全局设置也可正文中设置对后面生效,行距的意义为
\changes{v1.21}{2021/01/12}{增加脚注线间的距离选项。}
-\changes{v1.23q}{2021/02/09}{取消使用 \pkg{zhlineskip} 宏包设置数学间距。}
+\changes{v1.23s}{2021/02/09}{取消使用 \pkg{zhlineskip} 宏包设置数学间距。}
\end{function}
\begin{optdesc}
@@ -202,8 +236,9 @@
\end{optdesc}
\subsection{其它字体}
-\begin{function}[EXP,added = 2021-01-08,updated = 2021-02-13]{elfont/table-cap,elfont/figure-cap,elfont/listing-cap,elfont/footnote,elfont/marginpart}
+\begin{function}[EXP,added = 2021-01-08,updated = 2021-02-13]{elsefont/...,table-cap,figure-cap,listing-cap,footnote,marginpart}
\begin{syntax}
+ 以下选项路径为 \tn{ctexset}\marg{elsefont/...}
table-cap = <\tn{sffamily}\tn{small}>
figure-cap = <\tn{sffamily}\tn{small}>
listing-cap = <\tn{sffamily}\tn{small}>
@@ -211,7 +246,7 @@
marginpart = <\tn{rmfamily}\tn{footnotesize}>
\end{syntax}
\changes{v1.10}{2021/01/08}{加入自定义非正文字体选项。}
-\changes{v1.23q}{2021/02/08}{修复使用 \tn{zihao} 命令设置字体失效的问题。}
+\changes{v1.23s}{2021/02/08}{修复使用 \tn{zihao} 命令设置字体失效的问题。}
\end{function}
\begin{optdesc}
@@ -223,16 +258,16 @@
\end{optdesc}
\subsection{参考文献}
-\begin{function}[EXP,added = 2021-01-11,updated = 2021-03-08]{bibset/backend,bibset/bib-style,bibset/cite-style,bibset/bibfile,\printbibliography}
+\begin{function}[EXP,added = 2021-01-11,updated = 2021-03-15]{bibset/...,backend,bib-style,cite-style,bibfile}
\begin{syntax}
+ 以下选项路径为 \tn{ctexset}\marg{bibset/...}
backend = <(bibtex)|biblatex>
bib-style = <(numerical)|authoryear|其它格式>
cite-style = <标注风格>
bibfile = <refs.bib>
- \tn{printbibliography}\oarg{键值列表}
\end{syntax}
\changes{v1.21}{2021/01/11}{增加 \opt{bibset} 选项,可以使用 \hologo{BibTeX} 或 \hologo{biber} 编译参考文献。}
-\changes{v1.23q}{2021/02/23}{使用 \opt{bibset} 选项时可设置标注风格。}
+\changes{v1.23s}{2021/02/23}{使用 \opt{bibset} 选项时可设置标注风格。}
\end{function}
\begin{optdesc}
@@ -240,12 +275,27 @@
\item[bib-style] 参考文献格式为中国的参考文献推荐标准GB/T 7714-2015,有顺序编码制和著者-出版年制两种风格,理工科类一般使用顺序编码制,文科类一般使用著者-出版年制。若使用其它格式,使用 \hologo{BibTeX} 处理时需确保正确的 \opt{bst} 文件,使用 \hologo{biber} 处理可使用 \pkg{biblatex} 宏包支持的参考文献风格名称。
\item[cite-style] 标注参考文献的风格,\opt{backend = bibtex} 选项下可使用 \opt{super}(数字上标标注,默认)或 \opt{numbers}(数字标注)等 \pkg{natbib} 宏包带有的标注风格,\opt{backend = biblatex} 选项下可使用 \pkg{biblatex} 宏包支持的标注风格名称。
\item[bibfile] 参考文献的数据文件,使用 \hologo{biber} 处理时要带有 \opt{bib} 后缀,默认为一个以 \opt{refs.bib} 命名的文件。
- \item[\tn{printbibliography}] 两种方式\textbf{均使用}此命令打印参考文献,其中可选项仅在 \hologo{biber} 处理时有效。
\end{optdesc}
+\begin{function}[added = 2021-01-11,updated = 2021-03-15]{\printbibliography}
+\begin{syntax}
+ \tn{printbibliography}\oarg{键值列表}
+\end{syntax}
+两种方式\textbf{均使用}此命令打印参考文献,不同处理后端此命令的键值列表不同。使用 \hologo{BibTeX} 处理时选项与小节 \ref{subsec:document command} 目录的选项相同,使用 \hologo{biber} 处理时常用的选项如下
+\end{function}
+
+\begin{function}{heading,title}
+\begin{syntax}
+ heading = <bibliography|subbibliography|(bibintoc)|subbibintoc>
+ title = <参考文献标题名>
+\end{syntax}
+\opt{heading} 为参考文献标题的处理方式,\opt{bibliography} 选项以 \opt{chapter} 级别输出参考文献,不加进目录,\opt{subbibliography} 选项以 \opt{section} 级别输出参考文献,不加进目录,\opt{bibintoc} 选项以 \opt{chapter} 级别输出参考文献,加进目录,\opt{subbibintoc} 选项以 \opt{section} 级别输出参考文献,加进目录。\opt{title} 选项覆盖由 \opt{heading} 选项提供的缺省标题名。除此之外其他支持选项可见 \pkg{biblatex} 宏包说明文档。
+\end{function}
+
\subsection{定理样式}
-\begin{function}[EXP,added = 2021-01-12,updated = 2021-03-13]{thmset/thmbox,thmset/numberwith,thmset/headpunct,thmset/bodyfont,thmset/notefont,thmset/headfont,thmset/headindent,thmset/spaceabove,thmset/spacebelow,thmset/spacepost,\newtheorem, \declaretheoremstyle}
+\begin{function}[EXP,added = 2021-01-12,updated = 2021-03-13]{thmset/...,thmbox,numberwith,headpunct,bodyfont,notefont,headfont,headindent,spaceabove,spacebelow,spacepost}
\begin{syntax}
+ 以下选项路径为 \tn{ctexset}\marg{thmset/...}
thmbox = <true|(false)>
numberwith = <(chapter)|section|其它环境|空置>
headpunct = <(未设置)>
@@ -256,11 +306,8 @@
spaceabove = <(0.75ex plus .1ex)>
spacebelow = <(0.75ex plus .1ex)>
spacepost = <(\tn{ccwd})>
- \tn{newtheorem}\oarg{键值列表}\marg{定理环境名}
- \tn{declaretheoremstyle}\oarg{键值列表}\marg{定理样式名}
\end{syntax}
\changes{v1.21}{2021/01/12}{增加配置定理环境样式的选项。}
-\changes{v1.23q}{2021/03/12}{重新定义了新定理环境命令 \tn{newtheorem}。}
\end{function}
\begin{optdesc}
@@ -274,6 +321,17 @@
\item[spaceabove] 定理环境前的间距。
\item[spacebelow] 定理环境后的间距。
\item[spacepost] 定理标题后与内容的间距。
+\end{optdesc}
+
+\begin{function}[added = 2021-01-12,updated = 2021-03-13]{\newtheorem, \declaretheoremstyle}
+\begin{syntax}
+ \tn{newtheorem}\oarg{键值列表}\marg{定理环境名}
+ \tn{declaretheoremstyle}\oarg{键值列表}\marg{定理样式名}
+\end{syntax}
+\changes{v1.23s}{2021/03/12}{重新定义了新定理环境命令 \tn{newtheorem}。}
+\end{function}
+
+\begin{optdesc}
\item[\tn{newtheorem}] 定义新的定理类环境,可选参数与 \pkg{thmtools} 宏包定理命令 \tn{declaretheorem} 的参数一致。常用的选项如下
\begin{description}
\item[name] 定理的标题。默认值是环境的名称,并且首字母大写(英文标题)。
@@ -299,8 +357,9 @@
\end{ctexexam}
\subsection{页面边距}
-\begin{function}[EXP,added = 2021-01-13]{geoset/left,geoset/top,geoset/hmargin,geoset/textwidth,geoset/includehead,...}
+\begin{function}[EXP,added = 2021-01-13]{geoset/...,left,top,hmargin,textwidth,includehead,...}
\begin{syntax}
+ 以下选项路径为 \tn{ctexset}\marg{geoset/...}
left = <长度>
top = <长度>
hmargin = \marg{左边距,右边距}
@@ -324,20 +383,29 @@
\end{function}
\subsection{页眉页脚}
-\begin{function}[EXP,added = 2021-01-13,updated = 2021-03-14]{hdrset/head-foot,hdrset/chap-mark,hdrset/sec-mark,hdrset/headrule,hdrset/footrule,hdrset/footnoterule,\easyhead,\easyfoot,...}
+\begin{function}[EXP,added = 2021-01-13,updated = 2021-03-14]{hdrset/...,head-foot,chap-mark,sec-mark,headrule,footrule,footnoterule}
\begin{syntax}
+ 以下选项路径为 \tn{ctexset}\marg{hdrset/...}
head-foot = <页眉页脚中的内容>
chap-mark = <\tn{chaptermark} 标志命令 \tn{markboth} 中的内容>
sec-mark = <\tn{sectionmark} 标志命令 \tn{markright} 中的内容>
headrule = <页眉横线格式>
footrule = <页脚横线格式>
footnoterule = <脚注横线格式>
+\end{syntax}
+\opt{hdrset} 设置的命令由 \pkg{fancyhdr} 宏包提供支持,\opt{headrule}、\opt{footrule} 和 \opt{footnoterule} 三个横线选项一般可以使用 \tn{hrule} width \meta{长度} height \meta{高度} 命令来绘制,脚注横线默认为空。当然,手动绘制横线时线条粗细选项 \opt{style/rulewidth} 会失效。
+\changes{v1.21}{2021/01/11}{修复单面文档时页眉横线消失的问题。}
+\changes{v1.21}{2021/01/13}{增加配置页眉页脚的选项。}
+\changes{v1.23s}{2021/03/08}{优化页眉页脚设置,增加 \opt{chap-mark} 和 \opt{sec-mark} 选项。}
+\changes{v1.23s}{2021/03/14}{可以手动绘制页眉、页脚和脚注的横线。}
+\end{function}
+
+\begin{function}[added = 2021-01-13,updated = 2021-03-14]{,\easyhead,\easyfoot}
+\begin{syntax}
\tn{easyhead}\oarg{位置}\marg{内容}
\tn{easyfoot}\oarg{位置}\marg{内容}
\end{syntax}
-\opt{hdrset} 设置的命令由 \pkg{fancyhdr} 宏包提供支持,命令 \tn{easyhead} 和 \tn{easyfoot} 的含义与 \tn{fancyhead} 和 \tn{fancyfoot} 相同,它们用于 \opt{head-foot} 选项中,设置的是一个名为 \opt{fancy} 的页面风格。\pkg{fancyhdr} 将页眉页脚分成了左中右和奇数页(odd)、偶数页(even)共12个部分,可选参数中E、O代表偶数、奇数,L、C、R代表左、中、右部分。单面打印时,含有偶数的选项无效。
-
-\opt{headrule}、\opt{footrule} 和 \opt{footnoterule} 三个横线选项一般可以使用 \tn{hrule} width \meta{长度} height \meta{高度} 命令来绘制,脚注横线默认为空。当然,手动绘制横线时线条粗细选项 \opt{style/rulewidth} 会失效。
+命令 \tn{easyhead} 和 \tn{easyfoot} 的含义与 \tn{fancyhead} 和 \tn{fancyfoot} 相同,它们用于 \opt{head-foot} 选项中,设置的是一个名为 \opt{fancy} 的页面风格。\pkg{fancyhdr} 将页眉页脚分成了左中右和奇数页(odd)、偶数页(even)共12个部分,可选参数中E、O代表偶数、奇数,L、C、R代表左、中、右部分。单面打印时,含有偶数的选项无效。
\begin{ctexexam}
\ctexset
{
@@ -354,14 +422,10 @@
}
}
\end{ctexexam}
-\changes{v1.21}{2021/01/11}{修复单面文档时页眉横线消失的问题。}
-\changes{v1.21}{2021/01/13}{增加配置页眉页脚的选项。}
-\changes{v1.23q}{2021/03/08}{优化页眉页脚设置,增加 \opt{chap-mark} 和 \opt{sec-mark} 选项。}
-\changes{v1.23q}{2021/03/14}{可以手动绘制页眉、页脚和脚注的横线。}
\end{function}
\subsection{目录样式}
-\begin{function}[EXP,added = 2021-01-13,updated = 2021-01-15]{tocset/.../format,tocset/.../indent,tocset/.../rule,lists/lolskip,lists/belowoffset,tocset/belowoffset,\tocrule}
+\begin{function}[EXP,added = 2021-01-13,updated = 2021-01-15]{tocset/.../format,tocset/.../indent,tocset/.../rule,lists/lolskip,lists/belowoffset,tocset/belowoffset}
\begin{syntax}
format = <目录标题格式>
indent = <目录标题左边缩进>
@@ -369,12 +433,17 @@
lolskip = <(0.8pc)>
lists/belowoffset = <(0pc)>
belowoffset = <(-1pc)>
- \tn{tocrule} = \oarg{引导点间距|(0.7pc)}\oarg{引导点大小|(1.2)}\marg{引导点}\oarg{页码格式}
\end{syntax}
\opt{tocset} 将目录样式交给 \pkg{titletoc} 处理,预置了 \opt{part}、\opt{chapter}、\opt{section}、\opt{subsection} 和 \opt{lists} 五种级别的目录标题,键值列表中的...代表它们。\opt{lists} 为图片、表格和代码目录格式的级别。
\opt{lolskip} 是代码目录中章之间的代码标题的距离,使用刚性间距,与\CTeX 的 \opt{lotskip} 和 \opt{lofskip} 类似,它们的值均默认0.8pc。\opt{belowoffset} 选项为目录总标题 \tn{contentsname} 后的间距补偿,一般为负值,用于抵消 \opt{format} 中设置的间距。\opt{lists} 中的 \opt{belowoffset} 意义类似,但是一般为正值,在 \opt{lolskip = 0pc} 时使用。建议 \opt{lolskip+lists/format/addvspace = -belowoffset}。
+\changes{v1.21}{2021/01/13}{增加配置目录样式的选项。}
+\end{function}
+\begin{function}[added = 2021-01-13,updated = 2021-01-15]{\tocrule}
+\begin{syntax}
+ \tn{tocrule} = \oarg{引导点间距|(0.7pc)}\oarg{引导点大小|(1.2)}\marg{引导点}\oarg{页码格式}
+\end{syntax}
\tn{tocrule} 命令生成目录引导线,需要在 \opt{rule} 选项中使用,其中引导线间距需带有长度单位,引导点大小不带单位,为引导点符号正常大小的倍数,引导点一般为英文句号或 \tn{cdot} 中心点符号。页码格式的内容位于页码前面,可以设置页码字体、距离。
\begin{ctexexam}
\ctexset
@@ -390,7 +459,6 @@
}
}
\end{ctexexam}
-\changes{v1.21}{2021/01/13}{增加配置目录样式的选项。}
\end{function}
\section{常用环境}
@@ -421,7 +489,7 @@
\end{function}
\subsubsection{排序列表}
-\label{sort list}
+\label{subsec:sort list}
使用 \opt{enumerate} 环境可创建排序列表,使用 \opt{enumerate*} 环境产生行内部列表,可以使用\textbf{A、a、I、i和1}作为可选项为 \opt{enumerate} 与 \opt{enumerate*} 格式化标签。若生成\textbf{Item I、Item II、Item III}格式可以这样
\begin{ctexexam}
\begin{enumerate*}[(a)]
@@ -457,25 +525,25 @@
\end{function}
\subsection{习题}
-\label{exercise}
+\label{subsec:exercise}
\begin{function}[added = 2021-01-05,updated = 2021-03-13]{exercise}
\begin{syntax}
\tn{begin}\marg{exercise}\oarg{颜色名|(LightYellow)}\oarg{编号|(1.)}\oarg{标题|(习题)}\oarg{配置选项}
\tn{item} <习题内容>
\tn{end}\marg{exercise}
\end{syntax}
-习题环境 \opt{exercise} 的标题紧接上一节编号并加入目录与页眉,当使用星号环境时不进行编号。三个可选参数中颜色为自定义或 \pkg{xcolor} 包含的颜色名称,正文编号格式与小节 \ref{sort list} 排序列表相同,标题名默认为摘要,参数只能\textbf{从右往左}省略。
+习题环境 \opt{exercise} 的标题紧接上一节编号并加入目录与页眉,当使用星号环境时不进行编号。三个可选参数中颜色为自定义或 \pkg{xcolor} 包含的颜色名称,正文编号格式与小节 \ref{subsec:sort list} 排序列表相同,标题名默认为摘要,参数只能\textbf{从右往左}省略。
\begin{ctexexam}
\begin{exercise}[LightYellow][1.][习题]
\item 习题内容
\item 习题内容
\end{exercise}
\end{ctexexam}
-\changes{v1.23q}{2021/02/08}{增加准确的习题盒子标题目录锚点。}
+\changes{v1.23s}{2021/02/08}{增加准确的习题盒子标题目录锚点。}
\end{function}
\subsection{盒子}
-盒子以及小节 \ref{exercise} 中 \opt{exercise} 环境配置的选项由 \pkg{tcolorbox} 提供支持,具体选项可见宏包文档的 Option Keys 一节,可以进行边距、字体及背景颜色等各种个性化设置,一些配置会覆盖之前预置的设置。
+盒子以及小节 \ref{subsec:exercise} 中 \opt{exercise} 环境配置的选项由 \pkg{tcolorbox} 提供支持,具体选项可见宏包文档的 Option Keys 一节,可以进行边距、字体及背景颜色等各种个性化设置,一些配置会覆盖之前预置的设置。
\subsubsection{摘要盒子}
\begin{function}[added = 2021-01-05,updated = 2021-03-13]{outline}
@@ -601,7 +669,7 @@
\begin{syntax}
\tn{includepdf}\oarg{键值列表}\marg{文档名}
\end{syntax}
-该命令由 \pkg{pdfpages} 提供,将其他 pdf 文档插入当前文档,可以指定插入页数、逻辑页和横向等,详情查看宏包文档。
+该命令由 \pkg{pdfpages} 提供,将其他 pdf 文档插入当前文档,比如插入封面,可以指定插入页数、逻辑页和横向等,详情查看宏包文档。
\end{function}
\subsection{横向页面}
diff --git a/Master/texmf-dist/tex/latex/easybook/easybook.cls b/Master/texmf-dist/tex/latex/easybook/easybook.cls
index cfb30bc1caa..97f532796f2 100644
--- a/Master/texmf-dist/tex/latex/easybook/easybook.cls
+++ b/Master/texmf-dist/tex/latex/easybook/easybook.cls
@@ -7,9 +7,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
-\NeedsTeXFormat{LaTeX2e}
+\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e}
-\ProvidesExplClass{easybook}{2021/03/14}{1.23q}{}
+\ProvidesExplClass{easybook}{2021/03/16}{1.23s}{}
\cs_generate_variant:Nn \keys_define:nn {nx}
\cs_generate_variant:Nn \int_to_arabic:n {v}
@@ -29,6 +29,7 @@
\bool_set_true:N \l__zhtitle_bool
\bool_set_true:N \l__lang_chinese_bool
\bool_set_true:N \l__page_twoside_bool
+\bool_set_true:N \l__class_book_bool
\clist_new:N \g__options_clist
\keys_define:nn {easybook}
@@ -68,7 +69,13 @@
\__put_ctexbook:n {oneside}
},
- unknown .code:n =
+ class .choice:,
+ class .value_required:n = true,
+ class/book .code:n = {},
+ class/article .code:n = {\bool_set_false:N \l__class_book_bool},
+ class .initial:n = book,
+
+ unknown .code:n =
{\clist_gput_right:No \g__options_clist{\CurrentOption}}
}
@@ -93,7 +100,6 @@
\__put_ctexbook:n {\g__options_clist}
\LoadClass[UTF8]{ctexbook}
-\bool_new:N \l__capdash_bool
\bool_new:N \l__multoc_bool
\bool_new:N \l__chap_withpart_bool
\bool_new:N \l__foot_perpart_bool
@@ -107,7 +113,7 @@
style .meta:nn = {ctex/style}{#1},
link .meta:nn = {ctex/link}{#1},
spread .meta:nn = {ctex/spread}{#1},
- elfont .meta:nn = {ctex/elfont}{#1},
+ elsefont .meta:nn = {ctex/elsefont}{#1},
bibset .meta:nn = {ctex/bibset}{#1},
thmset .meta:nn = {ctex/thmset}{#1},
geoset .meta:nn = {ctex/geoset}{#1},
@@ -119,12 +125,8 @@
}
\__ctex_define:nn {style}
{
- capdash .bool_set:N = \l__capdash_bool,
- capdash .default:n = true,
- capdash .initial:n = false,
multoc .bool_set:N = \l__multoc_bool,
multoc .default:n = true,
- multoc .initial:n = false,
withpart .bool_set:N = \l__chap_withpart_bool,
withpart .default:n = true,
withpart .initial:n = false,
@@ -141,7 +143,17 @@
rulewidth .initial:n = 0.75pt,
uppercase .bool_set:N = \l__uppercase_bool,
uppercase .default:n = true,
- uppercase .initial:n = true
+ uppercase .initial:n = true,
+ figure-sep .tl_set:N = \l__figure_separator_tl,
+ table-sep .tl_set:N = \l__table_separator_tl,
+ listing-sep .tl_set:N = \l__lstlisting_separator_tl,
+ equation-sep .tl_set:N = \l__equation_separator_tl,
+ number-sep .meta:n =
+ {
+ figure-sep = {#1},table-sep = {#1},
+ listing-sep = {#1},equation-sep = {#1}
+ },
+ number-sep .initial:n = {.}
}
\RequirePackage
@@ -531,91 +543,113 @@
}{}
}
}
+
+\tl_set:Nn \l__toc_type_tl{book}
+\keys_define:nn {listoc}
+ {
+ article .code:n = \tl_set:Nn \l__toc_type_tl{article},
+ book .code:n = {},
+ multoc .bool_set:N = \l__multoc_bool,
+ multoc .default:n = true,
+ multoc .initial:n = false
+ }
+
\cs_new_protected:Npn \__title_mark_intoc:n #1
{
- \chapter*{\phantomsection#1}
- \CTEX@addtocline{chapter}{#1}
+ \tl_if_eq:NnTF \l__toc_type_tl{book}
+ {
+ \chapter*{\phantomsection#1}
+ \CTEX@addtocline{chapter}{#1}
+ }{
+ \section*{\phantomsection#1}
+ \CTEX@addtocline{section}{#1}
+ }
\__markboth:n {#1}
}
\cs_new_protected:Npn \__title_mark:n #1
{
- \chapter*{\phantomsection#1}
+ \tl_if_eq:NnTF \l__toc_type_tl{book}
+ {\chapter*{\phantomsection#1}}
+ {\section*{\phantomsection#1}}
\__markboth:n {#1}
}
-\cs_gset:Npn \tableofcontents
+\cs_new_protected:Npn \__ifmultoc_pre_set:
+ {
+ \bool_if:NTF \l__class_book_bool
+ {
+ \if@twocolumn
+ \@restonecoltrue
+ \onecolumn
+ \bool_if:NT \l__multoc_bool{\twocolumn}
+ \else
+ \@restonecolfalse
+ \bool_if:NT \l__multoc_bool{\twocolumn}
+ \fi
+ }{\tl_set:Nn \l__toc_type_tl{article}}
+ }
+\cs_new_protected:Npn \__ifmultoc_after_set:
+ {
+ \bool_if:NTF \l__class_book_bool
+ {
+ \if@restonecol
+ \twocolumn
+ \else
+ \onecolumn
+ \fi
+ }{\tl_set:Nn \l__toc_type_tl{article}}
+ }
+\RenewDocumentCommand{\tableofcontents}{o}
{
- \if@twocolumn
- \@restonecoltrue\onecolumn
- \bool_if:NT \l__multoc_bool{\twocolumn}
- \else
- \@restonecolfalse
- \bool_if:NT \l__multoc_bool{\twocolumn}
- \fi
+ \group_begin:
+ \IfValueT {#1}{\keys_set:nn {listoc}{#1}}
+ \__ifmultoc_pre_set:
\__title_mark:n {\contentsname}
\vspace*{\dim_use:N \l__toc_offset_dim}
\@starttoc{toc}
- \if@restonecol
- \twocolumn
- \else
- \onecolumn
- \fi
- }
-\cs_gset:Npn \listoffigures
- {
- \if@twocolumn
- \@restonecoltrue\onecolumn
- \bool_if:NT \l__multoc_bool{\twocolumn}
- \else
- \@restonecolfalse
- \bool_if:NT \l__multoc_bool{\twocolumn}
- \fi
- \__title_mark_intoc:n {\listfigurename}
+ \__ifmultoc_after_set:
+ \group_end:
+ }
+\RenewDocumentCommand{\listoffigures}{so}
+ {
+ \group_begin:
+ \IfValueT {#2}{\keys_set:nn {listoc}{#2}}
+ \__ifmultoc_pre_set:
+ \IfBooleanTF {#1}
+ {\__title_mark:n {\listfigurename}}
+ {\__title_mark_intoc:n {\listfigurename}}
\dim_add:NV \l__toc_offset_dim\l__toc_listsoffset_dim
\vspace*{\dim_use:N \l__toc_offset_dim}
\@starttoc{lof}
- \if@restonecol
- \twocolumn
- \else
- \onecolumn
- \fi
- }
-\cs_gset:Npn \listoftables
- {
- \if@twocolumn
- \@restonecoltrue\onecolumn
- \bool_if:NT \l__multoc_bool{\twocolumn}
- \else
- \@restonecolfalse
- \bool_if:NT \l__multoc_bool{\twocolumn}
- \fi
- \__title_mark_intoc:n {\listtablename}
+ \__ifmultoc_after_set:
+ \group_end:
+ }
+\RenewDocumentCommand{\listoftables}{so}
+ {
+ \group_begin:
+ \IfValueT {#2}{\keys_set:nn {listoc}{#2}}
+ \__ifmultoc_pre_set:
+ \IfBooleanTF {#1}
+ {\__title_mark:n {\listtablename}}
+ {\__title_mark_intoc:n {\listtablename}}
\dim_add:NV \l__toc_offset_dim\l__toc_listsoffset_dim
\vspace*{\dim_use:N \l__toc_offset_dim}
\@starttoc{lot}
- \if@restonecol
- \twocolumn
- \else
- \onecolumn
- \fi
- }
-\cs_new:Npn \listoflistings
- {
- \if@twocolumn
- \@restonecoltrue\onecolumn
- \bool_if:NT \l__multoc_bool{\twocolumn}
- \else
- \@restonecolfalse
- \bool_if:NT \l__multoc_bool{\twocolumn}
- \fi
- \__title_mark_intoc:n {\lstlistlistingname}
+ \__ifmultoc_after_set:
+ \group_end:
+ }
+\NewDocumentCommand{\listoflistings}{so}
+ {
+ \group_begin:
+ \IfValueT {#2}{\keys_set:nn {listoc}{#2}}
+ \__ifmultoc_pre_set:
+ \IfBooleanTF {#1}
+ {\__title_mark:n {\lstlistlistingname}}
+ {\__title_mark_intoc:n {\lstlistlistingname}}
\dim_add:NV \l__toc_offset_dim\l__toc_listsoffset_dim
\vspace*{\dim_use:N \l__toc_offset_dim}
\@starttoc{lol}
- \if@restonecol
- \twocolumn
- \else
- \onecolumn
- \fi
+ \__ifmultoc_after_set:
+ \group_end:
}
\makeindex[
@@ -627,9 +661,9 @@
]
\indexsetup
{
- level = \chapter*,
- toclevel = chapter,
- firstpagestyle = plain
+ level = \bool_if:NTF \l__class_book_bool{\chapter*}{\section*},
+ toclevel = \bool_if:NTF \l__class_book_bool{chapter}{section},
+ firstpagestyle = \bool_if:NTF \l__class_book_bool{plain}{fancy}
}
\__patch_cmd:Nnn \imki@indexheaders
{\@mkboth{\MakeUppercase\indexname}{\MakeUppercase\indexname}}
@@ -640,7 +674,7 @@
\tl_new:N \l__font_listing_tl
\tl_new:N \l__font_footnote_tl
-\__ctex_define:nn {elfont}
+\__ctex_define:nn {elsefont}
{
table-cap .tl_set:N = \l__font_table_tl,
table-cap .initial:n = \sffamily\small,
@@ -682,13 +716,46 @@
\captionsetup[figure][bi-second]{name = Figure}
\captionsetup[table][bi-second]{name = Table}
\cs_new:Npn \__arabic:n #1{\int_to_arabic:v {c@#1}}
-\AtBeginDocument
+\cs_new_protected:Npn \__separator_set:n #1
{
- \bool_if:NT \l__capdash_bool
+ \cs_set:cpn {the#1}
{
- \cs_gset:Npn \thefigure{\thechapter\textendash\__arabic:n {figure}}
- \cs_gset:Npn \thetable{\thechapter\textendash\__arabic:n {table}}
- \cs_gset:Npn \thelstlisting{\thechapter\textendash\__arabic:n {lstlisting}}
+ \int_compare:nT {\c@chapter > 0}
+ {
+ \thechapter
+ \use:c {l__#1_separator_tl}
+ }
+ \__arabic:n {#1}
+ }
+ }
+\cs_gset:cpn {thesection}
+ {
+ \int_compare:nT {\c@chapter > 0}{\thechapter.}
+ \__arabic:n {section}
+ }
+\clist_map_inline:nn
+ {{figure},{table},{lstlisting},{equation}}
+ {\__separator_set:n {#1}}
+\cs_gset_protected:Npn \appendix
+ {
+ \int_compare:nNnTF {\c@chapter} > {0}
+ {
+ \setcounter{chapter}{0}
+ \setcounter{section}{0}
+ \gdef\thechapter{\@Alph\c@chapter}
+ \gdef\CTEX@prechapter{\CTEX@preappendix}
+ \gdef\CTEX@thechapter{\CTEX@appendix@number}
+ \gdef\CTEX@postchapter{\CTEX@postappendix}
+ \gdef\CTEX@chapter@numbering{\CTEX@appendix@numbering}
+ }{
+ \setcounter{section}{0}
+ \setcounter{subsection}{0}
+ \gdef\thesection{\@Alph\c@section}
+ \gdef\CTEX@presection{\CTEX@preappendix}
+ \gdef\CTEX@thesection{\CTEX@appendix@number}
+ \gdef\CTEX@postsection{\CTEX@postappendix}
+ \gdef\CTEX@section@numbering{\CTEX@appendix@numbering}
+ \ctex_set:nn {appendix}{number = {\@Alph\c@section},name = {}}
}
}
\AtBeginEnvironment{tabularx}
@@ -1094,10 +1161,22 @@
}
\tl_if_empty:NF \l__bib_citestyle_tl
{\exp_args:NV \setcitestyle\l__bib_citestyle_tl}
- \cs_set:Npn \bibsection{\__title_mark_intoc:n \bibname}
\skip_set:Nn \bibsep{0ex}
- \NewDocumentCommand{\printbibliography}{o}
- {\exp_args:NV \bibliography\l__bib_file_tl}
+ \NewDocumentCommand{\printbibliography}{so}
+ {
+ \group_begin:
+ \IfValueT {##2}{\keys_set:nn {listoc}{##2}}
+ \__ifmultoc_pre_set:
+ \cs_set:Npn \bibsection
+ {
+ \IfBooleanTF {##1}
+ {\__title_mark:n {\bibname}}
+ {\__title_mark_intoc:n {\bibname}}
+ }
+ \exp_args:NV \bibliography\l__bib_file_tl
+ \__ifmultoc_after_set:
+ \group_end:
+ }
}
\cs_new_protected:Npn \__put_biblatex:n #1
{\PassOptionsToPackage{#1}{biblatex}}
@@ -1119,7 +1198,8 @@
\cs_new_protected:Npn \__biblatex_after_set:
{
\exp_args:NV \addbibresource\l__bib_file_tl
- \defbibheading{bibliography}[\bibname]{\__title_mark_intoc:n {##1}}
+ \cs_gset:Npn \blx@default@theheading{bibintoc}
+ \defbibheading{bibintoc}[\bibname]{\__title_mark_intoc:n {##1}}
\skip_set:Nn \bibitemsep{0ex}
}
\ctex_at_end_preamble:n