From 5a0d7cfdda1dbe41b31e7c9a7f7b26bf0b54e7c9 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 20 Apr 2021 20:13:34 +0000 Subject: easybook (20apr21) git-svn-id: svn://tug.org/texlive/trunk@58926 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/easybook/chapter1.tex | 2 +- Master/texmf-dist/doc/latex/easybook/chapter2.tex | 9 +- .../doc/latex/easybook/easybook-demo.pdf | Bin 268601 -> 268475 bytes .../doc/latex/easybook/easybook-demo.tex | 3 +- Master/texmf-dist/doc/latex/easybook/easybook.pdf | Bin 454141 -> 459430 bytes .../texmf-dist/source/latex/easybook/easybook.dtx | 337 ++++++++++++--------- Master/texmf-dist/tex/latex/easybook/easybook.cls | 270 +++++++++-------- 7 files changed, 348 insertions(+), 273 deletions(-) diff --git a/Master/texmf-dist/doc/latex/easybook/chapter1.tex b/Master/texmf-dist/doc/latex/easybook/chapter1.tex index 99e06cc2d27..cca66cef331 100644 --- a/Master/texmf-dist/doc/latex/easybook/chapter1.tex +++ b/Master/texmf-dist/doc/latex/easybook/chapter1.tex @@ -61,7 +61,7 @@ \zhlipsum*[59][name = aspirin] \end{ebparbox} -\begin{exercise}[LightYellow][1.](习题) +\begin{exercise}+[LightBlue][1.](习题)[after skip = 3ex][\zhlipsum*[20][name = zhufu]] \index{x@习题环境} \item \zhlipsum*[20][name = zhufu] \begin{tasks} diff --git a/Master/texmf-dist/doc/latex/easybook/chapter2.tex b/Master/texmf-dist/doc/latex/easybook/chapter2.tex index a6bb1afb5da..7028ad3f509 100644 --- a/Master/texmf-dist/doc/latex/easybook/chapter2.tex +++ b/Master/texmf-dist/doc/latex/easybook/chapter2.tex @@ -63,12 +63,11 @@ \bicaption{使用 tabularx 创建内容过长表格}{Use tabularx to create a table with too long content}\label{tab:example}\small \begin{tabularx}{0.87\textwidth}{@{}llL@{}} \toprule - Aliquam & Integer & Pellentesque tincidunt purus - vel magna. \\ + Aliquam & Integer & \lipsum[1][9] \\ \midrule - viverra & \multirow[c]{3}*{metus} & Nulla malesuada porttitor diam. Vestibulum lectus. Proin mauris. Proin eu nunc eu urna hendrerit faucibus. \\ - semper & & Nullam elementum, urna vel imperdiet sodales, elit ipsum pharetra ligula, ac pretium ante justo a nulla. Curabitur tristique arcu eu metus. \\ - \multicolumn{2}{c}{\multirow{3}*[0ex]{convallis}} & Nunc elementum fermentum wisi. Aenean placerat. Ut imperdiet, enim sed gravida sollicitudin, felis odio placerat quam, ac pulvinar elit purus eget enim. \\ + viverra & \multirow[c]{3}*{metus} & \lipsum[1][1-2] \\ + semper & & \lipsum[1][3-5] \\ + \multicolumn{2}{c}{\multirow{3}*[0ex]{convallis}} & \lipsum[1][6-8] \\ \bottomrule \end{tabularx} \end{table} diff --git a/Master/texmf-dist/doc/latex/easybook/easybook-demo.pdf b/Master/texmf-dist/doc/latex/easybook/easybook-demo.pdf index 4dd19a04ce0..280972b9ae6 100644 Binary files a/Master/texmf-dist/doc/latex/easybook/easybook-demo.pdf and b/Master/texmf-dist/doc/latex/easybook/easybook-demo.pdf differ diff --git a/Master/texmf-dist/doc/latex/easybook/easybook-demo.tex b/Master/texmf-dist/doc/latex/easybook/easybook-demo.tex index a98428c2881..6e41e8f7908 100644 --- a/Master/texmf-dist/doc/latex/easybook/easybook-demo.tex +++ b/Master/texmf-dist/doc/latex/easybook/easybook-demo.tex @@ -70,6 +70,7 @@ }, tocset = { + hang = false, line-align = true, part = { @@ -104,7 +105,7 @@ \url{https://latexstudio.net} \\ \url{https://gitee.com/texl3/easybook}\thanks{Gitee为项目的主要发布地址。} } -\date{2021/04/18\hskip\ccwd\relax v1.24n} +\date{2021/04/19\hskip\ccwd\relax v1.24o} \frontmatter[roman] \maketitle diff --git a/Master/texmf-dist/doc/latex/easybook/easybook.pdf b/Master/texmf-dist/doc/latex/easybook/easybook.pdf index e840fa99d30..1b53ae5a8ac 100644 Binary files a/Master/texmf-dist/doc/latex/easybook/easybook.pdf and b/Master/texmf-dist/doc/latex/easybook/easybook.pdf differ diff --git a/Master/texmf-dist/source/latex/easybook/easybook.dtx b/Master/texmf-dist/source/latex/easybook/easybook.dtx index e031600dbba..0f21f5784b9 100644 --- a/Master/texmf-dist/source/latex/easybook/easybook.dtx +++ b/Master/texmf-dist/source/latex/easybook/easybook.dtx @@ -55,7 +55,7 @@ The latest version of this license is in % % \title{\sffamily easybook 书籍文档类} % \author{瞿毅} -% \date{2021/04/18\hskip\ccwd\relax v1.24n\thanks{\url{https://gitee.com/texl3/easybook}}} +% \date{2021/04/19\hskip\ccwd\relax v1.24o\thanks{\url{https://gitee.com/texl3/easybook}}} % \maketitle % \begin{abstract} % \cls{easybook} 是基于 \cls{ctexbook} 书籍文档类创建以极简为风格的模板,可以看作对 \cls{ctexbook} 的进一步包装。虽然\CTeX 文档类提供了较好的中文支持,但想实现个性化功能一般需要在其基础上载入更多宏包来定制。\cls{easybook} 考虑了一些细节并载入一些常用宏包实现一般的排版需求,它适用于排版中英文书籍或笔记,甚至可稍加调整成为学位论文模板。 @@ -174,7 +174,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.24n}{2021/04/04}{目录命令的可选参数增加标题键值。} +% \changes{v1.24o}{2021/04/04}{目录命令的可选参数增加标题键值。} % \end{function} % % \section{接口选项} @@ -265,7 +265,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.24n}{2021/04/05}{增加 \pkg{hyperref} 超链接选项完整的支持。} +% \changes{v1.24o}{2021/04/05}{增加 \pkg{hyperref} 超链接选项完整的支持。} % \end{function} % % \begin{optdesc} @@ -284,13 +284,14 @@ The latest version of this license is in % % \subsection{行距} % \label{subsec:spacing} -% \begin{function}[EXP,added = 2021-01-05,updated = 2021-02-13]{line,table,math,caption,footnote} +% \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)> % \end{syntax} % \ding{229} 以上选项路径为 \opt{spread/...} \\ % 行距因子用于设置各种行距倍数,只能是浮点数,不能带有长度单位。各行距既可在导言区全局设置也可正文中设置对后面生效,行距的意义为 @@ -304,6 +305,7 @@ The latest version of this license is in % \item[math] 数学环境行距,包括 \pkg{amsmath} 和 \pkg{mathtools} 宏包附带的环境,但并未加载 \pkg{mathtools} 宏包。 % \item[caption] 图表代码标题行距。 % \item[footnote] 脚注行距。 +% \item[spread-all] 统一设置上述各种行距。 % \end{optdesc} % % \subsection{其它字体} @@ -342,7 +344,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.24n}{2021/04/09}{可以不载入参考文献包手动配置参考文献格式。} +% \changes{v1.24o}{2021/04/09}{可以不载入参考文献包手动配置参考文献格式。} % \end{function} % % \begin{optdesc} @@ -394,7 +396,7 @@ The latest version of this license is in % \end{function} % % \begin{optdesc} -% \item[thmbox] 开启定理及习题环境的盒子边框,需载入 \pkg{tcolorbox} 宏包才生效。 +% \item[thmbox] 开启几个预置定理环境盒子的边框,需载入 \pkg{tcolorbox} 宏包才生效。 % \item[within] 定理编号跟随的计数器,默认跟随章的编号,也可以跟随其它定理环境的编号,当计数器增加时定理编号会从零开始,空置时不跟随其它计数器。 % \item[headpunct] 定理标题末尾后的标记,在换行符或第一段内容的间隔之前。 % \item[bodyfont] 定理内容部分的字体。 @@ -490,7 +492,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.24n}{2021/04/09}{增加 \opt{subsec-mark} 标志选项,仅在 \opt{article} 模式生效。} +% \changes{v1.24o}{2021/04/09}{增加 \opt{subsec-mark} 标志选项,仅在 \opt{article} 模式生效。} % \end{function} % % \begin{function}[added = 2021-01-13,updated = 2021-03-14]{\easyhead,\easyfoot} @@ -549,7 +551,7 @@ The latest version of this license is in % } % \end{ctexexam} % -% \begin{function}[EXP,added = 2021-01-13,updated = 2021-04-06]{lists/lolskip,lists/belowoffset,tocset/tocline-fig,tocset/tocline-tab,tocset/tocline-lst,tocset/belowoffset,tocset/line-align} +% \begin{function}[EXP,added = 2021-01-13,updated = 2021-04-19]{lists/lolskip,lists/belowoffset,tocset/tocline-fig,tocset/tocline-tab,tocset/tocline-lst,tocset/belowoffset,tocset/line-align,tocset/hang} % \begin{syntax} % lolskip = <(0.8pc)> % belowoffset = <(0pc)> @@ -558,21 +560,23 @@ The latest version of this license is in % tocline-lst = <代码目录标签> % belowoffset = <(-1pc)> % line-align = <(true)|false> +% hang = % \end{syntax} -% \opt{lolskip} 是代码目录中章之间的代码标题的距离,与\CTeX 的表格目录和图片目录中章之间的标题距离选项 \opt{lotskip} 和 \opt{lofskip} 类似,它们的值均默认0.8 pc,在 \opt{article} 模式中此选项失效。目录标签整体使用 \opt{tocline} 设置,也可使用小节 \ref{subsec:page margins} 的 \opt{list-labelsep} 选项只设置编号与标题的间距。在图表标签的参数中,\#1与\#2分别代表编号和标题,代码标签的编号和标题则是 \tn{thelstlisting} 和 \tn{lstcaption},标签中还可包含标签名称,默认标签名称与图、表和代码环境的标题名称一致。下面举个设置标签的例子 -% \changes{v1.24n}{2021/04/05}{可以设置图、表和代码目录的标签。} -% \changes{v1.24n}{2021/04/06}{增加目录引导线右边对齐方式。} +% \opt{lolskip} 是代码目录中章之间的代码标题的距离,与\CTeX 的表格目录和图片目录中章之间的标题距离选项 \opt{lotskip} 和 \opt{lofskip} 类似,它们的值均默认0.8 pc,在 \opt{article} 模式中此选项失效。目录标签整体使用 \opt{tocline} 设置,也可使用小节 \ref{subsec:page margins} 的 \opt{list-labelsep} 选项只设置编号与标题的间距。在图表标签的参数中\#1代表编号,代码标签中则是 \tn{thelstlisting} 代表编号,标签中还可包含标签名称,默认标签名称与图、表和代码环境的标题名称一致。下面举个设置标签的例子 +% \changes{v1.24o}{2021/04/05}{可以设置图、表和代码目录的标签。} +% \changes{v1.24o}{2021/04/06}{增加目录引导线右边对齐方式。} +% \changes{v1.24o}{2021/04/19}{给目录增加 \opt{hang} 样式选项。} % \end{function} % % \begin{ctexexam} % \tocset % { -% tocline-fig = 图#1\hspace{\ccwd}#2 -% tocline-lst = 代码\thelstlisting\hspace{\ccwd}\lstcaption +% tocline-fig = 图#1\hspace{\ccwd} +% tocline-lst = 代码\thelstlisting\hspace{\ccwd} % } % \end{ctexexam} % -% \opt{belowoffset} 选项为主目录标题 \tn{contentsname} 后的间距补偿,一般为负值,用于抵消 \opt{format} 中设置的垂直间距。\opt{lists} 中的 \opt{belowoffset} 与之意义类似,但是一般为正值,可以在 \opt{article} 模式中使用。建议 \opt{lists/lolskip(0.8pc) + lists/format/addvspace(0.2pc) + lists/belowoffset(0pc) = belowoffset(-1pc)}。\opt{line-align} 选项可以使目录引导线右边对齐并与页码保持一定间隙,否则会与页码连接。 +% \opt{belowoffset} 选项为主目录标题 \tn{contentsname} 后的间距补偿,一般为负值,用于抵消 \opt{format} 中设置的垂直间距。\opt{lists} 中的 \opt{belowoffset} 与之意义类似,但是一般为正值,可以在 \opt{article} 模式中使用。建议 \opt{lists/lolskip(0.8pc) + lists/format/addvspace(0.2pc) + lists/belowoffset(0pc) = belowoffset(-1pc)}。\opt{line-align} 选项可以使目录引导线右边对齐并与页码保持一定间隙,否则会与页码连接。\opt{hang} 选项使目录标题为悬挂缩进形式,缩进距离为编号及其与标题间距的长度,但此时目录编号会失去超链接。 % % \section{常用环境} % @@ -587,14 +591,14 @@ The latest version of this license is in % \end{function} % % \subsection{列表} -% \begin{function}[added = 2021-01-05,updated = 2021-04-08]{enumerate,itemize,description} +% \begin{function}[added = 2021-01-05,updated = 2021-04-08]{enumerate,itemize,description,enumerate*,itemize*,description*} % \begin{syntax} % \tn{begin}\marg{环境名}\oarg{键值列表} % \ \tn{item} <列表内容> % \tn{end}\marg{环境名} % \end{syntax} -% \pkg{enumitem} 宏包为系统预置的列表环境 \env{enumerate}、\env{itemize}和 \env{description} 提供了更灵活的标签以及间距的控制,可使用 \tn{setlist} 命令设置原有的三种列表格式。已为三种列表预置了三个级别的格式可相互嵌套,默认标签与 \cls{book} 文档类相同,若自定义标签可例如 -% \changes{v1.24n}{2021/04/08}{重新优化列表环境的配置。} +% \pkg{enumitem} 宏包为系统预置的列表环境 \env{enumerate}、\env{itemize}和 \env{description} 提供了更灵活的标签以及间距的控制,可使用 \tn{setlist} 命令设置原有的三种列表格式,也可以直接使用可选参数的键值列表,具体选项见 \pkg{enumitem} 宏包文档。已为三种列表预置了三个级别的格式可相互嵌套,默认标签与 \cls{book} 文档类相同,若自定义标签可例如 +% \changes{v1.24o}{2021/04/08}{重新优化列表环境的配置。} % \end{function} % % \begin{ctexexam} @@ -635,7 +639,7 @@ The latest version of this license is in % \ <定理内容> % \tn{end}\marg{环境名} % \end{syntax} -% 这些是已预置的定理环境,定理环境除了注和证明跟随章编号并可带有边框,边框和习题标题盒子可使用 \opt{thmbox = false} 关闭,证明末尾会自动添加证明结束符。环境名对应的定理标题名如下 +% 这些是已预置的定理环境,定理环境除了注和证明跟随章编号并可带有边框,盒子边框可使用 \opt{thmset/thmbox = false} 关闭,证明末尾会自动添加证明结束符。环境名对应的定理标题名如下 % \begin{center} % \begin{tabular}{*{8}{c}} % \toprule @@ -648,18 +652,20 @@ The latest version of this license is in % % \subsection{习题} % \label{subsec:exercise} -% \begin{function}[added = 2021-01-05,updated = 2021-03-19]{exercise} +% \begin{function}[added = 2021-01-05,updated = 2021-04-19]{exercise} % \begin{syntax} -% \tn{begin}\marg{exercise}\oarg{颜色名|(LightYellow)}\oarg{编号|(1.)}\parg{标题|(习题)}\oarg{配置选项} +% \tn{begin}\marg{exercise}*+\oarg{颜色名|(LightBlue)}\oarg{编号|(1.)}\parg{标题|(习题)}\oarg{配置选项}\oarg{序言} % \ \tn{item} <习题内容> % \tn{end}\marg{exercise} % \end{syntax} -% 习题环境 \env{exercise} 的标题紧接上一节编号并加入目录与页眉,当使用星号环境时不进行编号。三个可选参数中颜色为自定义或 \pkg{xcolor} 包含的颜色名称,已载入了 \opt{svgnames} 颜色库。正文编号格式与小节 \ref{subsec:sort list} 排序列表相同,标题名默认为摘要。注意,环境具有相同定界符的可选参数只能\textbf{从右往左}省略,省略的参数使用默认值。 +% 习题环境 \env{exercise} 的标题紧接上一节编号并加入目录与页眉,当使用星号参数时不进行编号,使用+号参数启用 \pkg{tcolorbox} 支持生成标题。\oarg{颜色名} 选项在使用+号参数时有效,其中颜色为自定义或 \pkg{xcolor} 包含的颜色名称。题目编号格式与小节 \ref{subsec:sort list} 排序列表相同,标题名默认为习题。 +% +% 配置选项在是否使用+号参数时用法不同,使用+号参数时为 \pkg{tcolorbox} 的盒子选项,例如 \opt{boxrule} 和 \opt{fontupper}。不使用+号参数时相当于设置 \tn{ctexset}\marg{section = {\#1}} 键值选项列表,例如 \opt{format} 和 \opt{beforeskip}。\oarg{序言} 选项用于在习题环境开始前插入一段内容,可以是文本或者代码。注意,环境具有相同定界符的可选参数只能\textbf{从右往左}省略,省略的参数使用默认值。 % \changes{v1.23}{2021/02/08}{增加准确的习题盒子标题目录锚点。} % \end{function} % % \begin{ctexexam} -% \begin{exercise}[LightYellow][1.](习题) +% \begin{exercise}+[LightBlue][1.](习题) % \item 习题内容 % \item 习题内容 % \end{exercise} @@ -667,7 +673,7 @@ The latest version of this license is in % % \subsection{盒子} % \label{subsec:box} -% 使用盒子以及小节 \ref{subsec:exercise} 中的 \env{exercise} 环境需要在导言区\textbf{手动载入} \pkg{tcolorbox} 宏包,它们的配置选项同样由 \pkg{tcolorbox} 提供支持,具体选项可见宏包文档的 Option Keys 一节,可以进行边距、字体及背景颜色等各种个性化设置,一些配置会覆盖之前预置的设置。 +% 使用盒子以及小节 \ref{subsec:exercise} 中的 \env{exercise} 环境需要在导言区\textbf{手动载入} \pkg{tcolorbox} 宏包,它们的配置键值列表选项同样由 \pkg{tcolorbox} 提供支持,具体选项可见宏包文档的 Option Keys 一节,可以进行边距、字体及背景颜色等各种个性化设置,一些配置会覆盖之前预置的设置。 % % \subsubsection{摘要盒子} % \begin{function}[added = 2021-01-05,updated = 2021-03-19]{outline} @@ -687,30 +693,31 @@ The latest version of this license is in % \end{ctexexam} % % \subsubsection{段落盒子} -% \begin{function}[added = 2021-01-05,updated = 2021-04-18]{easybox} +% \begin{function}[added = 2021-01-05,updated = 2021-04-19]{easybox} % \begin{syntax} % \tn{begin}\marg{easybox}*\oarg{颜色名|(DarkCyan)}\parg{段落标题}\oarg{配置选项} % \ <盒子内容> % \tn{end}\marg{easybox} % \end{syntax} -% 环境 \env{easybox} 创建一个带有三个可选参数的扁平盒子。使用带有星号的环境时给盒子添加边框,\oarg{颜色名} 选项设置背景颜色,\parg{段落标题} 选项可以设置标题,默认无标题。 +% 环境 \env{easybox} 创建一个带有三个可选参数的扁平盒子。使用星号参数时给盒子添加边框,\oarg{颜色名} 选项设置背景颜色,\parg{段落标题} 选项可以设置标题,默认无标题。 % \end{function} % % \begin{ctexexam} -% \begin{easybox}*[MintCream](段落标题) +% \begin{easybox}*[DarkCyan](段落标题) % 盒子内容 % \tcblower % 盒子上下部分分界线 % 盒子内容 % \end{easybox} % \end{ctexexam} % -% \begin{function}[added = 2021-04-18]{ebparbox} +% \begin{function}[added = 2021-04-19]{ebparbox} % \begin{syntax} % \tn{begin}\marg{ebparbox}*\oarg{颜色名|(Purple)}\parg{段落标题}\oarg{配置选项} % \ <盒子内容> % \tn{end}\marg{ebparbox} % \end{syntax} -% 环境 \env{ebparbox} 与 \env{easybox} 类似,同样带有三个可选参数。当使用带有星号的环境时盒子左边带有一条竖线,\oarg{颜色名} 选项可以自定义竖线颜色,使用不带有星号的环境则盒子带有竖线颜色的浅色背景。\parg{段落标题} 选项可以设置标题,默认无标题。 +% 环境 \env{ebparbox} 与 \env{easybox} 类似,同样带有三个可选参数。当使用星号参数时盒子左边带有一条竖线,\oarg{颜色名} 选项可以自定义竖线颜色,使用不带有星号的环境则盒子带有竖线颜色的浅色背景。\parg{段落标题} 选项可以设置标题,默认无标题。 +% \changes{v1.24o}{2021/04/19}{优化盒子环境的选项,增加可带有标题的扁平盒子 \env{ebparbox}。} % \end{function} % % \subsubsection{行内盒子} @@ -769,7 +776,7 @@ The latest version of this license is in % \tn{labelformat}\marg{计数器}\marg{标签引用格式} % \end{syntax} % 使用 \tn{ref} 命令进行引用将会自动检测环境并添加相应的前缀,\tn{labelformat} 可以设置标签引用格式,第二个参数中\#1代表 \tn{the}\meta{计数器},可以设置引用序号的前缀和后缀。 -% \changes{v1.24n}{2021/04/11}{取消载入 \pkg{cleveref} 宏包来交叉引用。} +% \changes{v1.24o}{2021/04/11}{取消载入 \pkg{cleveref} 宏包来交叉引用。} % \end{function} % % \subsubsection{索引} @@ -845,7 +852,7 @@ The latest version of this license is in % 以下为 \cls{easybook} 直接调用的关键宏包,带有 \ding{75} 符号的宏包并未载入它们,仅做了预配置和兼容性处理,可根据需要在导言区手动载入以实现相关的功能。 % \begin{description} % \item[ctexbook] 提供中文排版的通用框架。 -% \item[xcolor] 提供多种颜色、阴影、色调和任意颜色的混合。 +% \item[xcolor] 提供任意颜色的设定与混合,已载入了 \opt{svgnames} 颜色库。 % \item[footmisc] 更改脚注排版的方法的集合。 % \item[amsmath] 提供\LaTeX 中的数学功能。 % \item[thmtools] 用于通常需要的排版定理支持。 @@ -879,7 +886,7 @@ The latest version of this license is in %<*class> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e,etoolbox} -\ProvidesExplClass{easybook}{2021/04/18}{1.24n}{beta} +\ProvidesExplClass{easybook}{2021/04/19}{1.24o}{beta} \cs_generate_variant:Nn \__ctex_define:nn {nx} \cs_generate_variant:Nn \int_to_arabic:n {v} @@ -1293,21 +1300,18 @@ The latest version of this license is in } \cs_new:Npn \__eb_upper_chaptermark_bool:n #1 { - \bool_if:NTF \l__eb_uppercase_bool - {\text_uppercase:n {\__eb_fancyhf_chap_mark:n {#1}}} - {\text_titlecase_first:n {\__eb_fancyhf_chap_mark:n {#1}}} + \bool_if:NT \l__eb_uppercase_bool + {\text_uppercase:n}{\__eb_fancyhf_chap_mark:n {#1}} } \cs_new:Npn \__eb_upper_sectionmark_bool:n #1 { - \bool_if:NTF \l__eb_uppercase_bool - {\text_uppercase:n {\__eb_fancyhf_sec_mark:n {#1}}} - {\text_titlecase_first:n {\__eb_fancyhf_sec_mark:n {#1}}} + \bool_if:NT \l__eb_uppercase_bool + {\text_uppercase:n}{\__eb_fancyhf_sec_mark:n {#1}} } \cs_new:Npn \__eb_upper_subsectionmark_bool:n #1 { - \bool_if:NTF \l__eb_uppercase_bool - {\text_uppercase:n {\__eb_fancyhf_subsec_mark:n {#1}}} - {\text_titlecase_first:n {\__eb_fancyhf_subsec_mark:n {#1}}} + \bool_if:NT \l__eb_uppercase_bool + {\text_uppercase:n}{\__eb_fancyhf_subsec_mark:n {#1}} } \ctex_at_end_preamble:n { @@ -1318,32 +1322,26 @@ The latest version of this license is in \pagestyle{fancy} \bool_if:NTF \l__eb_class_book_bool { - \bool_if:NTF \l__eb_page_twoside_bool + \cs_gset:Npn \chaptermark#1 { - \cs_gset:Npn \chaptermark#1 + \markboth + {\__eb_upper_chaptermark_bool:n {#1}} { - \markboth - {\__eb_upper_chaptermark_bool:n {#1}} + \bool_if:NT \l__eb_page_twoside_bool {\__eb_upper_chaptermark_bool:n {#1}} } - }{ - \cs_gset:Npn \chaptermark#1 - {\markboth{\__eb_upper_chaptermark_bool:n {#1}}{}} } \cs_gset:Npn \sectionmark#1 {\markright{\__eb_upper_sectionmark_bool:n {#1}}} }{ - \bool_if:NTF \l__eb_page_twoside_bool + \cs_gset:Npn \sectionmark#1 { - \cs_gset:Npn \sectionmark#1 + \markboth + {\__eb_upper_sectionmark_bool:n {#1}} { - \markboth - {\__eb_upper_sectionmark_bool:n {#1}} + \bool_if:NT \l__eb_page_twoside_bool {\__eb_upper_sectionmark_bool:n {#1}} } - }{ - \cs_gset:Npn \sectionmark#1 - {\markboth{\__eb_upper_sectionmark_bool:n {#1}}{}} } \cs_gset:Npn \subsectionmark#1 {\markright{\__eb_upper_subsectionmark_bool:n {#1}}} @@ -1375,24 +1373,26 @@ The latest version of this license is in lists/lolskip .initial:n = 0.8pc, lists/belowoffset .dim_set:N = \l__eb_toc_listsoffset_dim, lists/belowoffset .initial:n = 0pc, - tocline-fig .cs_set:Np = \eb@labelname@lof#1#2, + tocline-fig .cs_set:Np = \eb@labelname@lof#1, tocline-fig .initial:n = - {\figurename\space#1\hspace{\eb@list@labelsep}#2}, - tocline-tab .cs_set:Np = \eb@labelname@lot#1#2, + {\figurename\space#1\hspace{\eb@list@labelsep}}, + tocline-tab .cs_set:Np = \eb@labelname@lot#1, tocline-tab .initial:n = - {\tablename\space#1\hspace{\eb@list@labelsep}#2}, + {\tablename\space#1\hspace{\eb@list@labelsep}}, tocline-lst .tl_set:N = \eb@labelname@lol, tocline-lst .initial:n = { \lstlistingname\space \thelstlisting\hspace{\eb@list@labelsep} - \lstcaption }, belowoffset .dim_set:N = \l__eb_toc_offset_dim, belowoffset .initial:n = -1pc, line-align .bool_set:N = \l__eb_toc_line_align_bool, line-align .default:n = true, - line-align .initial:n = true + line-align .initial:n = true, + hang .bool_set:N = \eb@titletoc@hang@fix, + hang .default:n = true, + hang .initial:n = false } \ctex_set:nn {tocset} { @@ -1432,7 +1432,12 @@ The latest version of this license is in { \titlecontents{#1} [\use:c {l__toc_#2_indent_tl}] - {\use:c {l__toc_#2_format_tl}}{}{} + {\use:c {l__toc_#2_format_tl}} + { + \ifodd\eb@titletoc@hang@fix + \contentspush{\color{ctex@link}\thecontentslabel} + \fi + }{} {\use:c {l__toc_#2_rule_tl}} } \contentsuse{lstlisting}{lol} @@ -1453,19 +1458,49 @@ The latest version of this license is in figure = \eb@labelname@lof, table = \eb@labelname@lot } -\cs_gset:Npn \caption@@@addcontentsline#1#2#3#4 +\cs_new:Npn \eb@numberline#1#2 { - \addcontentsline{#1}{#2} - {\prop_item:Nn \l_label_name_prop{#2}{#3}{#4}} + \CTEXifname + { + \protect\numberline{\use:c {CTEXthe#1}} + \hspace{#2} + }{} } -\ctex_patch_cmd:Nnn \lst@MakeCaption +\ctex_at_end_preamble:n { - \addcontentsline{lol}{lstlisting} - {\protect\numberline{\thelstlisting}\lst@@caption} - }{ - \let\lstcaption\lst@@caption - \addcontentsline{lol}{lstlisting}{\eb@labelname@lol} + \cs_gset:Npn \caption@@@addcontentsline#1#2#3#4 + { + \addcontentsline{#1}{#2} + { + \ifodd\eb@titletoc@hang@fix + \protect\numberline + \fi + {\prop_item:Nn \l_label_name_prop{#2}{#3}}{#4} + } + } + \ctex_patch_cmd:Nnn \lst@MakeCaption + { + \addcontentsline{lol}{lstlisting} + {\protect\numberline{\thelstlisting}\lst@@caption} + }{ + \addcontentsline{lol}{lstlisting} + { + \ifodd\eb@titletoc@hang@fix + \protect\numberline + \fi + {\eb@labelname@lol}\lst@@caption + } + } + \ifodd\eb@titletoc@hang@fix + \ctex_set:n + { + chapter/tocline = \eb@numberline{#1}{\ccwd}#2, + section/tocline = \eb@numberline{#1}{\ccwd}#2, + subsection/tocline = \eb@numberline{#1}{\ccwd}#2 + } + \fi } + \__eb_appto_cmd:Nn \@chapter { \skip_if_eq:nnF {\l__eb_toc_lolskip_skip}{\c_zero_skip} @@ -1493,15 +1528,17 @@ The latest version of this license is in {\text_uppercase:n {#1}} {\text_titlecase_first:n {#1}} } -\cs_new_protected:Npn \eb@markdouble#1 +\cs_new_protected:Npn \eb@nonumber@markdouble#1 { - \bool_if:NTF \l__eb_page_twoside_bool + \markboth + {\__eb_uppercase_bool:n {#1}} { - \markboth - {\__eb_uppercase_bool:n {#1}} + \bool_if:NT \l__eb_page_twoside_bool {\__eb_uppercase_bool:n {#1}} - }{\markboth{\__eb_uppercase_bool:n {#1}}{}} + } } +\cs_new_protected:Npn \eb@nonumber@markright#1 + {\markright{\__eb_uppercase_bool:n {#1}}} \tl_set:Nn \l__eb_toc_type_tl{book} \keys_define:nn {listoc} @@ -1520,18 +1557,27 @@ The latest version of this license is in { \chapter*{\phantomsection#1} \CTEX@addtocline{chapter}{#1} + \eb@nonumber@markdouble{#1} }{ \section*{\phantomsection#1} \CTEX@addtocline{section}{#1} + \bool_if:NTF \l__eb_class_book_bool + {\eb@nonumber@markright{#1}} + {\eb@nonumber@markdouble{#1}} } - \eb@markdouble{#1} } \cs_new_protected:Npn \__eb_title_mark_notoc:n #1 { \tl_if_eq:NnTF \l__eb_toc_type_tl{book} - {\chapter*{\phantomsection#1}} - {\section*{\phantomsection#1}} - \eb@markdouble{#1} + { + \chapter*{\phantomsection#1} + \eb@nonumber@markdouble{#1} + }{ + \section*{\phantomsection#1} + \bool_if:NTF \l__eb_class_book_bool + {\eb@nonumber@markright{#1}} + {\eb@nonumber@markdouble{#1}} + } } \cs_new_protected:Npn \__eb_class_title_bool:n #1 { @@ -1543,7 +1589,7 @@ The latest version of this license is in \section*{\phantomsection#1} \CTEX@addtocline{section}{#1} } - \eb@markdouble{#1} + \eb@nonumber@markdouble{#1} } \cs_new_protected:Npn \__eb_multoc_pre_bool: { @@ -1644,7 +1690,7 @@ The latest version of this license is in } \ctex_patch_cmd:Nnn \imki@indexheaders {\@mkboth{\MakeUppercase\indexname}{\MakeUppercase\indexname}} - {\eb@markdouble{\indexname}} + {\eb@nonumber@markdouble{\indexname}} } \tl_new:N \l__eb_font_table_tl @@ -1763,16 +1809,21 @@ The latest version of this license is in \__ctex_define:nn {spread} { - line .fp_set:N = \l__eb_spread_line_fp, - line .initial:n = 1.3, - table .fp_set:N = \l__eb_spread_table_fp, - table .initial:n = 1.05, - math .fp_set:N = \l__eb_spread_math_fp, - math .initial:n = 1.05, - caption .fp_set:N = \l__eb_spread_caption_fp, - caption .initial:n = 1, - footnote .fp_set:N = \l__eb_spread_footnote_fp, - footnote .initial:n = 1 + line .fp_set:N = \l__eb_spread_line_fp, + line .initial:n = 1.3, + table .fp_set:N = \l__eb_spread_table_fp, + table .initial:n = 1.05, + math .fp_set:N = \l__eb_spread_math_fp, + math .initial:n = 1.05, + caption .fp_set:N = \l__eb_spread_caption_fp, + caption .initial:n = 1, + footnote .fp_set:N = \l__eb_spread_footnote_fp, + footnote .initial:n = 1, + spread-all .meta:n = + { + line = {#1},table = {#1},math = {#1}, + caption = {#1},footnote = {#1} + } } \skip_set:Nn \parskip{0pt plus 2pt minus 1pt} @@ -1828,19 +1879,19 @@ The latest version of this license is in \cs_new_protected:Npn \__eb_thmname_set:nnn #1#2#3 { \tl_if_eq:NnTF \l__ctex_scheme_tl{chinese} - {\tl_const:cn {c__eb_name_#1_tl}{#2}} {\tl_const:cn {c__eb_name_#1_tl}{#3}} + {\tl_const:cn {c__eb_name_#1_tl}{#2}} } \clist_map_inline:nn { - {example}{例}{Example}, - {definition}{定义}{Definition}, - {theorem}{定理}{Theorem}, - {proposition}{性质}{Proposition}, - {lemma}{引理}{Lemma}, - {corollary}{推论}{Corollary}, - {remark}{注}{Remark}, - {exercise}{练习}{Exercise} + {proposition}{Proposition}{性质}, + {definition}{Definition}{定义}, + {corollary}{Corollary}{推论}, + {exercise}{Exercise}{练习}, + {theorem}{Theorem}{定理}, + {example}{Example}{例}, + {remark}{Remark}{注}, + {lemma}{Lemma}{引理} }{\__eb_thmname_set:nnn #1} \bool_new:N \l__eb_thmbox_bool @@ -2001,8 +2052,7 @@ The latest version of this license is in enhanced~jigsaw,pad~at~break* = 3pt, opacityback = 0, colframe = ctex@emph, - left = 6pt,right = 6pt,top = 8pt,bottom = 8pt,middle= 8pt, - arc = 0pt + left = 6pt,right = 6pt,top = 8pt,bottom = 8pt,middle= 8pt }, tc-outline/.style = { @@ -2019,14 +2069,14 @@ The latest version of this license is in }, tc-exercise/.style = { - enhanced,on~line, - fontupper = \sffamily\Large, - boxrule = 1pt,arc = 5pt, - left = 6pt,right = 6pt,top = 3.5pt,bottom = 3.5pt, - before~skip = 4ex,after~skip = 2.25ex + blank,on~line,center, + fontupper = \Large\sffamily, + before~skip = 3.5ex,after~skip = 2.25ex }, breakable, boxsep = 0pt, + arc = 0pt, + fonttitle = \sffamily, boxrule = \l__eb_rule_width_dim } \NewDocumentEnvironment{outline}{D(){\abstractname}o+b} @@ -2038,39 +2088,32 @@ The latest version of this license is in \end{tcolorbox} }{} \NewDocumentEnvironment{exercise} - {sO{LightYellow}O{1.}D(){\c__eb_name_exercise_tl}o+b} - { - \begin{center} - \bool_if:NTF \l__eb_thmbox_bool - { - \tcbox[ - tc-exercise, - colback = #2,colframe = black, - drop~fuzzy~shadow = #2, - IfValueT = {#5}{#5}, - phantom = - \IfBooleanF{#1} - { - \CTEX@ifnametrue - \refstepcounter{section} - \markright{\CTEXthesection\hspace{0.5\ccwd}#4} - \CTEX@addtocline{section}{#4} - } - ]{\IfBooleanF{#1}{\CTEXthesection\hspace{0.5\ccwd}}#4} - }{ - \color{ctex@frame}\sffamily\Large - \IfBooleanF{#1} - { - \CTEX@ifnametrue - \refstepcounter{section} - \markright{\CTEXthesection\hspace{0.5\ccwd}#4} - \CTEX@addtocline{section}{#4} - \CTEXthesection\hspace{0.5\ccwd} - }#4 - } - \end{center} - \begin{enumerate}[#3,labelsep = 0.5\ccwd] - #6 + {st+O{LightBlue}O{1.}D(){\c__eb_name_exercise_tl}o+O{}+b} + { + \IfBooleanTF{#2} + { + \tcbox[ + tc-exercise, + fuzzy~halo = 5pt~with~#3, + IfValueT = {#6}{#6}, + phantom = + \IfBooleanF{#1} + { + \CTEX@ifnametrue + \refstepcounter{section} + \markright{\CTEXthesection\hspace{0.5\ccwd}#5} + \CTEX@addtocline{section}{#5} + } + ]{\IfBooleanF{#1}{\CTEXthesection\hspace{0.5\ccwd}}#5} + }{ + \group_begin: + \keys_set:nn {ctex/section}{format += \centering} + \IfValueT{#6}{\keys_set:nn {ctex/section}{#6}} + \IfBooleanTF{#1}{\section*{#5}}{\section{#5}} + \group_end: + }#7 + \begin{enumerate}[#4,labelsep = 0.5\ccwd] + #8 \end{enumerate} }{} \DeclareTColorBox{easybox}{sO{DarkCyan}d()O{}} @@ -2082,9 +2125,8 @@ The latest version of this license is in IfValueT = {#3}{title = #3}, colback = #2!8!white,colbacktitle = #2!8!white, coltitle = black,colframe = black, - fonttitle = \sffamily, left = 6pt,right = 6pt,bottom = 8pt,middle= 8pt, - bottomtitle = 8pt,arc = 0pt, + bottomtitle = 8pt, beforeafter~skip = 2ex, halign~upper = left,halign~lower = left, center~title,#4 @@ -2106,10 +2148,9 @@ The latest version of this license is in bottom = 8pt,toptitle = 8pt }, left = 8pt,right = 8pt,middle= 8pt, - bottomtitle = 8pt,arc = 0pt, + bottomtitle = 8pt, beforeafter~skip = 1.5ex, - colframe = #2,coltitle = #2, - fonttitle = \sffamily,#4 + colframe = #2,coltitle = #2,#4 } \DeclareTotalTCBox{\fuzzy}{O{DarkSeaGreen}vO{}} { @@ -2120,7 +2161,7 @@ The latest version of this license is in { nobeforeafter,tcbox~raise~base, top = 2pt,bottom = 2.5pt,left = 2pt,right = 2pt, - boxsep = 0pt,boxrule = 0.75pt,arc = 1pt, + boxrule = 0.75pt,arc = 1pt, colback = #1!15!white,#3 }{#2} } @@ -2252,8 +2293,8 @@ The latest version of this license is in \footnotesize \exp_args:Nx \linespread{\fp_use:N \l__eb_spread_footnote_fp}\selectfont - \skip_gset:Nn \footnotesep{\ht\strutbox} - \group_end: + \exp_args:NNNo \group_end: + \dim_set:Nn \footnotesep{\dim_use:N \box_ht:N \strutbox} \bool_if:NT \l__eb_chap_withpart_bool {\counterwithin*{chapter}{part}} \tl_if_eq:NnT \l__eb_foot_numberwith_tl{part} diff --git a/Master/texmf-dist/tex/latex/easybook/easybook.cls b/Master/texmf-dist/tex/latex/easybook/easybook.cls index c63f009edcb..7e550bf31c2 100644 --- a/Master/texmf-dist/tex/latex/easybook/easybook.cls +++ b/Master/texmf-dist/tex/latex/easybook/easybook.cls @@ -13,7 +13,7 @@ %% https://creativecommons.org/licenses/by/4.0/legalcode \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e,etoolbox} -\ProvidesExplClass{easybook}{2021/04/18}{1.24n}{beta} +\ProvidesExplClass{easybook}{2021/04/19}{1.24o}{beta} \cs_generate_variant:Nn \__ctex_define:nn {nx} \cs_generate_variant:Nn \int_to_arabic:n {v} @@ -427,21 +427,18 @@ } \cs_new:Npn \__eb_upper_chaptermark_bool:n #1 { - \bool_if:NTF \l__eb_uppercase_bool - {\text_uppercase:n {\__eb_fancyhf_chap_mark:n {#1}}} - {\text_titlecase_first:n {\__eb_fancyhf_chap_mark:n {#1}}} + \bool_if:NT \l__eb_uppercase_bool + {\text_uppercase:n}{\__eb_fancyhf_chap_mark:n {#1}} } \cs_new:Npn \__eb_upper_sectionmark_bool:n #1 { - \bool_if:NTF \l__eb_uppercase_bool - {\text_uppercase:n {\__eb_fancyhf_sec_mark:n {#1}}} - {\text_titlecase_first:n {\__eb_fancyhf_sec_mark:n {#1}}} + \bool_if:NT \l__eb_uppercase_bool + {\text_uppercase:n}{\__eb_fancyhf_sec_mark:n {#1}} } \cs_new:Npn \__eb_upper_subsectionmark_bool:n #1 { - \bool_if:NTF \l__eb_uppercase_bool - {\text_uppercase:n {\__eb_fancyhf_subsec_mark:n {#1}}} - {\text_titlecase_first:n {\__eb_fancyhf_subsec_mark:n {#1}}} + \bool_if:NT \l__eb_uppercase_bool + {\text_uppercase:n}{\__eb_fancyhf_subsec_mark:n {#1}} } \ctex_at_end_preamble:n { @@ -452,32 +449,26 @@ \pagestyle{fancy} \bool_if:NTF \l__eb_class_book_bool { - \bool_if:NTF \l__eb_page_twoside_bool + \cs_gset:Npn \chaptermark#1 { - \cs_gset:Npn \chaptermark#1 + \markboth + {\__eb_upper_chaptermark_bool:n {#1}} { - \markboth - {\__eb_upper_chaptermark_bool:n {#1}} + \bool_if:NT \l__eb_page_twoside_bool {\__eb_upper_chaptermark_bool:n {#1}} } - }{ - \cs_gset:Npn \chaptermark#1 - {\markboth{\__eb_upper_chaptermark_bool:n {#1}}{}} } \cs_gset:Npn \sectionmark#1 {\markright{\__eb_upper_sectionmark_bool:n {#1}}} }{ - \bool_if:NTF \l__eb_page_twoside_bool + \cs_gset:Npn \sectionmark#1 { - \cs_gset:Npn \sectionmark#1 + \markboth + {\__eb_upper_sectionmark_bool:n {#1}} { - \markboth - {\__eb_upper_sectionmark_bool:n {#1}} + \bool_if:NT \l__eb_page_twoside_bool {\__eb_upper_sectionmark_bool:n {#1}} } - }{ - \cs_gset:Npn \sectionmark#1 - {\markboth{\__eb_upper_sectionmark_bool:n {#1}}{}} } \cs_gset:Npn \subsectionmark#1 {\markright{\__eb_upper_subsectionmark_bool:n {#1}}} @@ -509,24 +500,26 @@ lists/lolskip .initial:n = 0.8pc, lists/belowoffset .dim_set:N = \l__eb_toc_listsoffset_dim, lists/belowoffset .initial:n = 0pc, - tocline-fig .cs_set:Np = \eb@labelname@lof#1#2, + tocline-fig .cs_set:Np = \eb@labelname@lof#1, tocline-fig .initial:n = - {\figurename\space#1\hspace{\eb@list@labelsep}#2}, - tocline-tab .cs_set:Np = \eb@labelname@lot#1#2, + {\figurename\space#1\hspace{\eb@list@labelsep}}, + tocline-tab .cs_set:Np = \eb@labelname@lot#1, tocline-tab .initial:n = - {\tablename\space#1\hspace{\eb@list@labelsep}#2}, + {\tablename\space#1\hspace{\eb@list@labelsep}}, tocline-lst .tl_set:N = \eb@labelname@lol, tocline-lst .initial:n = { \lstlistingname\space \thelstlisting\hspace{\eb@list@labelsep} - \lstcaption }, belowoffset .dim_set:N = \l__eb_toc_offset_dim, belowoffset .initial:n = -1pc, line-align .bool_set:N = \l__eb_toc_line_align_bool, line-align .default:n = true, - line-align .initial:n = true + line-align .initial:n = true, + hang .bool_set:N = \eb@titletoc@hang@fix, + hang .default:n = true, + hang .initial:n = false } \ctex_set:nn {tocset} { @@ -566,7 +559,12 @@ { \titlecontents{#1} [\use:c {l__toc_#2_indent_tl}] - {\use:c {l__toc_#2_format_tl}}{}{} + {\use:c {l__toc_#2_format_tl}} + { + \ifodd\eb@titletoc@hang@fix + \contentspush{\color{ctex@link}\thecontentslabel} + \fi + }{} {\use:c {l__toc_#2_rule_tl}} } \contentsuse{lstlisting}{lol} @@ -587,19 +585,49 @@ figure = \eb@labelname@lof, table = \eb@labelname@lot } -\cs_gset:Npn \caption@@@addcontentsline#1#2#3#4 +\cs_new:Npn \eb@numberline#1#2 { - \addcontentsline{#1}{#2} - {\prop_item:Nn \l_label_name_prop{#2}{#3}{#4}} + \CTEXifname + { + \protect\numberline{\use:c {CTEXthe#1}} + \hspace{#2} + }{} } -\ctex_patch_cmd:Nnn \lst@MakeCaption +\ctex_at_end_preamble:n { - \addcontentsline{lol}{lstlisting} - {\protect\numberline{\thelstlisting}\lst@@caption} - }{ - \let\lstcaption\lst@@caption - \addcontentsline{lol}{lstlisting}{\eb@labelname@lol} + \cs_gset:Npn \caption@@@addcontentsline#1#2#3#4 + { + \addcontentsline{#1}{#2} + { + \ifodd\eb@titletoc@hang@fix + \protect\numberline + \fi + {\prop_item:Nn \l_label_name_prop{#2}{#3}}{#4} + } + } + \ctex_patch_cmd:Nnn \lst@MakeCaption + { + \addcontentsline{lol}{lstlisting} + {\protect\numberline{\thelstlisting}\lst@@caption} + }{ + \addcontentsline{lol}{lstlisting} + { + \ifodd\eb@titletoc@hang@fix + \protect\numberline + \fi + {\eb@labelname@lol}\lst@@caption + } + } + \ifodd\eb@titletoc@hang@fix + \ctex_set:n + { + chapter/tocline = \eb@numberline{#1}{\ccwd}#2, + section/tocline = \eb@numberline{#1}{\ccwd}#2, + subsection/tocline = \eb@numberline{#1}{\ccwd}#2 + } + \fi } + \__eb_appto_cmd:Nn \@chapter { \skip_if_eq:nnF {\l__eb_toc_lolskip_skip}{\c_zero_skip} @@ -627,15 +655,17 @@ {\text_uppercase:n {#1}} {\text_titlecase_first:n {#1}} } -\cs_new_protected:Npn \eb@markdouble#1 +\cs_new_protected:Npn \eb@nonumber@markdouble#1 { - \bool_if:NTF \l__eb_page_twoside_bool + \markboth + {\__eb_uppercase_bool:n {#1}} { - \markboth + \bool_if:NT \l__eb_page_twoside_bool {\__eb_uppercase_bool:n {#1}} - {\__eb_uppercase_bool:n {#1}} - }{\markboth{\__eb_uppercase_bool:n {#1}}{}} + } } +\cs_new_protected:Npn \eb@nonumber@markright#1 + {\markright{\__eb_uppercase_bool:n {#1}}} \tl_set:Nn \l__eb_toc_type_tl{book} \keys_define:nn {listoc} @@ -654,18 +684,27 @@ { \chapter*{\phantomsection#1} \CTEX@addtocline{chapter}{#1} + \eb@nonumber@markdouble{#1} }{ \section*{\phantomsection#1} \CTEX@addtocline{section}{#1} + \bool_if:NTF \l__eb_class_book_bool + {\eb@nonumber@markright{#1}} + {\eb@nonumber@markdouble{#1}} } - \eb@markdouble{#1} } \cs_new_protected:Npn \__eb_title_mark_notoc:n #1 { \tl_if_eq:NnTF \l__eb_toc_type_tl{book} - {\chapter*{\phantomsection#1}} - {\section*{\phantomsection#1}} - \eb@markdouble{#1} + { + \chapter*{\phantomsection#1} + \eb@nonumber@markdouble{#1} + }{ + \section*{\phantomsection#1} + \bool_if:NTF \l__eb_class_book_bool + {\eb@nonumber@markright{#1}} + {\eb@nonumber@markdouble{#1}} + } } \cs_new_protected:Npn \__eb_class_title_bool:n #1 { @@ -677,7 +716,7 @@ \section*{\phantomsection#1} \CTEX@addtocline{section}{#1} } - \eb@markdouble{#1} + \eb@nonumber@markdouble{#1} } \cs_new_protected:Npn \__eb_multoc_pre_bool: { @@ -778,7 +817,7 @@ } \ctex_patch_cmd:Nnn \imki@indexheaders {\@mkboth{\MakeUppercase\indexname}{\MakeUppercase\indexname}} - {\eb@markdouble{\indexname}} + {\eb@nonumber@markdouble{\indexname}} } \tl_new:N \l__eb_font_table_tl @@ -897,16 +936,21 @@ \__ctex_define:nn {spread} { - line .fp_set:N = \l__eb_spread_line_fp, - line .initial:n = 1.3, - table .fp_set:N = \l__eb_spread_table_fp, - table .initial:n = 1.05, - math .fp_set:N = \l__eb_spread_math_fp, - math .initial:n = 1.05, - caption .fp_set:N = \l__eb_spread_caption_fp, - caption .initial:n = 1, - footnote .fp_set:N = \l__eb_spread_footnote_fp, - footnote .initial:n = 1 + line .fp_set:N = \l__eb_spread_line_fp, + line .initial:n = 1.3, + table .fp_set:N = \l__eb_spread_table_fp, + table .initial:n = 1.05, + math .fp_set:N = \l__eb_spread_math_fp, + math .initial:n = 1.05, + caption .fp_set:N = \l__eb_spread_caption_fp, + caption .initial:n = 1, + footnote .fp_set:N = \l__eb_spread_footnote_fp, + footnote .initial:n = 1, + spread-all .meta:n = + { + line = {#1},table = {#1},math = {#1}, + caption = {#1},footnote = {#1} + } } \skip_set:Nn \parskip{0pt plus 2pt minus 1pt} @@ -962,19 +1006,19 @@ \cs_new_protected:Npn \__eb_thmname_set:nnn #1#2#3 { \tl_if_eq:NnTF \l__ctex_scheme_tl{chinese} - {\tl_const:cn {c__eb_name_#1_tl}{#2}} {\tl_const:cn {c__eb_name_#1_tl}{#3}} + {\tl_const:cn {c__eb_name_#1_tl}{#2}} } \clist_map_inline:nn { - {example}{例}{Example}, - {definition}{定义}{Definition}, - {theorem}{定理}{Theorem}, - {proposition}{性质}{Proposition}, - {lemma}{引理}{Lemma}, - {corollary}{推论}{Corollary}, - {remark}{注}{Remark}, - {exercise}{练习}{Exercise} + {proposition}{Proposition}{性质}, + {definition}{Definition}{定义}, + {corollary}{Corollary}{推论}, + {exercise}{Exercise}{练习}, + {theorem}{Theorem}{定理}, + {example}{Example}{例}, + {remark}{Remark}{注}, + {lemma}{Lemma}{引理} }{\__eb_thmname_set:nnn #1} \bool_new:N \l__eb_thmbox_bool @@ -1135,8 +1179,7 @@ enhanced~jigsaw,pad~at~break* = 3pt, opacityback = 0, colframe = ctex@emph, - left = 6pt,right = 6pt,top = 8pt,bottom = 8pt,middle= 8pt, - arc = 0pt + left = 6pt,right = 6pt,top = 8pt,bottom = 8pt,middle= 8pt }, tc-outline/.style = { @@ -1153,14 +1196,14 @@ }, tc-exercise/.style = { - enhanced,on~line, - fontupper = \sffamily\Large, - boxrule = 1pt,arc = 5pt, - left = 6pt,right = 6pt,top = 3.5pt,bottom = 3.5pt, - before~skip = 4ex,after~skip = 2.25ex + blank,on~line,center, + fontupper = \Large\sffamily, + before~skip = 3.5ex,after~skip = 2.25ex }, breakable, boxsep = 0pt, + arc = 0pt, + fonttitle = \sffamily, boxrule = \l__eb_rule_width_dim } \NewDocumentEnvironment{outline}{D(){\abstractname}o+b} @@ -1172,39 +1215,32 @@ \end{tcolorbox} }{} \NewDocumentEnvironment{exercise} - {sO{LightYellow}O{1.}D(){\c__eb_name_exercise_tl}o+b} - { - \begin{center} - \bool_if:NTF \l__eb_thmbox_bool - { - \tcbox[ - tc-exercise, - colback = #2,colframe = black, - drop~fuzzy~shadow = #2, - IfValueT = {#5}{#5}, - phantom = - \IfBooleanF{#1} - { - \CTEX@ifnametrue - \refstepcounter{section} - \markright{\CTEXthesection\hspace{0.5\ccwd}#4} - \CTEX@addtocline{section}{#4} - } - ]{\IfBooleanF{#1}{\CTEXthesection\hspace{0.5\ccwd}}#4} - }{ - \color{ctex@frame}\sffamily\Large - \IfBooleanF{#1} - { - \CTEX@ifnametrue - \refstepcounter{section} - \markright{\CTEXthesection\hspace{0.5\ccwd}#4} - \CTEX@addtocline{section}{#4} - \CTEXthesection\hspace{0.5\ccwd} - }#4 - } - \end{center} - \begin{enumerate}[#3,labelsep = 0.5\ccwd] - #6 + {st+O{LightBlue}O{1.}D(){\c__eb_name_exercise_tl}o+O{}+b} + { + \IfBooleanTF{#2} + { + \tcbox[ + tc-exercise, + fuzzy~halo = 5pt~with~#3, + IfValueT = {#6}{#6}, + phantom = + \IfBooleanF{#1} + { + \CTEX@ifnametrue + \refstepcounter{section} + \markright{\CTEXthesection\hspace{0.5\ccwd}#5} + \CTEX@addtocline{section}{#5} + } + ]{\IfBooleanF{#1}{\CTEXthesection\hspace{0.5\ccwd}}#5} + }{ + \group_begin: + \keys_set:nn {ctex/section}{format += \centering} + \IfValueT{#6}{\keys_set:nn {ctex/section}{#6}} + \IfBooleanTF{#1}{\section*{#5}}{\section{#5}} + \group_end: + }#7 + \begin{enumerate}[#4,labelsep = 0.5\ccwd] + #8 \end{enumerate} }{} \DeclareTColorBox{easybox}{sO{DarkCyan}d()O{}} @@ -1216,9 +1252,8 @@ IfValueT = {#3}{title = #3}, colback = #2!8!white,colbacktitle = #2!8!white, coltitle = black,colframe = black, - fonttitle = \sffamily, left = 6pt,right = 6pt,bottom = 8pt,middle= 8pt, - bottomtitle = 8pt,arc = 0pt, + bottomtitle = 8pt, beforeafter~skip = 2ex, halign~upper = left,halign~lower = left, center~title,#4 @@ -1240,10 +1275,9 @@ bottom = 8pt,toptitle = 8pt }, left = 8pt,right = 8pt,middle= 8pt, - bottomtitle = 8pt,arc = 0pt, + bottomtitle = 8pt, beforeafter~skip = 1.5ex, - colframe = #2,coltitle = #2, - fonttitle = \sffamily,#4 + colframe = #2,coltitle = #2,#4 } \DeclareTotalTCBox{\fuzzy}{O{DarkSeaGreen}vO{}} { @@ -1254,7 +1288,7 @@ { nobeforeafter,tcbox~raise~base, top = 2pt,bottom = 2.5pt,left = 2pt,right = 2pt, - boxsep = 0pt,boxrule = 0.75pt,arc = 1pt, + boxrule = 0.75pt,arc = 1pt, colback = #1!15!white,#3 }{#2} } @@ -1386,8 +1420,8 @@ \footnotesize \exp_args:Nx \linespread{\fp_use:N \l__eb_spread_footnote_fp}\selectfont - \skip_gset:Nn \footnotesep{\ht\strutbox} - \group_end: + \exp_args:NNNo \group_end: + \dim_set:Nn \footnotesep{\dim_use:N \box_ht:N \strutbox} \bool_if:NT \l__eb_chap_withpart_bool {\counterwithin*{chapter}{part}} \tl_if_eq:NnT \l__eb_foot_numberwith_tl{part} -- cgit v1.2.3