From b6c67ad0856449e51a22add69b5c29dc448710a9 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 18 Oct 2021 19:49:23 +0000 Subject: easybook (18oct21) git-svn-id: svn://tug.org/texlive/trunk@60794 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/easybook/easybook.pdf | Bin 576486 -> 577839 bytes Master/texmf-dist/doc/latex/easybook/easybook.tex | 52 ++++--- .../texmf-dist/source/latex/easybook/easybook.dtx | 163 ++++++++++++--------- Master/texmf-dist/tex/latex/easybook/easybase.sty | 159 ++++++++++++-------- Master/texmf-dist/tex/latex/easybook/easybook.cls | 2 +- .../texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg | 2 +- 6 files changed, 224 insertions(+), 154 deletions(-) (limited to 'Master') diff --git a/Master/texmf-dist/doc/latex/easybook/easybook.pdf b/Master/texmf-dist/doc/latex/easybook/easybook.pdf index 02ae0c76ee7..a6c182352e9 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 b7e477da928..209ca5efe69 100644 --- a/Master/texmf-dist/doc/latex/easybook/easybook.tex +++ b/Master/texmf-dist/doc/latex/easybook/easybook.tex @@ -20,8 +20,8 @@ name = easybook, color-scheme = blue, title = EASYBOOK 使用手册, - version = v1.3N, - date = 2021/10/16, + version = v1.3O, + date = 2021/10/18, authors = 瞿毅, info = 排版简体中文学位论文和书籍, email = q1jx@foxmail.com, @@ -466,10 +466,10 @@ \keyval-{caption}{数值}\Default{1.2} 图片、表格和代码题注的行距因子。 \keyval-{footnote}{数值}\Default{1.2} - 脚注内容整体的行距因子,可以使用 \option{fntext-form} 的代码覆盖每个脚注单独的行距,从而与不同脚注的段落间距不同。 + 脚注内容整体的行距因子,可以使用 \option{fnpara-form} 的代码覆盖每个脚注单独的行距,从而与不同脚注的段落间距不同。 \begin{ctexexam} \spread{footnote = 1.3} - \hdrset{fntext-form = \linespread{1.2}\selectfont} + \hdrset{fnpara-form = \linespread{1.2}\selectfont} \end{ctexexam} \keyval-{spread-all}{数值}\Default 统一设置上述各种行距因子。 @@ -535,8 +535,8 @@ \label{subsec:theorem of style} 文档类已预置 8 个定理环境,环境名及对应的定理名见小节 \ref{subsec:theorem},它们均使用预置的定理样式 \code{easy-theorem}。下面 \module*{thmset} 模块的选项仅对这个定理样式生效,由 \pkg*{thmtools} 宏包提供支持。 \begin{options} - \keybool{thmbox}\Module{thmset}\Default{false} - 给定理环境使用彩色盒子。这个特殊选项在 \module*{thmset} 模块中使用 \pkg*{tcolorbox} 宏包来支持,\meta{盒子风格} 默认为 \code{tc-theorem}。新建定理命令的同名选项则包括 \code{L}、\code{M} 和 \code{S} 三个参数。 + \keybool{thmframe}\Module{thmset}\Default{false} + 给定理环境使用彩色盒子。这个特殊选项在 \module*{thmset} 模块中使用 \pkg*{tcolorbox} 宏包来支持,\meta{盒子风格} 默认为 \code{tc-theorem}。\pkg*{thmtools} 具有类似的选项 \option*{thmbox},可在新建定理样式的命令中使用。 \keychoice{within}{chapter,section,env,empty}\Default{chapter} 定理编号跟随的计数器,默认跟随章的编号,也可以跟随其它定理环境的编号,当计数器增加时定理编号会从零开始,空置时不跟随其它计数器编号。 \keyval-{headpunct}{代码}\Default @@ -580,7 +580,7 @@ \begin{itemize} \item 中英文模式下标题不同,英文标题为可选项,默认为首字母大写的 \meta{环境名}。 \item 自动定义交叉引用的格式,引用标签前缀为定理名。 - \item 模块 \module*{thmset} 的定理盒子选项 \keyis-{thmbox}{true} 仍然生效,其中 \meta{盒子风格} 可以使用新建盒子风格命令 \cs{newtcbstyle} 定义。 + \item 模块 \module*{thmset} 的定理盒子选项 \keyis-{thmframe}{true} 仍然生效,其中 \meta{盒子风格} 可以使用新建盒子风格命令 \cs{newtcbstyle} 定义。 \item 新建定理环境默认使用的 \meta{定理样式} 为 \code{easy-theorem},而不是 \pkg*{thmtools} 默认样式。 \end{itemize} \command{declaretheoremstyle}[\oarg{键值列表1}\marg{定理样式}\oarg{键值列表2}] @@ -695,33 +695,34 @@ \end{commands} \subsubsection{脚注格式} +模块 \module*{hdrset} 还可以灵活调整脚注编号和内容的格式。格式主要包括脚注标记的编号类型、字体、附加符号、对齐方式和缩进距离等,以及脚注内容的首行缩进、行距和字体等。基本思想是默认脚注和自定义编号脚注标记的格式分离,两种类型脚注各自正文和内容的标记又共享格式,默认脚注中正文和内容标记的编号类型分离。 \begin{options} - \keyval-{fnmargin}{刚性长度}\Module{hdrset}\Default{0.75em} - 脚注首段缩进距离,等于长度 \cs{footnoteindent} 的值。 + \keyval-{fnindent}{刚性长度}\Module{hdrset}\Default{0.75em} + 脚注内容首段缩进距离,等于长度 \cs{footnoteindent} 的值。 \keyval-{fnparskip}{弹性长度}\Default{0ex} 脚注段落间距,等于长度 \cs{footparskip} 的值。 \keyval-{fnparindent}{刚性长度}\Default{2em} 脚注段落缩进,等于长度 \cs{footparindent} 的值。 - \keychoice{footnotetype}{hang,default,bottom}\Default{hang} - 脚注的类型,悬挂缩进 \code{hang} 是默认值,\code{default} 是原始的类型,在一些浮动体排版的情况下,脚注可能位于页面中间,\code{bottom} 使脚注始终位于页面底端。这是个复合选项,\code{bottom} 可以与前两种类型重复或复合使用: + \keychoice{footnotetype}{hang,default,flush,bottom}\Default{hang} + 脚注的类型,悬挂缩进 \code{hang} 是默认值,\code{default} 是原始的类型,在一些浮动体排版的情况下,脚注可能位于页面中间,\code{bottom} 使脚注始终位于页面底端,\code{flush} 使脚注内容标记位于脚注首行边缘外侧并右对齐。其中 \code{bottom} 是复合选项,可以与前三种类型重复或复合使用: \begin{ctexexam} \hdrset{footnotetype = default,footnotetype = bottom} \hdrset{footnotetype = {hang,bottom}} \end{ctexexam} \keychoice{fnmark-pos}{normal,super}\Default{super} 设置脚注内容标记的位置,正常文本或是上标形式。 - \keychoice{fnmark-num}{plain,pifont,pifont*,pifont-sans,pifont-sans*,short num}\Default{plain} - 脚注正文标记编号的格式,默认为原生样式 \code{plain},还可以改为 \code{pifont} 的各个版本,从左往右依次为普通版、阴文衬线版、阳文无衬线版和阴文无衬线版,缺点是它们的编号仅包括 1-10。 + \keychoice{fnmark-num}{plain,pifont,pifont*,pisans,pisans*,short num}\Default{plain} + 脚注正文标记编号的类型,默认为原生样式 \code{plain},还可以改为 \code{pifont} 的各个版本,从左往右依次为普通版、阴文衬线版、阳文无衬线版和阴文无衬线版,缺点是它们的编号仅包括 1-10。 短编号的形式与列表环境类似,不过增加了一个中文数字格式参数 \code{c}。原生样式 \code{plain} 等同于单独使用数字 \code{1} 参数。这个选项可以用在正文中改变其后脚注编号格式。 \begin{ctexexam} \hdrset{fnmark-num = 1} % 等于编号格式plain \hdrset{fnmark-num = (a)} \end{ctexexam} - \keychoice{fntext-num}{plain,pifont,pifont*,pifont-sans,pifont-sans*,short num}\Default{plain} - 脚注内容标记编号的格式,用法与 \option{fnmark-num} 一样,所以脚注内容与正文标记编号格式\textbf{可以不同}。 - \keychoice{fnboth-num}{plain,pifont,pifont*,pifont-sans,pifont-sans*,short num}\Default{plain} - 同时设定脚注正文标记编号 \option{fnmark-num} 与脚注内容标记编号 \option{fntext-num} 的格式。目前脚注编号格式选项对于迷你页环境 \env*{minipage} 无效,其中的脚注保持默认英文字母的编号形式。 + \keychoice{fntext-num}{plain,pifont,pifont*,pisans,pisans*,short num}\Default{plain} + 脚注内容标记编号的类型,用法与 \option{fnmark-num} 一样,所以脚注内容与正文标记编号格式\textbf{可以不同}。 + \keychoice{fnboth-num}{plain,pifont,pifont*,pisans,pisans*,short num}\Default{plain} + 同时设定脚注正文标记编号 \option{fnmark-num} 与脚注内容标记编号 \option{fntext-num} 的类型。目前脚注编号格式选项对于迷你页环境 \env*{minipage} 无效,其中的脚注保持默认英文字母的编号形式。 \keyval-{fnmark-form}{格式代码}\Default 脚注标记的格式,一般配合选项 \keyis-{fnmark-num}{plain} 使用,例如配合 \pkg*{circledsteps} 宏包的带圈符号命令 \cs*{Circled} 给脚注标记添加圆圈: \begin{ctexexam} @@ -736,10 +737,17 @@ 单独设定自定义脚注标记的格式,自定义脚注的命令与用法见小节 \ref{subsubsec:custom footnotes}。 \keyval-{fnboth-form}{格式代码}\Default 同时设定脚注标记 \option{fnmark-form} 和自定义脚注标记 \option{fncust-form} 的格式。标记格式选项含有字体命令会覆盖 \module*{subfont/}\option{footnote} 的设置,最后一个格式命令可以带有一个参数接受脚注标记。 - \keyval-{fntext-form}{格式代码}\Default - 脚注内容的格式,在此设置字体命令会覆盖 \module*{subfont/}\option{footnote} 的设置,最后一个格式命令可以带有一个参数,这个参数接受脚注内容。 - \kvsplit{fnmark-code}{前代码,后代码}\newline - 脚注内容标记前后增加代码可以用 \meta{前代码} 与 \meta{后代码},也可以只有前部分,这两部分代码只对页面下方的标记有效。由于脚注标记处于水平模式,一般在脚注类型为 \keyis-{footnotetype}{default} 时在标记与其后脚注段落间插入距离代码,或与正文中的标记稍有不同。 + \keyval-{fnpara-form}{格式代码}\Default + 脚注内容的格式,在此设置字体命令会覆盖 \module*{subfont/}\option{footnote} 的设置,最后一个格式命令可以带有一个参数接受脚注内容。 + \kvsplit{fntext-code}{前代码,后代码}\newline + 可以用 \meta{前代码} 与 \meta{后代码} 额外增加脚注内容标记前后的代码,也可以只有前部分,\meta{前代码} 中最后一个格式命令可以带有一个参数接受脚注内容标记。由于脚注标记处于水平模式,一般用于在脚注内容标记与脚注首行间插入一点距离,或与脚注正文标记的格式稍有不同。 + \begin{ctexexam} + \hdrset + { + footnotetype = flush, + fntext-code = {,\enskip} + } + \end{ctexexam} \end{options} \subsection{目录样式} @@ -881,7 +889,7 @@ \environment{example}\default{} \environment{remark}\default{} \environment{proof} - 这些是预置的定理环境,可使用选项 \module*{thmset/}\option{thmbox} 为它们添加盒子边框,其中注与证明环境不编号,证明末尾会自动添加证明结束符,声明新的定理环境或更改定理盒子样式见小节 \ref{subsec:theorem of style}。环境名与之对应的定理名如下: + 这些是预置的定理环境,可使用选项 \module*{thmset/}\option{thmframe} 为它们添加盒子边框,其中注与证明环境不编号,证明末尾会自动添加证明结束符,声明新的定理环境或更改定理盒子样式见小节 \ref{subsec:theorem of style}。环境名与之对应的定理名如下: \begin{center} \begin{tblr} { diff --git a/Master/texmf-dist/source/latex/easybook/easybook.dtx b/Master/texmf-dist/source/latex/easybook/easybook.dtx index ac09fdcaf72..a7d77a29ae3 100644 --- a/Master/texmf-dist/source/latex/easybook/easybook.dtx +++ b/Master/texmf-dist/source/latex/easybook/easybook.dtx @@ -15,7 +15,7 @@ %<*class> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e} -\ProvidesExplClass{easybook}{2021/10/16}{1.3N} +\ProvidesExplClass{easybook}{2021/10/18}{1.3O} {Typeset Chinese theses or books} \bool_set_false:N \l__eb_compile_draft_bool @@ -319,7 +319,7 @@ %<*package> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e,etoolbox} -\ProvidesExplPackage{easybase}{2021/10/16}{1.3N} +\ProvidesExplPackage{easybase}{2021/10/18}{1.3O} {Typeset Chinese theses or books} \cs_generate_variant:Nn \dim_set:Nn { NV } @@ -797,9 +797,9 @@ { \ding{\int_eval:n { 171 + #1 }} } \cs_new:Npn \eb_fnmark_counter_pifont_neg:N #1 { \ding{\int_eval:n { 181 + #1 }} } -\cs_new:Npn \eb_fnmark_counter_pifont_sans:N #1 +\cs_new:Npn \eb_fnmark_counter_pisans:N #1 { \ding{\int_eval:n { 191 + #1 }} } -\cs_new:Npn \eb_fnmark_counter_pifont_sans_neg:N #1 +\cs_new:Npn \eb_fnmark_counter_pisans_neg:N #1 { \ding{\int_eval:n { 201 + #1 }} } \cs_new:Npn \eb_int_format_trans:NN #1 { @@ -826,10 +826,10 @@ { \exp_not:N \eb_fnmark_counter_pifont:N } { pifont* } { \exp_not:N \eb_fnmark_counter_pifont_neg:N } - { pifont-sans } - { \exp_not:N \eb_fnmark_counter_pifont_sans:N } - { pifont-sans* } - { \exp_not:N \eb_fnmark_counter_pifont_sans_neg:N } + { pisans } + { \exp_not:N \eb_fnmark_counter_pisans:N } + { pisans* } + { \exp_not:N \eb_fnmark_counter_pisans_neg:N } } { \exp_not:N \c@footnote } } @@ -849,33 +849,49 @@ } \cs_set_eq:cN {#2} \l__eb_fnmark_short_tokens_tl } -\bool_new:N \l__eb_fntext_bottom_bool +\cs_new_protected:Npn \eb_footnote_choice_handle:n #1 + { + \str_case:nnF {#1} + { + { bottom } + { \bool_set_true:N \l__eb_fnpara_bottom_bool } + { flush } + { + \tl_set:Nn \l__eb_footnote_choice_tl { default } + \clist_push:Nn \l__eb_footnote_mulchoice_clist {#1} + } + } + { + \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} } + } + } +\bool_new:N \l__eb_fnpara_bottom_bool +\clist_new:N \l__eb_footnote_mulchoice_clist \ctex_define:nn { hdrset } { - fnmargin .dim_set:N = \footnoteindent, - fnmargin .initial:n = 0.75em, + fnindent .dim_set:N = \footnoteindent, + fnindent .initial:n = 0.75em, fnparskip .skip_set:N = \footparskip, fnparskip .initial:n = 0ex, fnparindent .dim_set:N = \footparindent, fnparindent .initial:n = 2em, - fntext-form .tl_set:N = \l__eb_fntext_format_tl, + fnpara-form .tl_set:N = \l__eb_fnpara_format_tl, fnmark-pos .tl_set:N = \l__eb_fnmark_position_tl, fnmark-pos .initial:n = super, - fnmark-code .code:n = \eb_assign_fnmark_code:n {#1}, - fnmark-code .initial:n = + fntext-code .code:n = \eb_assign_fnmark_code:n {#1}, + fntext-code .initial:n = { ,\tl_if_eq:NnF \l__eb_fnmark_position_tl { super } { \space } }, fnmark-form .tl_set:N = \l__eb_fnmark_format_tl, fncust-form .tl_set:N = \l__eb_fncust_format_tl, fnboth-form .meta:n = { fnmark-form = #1,fncust-form = #1 }, footnotetype .multichoices:nn = - { default,hang,bottom,para } - { - \tl_if_eq:nnTF { bottom } {#1} - { \bool_set_true:N \l__eb_fntext_bottom_bool } - { \tl_set:Nn \l__eb_footnotetype_choice_tl {#1} } - }, + { default,hang,bottom,para,flush } + { \eb_footnote_choice_handle:n {#1} }, footnotetype .value_required:n = true, footnotetype .initial:n = hang, @@ -912,7 +928,11 @@ { part } { \counterwithin*{footnote}{part} } { page } { \counterwithin*{footnote}{page} } } - \bool_if:NT \l__eb_fntext_bottom_bool + \eb_fnpara_if_pos_bottom: + } +\cs_new_protected:Npn \eb_fnpara_if_pos_bottom: + { + \bool_if:NT \l__eb_fnpara_bottom_bool { \cs_set:Npn \@makecol { @@ -948,57 +968,66 @@ } } } -\cs_set:Npn \@makefntext #1 +\cs_new_protected:Npn \eb_footnote_direct_hang: { - \group_begin: - \str_case:Vn \l__eb_footnotetype_choice_tl + \hbox_set:Nn \l_tmpa_box { - { hang } { \use_i:nn } - { default } { \use_ii:nn } + \dim_compare:nNnTF { \footnoteindent } > { 0pt } + { \hbox_to_wd:nn { \footnoteindent } { \eb@makefnmark\hss } } + { \eb@makefnmark } + } + \dim_set:Nn \leftmargin { \box_wd:N \l_tmpa_box } + \dim_zero:N \rightmargin + \dim_set_eq:NN \linewidth \columnwidth + \dim_sub:Nn \linewidth { \leftmargin } + \parshape\@ne\leftmargin\linewidth + \@setpar{{\@@par}} + \mode_leave_vertical: + \hbox_overlap_left:n { \box_use:N \l_tmpa_box } + } +\cs_new_protected:Npn \eb_footnote_direct_default: + { + \noindent + \clist_if_in:NnT \l__eb_footnote_mulchoice_clist { flush } + { \dim_zero:N \footnoteindent } + \int_case:nn { \dim_sign:V \footnoteindent } + { + { 1 } { \use_i:nnn } + { 0 } { \use_ii:nnn } + { -1 } { \use_iii:nnn } } + { \hbox_to_wd:nn { \footnoteindent } { \hss\eb@makefnmark } } + { \hbox_overlap_left:n { \eb@makefnmark } } { - \hbox_set:Nn \l_tmpa_box + \hbox_overlap_left:n { - \dim_compare:nNnTF { \footnoteindent } > { 0pt } - { \hbox_to_wd:nn { \footnoteindent } { \eb@makefnmark\hss } } - { \eb@makefnmark } - } - \dim_set:Nn \leftmargin { \box_wd:N \l_tmpa_box } - \dim_zero:N \rightmargin - \dim_set_eq:NN \linewidth \columnwidth - \dim_sub:Nn \linewidth { \leftmargin } - \parshape\@ne\leftmargin\linewidth - \@setpar{{\@@par}} - \mode_leave_vertical: - \hbox_overlap_left:n { \box_use:N \l_tmpa_box } - } - { - \noindent - \int_case:nn { \dim_sign:V \footnoteindent } - { - { 1 } { \use_i:nnn } - { 0 } { \use_ii:nnn } - { -1 } { \use_iii:nnn } - } - { \hbox_to_wd:nn { \footnoteindent } { \hss\eb@makefnmark } } - { \hbox_overlap_left:n { \eb@makefnmark } } - { - \hbox_overlap_left:n - { - \hbox_to_wd:nn { -\footnoteindent } - { \eb@makefnmark\hss } - } + \hbox_to_wd:nn { -\footnoteindent } + { \eb@makefnmark\hss } } } + } +\cs_set:Npn \@makefntext #1 + { + \group_begin: + \str_case:Vn \l__eb_footnote_choice_tl + { + { hang } { \use_i:nn } + { default } { \use_ii:nn } + } + { \eb_footnote_direct_hang: } + { \eb_footnote_direct_default: } \skip_set:NV \parskip \footparskip \dim_set:NV \parindent \footparindent - \l__eb_fntext_format_tl{#1} - \tl_if_eq:NnT \l__eb_footnotetype_choice_tl { hang } { \par } + \l__eb_fnpara_format_tl{#1} + \tl_if_eq:NnT \l__eb_footnote_choice_tl { hang } { \par } \group_end: } \cs_set_eq:NN \eb@makefntext \@makefntext \ctex_at_end_package:nn { footmisc } - { \cs_set_eq:NN \@makefntext \eb@makefntext } + { + \@ifpackagewith{footmisc}{hang} + {\cs_set_eq:NN \@makefntext \eb@makefntext}{} + } \eb_at_end_patch_cmd:nnn { \@footnotetext,\@mpfootnotetext } { \reset@font } { @@ -1079,7 +1108,7 @@ { \eb@fnmark@super* } { \tl_use:N \l__eb_fnmark_before_tl - \l__eb_fnmark_format_tl{\@thefnmark} + {\l__eb_fnmark_format_tl{\@thefnmark}} \tl_use:N \l__eb_fnmark_after_tl } } @@ -1098,7 +1127,7 @@ } \cs_new_protected:Npn \eb_fncust_format_initial: { - \hdrset{fnmark-code = { }} + % \hdrset{fntext-code = { }} \tl_set_eq:NN \l__eb_fnmark_format_tl \l__eb_fncust_format_tl } @@ -1914,7 +1943,7 @@ name = \tl_use:c { c__eb_name_#1_tl }, style = easy-theorem,#5 ] - \bool_if:NT \l__eb_thmbox_bool + \bool_if:NT \l__eb_thmframe_bool { \@ifpackageloaded{tcolorbox} {\tcolorboxenvironment{#1}{#4}} @@ -1924,7 +1953,7 @@ } \msg_new:nnn { easybase } { need-tcolorbox } { - Now~that~the~thmbox~option~is~true. \\ + Now~that~the~thmframe~option~is~true. \\ Please~load~the~tcolorbox~macro~package. } \cs_set_eq:NN \EBNewTheorem \DeclareTheorem @@ -1949,9 +1978,11 @@ { \ctex_define:nn { thmset } { #1 .tl_set:N = #2 } } \ctex_define:nn { thmset } { - thmbox .bool_set:N = \l__eb_thmbox_bool, + thmframe .bool_set:N = \l__eb_thmframe_bool, + thmframe .default:n = true, + thmframe .initial:n = false, + thmbox .meta:n = { thmframe = #1 }, thmbox .default:n = true, - thmbox .initial:n = false, notebraces .tl_set:N = \l__eb_thm_notebraces_tl, unknown .code:n = \eb_msg_unknown_option:n { thmset } } @@ -2391,7 +2422,7 @@ } % %<*tcolorbox> -\ProvidesExplFile{eb-tcolorbox.cfg}{2021/10/16}{1.3N} +\ProvidesExplFile{eb-tcolorbox.cfg}{2021/10/18}{1.3O} {Customization of tcolorbox for easybook} \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 1ab895b4862..cb1b30ed9cf 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/10/16}{1.3N} +\ProvidesExplPackage{easybase}{2021/10/18}{1.3O} {Typeset Chinese theses or books} \cs_generate_variant:Nn \dim_set:Nn { NV } @@ -498,9 +498,9 @@ { \ding{\int_eval:n { 171 + #1 }} } \cs_new:Npn \eb_fnmark_counter_pifont_neg:N #1 { \ding{\int_eval:n { 181 + #1 }} } -\cs_new:Npn \eb_fnmark_counter_pifont_sans:N #1 +\cs_new:Npn \eb_fnmark_counter_pisans:N #1 { \ding{\int_eval:n { 191 + #1 }} } -\cs_new:Npn \eb_fnmark_counter_pifont_sans_neg:N #1 +\cs_new:Npn \eb_fnmark_counter_pisans_neg:N #1 { \ding{\int_eval:n { 201 + #1 }} } \cs_new:Npn \eb_int_format_trans:NN #1 { @@ -527,10 +527,10 @@ { \exp_not:N \eb_fnmark_counter_pifont:N } { pifont* } { \exp_not:N \eb_fnmark_counter_pifont_neg:N } - { pifont-sans } - { \exp_not:N \eb_fnmark_counter_pifont_sans:N } - { pifont-sans* } - { \exp_not:N \eb_fnmark_counter_pifont_sans_neg:N } + { pisans } + { \exp_not:N \eb_fnmark_counter_pisans:N } + { pisans* } + { \exp_not:N \eb_fnmark_counter_pisans_neg:N } } { \exp_not:N \c@footnote } } @@ -550,33 +550,49 @@ } \cs_set_eq:cN {#2} \l__eb_fnmark_short_tokens_tl } -\bool_new:N \l__eb_fntext_bottom_bool +\cs_new_protected:Npn \eb_footnote_choice_handle:n #1 + { + \str_case:nnF {#1} + { + { bottom } + { \bool_set_true:N \l__eb_fnpara_bottom_bool } + { flush } + { + \tl_set:Nn \l__eb_footnote_choice_tl { default } + \clist_push:Nn \l__eb_footnote_mulchoice_clist {#1} + } + } + { + \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} } + } + } +\bool_new:N \l__eb_fnpara_bottom_bool +\clist_new:N \l__eb_footnote_mulchoice_clist \ctex_define:nn { hdrset } { - fnmargin .dim_set:N = \footnoteindent, - fnmargin .initial:n = 0.75em, + fnindent .dim_set:N = \footnoteindent, + fnindent .initial:n = 0.75em, fnparskip .skip_set:N = \footparskip, fnparskip .initial:n = 0ex, fnparindent .dim_set:N = \footparindent, fnparindent .initial:n = 2em, - fntext-form .tl_set:N = \l__eb_fntext_format_tl, + fnpara-form .tl_set:N = \l__eb_fnpara_format_tl, fnmark-pos .tl_set:N = \l__eb_fnmark_position_tl, fnmark-pos .initial:n = super, - fnmark-code .code:n = \eb_assign_fnmark_code:n {#1}, - fnmark-code .initial:n = + fntext-code .code:n = \eb_assign_fnmark_code:n {#1}, + fntext-code .initial:n = { ,\tl_if_eq:NnF \l__eb_fnmark_position_tl { super } { \space } }, fnmark-form .tl_set:N = \l__eb_fnmark_format_tl, fncust-form .tl_set:N = \l__eb_fncust_format_tl, fnboth-form .meta:n = { fnmark-form = #1,fncust-form = #1 }, footnotetype .multichoices:nn = - { default,hang,bottom,para } - { - \tl_if_eq:nnTF { bottom } {#1} - { \bool_set_true:N \l__eb_fntext_bottom_bool } - { \tl_set:Nn \l__eb_footnotetype_choice_tl {#1} } - }, + { default,hang,bottom,para,flush } + { \eb_footnote_choice_handle:n {#1} }, footnotetype .value_required:n = true, footnotetype .initial:n = hang, @@ -613,7 +629,11 @@ { part } { \counterwithin*{footnote}{part} } { page } { \counterwithin*{footnote}{page} } } - \bool_if:NT \l__eb_fntext_bottom_bool + \eb_fnpara_if_pos_bottom: + } +\cs_new_protected:Npn \eb_fnpara_if_pos_bottom: + { + \bool_if:NT \l__eb_fnpara_bottom_bool { \cs_set:Npn \@makecol { @@ -649,57 +669,66 @@ } } } -\cs_set:Npn \@makefntext #1 +\cs_new_protected:Npn \eb_footnote_direct_hang: { - \group_begin: - \str_case:Vn \l__eb_footnotetype_choice_tl + \hbox_set:Nn \l_tmpa_box { - { hang } { \use_i:nn } - { default } { \use_ii:nn } + \dim_compare:nNnTF { \footnoteindent } > { 0pt } + { \hbox_to_wd:nn { \footnoteindent } { \eb@makefnmark\hss } } + { \eb@makefnmark } + } + \dim_set:Nn \leftmargin { \box_wd:N \l_tmpa_box } + \dim_zero:N \rightmargin + \dim_set_eq:NN \linewidth \columnwidth + \dim_sub:Nn \linewidth { \leftmargin } + \parshape\@ne\leftmargin\linewidth + \@setpar{{\@@par}} + \mode_leave_vertical: + \hbox_overlap_left:n { \box_use:N \l_tmpa_box } + } +\cs_new_protected:Npn \eb_footnote_direct_default: + { + \noindent + \clist_if_in:NnT \l__eb_footnote_mulchoice_clist { flush } + { \dim_zero:N \footnoteindent } + \int_case:nn { \dim_sign:V \footnoteindent } + { + { 1 } { \use_i:nnn } + { 0 } { \use_ii:nnn } + { -1 } { \use_iii:nnn } } + { \hbox_to_wd:nn { \footnoteindent } { \hss\eb@makefnmark } } + { \hbox_overlap_left:n { \eb@makefnmark } } { - \hbox_set:Nn \l_tmpa_box + \hbox_overlap_left:n { - \dim_compare:nNnTF { \footnoteindent } > { 0pt } - { \hbox_to_wd:nn { \footnoteindent } { \eb@makefnmark\hss } } - { \eb@makefnmark } - } - \dim_set:Nn \leftmargin { \box_wd:N \l_tmpa_box } - \dim_zero:N \rightmargin - \dim_set_eq:NN \linewidth \columnwidth - \dim_sub:Nn \linewidth { \leftmargin } - \parshape\@ne\leftmargin\linewidth - \@setpar{{\@@par}} - \mode_leave_vertical: - \hbox_overlap_left:n { \box_use:N \l_tmpa_box } - } - { - \noindent - \int_case:nn { \dim_sign:V \footnoteindent } - { - { 1 } { \use_i:nnn } - { 0 } { \use_ii:nnn } - { -1 } { \use_iii:nnn } - } - { \hbox_to_wd:nn { \footnoteindent } { \hss\eb@makefnmark } } - { \hbox_overlap_left:n { \eb@makefnmark } } - { - \hbox_overlap_left:n - { - \hbox_to_wd:nn { -\footnoteindent } - { \eb@makefnmark\hss } - } + \hbox_to_wd:nn { -\footnoteindent } + { \eb@makefnmark\hss } } } + } +\cs_set:Npn \@makefntext #1 + { + \group_begin: + \str_case:Vn \l__eb_footnote_choice_tl + { + { hang } { \use_i:nn } + { default } { \use_ii:nn } + } + { \eb_footnote_direct_hang: } + { \eb_footnote_direct_default: } \skip_set:NV \parskip \footparskip \dim_set:NV \parindent \footparindent - \l__eb_fntext_format_tl{#1} - \tl_if_eq:NnT \l__eb_footnotetype_choice_tl { hang } { \par } + \l__eb_fnpara_format_tl{#1} + \tl_if_eq:NnT \l__eb_footnote_choice_tl { hang } { \par } \group_end: } \cs_set_eq:NN \eb@makefntext \@makefntext \ctex_at_end_package:nn { footmisc } - { \cs_set_eq:NN \@makefntext \eb@makefntext } + { + \@ifpackagewith{footmisc}{hang} + {\cs_set_eq:NN \@makefntext \eb@makefntext}{} + } \eb_at_end_patch_cmd:nnn { \@footnotetext,\@mpfootnotetext } { \reset@font } { @@ -780,7 +809,7 @@ { \eb@fnmark@super* } { \tl_use:N \l__eb_fnmark_before_tl - \l__eb_fnmark_format_tl{\@thefnmark} + {\l__eb_fnmark_format_tl{\@thefnmark}} \tl_use:N \l__eb_fnmark_after_tl } } @@ -799,7 +828,7 @@ } \cs_new_protected:Npn \eb_fncust_format_initial: { - \hdrset{fnmark-code = { }} + % \hdrset{fntext-code = { }} \tl_set_eq:NN \l__eb_fnmark_format_tl \l__eb_fncust_format_tl } @@ -1615,7 +1644,7 @@ name = \tl_use:c { c__eb_name_#1_tl }, style = easy-theorem,#5 ] - \bool_if:NT \l__eb_thmbox_bool + \bool_if:NT \l__eb_thmframe_bool { \@ifpackageloaded{tcolorbox} {\tcolorboxenvironment{#1}{#4}} @@ -1625,7 +1654,7 @@ } \msg_new:nnn { easybase } { need-tcolorbox } { - Now~that~the~thmbox~option~is~true. \\ + Now~that~the~thmframe~option~is~true. \\ Please~load~the~tcolorbox~macro~package. } \cs_set_eq:NN \EBNewTheorem \DeclareTheorem @@ -1650,9 +1679,11 @@ { \ctex_define:nn { thmset } { #1 .tl_set:N = #2 } } \ctex_define:nn { thmset } { - thmbox .bool_set:N = \l__eb_thmbox_bool, + thmframe .bool_set:N = \l__eb_thmframe_bool, + thmframe .default:n = true, + thmframe .initial:n = false, + thmbox .meta:n = { thmframe = #1 }, thmbox .default:n = true, - thmbox .initial:n = false, notebraces .tl_set:N = \l__eb_thm_notebraces_tl, unknown .code:n = \eb_msg_unknown_option:n { thmset } } diff --git a/Master/texmf-dist/tex/latex/easybook/easybook.cls b/Master/texmf-dist/tex/latex/easybook/easybook.cls index 65704d5130d..3533a39aad0 100644 --- a/Master/texmf-dist/tex/latex/easybook/easybook.cls +++ b/Master/texmf-dist/tex/latex/easybook/easybook.cls @@ -20,7 +20,7 @@ %% This work has the LPPL maintenance status `maintained'. \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e} -\ProvidesExplClass{easybook}{2021/10/16}{1.3N} +\ProvidesExplClass{easybook}{2021/10/18}{1.3O} {Typeset Chinese theses or books} \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 index 6a9af92f8b0..0e70735bc75 100644 --- a/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg +++ b/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg @@ -18,7 +18,7 @@ %% LaTeX version 2005/12/01 or later. %% %% This work has the LPPL maintenance status `maintained'. -\ProvidesExplFile{eb-tcolorbox.cfg}{2021/10/16}{1.3N} +\ProvidesExplFile{eb-tcolorbox.cfg}{2021/10/18}{1.3O} {Customization of tcolorbox for easybook} \tl_gset:Nn \eb@tc@line@skip { 0.5\baselineskip } -- cgit v1.2.3