diff options
author | Karl Berry <karl@freefriends.org> | 2021-07-04 20:42:21 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-07-04 20:42:21 +0000 |
commit | 94d9450d42ae0954f849d2da487a8c4276f21742 (patch) | |
tree | e73cb431eb5e8cb0056bbb9637631d2194fa2aaa /Master/texmf-dist | |
parent | b6e5140d83d14f9d407d5d6f2cb5853b14b12daf (diff) |
easybook (4jul21)
git-svn-id: svn://tug.org/texlive/trunk@59828 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/easybook/easybook.pdf | bin | 556751 -> 559175 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/easybook/easybook.dtx | 435 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/easybook/easybook.ins | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/easybook/easybase.sty | 192 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/easybook/easybook.cls | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg | 194 |
6 files changed, 466 insertions, 359 deletions
diff --git a/Master/texmf-dist/doc/latex/easybook/easybook.pdf b/Master/texmf-dist/doc/latex/easybook/easybook.pdf Binary files differindex 43cbc4c9301..94de4110840 100644 --- a/Master/texmf-dist/doc/latex/easybook/easybook.pdf +++ b/Master/texmf-dist/doc/latex/easybook/easybook.pdf diff --git a/Master/texmf-dist/source/latex/easybook/easybook.dtx b/Master/texmf-dist/source/latex/easybook/easybook.dtx index 8d93f7f5660..17f6663350d 100644 --- a/Master/texmf-dist/source/latex/easybook/easybook.dtx +++ b/Master/texmf-dist/source/latex/easybook/easybook.dtx @@ -28,7 +28,7 @@ % % \title{\sffamily easybook 文档类手册} % \author{瞿毅} -% \date{2021/07/02\hskip\ccwd\relax v1.26p\thanks{\url{https://gitee.com/texl3/easybook}}} +% \date{2021/07/03\hskip\ccwd\relax v1.26q\thanks{\url{https://gitee.com/texl3/easybook}}} % % \maketitle % \begin{abstract} @@ -158,7 +158,7 @@ % floatpage = <true|(false)> % \end{syntax} % 开启这个选项后浮动环境 \env{table} 和 \env{figure} 的比例参数会使用默认值,关闭它则尽可能避免出现浮动页,使图表环境与正文段落更加紧凑,减少多余的空白版面。 -% \changes{v1.26p}{2021/06/15}{增加浮动环境比例参数选项 \opt{floatpage}。} +% \changes{v1.26q}{2021/06/15}{增加浮动环境比例参数选项 \opt{floatpage}。} % \end{function} % % \subsection{article 模式} @@ -240,7 +240,7 @@ % \tn{EBeforeAddBitoc*}\marg{加入目录英文标题前的代码} % \end{syntax} % \tn{appendix} 命令后的章节标题变为附录形式。英文目录中附录标题的格式用可选参数修改,英文附录目录前名字默认为 Appendix\tn{space},后名字默认为空,名字之间用一个半角逗号分开,也可以只有一部分,表示英文附录目录前名字。英文附录目录数字输出命令默认为 \tn{Alph}\{chapter\}。 -% \changes{v1.26p}{2021/06/13}{增加调整英文目录格式的钩子 \tn{EBeforeAddBitoc}。} +% \changes{v1.26q}{2021/06/13}{增加调整英文目录格式的钩子 \tn{EBeforeAddBitoc}。} % \end{function} % % \tn{EBeforeAddBitoc} 是一个作用于局部范围的英文目录钩子,可以插入标题或目录设置的命令改变英文目录中标题的显示格式,也可以覆盖上述的目录前后名字和编号等设置,带有星号的命令会重置之前的代码,放置在导言区或 \tn{bichapter} 等命令前生效。 @@ -255,7 +255,7 @@ % \ \oarg{水平偏移}\parg{下标代码} % \end{syntax} % 上标和下标的功能来自 \pkg{spbmark} 宏包,\tn{super}、\tn{sub} 和 \tn{supersub} 三个命令可以用于输出上标和下标。它们根据当前处于文本模式还是数学模式来匹配相应的模式,或者可以使用它们的星号变体命令来强制使用数学模式。也可以使用键值列表对偏移量进行全局设置,详情见小节 \ref{subsubsec:super-sub-script}。 -% \changes{v1.26p}{2021/06/28}{增加可以调整相对位置和格式的上标和下标命令 \tn{super}、\tn{sub} 和 \tn{supersub}。} +% \changes{v1.26q}{2021/06/28}{增加可以调整相对位置和格式的上标和下标命令 \tn{super}、\tn{sub} 和 \tn{supersub}。} % \end{function} % % 垂直和水平偏移默认值都是 0 pt,\meta{对齐方式} 的参数与 \opt{supersubalign} 相同。\meta{格式代码} 用于格式化上标和下标,可以插入字体或颜色等命令。代码中的最后一个命令可以接受一个为上标或下标的参数。\tn{textsuperscript} 和 \tn{textsubscript} 命令已被重新定义并且分别等价于 \tn{super} 和 \tn{sub},如果您需要使用它们的原始定义创建新命令,则可以使用 \tn{spb@textsuperscript@save} 和 \tn{spb@textsubscript@save} 命令。 @@ -282,7 +282,7 @@ % % \subsection{风格} % \label{subsec:style} -% \begin{function}[EXP,added = 2021-01-05,updated = 2021-05-19]{color,color-all,multoc,withpart,footwith,rulewidth,uppercase,figurepath} +% \begin{function}[EXP,added = 2021-01-05,updated = 2021-07-03]{color,color-all,multoc,withpart,footwith,rulewidth,uppercase,figurepath} % \begin{syntax} % color = <(none)|seaside|energy|cyberpunk> % color-all = <HTML颜色代码> @@ -300,13 +300,13 @@ % \end{function} % % \begin{optdesc} -% \item[color] 主题颜色,包括标题、页眉颜色等,选项 \opt{none} 为黑白页面,但不包括超链接。 -% \begin{function}{ctex@frame,ctex@emph,ctex@verb} +% \item[color] 预置了四种主题颜色,默认主题 \opt{none} 为黑白页面,主题颜色不包括超链接。 +% \begin{function}{\DeclareThemeColor} % \begin{syntax} -% \tn{definecolor}\oarg{类型}\marg{名称}\marg{模式列表}\marg{参数列表} +% \tn{DeclareThemeColor}\{<风格名称>,<ctex@frame>,<ctex@emph>,<ctex@verb>\} % \end{syntax} -% 主题颜色用到这三个颜色,可以使用 \tn{definecolor} 命令进行更改,类似地更改超链接颜色见小节 \ref{subsec:hyperlinks}。 -% \changes{v1.10}{2021/01/08}{可以自定义主题颜色。} +% 可以使用 \tn{DeclareThemeColor} 命令声明新的主题颜色,它的参数以英文逗号分隔,第一部分为颜色风格名称,后面三部分为 HTML 颜色代码,构成主题颜色。类似地更改超链接颜色见小节 \ref{subsec:hyperlinks}。 +% \changes{v1.26q}{2021/07/03}{使用 \tn{DeclareThemeColor} 命令声明新的颜色风格。} % \end{function} % \item[color-all] 统一设置主题的各部分颜色,参数是 6 个十六进制数字组成的 HTML 颜色代码,任意颜色的代码可以在常见的图片处理工具拾色器中查看。 % \item[multoc] 开启多栏目录,与节 \ref{sec:document command} 中目录命令的同名选项有相同效果。 @@ -348,7 +348,7 @@ % % \subsection{超链接} % \label{subsec:hyperlinks} -% \begin{function}[EXP,added = 2021-01-05,updated = 2021-05-06]{linktype,linkcolor,linkcol-all,linktoc} +% \begin{function}[EXP,added = 2021-01-05,updated = 2021-07-03]{linktype,linkcolor,linkcol-all,linktoc} % \begin{syntax} % linktype = <(edge)|various|none> % linkcolor = <fresh|cutepink|(navyblue)|crimson> @@ -364,14 +364,14 @@ % \end{function} % % \begin{optdesc} -% \item[linktype] \opt{edge} 使超链接为边框形式,\opt{various} 使超链接为彩色字体,有四种颜色风格。\opt{none} 关闭超链接边框与颜色,此时 \opt{linkcolor} 选项无效。 +% \item[linktype] \opt{edge} 使超链接为边框形式,\opt{various} 使超链接变为彩色,预置了四种颜色样式。\opt{none} 关闭超链接边框与颜色,此时 \opt{linkcolor} 选项无效。 % \item[linkcolor] 超链接颜色样式。 -% \begin{function}{ctex@link,ctex@url,ctex@cite} +% \begin{function}{\DeclareLinkColor} % \begin{syntax} -% \tn{definecolor}\oarg{类型}\marg{名称}\marg{模式列表}\marg{参数列表} +% \tn{DeclareLinkColor}\{<风格名称>,<ctex@link>,<ctex@url>,<ctex@cite>\} % \end{syntax} -% 超链接颜色用到这三个颜色,可以使用 \tn{definecolor} 命令进行更改。 -% \changes{v1.10}{2021/01/08}{可以自定义超链接颜色。} +% 可以使用 \tn{DeclareLinkColor} 命令声明新的超链接颜色样式,它的参数以英文逗号分隔,第一部分为颜色风格名称,后面三部分为 HTML 颜色代码,构成超链接颜色。 +% \changes{v1.26q}{2021/07/03}{使用 \tn{DeclareLinkColor} 命令声明新的超链接颜色。} % \end{function} % \item[linkcol-all] 统一设置超链接的各部分颜色,参数是 6 个十六进制数字组成的 HTML 颜色代码,任意颜色的代码可以在常见的图片处理工具拾色器中查看。 % \item[linktoc] 将目录中的超链接取消、置于标题上、置于页码上或置于标题和页码上。 @@ -492,7 +492,7 @@ % \end{syntax} % \ding{229} 以上选项路径为 \opt{thmset/...} % \changes{v1.21}{2021/01/12}{增加配置定理环境样式的选项。} -% \changes{v1.26p}{2021/07/01}{增加配置公式标签括号选项 \opt{brackets}。} +% \changes{v1.26q}{2021/07/01}{增加配置公式标签括号选项 \opt{brackets}。} % \end{function} % % \begin{optdesc} @@ -519,7 +519,7 @@ % 文档类已预置 8 个定理环境,环境名及对应的定理标题名见小节 \ref{subsec:theorem},如果需要新的定理标题名或定理样式可使用这两个命令,由 \pkg{thmtools} 提供支持,用法与它的同名命令一致。 % \changes{v1.23}{2021/03/12}{重新定义了新定理环境命令 \tn{newtheorem}。} % \changes{v1.24}{2021/04/25}{增加定义定理环境命令 \tn{EBNewTheorem}。} -% \changes{v1.26p}{2021/06/15}{定义新定理环境的命令调整为 \tn{declaretheorem}。} +% \changes{v1.26q}{2021/06/15}{定义新定理环境的命令调整为 \tn{declaretheorem}。} % \end{function} % % \begin{optdesc} @@ -625,7 +625,7 @@ % \tn{markrule}\oarg{长度|(\tn{textwidth})}\parg{颜色名}\marg{线宽|(0.75pt)}[<上间距>+<下间距>] % \end{syntax} % 命令 \tn{easyhead} 和 \tn{easyfoot} 的使用方法与 \tn{fancyhead} 和 \tn{fancyfoot} 完全相同,它们需要在 \opt{head-foot} 选项中使用,设置的是一个名为 \opt{fancy} 的页面风格。\pkg{fancyhdr} 将页眉页脚分成了左中右和奇数页(odd)、偶数页(even)共12个部分,可选参数中E、O代表偶数、奇数,L、C、R代表左、中、右部分。单面打印时,含有偶数的选项无效。 -% \changes{v1.26p}{2021/06/14}{增加页眉页脚的横线绘制命令 \tn{markrule}。} +% \changes{v1.26q}{2021/06/14}{增加页眉页脚的横线绘制命令 \tn{markrule}。} % \end{function} % % 命令 \tn{markrule} 用于绘制页眉页脚横线,长度默认为页面文本区的宽度,上下间距为横线与上下方部件的间距,带有长度单位,间距长度之间用 + 号分开,若只有一部分则表示上间距,这个命令也可以在正文中绘制横线。下面举一个设置页眉内容的例子: @@ -827,29 +827,40 @@ % % \subsection{习题} % \label{subsec:exercise} -% \begin{function}[added = 2021-01-05,updated = 2021-06-06]{exercise} +% \begin{function}[added = 2021-01-05,updated = 2021-07-03]{exercise} % \begin{syntax} % \tn{begin}\marg{exercise}*+\oarg{键值列表}\parg{键值列表}\oarg{键值列表} % \ \tn{item} <习题内容> % \tn{end}\marg{exercise} % \end{syntax} -% 习题环境 \env{exercise} 的标题紧接上一节编号并加入目录与页眉,当使用星号参数时不进行编号,使用 + 号参数独立编号并启用 \pkg{tcolorbox} 支持生成标题,并使 \opt{color} 生效。第三个 \meta{键值列表} 的选项与小节 \ref{subsec:sort list} 排序列表相同,\opt{number} 的编号格式也是如此。第一个 \meta{键值列表} 中包含的选项如下: +% 习题环境 \env{exercise} 的标题紧接上一节编号并加入目录与页眉,当使用星号参数时不进行编号,使用 + 号参数独立编号并启用 \pkg{tcolorbox} 支持生成标题,并使 \opt{color} 生效,此时计数器使用的值为 \tn{thetcbcounter}。第三个 \meta{键值列表} 的选项与小节 \ref{subsec:sort list} 排序列表相同,\opt{number} 的编号格式也是如此。第一个 \meta{键值列表} 中包含的选项如下: % \changes{v1.23}{2021/02/08}{增加准确的习题盒子标题目录锚点。} % \end{function} % -% \begin{function}{color,title,number,numsep} +% \begin{function}{color,title,number,numsep,label} % \begin{syntax} % color = <标题背景颜色名|(LightSkyBlue)> % title = <环境标题> % number = <习题编号格式|(1.)> % numsep = <编号与标题的间距|(0.5\tn{ccwd})> +% label = <标签内容> % \end{syntax} -% 第二个 \meta{键值列表} 在是否使用 + 号参数时用法不同,使用 + 号参数时为 \pkg{tcolorbox} 的盒子选项,例如 \opt{boxrule} 和 \opt{fontupper}。不使用 + 号参数时相当于设置 \tn{ctexset}\{section = {\#1}\} 键值选项列表,例如 \opt{format} 和 \opt{beforeskip}。另外还可以使用 \tn{exerprologue} 命令在习题环境开始前插入一段内容,可以是文本或者代码,需要在每一个习题环境前使用。 +% 第二个 \meta{键值列表} 在是否使用 + 号参数时用法不同,使用 + 号参数时为 \pkg{tcolorbox} 的盒子选项,例如 \opt{boxrule} 和 \opt{fontupper}。不使用 + 号参数时相当于设置 \tn{ctexset}\{section = {\#1}\} 键值选项列表,例如 \opt{format} 和 \opt{beforeskip}。\opt{label} 选项用于设置习题环境的引用标签,它与标签格式命令 \tn{labelformat} 对应的计数器是 eb@exercise。 +% \end{function} +% +% \begin{function}{\setexercise,\exerprologue,\tcphanifname} +% \begin{syntax} +% \tn{setexercise}\marg{键值列表} +% \tn{exerprologue}\marg{序言内容} +% \tn{tcphanifname}\marg{编号代码}\marg{不编号代码} +% \end{syntax} +% 可以通过 \tn{setexercise} 命令使用键值列表设置上述习题选项的默认值。\tn{exerprologue} 命令在习题环境开始前插入一段内容,可以是文本或者代码,需要在每一个习题环境前使用。\tn{tcphanifname} 命令根据使用 \pkg{tcolorbox} 生成的习题标题是否编号,在超链接锚点的位置加入代码。 % \end{function} % % \begin{ctexexam} +% \tcphanifname{\markright{\EBUseCounter{tcbcounter}{\quad 习题}}}{} % \exerprologue{习题前的一段文本} -% \begin{exercise}+[color = LightSkyBlue](after skip = 3.25ex)[itemsep = 1ex] +% \begin{exercise}+[color = LightSkyBlue](after skip = 3.75ex)[itemsep = 1ex] % \item 习题内容 % \item 习题内容 % \end{exercise} @@ -952,7 +963,7 @@ % \tn{EBUseCounter*}\oarg{父计数器}\parg{编号|(arabic)}\marg{计数器}\marg{内容}\oarg{分隔符|(.)}\parg{数值} % \end{syntax} % \tn{newcounter} 是 \LaTeX 自带的创建计数器命令,\tn{EBUseCounter} 将会以一定的格式使用由它创建的计数器,将会以 \tn{the}\meta{父计数器}\meta{分隔符}\tn{the}\meta{计数器}\meta{内容} 输出当前内容。 -% \changes{v1.26p}{2021/06/30}{增加计数器使用命令 \tn{EBUseCounter}。} +% \changes{v1.26q}{2021/06/30}{增加计数器使用命令 \tn{EBUseCounter}。} % \end{function} % % 需要注意的是 \tn{EBUseCounter} 仅具有 \textbf{输出功能},并不会改变计数器原有的绑定关系。默认每使用一次命令 \meta{计数器} 的值增加 1,带有星号的命令使 \meta{计数器} 保持当前值,\meta{编号} 为 arabic 和 alpha 等格式,\meta{数值} 可以手动将 \meta{计数器} 设为指定值。 @@ -1139,7 +1150,7 @@ %<*class> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e} -\ProvidesExplClass{easybook}{2021/07/02}{1.26p} +\ProvidesExplClass{easybook}{2021/07/03}{1.26q} {Typeset Chinese books or notes} \bool_set_false:N \l__eb_compile_draft_bool @@ -1387,7 +1398,7 @@ %<*package> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{etoolbox} -\ProvidesExplPackage{easybase}{2021/07/02}{1.26p} +\ProvidesExplPackage{easybase}{2021/07/03}{1.26q} {Typeset Chinese books or notes} \cs_generate_variant:Nn \eb_ctex_define:nn { nx } @@ -1425,26 +1436,28 @@ \seq_map_inline:Nn \l__eb_env_hook_name_seq { \AtBeginEnvironment{##1}{#2} } } +\cs_new_protected:Npn \eb_match_package_name:n #1 + { + \tl_if_in:nnTF {#1} { [ } + { + \regex_split:nnNT { \[ } {#1} \l_tmpa_seq + { \seq_pop_left:NN \l_tmpa_seq \l_tmpa_tl } + \@ifpackageloaded{\l_tmpa_tl}{} + { + \exp_last_unbraced:Nx \RequirePackage + { [\seq_use:Nn \l_tmpa_seq { , } }{\l_tmpa_tl} + } + } + { \@ifpackageloaded{#1}{}{\RequirePackage{#1}} } + } \NewDocumentCommand{\eb@package@load}{O{}m} { \seq_set_split:Nnn \l__eb_package_name_seq { + } {#2} \int_compare:oNnT { \seq_count:N \l__eb_package_name_seq } = { 1 } { \PassOptionsToPackage{#1}{#2} } - \seq_map_inline:Nn \l__eb_package_name_seq - { - \regex_match:nnTF { [^\w] } {##1} - { - \regex_split:nnNT { \[ } {##1} \l_tmpa_seq - { \seq_pop_left:NN \l_tmpa_seq \l_tmpa_tl } - \@ifpackageloaded{\l_tmpa_tl}{} - { - \exp_last_unbraced:Nx \RequirePackage - { [\seq_use:Nn \l_tmpa_seq { , } }{\l_tmpa_tl} - } - } - { \@ifpackageloaded{##1}{}{\RequirePackage{##1}} } - } + \seq_map_function:NN + \l__eb_package_name_seq \eb_match_package_name:n } \cs_new_protected:Npn \eb_at_end_preamble:n { \BeforeBeginEnvironment{document} } @@ -2769,161 +2782,15 @@ title .tl_set:N = \eb@tc@exercise@title, title .initial:n = \c__eb_name_exercise_tl, numsep .dim_set:N = \eb@toc@exercise@numsep, - numsep .initial:n = 0.5\ccwd + numsep .initial:n = 0.5\ccwd, + label .tl_set:N = \eb@tc@exercise@label } +\cs_new_protected:Npn \setexercise #1 + { \keys_set:nn { eb/exercise } {#1} } \ctex_at_end_package:nn { tcolorbox } { \eb_package_later_bool:nn { tcolorbox } { 2020/10/09 } - \tcbset - { - tc-theorem/.style = - { - enhanced~jigsaw,pad~at~break* = 3pt, - opacityback = 0, - colframe = ctex@emph, - sharpish~corners, - left = 6pt,right = 6pt,top = 8pt,bottom = 8pt,middle= 8pt - }, - tc-outline/.style = - { - enhanced,nofloat, - tikznode~boxed~title, - interior~style = white,colframe = ctex@emph, - colbacktitle = white,coltitle = ctex@emph, - fonttitle = \large\sffamily,fontupper = \itshape, - boxed~title~style = {size = normal,opacityframe = 0,boxrule = 0pt}, - attach~boxed~title~to~top~center = {yshift = -\tcboxedtitleheight/2}, - after~skip = 3ex, - sharpish~corners, - left = 2pc,right = 2pc,top = 1.5pc,bottom = 1pc - }, - tc-exercise/.style = - { - blank,on~line,center, - sharpish~corners, - fontupper = \Large\sffamily, - before~skip = 3.75ex,after~skip = 2.5ex - }, - breakable, - boxsep = 0pt, - fonttitle = \sffamily, - boxrule = \l__eb_rule_width_dim - } - \newtcbox[auto~counter]{\eb@tc@exercise@box}[1]{tc-exercise,#1} - \tl_new:N \eb@tc@list@prologue - \cs_new:Npn \exerprologue #1 { \tl_gset:Nn \eb@tc@list@prologue {#1} } - \cs_new:Npn \eb_tcb_toc_counter_numsep:n #1 - { - \thetcbcounter - \hspace{\use:c { eb@toc@#1@numsep }} - } - \NewDocumentEnvironment{outline}{O{}D(){\abstractname}o+b} - { - \begin{tcolorbox}[tc-outline,title = #2,IfValueT = {#3}{#3}] - \begin{eb@outline@list}[#1] - #4 - \end{eb@outline@list} - \end{tcolorbox} - }{} - \NewDocumentEnvironment{exercise}{st+od()O{}+b} - { - \IfValueT{#3}{ \keys_set:nn { eb/exercise } {#3} } - \IfBooleanTF{#2} - { - \eb@tc@exercise@box - { - fuzzy~halo = 5pt~with~\eb@tc@background@color, - IfValueT = {#4}{#4}, - phantom = - \IfBooleanF{#1} - { - \markright - { - \eb_tcb_toc_counter_numsep:n { exercise } - \eb@tc@exercise@title - } - \addcontentsline{toc}{section} - { - \eb_tcb_toc_counter_numsep:n { section } - \eb@tc@exercise@title - } - } - }{ - \IfBooleanF{#1} - { - \eb_tcb_toc_counter_numsep:n { exercise } - \eb_current_label:n { tcbcounter } - } - \eb@tc@exercise@title - } - }{ - \group_begin: - \ctex_set:nn { section } { format += \centering } - \IfValueT{#4}{\ctex_set:nn { section } {#4}} - \IfBooleanTF{#1} - {\section*{\eb@tc@exercise@title}} - {\section{\eb@tc@exercise@title}} - \group_end: - } - \tl_if_empty:NF \eb@tc@list@prologue { \eb@tc@list@prologue } - \begin{enumerate}[\eb@tc@list@number,labelsep = 0.5\ccwd,#5] - #6 - \end{enumerate} - \tl_gclear:N \eb@tc@list@prologue - }{} - \DeclareTColorBox{easybox}{sO{Khaki}d()O{}} - { - enhanced~jigsaw,pad~at~break* = 3pt, - IfBooleanTF = {#1} - {toptitle = 8pt,top = 8pt} - {frame~hidden,boxrule = 0pt,toptitle = 8pt,top = 0pt}, - IfValueT = {#3}{title = #3}, - colback = #2,colbacktitle = #2, - opacityback = 0.12,opacitybacktitle = 0.12, - coltitle = black,colframe = black, - sharpish~corners, - left = 6pt,right = 6pt,bottom = 8pt,middle= 8pt, - bottomtitle = 8pt, - beforeafter~skip = 2ex, - halign~upper = left,halign~lower = left, - center~title,#4 - } - \DeclareTColorBox{ebparbox}{sO{DarkSlateBlue}d()O{}} - { - frame~hidden, - enhanced~jigsaw,pad~at~break* = 3pt, - boxrule = 0pt, - borderline~west = {3pt}{0pt}{#2}, - IfBooleanTF = {#1} - { - colback = white, - IfValueT = {#3}{title = #3}, - top = 0pt,bottom = 0pt,toptitle = 0pt - }{ - colback = #2,colbacktitle = #2, - opacityback = 0.12,opacitybacktitle = 0.12, - IfValueTF = {#3}{title = #3,top = 0pt}{top = 8pt}, - bottom = 8pt,toptitle = 8pt - }, - left = 8pt,right = 8pt,middle= 8pt, - sharpish~corners, - bottomtitle = 8pt, - beforeafter~skip = 1.5ex, - colframe = #2,coltitle = #2,#4 - } - \DeclareTotalTCBox{\ebemph}{O{DarkSeaGreen}vO{}} - { - nobeforeafter,tcbox~raise~base, - blank,fuzzy~halo = 2pt~with~#1,#3 - }{#2} - \DeclareTotalTCBox{\eblink}{O{Aqua}vO{}} - { - standard~jigsaw, - nobeforeafter,tcbox~raise~base, - top = 1.25pt,bottom = 1.25pt,left = 1.25pt,right = 1.25pt, - boxrule = 0.75pt,arc = 1pt, - colback = #1,opacityback = 0.12,colframe = #1,#3 - }{#2} + \file_if_exist_input:n { eb-tcolorbox.cfg } } \bool_set_true:N \l__eb_backend_bibtex_bool @@ -3109,6 +2976,10 @@ { \definecolorset{HTML}{ctex@}{}{link,#1;url,#1;cite,#1} } \cs_new_protected:Npn \eb_define_themecolor:n #1 { \definecolorset{HTML}{ctex@}{}{frame,#1;emph,#1;verb,#1} } +\cs_new_protected:Npn \DeclareLinkColor #1 + { \eb_ctex_define:nx { refset } { \eb_linkcolor_set:n {#1} } } +\cs_new_protected:Npn \DeclareThemeColor #1 + { \eb_ctex_define:nx { style } { \eb_themecolor_set:n {#1} } } \cs_new:Npn \eb_linkcolor_set:n #1 { linkcolor/\clist_item:nn {#1} { 1 } .code:n = @@ -3259,4 +3130,184 @@ \labelformat{subsection}{Subsection~#1} } %</package> +%<*tcolorbox> +\ProvidesExplFile{eb-tcolorbox.cfg}{2021/07/03}{1.26q} + {Customization of tcolorbox for easybook} + +\cs_new_protected:Npn \eb_tcb_theorem_set:n #1 + { \tcbset{tc-theorem/.style = {#1}} } +\cs_new_protected:Npn \eb_tcb_outline_set:n #1 + { \tcbset{tc-outline/.style = {#1}} } +\cs_new_protected:Npn \eb_tcb_exercise_set:n #1 + { \tcbset{tc-exercise/.style = {#1}} } +\eb_tcb_theorem_set:n + { + enhanced~jigsaw,pad~at~break* = 3pt, + opacityback = 0, + colframe = ctex@emph, + sharpish~corners, + left = 6pt,right = 6pt,top = 8pt,bottom = 8pt,middle= 8pt + } +\eb_tcb_outline_set:n + { + enhanced,nofloat, + tikznode~boxed~title, + interior~style = white,colframe = ctex@emph, + colbacktitle = white,coltitle = ctex@emph, + fonttitle = \large\sffamily,fontupper = \itshape, + boxed~title~style = {size = normal,opacityframe = 0,boxrule = 0pt}, + attach~boxed~title~to~top~center = {yshift = -\tcboxedtitleheight/2}, + after~skip = 3ex,arc = 3pt, + left = 2pc,right = 2pc,top = 1.5pc,bottom = 1pc + } +\eb_tcb_exercise_set:n + { + blank,on~line,center, + sharpish~corners, + fontupper = \Large\sffamily, + before~skip = 3.75ex,after~skip = 3ex + } +\tcbset + { + breakable, + boxsep = 0pt, + fonttitle = \sffamily, + boxrule = \l__eb_rule_width_dim + } + +\newtcbox[auto~counter]{\eb@tc@exercise@box}[1]{tc-exercise,#1} +\tl_new:N \p@eb@exercise +\tl_new:N \eb@tc@list@prologue +\tl_set:Nn \eb@tc@exercise@ifnametrue + { + \markright + { + \eb_tcb_toc_counter_numsep:n { exercise } + \eb@tc@exercise@title + } + \addcontentsline{toc}{section} + { + \eb_tcb_toc_counter_numsep:n { section } + \eb@tc@exercise@title + } + } +\cs_new:Npn \exerprologue #1 { \tl_gset:Nn \eb@tc@list@prologue {#1} } +\cs_new:Npn \tcphanifname #1#2 + { + \tl_gset:Nn \eb@tc@exercise@ifnametrue {#1} + \tl_gset:Nn \eb@tc@exercise@ifnamefalse {#2} + } +\cs_set:Npn \eb_exercise_label_noempty_use: + { + \eb_current_label:n { eb@exercise } + \tl_if_empty:NF \eb@tc@exercise@label + { \exp_args:NV \label \eb@tc@exercise@label } + } +\cs_new:Npn \eb_tcb_toc_counter_numsep:n #1 + { + \thetcbcounter + \hspace{\use:c { eb@toc@#1@numsep }} + } + +\NewDocumentEnvironment{outline}{O{}D(){\abstractname}o+b} + { + \begin{tcolorbox}[tc-outline,title = #2,IfValueT = {#3}{#3}] + \begin{eb@outline@list}[#1] + #4 + \end{eb@outline@list} + \end{tcolorbox} + }{} +\NewDocumentEnvironment{exercise}{st+od()O{}+b} + { + \IfValueT{#3}{ \keys_set:nn { eb/exercise } {#3} } + \IfBooleanTF{#2} + { + \eb@tc@exercise@box + { + fuzzy~halo = 5pt~with~\eb@tc@background@color, + IfValueT = {#4}{#4}, + phantom = + \IfBooleanTF{#1} + {\eb@tc@exercise@ifnamefalse} + {\eb@tc@exercise@ifnametrue} + }{ + \IfBooleanF{#1} + { + \eb_tcb_toc_counter_numsep:n { exercise } + \tl_set_eq:NN \theeb@exercise \thetcbcounter + \eb_exercise_label_noempty_use: + } + \eb@tc@exercise@title + } + }{ + \group_begin: + \ctex_set:nn { section } { format += \centering } + \IfValueT{#4}{\ctex_set:nn { section } {#4}} + \IfBooleanTF{#1} + {\section*{\eb@tc@exercise@title}} + {\section{\eb@tc@exercise@title}} + \tl_set_eq:NN \theeb@exercise \thesection + \eb_exercise_label_noempty_use: + \group_end: + } + \tl_if_empty:NF \eb@tc@list@prologue { \eb@tc@list@prologue } + \begin{enumerate}[\eb@tc@list@number,labelsep = 0.5\ccwd,#5] + #6 + \end{enumerate} + \tl_gclear:N \eb@tc@list@prologue + }{} +\DeclareTColorBox{easybox}{sO{Khaki}d()O{}} + { + enhanced~jigsaw,pad~at~break* = 3pt, + IfBooleanTF = {#1} + {toptitle = 8pt,top = 8pt} + {frame~hidden,boxrule = 0pt,toptitle = 8pt,top = 0pt}, + IfValueT = {#3}{title = #3}, + colback = #2,colbacktitle = #2, + opacityback = 0.12,opacitybacktitle = 0.12, + coltitle = black,colframe = black, + sharpish~corners, + left = 6pt,right = 6pt,bottom = 8pt,middle= 8pt, + bottomtitle = 8pt, + beforeafter~skip = 2ex, + halign~upper = left,halign~lower = left, + center~title,#4 + } +\DeclareTColorBox{ebparbox}{sO{DarkSlateBlue}d()O{}} + { + frame~hidden, + enhanced~jigsaw,pad~at~break* = 3pt, + boxrule = 0pt, + borderline~west = {3pt}{0pt}{#2}, + IfBooleanTF = {#1} + { + colback = white, + IfValueT = {#3}{title = #3}, + top = 0pt,bottom = 0pt,toptitle = 0pt + }{ + colback = #2,colbacktitle = #2, + opacityback = 0.12,opacitybacktitle = 0.12, + IfValueTF = {#3}{title = #3,top = 0pt}{top = 8pt}, + bottom = 8pt,toptitle = 8pt + }, + left = 8pt,right = 8pt,middle= 8pt, + sharpish~corners, + bottomtitle = 8pt, + beforeafter~skip = 1.5ex, + colframe = #2,coltitle = #2,#4 + } +\DeclareTotalTCBox{\ebemph}{O{DarkSeaGreen}vO{}} + { + nobeforeafter,tcbox~raise~base, + blank,fuzzy~halo = 2pt~with~#1,#3 + }{#2} +\DeclareTotalTCBox{\eblink}{O{Aqua}vO{}} + { + standard~jigsaw, + nobeforeafter,tcbox~raise~base, + top = 1.25pt,bottom = 1.25pt,left = 1.25pt,right = 1.25pt, + boxrule = 0.75pt,arc = 1pt, + colback = #1,opacityback = 0.12,colframe = #1,#3 + }{#2} +%</tcolorbox> \endinput
\ No newline at end of file diff --git a/Master/texmf-dist/source/latex/easybook/easybook.ins b/Master/texmf-dist/source/latex/easybook/easybook.ins index 484d0da0dab..496edcba6c9 100644 --- a/Master/texmf-dist/source/latex/easybook/easybook.ins +++ b/Master/texmf-dist/source/latex/easybook/easybook.ins @@ -24,6 +24,7 @@ The latest version of this license is in { \file{easybook.cls}{\from{\jobname.dtx}{class}} \file{easybase.sty}{\from{\jobname.dtx}{package}} + \file{eb-tcolorbox.cfg}{\from{\jobname.dtx}{tcolorbox}} } \obeyspaces @@ -34,6 +35,7 @@ The latest version of this license is in \Msg{* *} \Msg{* easybook.cls *} \Msg{* easybase.sty *} +\Msg{* eb-tcolorbox.cfg *} \Msg{* *} \Msg{* Happy TeXing! *} \Msg{* *} diff --git a/Master/texmf-dist/tex/latex/easybook/easybase.sty b/Master/texmf-dist/tex/latex/easybook/easybase.sty index fcd7942c197..fd648195f59 100644 --- a/Master/texmf-dist/tex/latex/easybook/easybase.sty +++ b/Master/texmf-dist/tex/latex/easybook/easybase.sty @@ -13,7 +13,7 @@ %% https://creativecommons.org/licenses/by/4.0/legalcode \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{etoolbox} -\ProvidesExplPackage{easybase}{2021/07/02}{1.26p} +\ProvidesExplPackage{easybase}{2021/07/03}{1.26q} {Typeset Chinese books or notes} \cs_generate_variant:Nn \eb_ctex_define:nn { nx } @@ -51,26 +51,28 @@ \seq_map_inline:Nn \l__eb_env_hook_name_seq { \AtBeginEnvironment{##1}{#2} } } +\cs_new_protected:Npn \eb_match_package_name:n #1 + { + \tl_if_in:nnTF {#1} { [ } + { + \regex_split:nnNT { \[ } {#1} \l_tmpa_seq + { \seq_pop_left:NN \l_tmpa_seq \l_tmpa_tl } + \@ifpackageloaded{\l_tmpa_tl}{} + { + \exp_last_unbraced:Nx \RequirePackage + { [\seq_use:Nn \l_tmpa_seq { , } }{\l_tmpa_tl} + } + } + { \@ifpackageloaded{#1}{}{\RequirePackage{#1}} } + } \NewDocumentCommand{\eb@package@load}{O{}m} { \seq_set_split:Nnn \l__eb_package_name_seq { + } {#2} \int_compare:oNnT { \seq_count:N \l__eb_package_name_seq } = { 1 } { \PassOptionsToPackage{#1}{#2} } - \seq_map_inline:Nn \l__eb_package_name_seq - { - \regex_match:nnTF { [^\w] } {##1} - { - \regex_split:nnNT { \[ } {##1} \l_tmpa_seq - { \seq_pop_left:NN \l_tmpa_seq \l_tmpa_tl } - \@ifpackageloaded{\l_tmpa_tl}{} - { - \exp_last_unbraced:Nx \RequirePackage - { [\seq_use:Nn \l_tmpa_seq { , } }{\l_tmpa_tl} - } - } - { \@ifpackageloaded{##1}{}{\RequirePackage{##1}} } - } + \seq_map_function:NN + \l__eb_package_name_seq \eb_match_package_name:n } \cs_new_protected:Npn \eb_at_end_preamble:n { \BeforeBeginEnvironment{document} } @@ -1395,161 +1397,15 @@ title .tl_set:N = \eb@tc@exercise@title, title .initial:n = \c__eb_name_exercise_tl, numsep .dim_set:N = \eb@toc@exercise@numsep, - numsep .initial:n = 0.5\ccwd + numsep .initial:n = 0.5\ccwd, + label .tl_set:N = \eb@tc@exercise@label } +\cs_new_protected:Npn \setexercise #1 + { \keys_set:nn { eb/exercise } {#1} } \ctex_at_end_package:nn { tcolorbox } { \eb_package_later_bool:nn { tcolorbox } { 2020/10/09 } - \tcbset - { - tc-theorem/.style = - { - enhanced~jigsaw,pad~at~break* = 3pt, - opacityback = 0, - colframe = ctex@emph, - sharpish~corners, - left = 6pt,right = 6pt,top = 8pt,bottom = 8pt,middle= 8pt - }, - tc-outline/.style = - { - enhanced,nofloat, - tikznode~boxed~title, - interior~style = white,colframe = ctex@emph, - colbacktitle = white,coltitle = ctex@emph, - fonttitle = \large\sffamily,fontupper = \itshape, - boxed~title~style = {size = normal,opacityframe = 0,boxrule = 0pt}, - attach~boxed~title~to~top~center = {yshift = -\tcboxedtitleheight/2}, - after~skip = 3ex, - sharpish~corners, - left = 2pc,right = 2pc,top = 1.5pc,bottom = 1pc - }, - tc-exercise/.style = - { - blank,on~line,center, - sharpish~corners, - fontupper = \Large\sffamily, - before~skip = 3.75ex,after~skip = 2.5ex - }, - breakable, - boxsep = 0pt, - fonttitle = \sffamily, - boxrule = \l__eb_rule_width_dim - } - \newtcbox[auto~counter]{\eb@tc@exercise@box}[1]{tc-exercise,#1} - \tl_new:N \eb@tc@list@prologue - \cs_new:Npn \exerprologue #1 { \tl_gset:Nn \eb@tc@list@prologue {#1} } - \cs_new:Npn \eb_tcb_toc_counter_numsep:n #1 - { - \thetcbcounter - \hspace{\use:c { eb@toc@#1@numsep }} - } - \NewDocumentEnvironment{outline}{O{}D(){\abstractname}o+b} - { - \begin{tcolorbox}[tc-outline,title = #2,IfValueT = {#3}{#3}] - \begin{eb@outline@list}[#1] - #4 - \end{eb@outline@list} - \end{tcolorbox} - }{} - \NewDocumentEnvironment{exercise}{st+od()O{}+b} - { - \IfValueT{#3}{ \keys_set:nn { eb/exercise } {#3} } - \IfBooleanTF{#2} - { - \eb@tc@exercise@box - { - fuzzy~halo = 5pt~with~\eb@tc@background@color, - IfValueT = {#4}{#4}, - phantom = - \IfBooleanF{#1} - { - \markright - { - \eb_tcb_toc_counter_numsep:n { exercise } - \eb@tc@exercise@title - } - \addcontentsline{toc}{section} - { - \eb_tcb_toc_counter_numsep:n { section } - \eb@tc@exercise@title - } - } - }{ - \IfBooleanF{#1} - { - \eb_tcb_toc_counter_numsep:n { exercise } - \eb_current_label:n { tcbcounter } - } - \eb@tc@exercise@title - } - }{ - \group_begin: - \ctex_set:nn { section } { format += \centering } - \IfValueT{#4}{\ctex_set:nn { section } {#4}} - \IfBooleanTF{#1} - {\section*{\eb@tc@exercise@title}} - {\section{\eb@tc@exercise@title}} - \group_end: - } - \tl_if_empty:NF \eb@tc@list@prologue { \eb@tc@list@prologue } - \begin{enumerate}[\eb@tc@list@number,labelsep = 0.5\ccwd,#5] - #6 - \end{enumerate} - \tl_gclear:N \eb@tc@list@prologue - }{} - \DeclareTColorBox{easybox}{sO{Khaki}d()O{}} - { - enhanced~jigsaw,pad~at~break* = 3pt, - IfBooleanTF = {#1} - {toptitle = 8pt,top = 8pt} - {frame~hidden,boxrule = 0pt,toptitle = 8pt,top = 0pt}, - IfValueT = {#3}{title = #3}, - colback = #2,colbacktitle = #2, - opacityback = 0.12,opacitybacktitle = 0.12, - coltitle = black,colframe = black, - sharpish~corners, - left = 6pt,right = 6pt,bottom = 8pt,middle= 8pt, - bottomtitle = 8pt, - beforeafter~skip = 2ex, - halign~upper = left,halign~lower = left, - center~title,#4 - } - \DeclareTColorBox{ebparbox}{sO{DarkSlateBlue}d()O{}} - { - frame~hidden, - enhanced~jigsaw,pad~at~break* = 3pt, - boxrule = 0pt, - borderline~west = {3pt}{0pt}{#2}, - IfBooleanTF = {#1} - { - colback = white, - IfValueT = {#3}{title = #3}, - top = 0pt,bottom = 0pt,toptitle = 0pt - }{ - colback = #2,colbacktitle = #2, - opacityback = 0.12,opacitybacktitle = 0.12, - IfValueTF = {#3}{title = #3,top = 0pt}{top = 8pt}, - bottom = 8pt,toptitle = 8pt - }, - left = 8pt,right = 8pt,middle= 8pt, - sharpish~corners, - bottomtitle = 8pt, - beforeafter~skip = 1.5ex, - colframe = #2,coltitle = #2,#4 - } - \DeclareTotalTCBox{\ebemph}{O{DarkSeaGreen}vO{}} - { - nobeforeafter,tcbox~raise~base, - blank,fuzzy~halo = 2pt~with~#1,#3 - }{#2} - \DeclareTotalTCBox{\eblink}{O{Aqua}vO{}} - { - standard~jigsaw, - nobeforeafter,tcbox~raise~base, - top = 1.25pt,bottom = 1.25pt,left = 1.25pt,right = 1.25pt, - boxrule = 0.75pt,arc = 1pt, - colback = #1,opacityback = 0.12,colframe = #1,#3 - }{#2} + \file_if_exist_input:n { eb-tcolorbox.cfg } } \bool_set_true:N \l__eb_backend_bibtex_bool @@ -1735,6 +1591,10 @@ { \definecolorset{HTML}{ctex@}{}{link,#1;url,#1;cite,#1} } \cs_new_protected:Npn \eb_define_themecolor:n #1 { \definecolorset{HTML}{ctex@}{}{frame,#1;emph,#1;verb,#1} } +\cs_new_protected:Npn \DeclareLinkColor #1 + { \eb_ctex_define:nx { refset } { \eb_linkcolor_set:n {#1} } } +\cs_new_protected:Npn \DeclareThemeColor #1 + { \eb_ctex_define:nx { style } { \eb_themecolor_set:n {#1} } } \cs_new:Npn \eb_linkcolor_set:n #1 { linkcolor/\clist_item:nn {#1} { 1 } .code:n = diff --git a/Master/texmf-dist/tex/latex/easybook/easybook.cls b/Master/texmf-dist/tex/latex/easybook/easybook.cls index 88515d710dc..2e424c5d171 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} -\ProvidesExplClass{easybook}{2021/07/02}{1.26p} +\ProvidesExplClass{easybook}{2021/07/03}{1.26q} {Typeset Chinese books or notes} \bool_set_false:N \l__eb_compile_draft_bool diff --git a/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg b/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg new file mode 100644 index 00000000000..131762fe4b1 --- /dev/null +++ b/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg @@ -0,0 +1,194 @@ +%% +%% This is file `eb-tcolorbox.cfg', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% easybook.dtx (with options: `tcolorbox') +%% Copyright (C) 2021 by Qu Yi <quee123@foxmail.com> +%% +%% This work may be distributed and/or modified under the +%% conditions of the CC-BY 4.0 License. +%% The latest version of this license is in +%% https://creativecommons.org/licenses/by/4.0/legalcode +\ProvidesExplFile{eb-tcolorbox.cfg}{2021/07/03}{1.26q} + {Customization of tcolorbox for easybook} + +\cs_new_protected:Npn \eb_tcb_theorem_set:n #1 + { \tcbset{tc-theorem/.style = {#1}} } +\cs_new_protected:Npn \eb_tcb_outline_set:n #1 + { \tcbset{tc-outline/.style = {#1}} } +\cs_new_protected:Npn \eb_tcb_exercise_set:n #1 + { \tcbset{tc-exercise/.style = {#1}} } +\eb_tcb_theorem_set:n + { + enhanced~jigsaw,pad~at~break* = 3pt, + opacityback = 0, + colframe = ctex@emph, + sharpish~corners, + left = 6pt,right = 6pt,top = 8pt,bottom = 8pt,middle= 8pt + } +\eb_tcb_outline_set:n + { + enhanced,nofloat, + tikznode~boxed~title, + interior~style = white,colframe = ctex@emph, + colbacktitle = white,coltitle = ctex@emph, + fonttitle = \large\sffamily,fontupper = \itshape, + boxed~title~style = {size = normal,opacityframe = 0,boxrule = 0pt}, + attach~boxed~title~to~top~center = {yshift = -\tcboxedtitleheight/2}, + after~skip = 3ex,arc = 3pt, + left = 2pc,right = 2pc,top = 1.5pc,bottom = 1pc + } +\eb_tcb_exercise_set:n + { + blank,on~line,center, + sharpish~corners, + fontupper = \Large\sffamily, + before~skip = 3.75ex,after~skip = 3ex + } +\tcbset + { + breakable, + boxsep = 0pt, + fonttitle = \sffamily, + boxrule = \l__eb_rule_width_dim + } + +\newtcbox[auto~counter]{\eb@tc@exercise@box}[1]{tc-exercise,#1} +\tl_new:N \p@eb@exercise +\tl_new:N \eb@tc@list@prologue +\tl_set:Nn \eb@tc@exercise@ifnametrue + { + \markright + { + \eb_tcb_toc_counter_numsep:n { exercise } + \eb@tc@exercise@title + } + \addcontentsline{toc}{section} + { + \eb_tcb_toc_counter_numsep:n { section } + \eb@tc@exercise@title + } + } +\cs_new:Npn \exerprologue #1 { \tl_gset:Nn \eb@tc@list@prologue {#1} } +\cs_new:Npn \tcphanifname #1#2 + { + \tl_gset:Nn \eb@tc@exercise@ifnametrue {#1} + \tl_gset:Nn \eb@tc@exercise@ifnamefalse {#2} + } +\cs_set:Npn \eb_exercise_label_noempty_use: + { + \eb_current_label:n { eb@exercise } + \tl_if_empty:NF \eb@tc@exercise@label + { \exp_args:NV \label \eb@tc@exercise@label } + } +\cs_new:Npn \eb_tcb_toc_counter_numsep:n #1 + { + \thetcbcounter + \hspace{\use:c { eb@toc@#1@numsep }} + } + +\NewDocumentEnvironment{outline}{O{}D(){\abstractname}o+b} + { + \begin{tcolorbox}[tc-outline,title = #2,IfValueT = {#3}{#3}] + \begin{eb@outline@list}[#1] + #4 + \end{eb@outline@list} + \end{tcolorbox} + }{} +\NewDocumentEnvironment{exercise}{st+od()O{}+b} + { + \IfValueT{#3}{ \keys_set:nn { eb/exercise } {#3} } + \IfBooleanTF{#2} + { + \eb@tc@exercise@box + { + fuzzy~halo = 5pt~with~\eb@tc@background@color, + IfValueT = {#4}{#4}, + phantom = + \IfBooleanTF{#1} + {\eb@tc@exercise@ifnamefalse} + {\eb@tc@exercise@ifnametrue} + }{ + \IfBooleanF{#1} + { + \eb_tcb_toc_counter_numsep:n { exercise } + \tl_set_eq:NN \theeb@exercise \thetcbcounter + \eb_exercise_label_noempty_use: + } + \eb@tc@exercise@title + } + }{ + \group_begin: + \ctex_set:nn { section } { format += \centering } + \IfValueT{#4}{\ctex_set:nn { section } {#4}} + \IfBooleanTF{#1} + {\section*{\eb@tc@exercise@title}} + {\section{\eb@tc@exercise@title}} + \tl_set_eq:NN \theeb@exercise \thesection + \eb_exercise_label_noempty_use: + \group_end: + } + \tl_if_empty:NF \eb@tc@list@prologue { \eb@tc@list@prologue } + \begin{enumerate}[\eb@tc@list@number,labelsep = 0.5\ccwd,#5] + #6 + \end{enumerate} + \tl_gclear:N \eb@tc@list@prologue + }{} +\DeclareTColorBox{easybox}{sO{Khaki}d()O{}} + { + enhanced~jigsaw,pad~at~break* = 3pt, + IfBooleanTF = {#1} + {toptitle = 8pt,top = 8pt} + {frame~hidden,boxrule = 0pt,toptitle = 8pt,top = 0pt}, + IfValueT = {#3}{title = #3}, + colback = #2,colbacktitle = #2, + opacityback = 0.12,opacitybacktitle = 0.12, + coltitle = black,colframe = black, + sharpish~corners, + left = 6pt,right = 6pt,bottom = 8pt,middle= 8pt, + bottomtitle = 8pt, + beforeafter~skip = 2ex, + halign~upper = left,halign~lower = left, + center~title,#4 + } +\DeclareTColorBox{ebparbox}{sO{DarkSlateBlue}d()O{}} + { + frame~hidden, + enhanced~jigsaw,pad~at~break* = 3pt, + boxrule = 0pt, + borderline~west = {3pt}{0pt}{#2}, + IfBooleanTF = {#1} + { + colback = white, + IfValueT = {#3}{title = #3}, + top = 0pt,bottom = 0pt,toptitle = 0pt + }{ + colback = #2,colbacktitle = #2, + opacityback = 0.12,opacitybacktitle = 0.12, + IfValueTF = {#3}{title = #3,top = 0pt}{top = 8pt}, + bottom = 8pt,toptitle = 8pt + }, + left = 8pt,right = 8pt,middle= 8pt, + sharpish~corners, + bottomtitle = 8pt, + beforeafter~skip = 1.5ex, + colframe = #2,coltitle = #2,#4 + } +\DeclareTotalTCBox{\ebemph}{O{DarkSeaGreen}vO{}} + { + nobeforeafter,tcbox~raise~base, + blank,fuzzy~halo = 2pt~with~#1,#3 + }{#2} +\DeclareTotalTCBox{\eblink}{O{Aqua}vO{}} + { + standard~jigsaw, + nobeforeafter,tcbox~raise~base, + top = 1.25pt,bottom = 1.25pt,left = 1.25pt,right = 1.25pt, + boxrule = 0.75pt,arc = 1pt, + colback = #1,opacityback = 0.12,colframe = #1,#3 + }{#2} +\endinput +%% +%% End of file `eb-tcolorbox.cfg'. |