From aaf82f524c0dfe58de47f941d55875e5a7a3e8da Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 9 Dec 2021 21:04:51 +0000 Subject: easybook (9dec21) git-svn-id: svn://tug.org/texlive/trunk@61259 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/easybook/easybook.pdf | Bin 590568 -> 591059 bytes Master/texmf-dist/doc/latex/easybook/easybook.tex | 98 ++++++++++----------- .../texmf-dist/source/latex/easybook/easybook.dtx | 75 +++++++--------- Master/texmf-dist/tex/latex/easybook/easybase.sty | 29 +++--- Master/texmf-dist/tex/latex/easybook/easybook.cls | 34 +++---- .../texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg | 8 +- 6 files changed, 111 insertions(+), 133 deletions(-) (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/latex/easybook/easybook.pdf b/Master/texmf-dist/doc/latex/easybook/easybook.pdf index 9d298312428..6807d6f6feb 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/doc/latex/easybook/easybook.tex b/Master/texmf-dist/doc/latex/easybook/easybook.tex index ffb579a3b04..2a18f9a519a 100644 --- a/Master/texmf-dist/doc/latex/easybook/easybook.tex +++ b/Master/texmf-dist/doc/latex/easybook/easybook.tex @@ -20,7 +20,7 @@ name = easybook, color-scheme = blue, title = EASYBOOK 使用手册, - version = v1.41L, + version = v1.41N, date = 2021/12/08, authors = 瞿毅, info = 排版简体中文学位论文和书籍, @@ -35,8 +35,8 @@ module-sep = \,$\Rightarrow$\,, title-format = \huge\sffamily } -\KOMAoptions{headsepline = 0.6pt,numbers = noenddot} -\setfootnoterule[0.6pt]{0.4\columnwidth} +\KOMAoptions{headsepline = 0.5pt,numbers = noenddot} +\setfootnoterule[0.5pt]{0.4\columnwidth} \addtokomafont{headsepline}{\color{Blue}} \addtokomafont{footnoterule}{\color{Blue}} \addtokomafont{section}{\normalfont\sffamily} @@ -47,7 +47,7 @@ \setlist{nosep,labelindent = \parindent,leftmargin = *,labelsep = 0.5em} \setlist[itemize,1]{label = \small\color{Blue}\textbullet} \setcounter{tocdepth}{2} -\SetTblrInner{hline{1,Z} = {1pt,Blue}} +\SetTblrInner{hline{1,Z} = {0.8pt,Blue}} \ExplSyntaxOn\makeatletter \newcommand{\splitmeta}[2][\code{,}] @@ -108,7 +108,7 @@ \DefineVerbatimEnvironment{frameverb}{Verbatim} { baselinestretch = 1.2,gobble = 2,fontsize = \small, - rulecolor = \color{Blue},framerule = 0.6pt, + rulecolor = \color{Blue},framerule = 0.5pt, frame = single,framesep = 10pt, listparameters = { @@ -119,7 +119,7 @@ \DefineVerbatimEnvironment{ctexexam}{Verbatim} { baselinestretch = 1.2,gobble = 2,fontsize = \small, - rulecolor = \color{Blue},framerule = 0.6pt, + rulecolor = \color{Blue},framerule = 0.5pt, frame = single,framesep = 10pt, label = \rule{0pt}{12pt}\textnormal{\bfseries 例 \arabic{ctexexam}}, listparameters = @@ -134,7 +134,7 @@ \begin{document} \section{准备开始} -您在使用 \cls*{easybook} 文档类编写文档前可能需要满足以下的条件: +您在使用 \cls*{easybook} 文档类编写文档前可能需要具备以下的条件: \begin{itemize} \item 使用 \hologo{XeLaTeX}(推荐)或 \hologo{LuaLaTeX} 两种编译方式。 \item 由于用到了一些 \LaTeX 和宏包较新的功能,建议安装最新的 \TeX 发行版,例如 \TeX Live 2021 或 \hologo{MiKTeX} 21.2 之后的版本。 @@ -247,7 +247,7 @@ \insertblr { colspec = @{}*{4}{c}@{}, - hline{2} = {0.6pt,Blue}, + hline{2} = {0.5pt,Blue}, row{1} = {font = \sffamily}, column{1} = {cmd = \code} }{ @@ -263,7 +263,7 @@ \subsection{数学字体} \begin{options} - \keychoice{mathfont}{times,noto,notosans,nc,stix,charter,garamond,libertine,none}\Default{times} + \keychoice{mathfont}{times,noto,notosans,nc,stix2,charter,ebgaramond,libertine,none}\Default{times} 选择合适的数学字体,将会加载 \pkg*{newtxmath} 和 \pkg*{bm} 宏包。使用选项 \code{none} 时可以使用 \pkg*{unicode-math} 等其它数学字体宏包定义字体。 \end{options} @@ -366,11 +366,11 @@ \label{sec:interface options} \begin{commands} \command*{ctexset}[\marg{键值列表}] - \cls*{easybook} 扩展了 C\TeX 宏集 \hologo{LaTeX3} 风格键值的通用控制命令 \cs*{ctexset},接口选项同样可用它设置, 原有的 \meta{键值列表} 仍然可用。本文档类目前有 9 个模块用于实现常规的排版功能,如下表所示,它们既是统一接口 \cs*{ctexset} 的路径,也是相关模块的接口命令名: + \cls*{easybook} 扩展了 C\TeX 宏集 \hologo{LaTeX3} 风格键值的通用控制命令 \cs*{ctexset},接口选项同样可用它设置, 原有的 \meta{键值列表} 仍然可用。本文档类目前有 9 个模块用于实现常规的排版功能,如下表所示。模块名也是统一接口 \cs*{ctexset} 的路径,不同模块单独接口的命令名加上前缀 \code{eb}: \insertblr { colspec = @{}*{5}{c}@{}, - hline{3} = {0.6pt,Blue}, + hline{3} = {0.5pt,Blue}, row{1,3} = {font = \sffamily,belowsep = 0pt}, row{2,4} = {cmd = \module*} }{ @@ -391,7 +391,7 @@ uppercase = false } } - \style{figure-connect = {-}} + \ebstyle{connect-figure = {-}} \end{ctexexam} 文档类有三种选项:布尔型 \boolkey*{key},选项的值为 \code{true} 或 \code{false},如果不指定默认为真。键值型 \key*-{key}{value} 需要为选项指定值,后面 \code{=} 号不能省略。选择型 \choicekey*{key}{one,\default{two},three} 根据提供的可选值进行设定。 @@ -414,19 +414,19 @@ 使章标题跟随每一部分编号,开启新的一部分时章编号从 1 开始,默认不跟随。 \keychoice{footwith}{part,chapter,page}\Default{chapter} 使脚注跟随编号的计数器,默认跟随章,当开启新的一章时脚注编号从 1 开始。 - \keyval-{rulewidth}{刚性长度}\Default{0.6pt} + \keyval-{rulewidth}{刚性长度}\Default{0.5pt} 统一调整页眉、定理盒子以及代码等边框线条的粗细。需要单独设置代码和定理盒子边框线条的粗细时可用它们的宏包自带命令: \begin{ctexexam} \lstset{framerule = 0.5pt} \tcbset{boxrule = 0.5pt} \end{ctexexam} \keybool{uppercase}\Default{true} - 使用 \cs*{rightmark} 及 \cs*{leftmark} 标题标记命令获取标题内容时英文是否大写。 + 使用 \cs*{rightmark} 及 \cs*{leftmark} 等标题标记命令获取标题内容时英文是否大写。 \kvsplit{brackets}{左括号,右括号}\Default{\Carg{(\black{,})}} 设置行间公式编号标签的括号及格式,以英文逗号分隔,分别代表左右括号。\meta{左括号} 可以是带有一个参数的命令,用于接受编号和 \meta{右括号}。将标签括号设置为方括号,并使用无衬线字体: \begin{ctexexam} \newcommand{\bracketsf}[1]{\textsf{[#1}} - \style{brackets = {\bracketsf,]}} + \ebstyle{brackets = {\bracketsf,]}} \end{ctexexam} \kvsplit*{figurepath}{\meta{路径名1}\code{\}\{}\meta{路径名2}}\Default 设置插入图片的文件夹路径名,可以有多个路径名,每个路径包含在括号分隔,只有一个路径时需要包含在两层括号内。 @@ -450,27 +450,27 @@ \label{subsubsec:super-sub-script} \begin{options} \keyval-{super-vshift}{刚性长度}\Default{0pt} - 上标垂直偏移量,对应 \cs{super} 命令的参数 \meta{垂直偏移}。 + 上标垂直偏移量,对应上标命令 \cs{super} 的参数 \meta{垂直偏移}。 \keyval-{super-hshift}{刚性长度}\Default{0pt} - 上标水平偏移量,对应 \cs{super} 命令的参数 \meta{水平偏移}。 + 上标水平偏移量,对应上标命令 \cs{super} 的参数 \meta{水平偏移}。 \keyval-{sub-vshift}{刚性长度}\Default{0pt} - 下标垂直偏移量,对应 \cs{sub} 命令的参数 \meta{垂直偏移}。 + 下标垂直偏移量,对应下标命令 \cs{sub} 的参数 \meta{垂直偏移}。 \keyval-{sub-hshift}{刚性长度}\Default{0pt} - 下标水平偏移量,对应 \cs{sub} 命令的参数 \meta{水平偏移}。 + 下标水平偏移量,对应下标命令 \cs{sub} 的参数 \meta{水平偏移}。 \opt{nohshift}\Default! 同时取消上标和下标的 \meta{水平偏移},与 \keyis-{super-hshift}{0pt} 和 \keyis-{sub-hshift}{0pt} 等效。 \opt{novshift}\Default! 同时取消上标和下标的 \meta{垂直偏移},与 \keyis-{super-vshift}{0pt} 和 \keyis-{sub-vshift}{0pt} 等效。 \keyval-{super-format}{上标格式}\Default - 上标的格式,对应 \cs{super} 命令的参数 \meta{格式代码}。 + 上标的格式,对应上标命令 \cs{super} 的参数 \meta{格式代码}。 \keyval-{sub-format}{下标格式}\Default - 下标的格式,对应 \cs{sub} 命令的参数 \meta{格式代码}。 + 下标的格式,对应下标命令 \cs{sub} 的参数 \meta{格式代码}。 \keyval-{supersub-hshift}{刚性长度}\Default{0pt} - 上下标水平偏移量,对应 \cs{supersub} 命令的参数 \meta{水平偏移}。 + 上下标水平偏移量,对应上下标命令 \cs{supersub} 的参数 \meta{水平偏移}。 \kvsplit{supersub-format}{上标格式,下标格式}\Default - 上下标格式,对应 \cs{supersub} 命令的参数 \splitmeta{上标格式,下标格式}。以英文逗号分隔为前后部分,也可以只有前部分,表示上标的格式。 + 上下标格式,对应上下标命令 \cs{supersub} 的参数 \splitmeta{上标格式,下标格式}。以英文逗号分隔为前后部分,也可以只有前部分,表示上标的格式。 \keyval-{supersubsep}{刚性长度}\Default{0.3ex} - 上下标垂直间距,对应 \cs{supersub} 命令的参数 \meta{间距}。 + 上下标垂直间距,对应上下标命令 \cs{supersub} 的参数 \meta{间距}。 \keychoice{supersubalign}{l,c,r}\Default{l} 上下标的水平对齐方式,有左对齐、居中对齐和右对齐三种 \meta{对齐方式}。 \end{options} @@ -514,8 +514,8 @@ \keyval-{footnote}{数值}\Default{1.2} 脚注内容整体的行距因子,可以使用 \option{fnpara-form} 的代码覆盖每个脚注单独的行距,从而与不同脚注的段落间距不同\footnote{若在正文区中更改脚注行距,脚注横线下方的间距不会随当前行距改变。}。 \begin{ctexexam} - \spread{footnote = 1.3} - \hdrset{fnpara-form = \linespread{1.2}\selectfont} + \ebspread{footnote = 1.3} + \ebhdrset{fnpara-form = \linespread{1.2}\selectfont} \end{ctexexam} \keyval-{every}{数值}\Default 统一设置上述所有的行距因子。 @@ -539,11 +539,11 @@ \end{options} \begin{commands} - \command{addsubfont}[\marg{字体类型}\marg{字体命令}] + \command{addtosubfont}[\marg{字体类型}\marg{字体命令}] 用于在上述各种字体原有的格式上附加代码。其中 \meta{字体命令} 也可以包括行距命令且相对于 \module*{spread} 模块具有优先性,不同题注的 \meta{字体类型} 则为相应选项的后缀名。 \begin{ctexexam} - \addsubfont{every}{\linespread{1.5}\selectfont} - \addsubfont{footnote}{\sffamily} + \addtosubfont{every}{\linespread{1.5}\selectfont} + \addtosubfont{footnote}{\sffamily} \end{ctexexam} \end{commands} @@ -647,10 +647,10 @@ \item 新建定理环境默认使用的 \meta{定理样式} 为 \code{easy-theorem},而不是 \pkg*{thmtools} 的默认样式。 \end{itemize} - 下面新建一个与例 \ref{exam:new theorem env} 相同的定理环境猜想,并使用 \cs{addtcbstyle} 命令调整 \keyis-{thmframe}{true} 时默认的盒子风格。它的第一个参数为 \code{tc-theorem},关于命令的介绍在小节 \ref{subsec:box}。 + 下面新建一个与例 \ref{exam:new theorem env} 相同的定理环境猜想,并使用 \cs{addtotcbstyle} 命令调整 \keyis-{thmframe}{true} 时默认的盒子风格。它的第一个参数为 \code{tc-theorem},关于命令的介绍在小节 \ref{subsec:box}。 \begin{ctexexam} \deftheorem{caixiang}{猜想}[style = mythm] - \addtcbstyle{tc-theorem}{colback = GreenYellow} + \addtotcbstyle{tc-theorem}{colback = GreenYellow} \end{ctexexam} \command{declaretheoremstyle}[\oarg{键值列表1}\marg{定理样式}\oarg{键值列表2}] 声明新的定理样式命令,键值列表支持 \pkg*{thmtools} 宏包中原命令以及 \cs{declaretheorem} 的所有选项。可选参数的 \meta{键值列表1} 与 \meta{键值列表2} 等效,用法与原来的同名命令一致。下面定义一个名为 \code{mythm} 的定理样式用于 \cs{declaretheorem} 的 \option*{style} 选项: @@ -671,7 +671,7 @@ \keyval*-{textwidth}{页面文本区宽度}\default{} \keybool*{includehead}\Default*{false} \begin{ctexexam} - \geoset + \ebgeoset { headruleskip = 3pt, top = 2.5cm, @@ -696,7 +696,7 @@ \kvsplit-{chap-label}{\oarg{数字输出命令}\marg{距离命令}}\Default{\cs*{hspace}\Carg{1em}} 标题标记命令 \cs*{chaptermark} 内容的标签(标题有编号时),比标题标记选项更常用,可选参数是对应于章节编号计数器的输出命令,必选参数是编号与标题之间的距离命令: \begin{ctexexam} - \hdrset + \ebhdrset { chap-label = [\thechapter]{\hspace{1em}}, sec-mark = \CTEXifname{\CTEXthesection——}{}#1 @@ -731,7 +731,7 @@ \command{markrule}[\oarg{长度}\darg{颜色名}\marg{线宽}\spemcoarg{上间距,下间距}] 命令 \cs{markrule} 既可在 \meta{横线命令} 中用于绘制页眉页脚横线,也可以在正文中使用。\meta{长度} 默认为页面文本区的宽度,上下间距为横线与上下方部件的间距,带有长度单位,上下间距之间用 \code{|} 符号分开,若只有一部分则表示 \meta{上间距}。下面举一个设置页眉内容的例子: \begin{ctexexam} - \hdrset{headrule = \markrule(DarkOrchid){0.5pt}[2pt|2pt]} + \ebhdrset{headrule = \markrule(DarkOrchid){0.5pt}[2pt|2pt]} \fancyhead[ER]{\leftmark} \fancyhead[OL]{\rightmark} \fancyhead[EL,OR]{\textbf{\thepage}} @@ -744,8 +744,8 @@ \keychoice{footnotetype}{hang,default,flush,bottom}\Module{hdrset}\Default{hang} 脚注的类型,悬挂缩进 \code{hang} 是默认值,\code{default} 是原始的类型,在一些浮动体排版的情况下,脚注可能位于页面中间,\code{bottom} 使脚注始终位于页面底端,\code{flush} 使脚注内容标记位于脚注首行边缘外侧并右对齐。其中 \code{bottom} 是复合选项,可以与前三种类型重复或复合使用: \begin{ctexexam} - \hdrset{footnotetype = default,footnotetype = bottom} - \hdrset{footnotetype = {hang,bottom}} + \ebhdrset{footnotetype = default,footnotetype = bottom} + \ebhdrset{footnotetype = {hang,bottom}} \end{ctexexam} \keyval-{fnindent}{刚性长度}\Default{0.75em} 每个脚注首段的首行缩进(选项 \option*{hang} 为整体缩进),等于长度 \cs{footindent} 的值。 @@ -760,8 +760,8 @@ 短编号的形式与列表环境类似,不过增加了中文数字 \code{c} 和符号 \code{s} 格式参数。原生样式 \code{plain} 等同于单独使用数字 \code{1} 参数。这个选项可以用在正文中改变其后脚注编号类型。 \begin{ctexexam} - \hdrset{fnmark-num = 1} % 等于编号类型plain - \hdrset{fnmark-num = (a)} + \ebhdrset{fnmark-num = 1} % 等于编号类型plain + \ebhdrset{fnmark-num = (a)} \end{ctexexam} \begin{commands}\noitemsep \command{DefineFntSymbols}[\marg{符号表名}\marg{符号数量}\marg{符号列表}]\default{} @@ -770,7 +770,7 @@ \begin{ctexexam} \DefineFntSymbols{myfnsymb}{2}{{1}{*}{2}{@}} \setfntsymbol{myfnsymb} - \hdrset{fnmark-num = s} + \ebhdrset{fnmark-num = s} \end{ctexexam} \end{commands} \keychoice{fntext-num}{plain,pifont,pifont*,pisans,pisans*,short num}\Default{plain} @@ -787,7 +787,7 @@ 默认脚注标记的格式,\code{match} 可以匹配 \option*{super-format} 全局的值。一般配合选项 \keyis-{fnmate-num}{plain} 使用,例如配合 \pkg*{circledsteps} 宏包的带圈符号命令 \cs*{Circled} 给脚注标记添加圆圈: \begin{ctexexam} \usepackage{circledsteps} - \hdrset + \ebhdrset { fntext-pos = normal, fnmate-form = \tiny\Circled @@ -802,7 +802,7 @@ \kvsplit{fntext-code}{前代码,后代码}\newline 可以用 \meta{前代码} 与 \meta{后代码} 额外增加脚注内容标记前后的代码,也可以只有前部分,\meta{前代码} 中最后一个格式命令可以带有一个参数接受脚注内容标记。由于脚注标记处于水平模式,一般用于在脚注内容标记与脚注首行间插入一点距离,或与脚注正文标记的格式稍有不同。 \begin{ctexexam} - \hdrset + \ebhdrset { footnotetype = flush, fntext-code = {,\enskip} @@ -956,7 +956,7 @@ \insertblr { colspec = @{}*{11}{c}@{}, - hline{2} = {0.6pt,Blue}, + hline{2} = {0.5pt,Blue}, row{1} = {font = \sffamily}, row{2} = {cmd = \env} }{ @@ -1013,10 +1013,10 @@ \environment{exercise}[\sarg\parg\oarg{键值列表1}\darg{键值列表2}\oarg{键值列表3}] 习题环境的标题使用 \cs*{tcbox} 行内盒子包装样式,内容则使用 \env*{enumerate} 列表环境。它有 5 个可选参数,应当注意用法。当使用星号参数时标题不进行编号,使用 \parg{} 号参数时不显示标题,此时 \meta{键值列表1} 除了 \option{label} 选项失效。 - \meta{键值列表2} 包括 \pkg*{tcolorbox} 的盒子样式选项,例如 \option*{boxsep} 和 \option*{fontupper} 等,也可以使用下述 \option{tcolorbox} 选项。在这里可以使用 \cs{addtcbstyle} 命令设置标题选项 \meta{键值列表2} 的值,第一个参数为 \code{tc-exercise}。 + \meta{键值列表2} 包括 \pkg*{tcolorbox} 的盒子样式选项,例如 \option*{boxsep} 和 \option*{fontupper} 等,也可以使用下述 \option{tcolorbox} 选项。在这里可以使用 \cs{addtotcbstyle} 命令设置标题选项 \meta{键值列表2} 的值,第一个参数为 \code{tc-exercise}。 \begin{ctexexam} \tcphantomifname{\markright{\counteruse{tcbcounter}\quad 习题}}{} - \addtcbstyle{tc-exercise}{boxsep = 5pt} + \addtotcbstyle{tc-exercise}{boxsep = 5pt} \exerprologue{习题前的一段文本} \begin{exercise}+[color = LightSkyBlue](after skip = 2pc)[itemsep = 1ex] \item 第一题 @@ -1059,8 +1059,8 @@ 使用盒子以及小节 \ref{subsec:exercise} 中的 \env{exercise} 环境需要在导言区\textbf{手动载入} \pkg*{tcolorbox} 宏包,它们 \meta{配置选项} 的键值列表同样由 \pkg*{tcolorbox} 提供支持,具体选项可见宏包文档的 Option Keys 一节,可以进行边距、字体及背景颜色等各种个性化设置,一些配置会覆盖预设。 \begin{commands} \command{deftcbstyle}[\marg{盒子风格}\marg{键值列表}] - 新建或重置一个名称为 \meta{盒子风格} 的 \pkg*{tcolorbox} 宏包盒子风格,可以与 \cs{addtcbstyle} 命令联用。 - \command{addtcbstyle}[\marg{盒子风格}\marg{键值列表}] + 新建或重置一个名称为 \meta{盒子风格} 的 \pkg*{tcolorbox} 宏包盒子风格,可以与 \cs{addtotcbstyle} 命令联用。 + \command{addtotcbstyle}[\marg{盒子风格}\marg{键值列表}] 修改已存在的 \pkg*{tcolorbox} 宏包盒子风格。这个命令可以调整以下即将介绍的预置盒子风格,对于预置盒子来说参数 \meta{盒子风格} 即为它们对应的环境或命令名。 \begin{ctexexam} \deftcbstyle{mytcb} % 新建一个盒子风格mytcb @@ -1083,14 +1083,14 @@ \subsubsection{摘要盒子} \begin{environments} \environment{outline}[\oarg{键值列表1}\darg{标题名称}\oarg{键值列表2}] - 摘要盒子 \env{outline} 可用于章前摘要,它的标题是可选参数,默认标题是摘要。\meta{键值列表2} 是摘要盒子样式选项,可以使用 \cs{addtcbstyle} 命令对它进行全局设置,第一个参数为 \code{tc-outline}。 + 摘要盒子 \env{outline} 可用于章前摘要,它的标题是可选参数,默认标题是摘要。\meta{键值列表2} 是摘要盒子样式选项,可以使用 \cs{addtotcbstyle} 命令对它进行全局设置,第一个参数为 \code{tc-outline}。 \end{environments} \begin{commands} \command{setoutlinelist}[\marg{键值列表1}] \meta{键值列表1} 与 \pkg*{enumitem} 宏包中列表配置选项相同,可以设置摘要条目的各种距离,要对它进行全局设置可以使用 \cs{setoutlinelist} 命令。 \begin{ctexexam} - \addtcbstyle{tc-outline}{arc = 6pt} + \addtotcbstyle{tc-outline}{arc = 6pt} \begin{outline}[leftmargin = *](摘要标题) \item 摘要内容1 \item 摘要内容2 @@ -1101,7 +1101,7 @@ \subsubsection{段落盒子} \begin{environments} \environment{easybox}[\sarg\oarg{颜色名}\darg{段落标题}\oarg{配置选项}] - 环境 \env{easybox} 创建一个带有三个可选参数的扁平盒子。使用星号参数时给盒子添加边框,\meta{颜色名} 选项设置背景颜色,\meta{段落标题} 选项可以设置标题,默认无标题。如果 \meta{配置选项} 较长且希望在原有基础上改为全局固定的样式,可以使用 \cs{addtcbstyle} 命令设置,第一个参数为 \code{tc-easybox}。 + 环境 \env{easybox} 创建一个带有三个可选参数的扁平盒子。使用星号参数时给盒子添加边框,\meta{颜色名} 选项设置背景颜色,\meta{段落标题} 选项可以设置标题,默认无标题。如果 \meta{配置选项} 较长且希望在原有基础上改为全局固定的样式,可以使用 \cs{addtotcbstyle} 命令设置,第一个参数为 \code{tc-easybox}。 \begin{ctexexam} \begin{easybox}*[DarkCyan](段落标题) 上半盒子内容 diff --git a/Master/texmf-dist/source/latex/easybook/easybook.dtx b/Master/texmf-dist/source/latex/easybook/easybook.dtx index f8f3e85ddba..ce53b486005 100644 --- a/Master/texmf-dist/source/latex/easybook/easybook.dtx +++ b/Master/texmf-dist/source/latex/easybook/easybook.dtx @@ -15,14 +15,14 @@ %<*class> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e} -\ProvidesExplClass{easybook}{2021/12/08}{1.41L} +\ProvidesExplClass{easybook}{2021/12/08}{1.41N} {Typeset Chinese theses or books} \bool_set_false:N \l__eb_compile_draft_bool \bool_set_false:N \l__eb_title_newline_bool \bool_set_true:N \l__eb_class_mode_book_bool \tl_new:N \g__eb_config_tl -\tl_new:N \l__eb_font_choice_tl +\tl_new:N \l__eb_font_value_tl \clist_new:N \g__eb_options_clist \cs_new_protected:Npn \eb_put_ctexbook:n #1 { \PassOptionsToClass{#1}{ctexbook} } @@ -35,18 +35,12 @@ enmode .meta:n = { newline,scheme = plain }, font .choices:nn = { noto,garamond,times,times*,libertine,palatino,auto } - { \tl_set:Nn \l__eb_font_choice_tl {#1} }, + { \tl_set:Nn \l__eb_font_value_tl {#1} }, font .value_required:n = true, font .initial:n = auto, cjkfont .code:n = \eb_put_ctexbook:n { fontset = #1 }, paper .code:n = \PassOptionsToPackage{#1}{geometry}, - mathfont .choices:nn = - { - noto,notosans,times,libertine, - charter,garamond,none,nc,stix - } - { \tl_set:Nn \l__eb_mathfont_choice_tl {#1} }, - mathfont .value_required:n = true, + mathfont .tl_set:N = \l__eb_mathfont_value_tl, mathfont .initial:n = times, class .choice:, class .value_required:n = true, @@ -72,7 +66,7 @@ \RequirePackage{easybase} \ctex_at_end:n { - \use:c { eb@font@load@\l__eb_font_choice_tl } + \use:c { eb@font@load@\l__eb_font_value_tl } \tl_if_empty:NF \g__eb_config_tl { \file_input:n { \g__eb_config_tl } } } @@ -231,18 +225,16 @@ } \cs_new_protected:Npn \eb_put_newtxmath:n #1 { \PassOptionsToPackage{#1}{newtxmath} } -\str_case:VnT \l__eb_mathfont_choice_tl - { - { times } { } - { nc } { \eb_put_newtxmath:n { nc } } - { noto } { \eb_put_newtxmath:n { noto } } - { stix } { \eb_put_newtxmath:n { stix2 } } - { charter } { \eb_put_newtxmath:n { charter } } - { notosans } { \eb_put_newtxmath:n { notosans } } - { garamond } { \eb_put_newtxmath:n { ebgaramond } } - { libertine } { \eb_put_newtxmath:n { libertine } } - } - { \LoadPackage{newtxmath+bm} } +\cs_generate_variant:Nn \eb_put_newtxmath:n { V } +\str_case:VnF \l__eb_mathfont_value_tl + { + { times } { \LoadPackage{newtxmath+bm} } + { none } { } + } + { + \eb_put_newtxmath:V \l__eb_mathfont_value_tl + \LoadPackage{newtxmath+bm} + } \ctex_set:n { @@ -319,7 +311,7 @@ %<*package> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e,etoolbox} -\ProvidesExplPackage{easybase}{2021/12/08}{1.41L} +\ProvidesExplPackage{easybase}{2021/12/08}{1.41N} {Typeset Chinese theses or books} \cs_generate_variant:Nn \dim_set:Nn { NV } @@ -463,7 +455,7 @@ \bool_new:N \l__eb_mark_uppercase_bool \bool_new:N \l__eb_chap_counter_withpart_bool -\tl_new:N \l__eb_foot_counter_parent_choice_tl +\tl_new:N \l__eb_foot_counter_parent_value_tl \eb_seq_map_inline:nn { @@ -473,11 +465,8 @@ } { \ctex_define:n { #1 .meta:nn = { ctex/#1 } {##1} } - \cs_new_protected:cpn {#1} ##1 { \ctex_set:nn {#1} {##1} } + \cs_new_protected:cpn { eb#1 } ##1 { \ctex_set:nn {#1} {##1} } } -\keys_define:nn { } { ctex/link .inherit:n = ctex/refset } -\ctex_define:n { link .meta:nn = { ctex/link } {#1} } -\cs_set_eq:NN \link \refset \eb_seq_map_inline:nn { style,subfont,spread,bibset,thmset,hdrset,tocset } { @@ -581,7 +570,7 @@ withpart .default:n = true, withpart .initial:n = false, rulewidth .dim_set:N = \l__eb_rule_width_dim, - rulewidth .initial:n = 0.6pt, + rulewidth .initial:n = 0.5pt, uppercase .bool_set:N = \l__eb_mark_uppercase_bool, uppercase .default:n = true, uppercase .initial:n = true, @@ -747,7 +736,7 @@ { footwith .choices:nn = { part,page,chapter } - { \tl_set:Nn \l__eb_foot_counter_parent_choice_tl {#1} }, + { \tl_set:Nn \l__eb_foot_counter_parent_value_tl {#1} }, footwith .value_required:n = true, footwith .initial:n = chapter } @@ -830,7 +819,7 @@ } \cs_set_eq:cN {#2} \l__eb_fnmate_short_tokens_tl } -\cs_new_protected:Npn \eb_footnote_choice_handle:n #1 +\cs_new_protected:Npn \eb_footnote_value_handle:n #1 { \str_case:nnF {#1} { @@ -838,7 +827,7 @@ { \bool_set_true:N \l__eb_fnpara_bottom_bool } { flush } { - \tl_set:Nn \l__eb_footnote_choice_tl { default } + \tl_set:Nn \l__eb_footnote_value_tl { default } \clist_push:Nn \l__eb_footnote_mulchoice_clist {#1} } } @@ -846,7 +835,7 @@ \bool_lazy_or:nnT { \str_if_eq_p:nn {#1} { hang } } { \str_if_eq_p:nn {#1} { default } } - { \tl_set:Nn \l__eb_footnote_choice_tl {#1} } + { \tl_set:Nn \l__eb_footnote_value_tl {#1} } } } \cs_new_protected:Npn \eb_fnmate_shift_set:nnn #1#2#3 @@ -892,7 +881,7 @@ footnotetype .multichoices:nn = { default,hang,bottom,para,flush } - { \eb_footnote_choice_handle:n {#1} }, + { \eb_footnote_value_handle:n {#1} }, footnotetype .value_required:n = true, footnotetype .initial:n = hang, @@ -927,7 +916,7 @@ \dim_set:Nn \footnotesep { \dim_use:N \box_ht:N \strutbox } \bool_if:NT \l__eb_chap_counter_withpart_bool { \counterwithin*{chapter}{part} } - \str_case:VnT \l__eb_foot_counter_parent_choice_tl + \str_case:VnT \l__eb_foot_counter_parent_value_tl { { part } { \counterwithin*{footnote}{part} } { page } { \counterwithin*{footnote}{page} } @@ -1016,7 +1005,7 @@ \cs_set:Npn \@makefntext #1 { \group_begin: - \str_case:Vn \l__eb_footnote_choice_tl + \str_case:Vn \l__eb_footnote_value_tl { { hang } { \use_i:nn } { default } { \use_ii:nn } @@ -1026,7 +1015,7 @@ \skip_set:NV \parskip \footparskip \dim_set:NV \parindent \footparindent \l__eb_fnpara_format_tl{#1} - \tl_if_eq:NnT \l__eb_footnote_choice_tl { hang } { \par } + \tl_if_eq:NnT \l__eb_footnote_value_tl { hang } { \par } \group_end: } \cs_set_eq:NN \eb@makefntext \@makefntext @@ -1737,7 +1726,7 @@ marginpar .initial:n = \rmfamily\footnotesize, unknown .code:n = \eb_msg_abandon_option:n { subfont } } -\cs_new_protected:Npn \addsubfont #1#2 +\cs_new_protected:Npn \addtosubfont #1#2 { \str_case:nnF {#1} { @@ -2441,17 +2430,17 @@ } % %<*tcolorbox> -\ProvidesExplFile{eb-tcolorbox.cfg}{2021/12/08}{1.41L} +\ProvidesExplFile{eb-tcolorbox.cfg}{2021/12/08}{1.41N} {Customization of tcolorbox for easybook} \cs_set_protected:Npn \setexercise #1 { \keys_set:nn { eb/exercise } {#1} } -\cs_set_protected:Npn \addtcbstyle #1#2 +\cs_set_protected:Npn \addtotcbstyle #1#2 { \tcbset{#1/.append~style = {#2}} } \cs_set_protected:Npn \deftcbstyle #1#2 { \tcbset{#1/.style = {#2}} } \cs_new_protected:Npn \tcbappstyle - { \@ifstar{\deftcbstyle}{\addtcbstyle} } + { \@ifstar{\deftcbstyle}{\addtotcbstyle} } \cs_set_eq:NN \newtcbstyle \deftcbstyle \keys_define:nn { eb/exercise } { @@ -2467,7 +2456,7 @@ tocnumsep .initial:n = 1em, label .tl_set:N = \eb@tc@exercise@label, enumitem .code:n = \setexerlist{#1}, - tcolorbox .code:n = \addtcbstyle{exercise}{#1} + tcolorbox .code:n = \addtotcbstyle{exercise}{#1} } \tl_gset:Nn \eb@tc@line@skip { 0.5\baselineskip } diff --git a/Master/texmf-dist/tex/latex/easybook/easybase.sty b/Master/texmf-dist/tex/latex/easybook/easybase.sty index cdd8b6b9d33..5da7c26c70a 100644 --- a/Master/texmf-dist/tex/latex/easybook/easybase.sty +++ b/Master/texmf-dist/tex/latex/easybook/easybase.sty @@ -20,7 +20,7 @@ %% This work has the LPPL maintenance status `maintained'. \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e,etoolbox} -\ProvidesExplPackage{easybase}{2021/12/08}{1.41L} +\ProvidesExplPackage{easybase}{2021/12/08}{1.41N} {Typeset Chinese theses or books} \cs_generate_variant:Nn \dim_set:Nn { NV } @@ -164,7 +164,7 @@ \bool_new:N \l__eb_mark_uppercase_bool \bool_new:N \l__eb_chap_counter_withpart_bool -\tl_new:N \l__eb_foot_counter_parent_choice_tl +\tl_new:N \l__eb_foot_counter_parent_value_tl \eb_seq_map_inline:nn { @@ -174,11 +174,8 @@ } { \ctex_define:n { #1 .meta:nn = { ctex/#1 } {##1} } - \cs_new_protected:cpn {#1} ##1 { \ctex_set:nn {#1} {##1} } + \cs_new_protected:cpn { eb#1 } ##1 { \ctex_set:nn {#1} {##1} } } -\keys_define:nn { } { ctex/link .inherit:n = ctex/refset } -\ctex_define:n { link .meta:nn = { ctex/link } {#1} } -\cs_set_eq:NN \link \refset \eb_seq_map_inline:nn { style,subfont,spread,bibset,thmset,hdrset,tocset } { @@ -282,7 +279,7 @@ withpart .default:n = true, withpart .initial:n = false, rulewidth .dim_set:N = \l__eb_rule_width_dim, - rulewidth .initial:n = 0.6pt, + rulewidth .initial:n = 0.5pt, uppercase .bool_set:N = \l__eb_mark_uppercase_bool, uppercase .default:n = true, uppercase .initial:n = true, @@ -448,7 +445,7 @@ { footwith .choices:nn = { part,page,chapter } - { \tl_set:Nn \l__eb_foot_counter_parent_choice_tl {#1} }, + { \tl_set:Nn \l__eb_foot_counter_parent_value_tl {#1} }, footwith .value_required:n = true, footwith .initial:n = chapter } @@ -531,7 +528,7 @@ } \cs_set_eq:cN {#2} \l__eb_fnmate_short_tokens_tl } -\cs_new_protected:Npn \eb_footnote_choice_handle:n #1 +\cs_new_protected:Npn \eb_footnote_value_handle:n #1 { \str_case:nnF {#1} { @@ -539,7 +536,7 @@ { \bool_set_true:N \l__eb_fnpara_bottom_bool } { flush } { - \tl_set:Nn \l__eb_footnote_choice_tl { default } + \tl_set:Nn \l__eb_footnote_value_tl { default } \clist_push:Nn \l__eb_footnote_mulchoice_clist {#1} } } @@ -547,7 +544,7 @@ \bool_lazy_or:nnT { \str_if_eq_p:nn {#1} { hang } } { \str_if_eq_p:nn {#1} { default } } - { \tl_set:Nn \l__eb_footnote_choice_tl {#1} } + { \tl_set:Nn \l__eb_footnote_value_tl {#1} } } } \cs_new_protected:Npn \eb_fnmate_shift_set:nnn #1#2#3 @@ -593,7 +590,7 @@ footnotetype .multichoices:nn = { default,hang,bottom,para,flush } - { \eb_footnote_choice_handle:n {#1} }, + { \eb_footnote_value_handle:n {#1} }, footnotetype .value_required:n = true, footnotetype .initial:n = hang, @@ -628,7 +625,7 @@ \dim_set:Nn \footnotesep { \dim_use:N \box_ht:N \strutbox } \bool_if:NT \l__eb_chap_counter_withpart_bool { \counterwithin*{chapter}{part} } - \str_case:VnT \l__eb_foot_counter_parent_choice_tl + \str_case:VnT \l__eb_foot_counter_parent_value_tl { { part } { \counterwithin*{footnote}{part} } { page } { \counterwithin*{footnote}{page} } @@ -717,7 +714,7 @@ \cs_set:Npn \@makefntext #1 { \group_begin: - \str_case:Vn \l__eb_footnote_choice_tl + \str_case:Vn \l__eb_footnote_value_tl { { hang } { \use_i:nn } { default } { \use_ii:nn } @@ -727,7 +724,7 @@ \skip_set:NV \parskip \footparskip \dim_set:NV \parindent \footparindent \l__eb_fnpara_format_tl{#1} - \tl_if_eq:NnT \l__eb_footnote_choice_tl { hang } { \par } + \tl_if_eq:NnT \l__eb_footnote_value_tl { hang } { \par } \group_end: } \cs_set_eq:NN \eb@makefntext \@makefntext @@ -1438,7 +1435,7 @@ marginpar .initial:n = \rmfamily\footnotesize, unknown .code:n = \eb_msg_abandon_option:n { subfont } } -\cs_new_protected:Npn \addsubfont #1#2 +\cs_new_protected:Npn \addtosubfont #1#2 { \str_case:nnF {#1} { diff --git a/Master/texmf-dist/tex/latex/easybook/easybook.cls b/Master/texmf-dist/tex/latex/easybook/easybook.cls index 7ca1ec98ed7..3935ea4d887 100644 --- a/Master/texmf-dist/tex/latex/easybook/easybook.cls +++ b/Master/texmf-dist/tex/latex/easybook/easybook.cls @@ -20,14 +20,14 @@ %% This work has the LPPL maintenance status `maintained'. \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e} -\ProvidesExplClass{easybook}{2021/12/08}{1.41L} +\ProvidesExplClass{easybook}{2021/12/08}{1.41N} {Typeset Chinese theses or books} \bool_set_false:N \l__eb_compile_draft_bool \bool_set_false:N \l__eb_title_newline_bool \bool_set_true:N \l__eb_class_mode_book_bool \tl_new:N \g__eb_config_tl -\tl_new:N \l__eb_font_choice_tl +\tl_new:N \l__eb_font_value_tl \clist_new:N \g__eb_options_clist \cs_new_protected:Npn \eb_put_ctexbook:n #1 { \PassOptionsToClass{#1}{ctexbook} } @@ -40,18 +40,12 @@ enmode .meta:n = { newline,scheme = plain }, font .choices:nn = { noto,garamond,times,times*,libertine,palatino,auto } - { \tl_set:Nn \l__eb_font_choice_tl {#1} }, + { \tl_set:Nn \l__eb_font_value_tl {#1} }, font .value_required:n = true, font .initial:n = auto, cjkfont .code:n = \eb_put_ctexbook:n { fontset = #1 }, paper .code:n = \PassOptionsToPackage{#1}{geometry}, - mathfont .choices:nn = - { - noto,notosans,times,libertine, - charter,garamond,none,nc,stix - } - { \tl_set:Nn \l__eb_mathfont_choice_tl {#1} }, - mathfont .value_required:n = true, + mathfont .tl_set:N = \l__eb_mathfont_value_tl, mathfont .initial:n = times, class .choice:, class .value_required:n = true, @@ -77,7 +71,7 @@ \RequirePackage{easybase} \ctex_at_end:n { - \use:c { eb@font@load@\l__eb_font_choice_tl } + \use:c { eb@font@load@\l__eb_font_value_tl } \tl_if_empty:NF \g__eb_config_tl { \file_input:n { \g__eb_config_tl } } } @@ -236,18 +230,16 @@ } \cs_new_protected:Npn \eb_put_newtxmath:n #1 { \PassOptionsToPackage{#1}{newtxmath} } -\str_case:VnT \l__eb_mathfont_choice_tl +\cs_generate_variant:Nn \eb_put_newtxmath:n { V } +\str_case:VnF \l__eb_mathfont_value_tl + { + { times } { \LoadPackage{newtxmath+bm} } + { none } { } + } { - { times } { } - { nc } { \eb_put_newtxmath:n { nc } } - { noto } { \eb_put_newtxmath:n { noto } } - { stix } { \eb_put_newtxmath:n { stix2 } } - { charter } { \eb_put_newtxmath:n { charter } } - { notosans } { \eb_put_newtxmath:n { notosans } } - { garamond } { \eb_put_newtxmath:n { ebgaramond } } - { libertine } { \eb_put_newtxmath:n { libertine } } + \eb_put_newtxmath:V \l__eb_mathfont_value_tl + \LoadPackage{newtxmath+bm} } - { \LoadPackage{newtxmath+bm} } \ctex_set:n { diff --git a/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg b/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg index 602ac7c0de4..554368186a6 100644 --- a/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg +++ b/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg @@ -18,17 +18,17 @@ %% LaTeX version 2005/12/01 or later. %% %% This work has the LPPL maintenance status `maintained'. -\ProvidesExplFile{eb-tcolorbox.cfg}{2021/12/08}{1.41L} +\ProvidesExplFile{eb-tcolorbox.cfg}{2021/12/08}{1.41N} {Customization of tcolorbox for easybook} \cs_set_protected:Npn \setexercise #1 { \keys_set:nn { eb/exercise } {#1} } -\cs_set_protected:Npn \addtcbstyle #1#2 +\cs_set_protected:Npn \addtotcbstyle #1#2 { \tcbset{#1/.append~style = {#2}} } \cs_set_protected:Npn \deftcbstyle #1#2 { \tcbset{#1/.style = {#2}} } \cs_new_protected:Npn \tcbappstyle - { \@ifstar{\deftcbstyle}{\addtcbstyle} } + { \@ifstar{\deftcbstyle}{\addtotcbstyle} } \cs_set_eq:NN \newtcbstyle \deftcbstyle \keys_define:nn { eb/exercise } { @@ -44,7 +44,7 @@ tocnumsep .initial:n = 1em, label .tl_set:N = \eb@tc@exercise@label, enumitem .code:n = \setexerlist{#1}, - tcolorbox .code:n = \addtcbstyle{exercise}{#1} + tcolorbox .code:n = \addtotcbstyle{exercise}{#1} } \tl_gset:Nn \eb@tc@line@skip { 0.5\baselineskip } -- cgit v1.2.3