diff options
author | Karl Berry <karl@freefriends.org> | 2021-03-21 21:41:03 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-03-21 21:41:03 +0000 |
commit | df4e3642a167438ed7bf738426fc0e4afc9cb8e7 (patch) | |
tree | ce14f41d40d6439c14ba0351a68ad177591baff1 /Master | |
parent | 9a75f041e4bc046e8456e23e23fafeeffe7e8305 (diff) |
easybook (21mar21)
git-svn-id: svn://tug.org/texlive/trunk@58591 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/easybook/easybook-demo.pdf | bin | 262611 -> 262612 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/easybook/easybook-demo.tex | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/easybook/easybook.pdf | bin | 258261 -> 259234 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/easybook/easybook.dtx | 170 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/easybook/easybook.cls | 117 |
5 files changed, 200 insertions, 89 deletions
diff --git a/Master/texmf-dist/doc/latex/easybook/easybook-demo.pdf b/Master/texmf-dist/doc/latex/easybook/easybook-demo.pdf Binary files differindex 1be2e7f933d..63218b58a18 100644 --- a/Master/texmf-dist/doc/latex/easybook/easybook-demo.pdf +++ b/Master/texmf-dist/doc/latex/easybook/easybook-demo.pdf diff --git a/Master/texmf-dist/doc/latex/easybook/easybook-demo.tex b/Master/texmf-dist/doc/latex/easybook/easybook-demo.tex index 867240ca0c3..e2b64fb8b03 100644 --- a/Master/texmf-dist/doc/latex/easybook/easybook-demo.tex +++ b/Master/texmf-dist/doc/latex/easybook/easybook-demo.tex @@ -99,7 +99,7 @@ \url{https://latexstudio.net} \\ \url{https://gitee.com/texl3/easybook}\thanks{Gitee为项目的主要发布地址。} } -\date{2021/03/19\hskip\ccwd\relax v1.23v} +\date{2021/03/21\hskip\ccwd\relax v1.23x} \frontmatter[roman] \maketitle diff --git a/Master/texmf-dist/doc/latex/easybook/easybook.pdf b/Master/texmf-dist/doc/latex/easybook/easybook.pdf Binary files differindex dc22bed42de..062649bceb6 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 7269f8bcd5c..3206e3da325 100644 --- a/Master/texmf-dist/source/latex/easybook/easybook.dtx +++ b/Master/texmf-dist/source/latex/easybook/easybook.dtx @@ -51,7 +51,7 @@ The latest version of this license is in % % \changes{v1.20}{2021/01/09}{修改和完善用户文档。} % \changes{v1.20}{2021/01/09}{模板更改为使用 CC-BY 许可协议。} -% \changes{v1.23v}{2021/03/19}{修复在 \pkg{ctex} v2.5.6 更新后 \cls{easybook} 与 \pkg{hyperref} 冲突问题。} +% \changes{v1.23x}{2021/03/19}{修复在 \pkg{ctex} v2.5.6 更新后 \cls{easybook} 与 \pkg{hyperref} 冲突问题。} % % \CheckSum{0} % @@ -73,7 +73,7 @@ The latest version of this license is in % % \title{\sffamily easybook书籍文档类} % \author{瞿毅} -% \date{2021/03/19\hskip\ccwd\relax v1.23v\thanks{\url{https://gitee.com/texl3/easybook}}} +% \date{2021/03/21\hskip\ccwd\relax v1.23x\thanks{\url{https://gitee.com/texl3/easybook}}} % \maketitle % \begin{abstract} % \cls{easybook} 是基于 \cls{ctexbook} 书籍文档类创建以极简为风格的模板,可以看作对 \cls{ctexbook} 的进一步包装。虽然\CTeX 文档类提供了较好的中文支持,但想实现个性化功能一般需要在其基础上载入更多宏包来定制。\cls{easybook} 考虑了一些细节并载入一些常用宏包实现一般的排版需求,它适用于排版中英文书籍或笔记,甚至可稍加调整成为学位论文模板。 @@ -164,7 +164,7 @@ The latest version of this license is in % class = <(book)|article> % \end{syntax} % 设置文类风格,默认为 \opt{book} 文档类。选用 \opt{article} 使文档编号、结构等与 \cls{article} 文档类的特性相似,可用于短篇幅的文章,不要再使用 \tn{chapter} 命令,此时设置双栏目录的 \opt{style/multoc} 选项、小节 \ref{subsec:document command} 中打印目录命令的 \opt{multoc} 及 \opt{book} 选项均会失效,会以 \opt{section} 标题级别输出目录。 -% \changes{v1.23v}{2021/03/16}{增加 article 文章模式,可用于短篇幅的文章。} +% \changes{v1.23x}{2021/03/16}{增加 article 文章模式,可用于短篇幅的文章。} % \end{function} % % \subsection{文档命令} @@ -180,7 +180,7 @@ The latest version of this license is in % \tn{listoflistings*}\oarg{键值列表} % \end{syntax} % \tn{frontmatter} 为前言区命令,章标题不编号,页码可设置为例如 \opt{roman}、\opt{Alph} 等格式,带有星号的命令 \tn{frontmatter*} 不使用 \tn{cleardoublepage}。\tn{mainmatter} 为主文区命令,章标题正常编号且页码为从1开始计数的阿拉伯数字,\tn{mainmatter*} 命令不使用 \tn{cleardoublepage}。\tn{backmatter} 为后记区命令,页码格式与编号保持不变,章标题不编号。\tn{listoffigures} 命令输出图片目录,\tn{listoftables} 命令输出表格目录,\tn{listoflistings} 命令输出代码目录。带有星号的目录命令不会添加进主文档目录中,目录的键值列表选项如下 -% \changes{v1.23v}{2021/02/20}{重新定义文档结构划分命令。} +% \changes{v1.23x}{2021/02/20}{重新定义文档结构划分命令。} % \end{function} % % \begin{function}{multoc,book,article} @@ -188,7 +188,7 @@ The latest version of this license is in % multoc = <true|(false)> % \end{syntax} % \opt{multoc} 与 \opt{style/multoc} 选项具有相同的效果,但是具有优先性且可单独设置不同目录是否双栏排版。\opt{book} 选项使目录标题按照 \opt{chapter} 级别输出,\opt{article} 选项使目录标题按照 \opt{article} 级别输出,默认为 \opt{chapter} 级别。 -% \changes{v1.23v}{2021/03/15}{为几个目录增加键值列表的选项,可设置标题输出级别以及是否加入主目录。} +% \changes{v1.23x}{2021/03/15}{为几个目录增加键值列表的选项,可设置标题输出级别以及是否加入主目录。} % \end{function} % % \section{接口选项} @@ -225,9 +225,9 @@ The latest version of this license is in % \end{syntax} % \ding{229} 以上选项路径为 \opt{style/...} % \changes{v1.10}{2021/01/08}{更改颜色实现方式与选项名。} -% \changes{v1.23v}{2021/02/02}{noto风格的数学字体独立出来,可自定义设置。} -% \changes{v1.23v}{2021/02/09}{增加控制页面横线粗细的选项。} -% \changes{v1.23v}{2021/03/15}{增加控制编号连接符的选项。} +% \changes{v1.23x}{2021/02/02}{noto风格的数学字体独立出来,可自定义设置。} +% \changes{v1.23x}{2021/02/09}{增加控制页面横线粗细的选项。} +% \changes{v1.23x}{2021/03/15}{增加控制编号连接符的选项。} % \end{function} % % \begin{optdesc} @@ -289,7 +289,7 @@ The latest version of this license is in % \ding{229} 以上选项路径为 \opt{spread/...} \\ % 行距因子用于设置各种行距倍数,只能是浮点数,不能带有长度单位。\tn{ctexset} 原有的行距选项 \opt{linespread} 失效。各行距既可在导言区全局设置也可正文中设置对后面生效,行距的意义为 % \changes{v1.21}{2021/01/12}{增加脚注线间的距离选项。} -% \changes{v1.23v}{2021/02/09}{取消使用 \pkg{zhlineskip} 宏包设置数学间距。} +% \changes{v1.23x}{2021/02/09}{取消使用 \pkg{zhlineskip} 宏包设置数学间距。} % \end{function} % % \begin{optdesc} @@ -311,7 +311,7 @@ The latest version of this license is in % \end{syntax} % \ding{229} 以上选项路径为 \opt{elsefont/...} % \changes{v1.10}{2021/01/08}{加入自定义非正文字体选项。} -% \changes{v1.23v}{2021/02/08}{修复使用 \tn{zihao} 命令设置字体失效的问题。} +% \changes{v1.23x}{2021/02/08}{修复使用 \tn{zihao} 命令设置字体失效的问题。} % \end{function} % % \begin{optdesc} @@ -332,7 +332,7 @@ The latest version of this license is in % \end{syntax} % \ding{229} 以上选项路径为 \opt{bibset/...} % \changes{v1.21}{2021/01/11}{增加 \opt{bibset} 选项,可以使用 \hologo{BibTeX} 或 \hologo{biber} 编译参考文献。} -% \changes{v1.23v}{2021/02/23}{使用 \opt{bibset} 选项时可设置标注风格。} +% \changes{v1.23x}{2021/02/23}{使用 \opt{bibset} 选项时可设置标注风格。} % \end{function} % % \begin{optdesc} @@ -394,7 +394,7 @@ The latest version of this license is in % \tn{declaretheoremstyle}\oarg{键值列表}\marg{定理样式名} % \end{syntax} % 文档类已预置8个定理环境,环境名及对应的定理标题名见小节 \ref{subsec:theorem},如果需要新的定理标题名或定理样式可使用这两个命令。 -% \changes{v1.23v}{2021/03/12}{重新定义了新定理环境命令 \tn{newtheorem}。} +% \changes{v1.23x}{2021/03/12}{重新定义了新定理环境命令 \tn{newtheorem}。} % \end{function} % % \begin{optdesc} @@ -423,16 +423,20 @@ The latest version of this license is in % \end{ctexexam} % % \subsection{页面边距} -% \begin{function}[EXP,added = 2021-01-13]{left,top,hmargin,textwidth,includehead} +% \begin{function}[EXP,added = 2021-01-13,updated = 2021-03-21]{footnotemargin,footparskip,footparindent,list-labelsep,left,top,hmargin,textwidth,includehead} % \begin{syntax} -% left = <长度> -% top = <长度> +% footnotemargin = <脚注首行缩进|(0.5\tn{ccwd})> +% footparskip = <脚注段落间距|(0ex)> +% footparindent = <脚注分段缩进|(2\tn{ccwd})> +% list-labelsep = <索引目录编号与标题的间距|(\tn{ccwd})> +% left = <页面左边距> +% top = <页面上边距> % hmargin = \marg{左边距,右边距} -% textwidth = <长度> +% textwidth = <页面文本区宽度> % includehead = <true|(false)> % \end{syntax} % \ding{229} 以上选项路径为 \opt{geoset/...} \\ -% \opt{geoset} 将选项交给 \pkg{geometry} 宏包接口命令 \tn{geometry} 处理,并且选项的键值列表与之相同,上面的选项仅是一小部分,支持的参数可查阅宏包帮助文档。当在此设置页面大小时,会覆盖 \opt{paper} 选项的设置。 +% \opt{geoset} 会将前4个选项以外的其它选项交给 \pkg{geometry} 宏包接口命令 \tn{geometry} 处理,并且选项的键值列表与之相同,上面的选项仅是一小部分,支持的参数可查阅宏包帮助文档。当在此设置页面大小时,会覆盖 \opt{paper} 选项的设置。 % \begin{ctexexam} % \ctexset % { @@ -441,7 +445,8 @@ The latest version of this license is in % top = 2.5cm, % bottom = 2.5cm, % left = 3.2cm, -% right = 3.2cm +% right = 3.2cm, +% list-labelsep = \hspace{0.5\ccwd} % } % } % \end{ctexexam} @@ -462,8 +467,8 @@ The latest version of this license is in % \opt{hdrset} 设置的命令由 \pkg{fancyhdr} 宏包提供支持,\opt{headrule}、\opt{footrule} 和 \opt{footnoterule} 三个横线选项一般可以使用 \tn{hrule} width \meta{长度} height \meta{高度} 命令来绘制,脚注横线默认为空。当然,手动绘制横线时线条粗细选项 \opt{style/rulewidth} 会失效。 % \changes{v1.21}{2021/01/11}{修复单面文档时页眉横线消失的问题。} % \changes{v1.21}{2021/01/13}{增加配置页眉页脚的选项。} -% \changes{v1.23v}{2021/03/08}{优化页眉页脚设置,增加 \opt{chap-mark} 和 \opt{sec-mark} 选项。} -% \changes{v1.23v}{2021/03/14}{可以手动绘制页眉、页脚和脚注的横线。} +% \changes{v1.23x}{2021/03/08}{优化页眉页脚设置,增加 \opt{chap-mark} 和 \opt{sec-mark} 选项。} +% \changes{v1.23x}{2021/03/14}{可以手动绘制页眉、页脚和脚注的横线。} % \end{function} % % \begin{function}[added = 2021-01-13,updated = 2021-03-14]{,\easyhead,\easyfoot} @@ -510,7 +515,7 @@ The latest version of this license is in % belowoffset = <(0pc)> % belowoffset = <(-1pc)> % \end{syntax} -% \opt{lolskip} 是代码目录中章之间的代码标题的距离,使用刚性间距,与\CTeX 的 \opt{lotskip} 和 \opt{lofskip} 类似,它们的值均默认0.8 pc,在 \opt{article} 模式中此选项失效。\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{lolskip} 是代码目录中章之间的代码标题的距离,与\CTeX 的表格目录和图片目录中章之间的标题距离选项 \opt{lotskip} 和 \opt{lofskip} 类似,它们的值均默认0.8 pc,在 \opt{article} 模式中此选项失效。\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)}。 % \end{function} % % \begin{function}[added = 2021-01-13,updated = 2021-01-15]{\tocrule} @@ -540,7 +545,7 @@ The latest version of this license is in % \begin{function}[added = 2021-01-05]{equation,multline,gather,align} % \begin{syntax} % \tn{begin}\marg{环境名} -% \tn{item} <行间公式> +% <行间公式> % \tn{end}\marg{环境名} % \end{syntax} % \pkg{amsmath} 宏包提供了一系列数学环境,它们可以排布各种对齐或不对齐的公式组。\env{multline} 环境用于一行无法放下的长公式,\env{gather} 环境用于每行居中的公式组,\env{align} 环境用于多列对齐的公式组。 @@ -599,7 +604,7 @@ The latest version of this license is in % \begin{center} % \begin{tabular}{*{8}{c}} % \toprule -% theorem & definition & lemma & corollary & proposition & example & remark & prooof \\ +% theorem & definition & lemma & corollary & proposition & example & remark & proof \\ % 定理 & 定义 & 引理 & 推论& 性质 & 例 & 注 & 证明 \\ % \bottomrule % \end{tabular} @@ -621,7 +626,7 @@ The latest version of this license is in % \item 习题内容 % \end{exercise} % \end{ctexexam} -% \changes{v1.23v}{2021/02/08}{增加准确的习题盒子标题目录锚点。} +% \changes{v1.23x}{2021/02/08}{增加准确的习题盒子标题目录锚点。} % \end{function} % % \subsection{盒子} @@ -780,7 +785,7 @@ The latest version of this license is in %<*class> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e} -\ProvidesExplClass{easybook}{2021/03/19}{1.23v}{} +\ProvidesExplClass{easybook}{2021/03/21}{1.23x}{beta} \cs_generate_variant:Nn \keys_define:nn {nx} \cs_generate_variant:Nn \int_to_arabic:n {v} @@ -901,14 +906,6 @@ The latest version of this license is in withpart .bool_set:N = \l__chap_withpart_bool, withpart .default:n = true, withpart .initial:n = false, - footwith .choice:, - footwith .value_required:n = true, - footwith/part .code:n = - {\tl_set:Nn \l__foot_numberwith_tl{#1}}, - footwith/page .code:n = - {\tl_set:Nn \l__foot_numberwith_tl{#1}}, - footwith/chapter .code:n = {}, - footwith .initial:n = chapter, notomath .bool_set:N = \l__notomath_bool, notomath .default:n = true, notomath .initial:n = true, @@ -917,6 +914,16 @@ The latest version of this license is in uppercase .bool_set:N = \l__uppercase_bool, uppercase .default:n = true, uppercase .initial:n = true, + + footwith .choice:, + footwith .value_required:n = true, + footwith/part .code:n = + {\tl_set:Nn \l__foot_numberwith_tl{#1}}, + footwith/page .code:n = + {\tl_set:Nn \l__foot_numberwith_tl{#1}}, + footwith/chapter .code:n = {}, + footwith .initial:n = chapter, + figure-sep .tl_set:N = \l__figure_separator_tl, table-sep .tl_set:N = \l__table_separator_tl, listing-sep .tl_set:N = \l__lstlisting_separator_tl, @@ -951,6 +958,28 @@ The latest version of this license is in \tl_if_empty:NF \g__config_tl{\file_input:n {\g__config_tl}} } +\cs_new_protected:Npn \__ifpackage_later:nn #1#2 + { + \@ifpackagelater{#1}{#2} + {}{\msg_warning:nnn {easybook}{package-old}{#1}} + } +\msg_new:nnn {easybook}{package-old} + { + Package~#1~has~been~out~of~date. \\ + Some~problems~or~errors~may~occur \\ + if~you~continue~compiling. \\\\ + Please~update~your~macro~package~from~CTAN. + } +\clist_map_inline:nn + { + {expl3}{2020/10/27}, + {xparse}{2020/10/27}, + {l3keys2e}{2020/10/27}, + {ctex}{2020/10/19}, + {thmtools}{2020/08/01}, + {caption-light}{2020/08/24} + }{\__ifpackage_later:nn #1} + \sys_if_engine_xetex:TF { \cs_new_eq:NN \__set_family:nnn \xeCJK_set_family:nnn @@ -1055,7 +1084,15 @@ The latest version of this license is in \clist_new:N \g__geometry_clist \__ctex_define:nn {geoset} { - unknown .code:n = + footnotemargin .dim_set:N = \footnotemargin, + footnotemargin .initial:n = 0.5\ccwd, + footparskip .tl_set:N = \hangfootparskip, + footparskip .initial:n = 0ex, + footparindent .tl_set:N = \hangfootparindent, + footparindent .initial:n = 2\ccwd, + list-labelsep .dim_set:N = \list@labelsep, + list-labelsep .initial:n = \ccwd, + unknown .code:n = { \clist_gput_right:Nx \g__geometry_clist { @@ -1232,7 +1269,7 @@ The latest version of this license is in lists/indent .initial:n = 0\ccwd, lists/rule .tl_set:N = \l__toc_lists_rule_tl, lists/rule .initial:n = \tocrule{$\cdot$}, - lists/lolskip .dim_set:N = \l__toc_lolskip_dim, + lists/lolskip .skip_set:N = \l__toc_lolskip_skip, lists/lolskip .initial:n = 0.8pc, lists/belowoffset .dim_set:N = \l__toc_listsoffset_dim, lists/belowoffset .initial:n = 0pc, @@ -1266,19 +1303,34 @@ The latest version of this license is in }{\__titlecontents_set:nn #1} \ctex_patch_cmd:Nnn \caption@@@addcontentsline {\addcontentsline{#1}{#2}{\protect\numberline{#3}{#4}}} - {\addcontentsline{#1}{#2}{#3\hspace{\ccwd}#4}} + {\addcontentsline{#1}{#2}{#3\hspace{\list@labelsep}#4}} \ctex_patch_cmd:Nnn \lst@MakeCaption { \addcontentsline{lol}{lstlisting} {\protect\numberline{\thelstlisting}\lst@@caption} }{ \addcontentsline{lol}{lstlisting} - {\thelstlisting\hspace{\ccwd}\lst@@caption} + {\thelstlisting\hspace{\list@labelsep}\lst@@caption} } \__appto_cmd:Nn \@chapter { - \addtocontents{lol} - {\protect\addvspace{\dim_use:N \l__toc_lolskip_dim}} + \skip_if_eq:nnF {\l__toc_lolskip_skip}{\c_zero_skip} + { + \addtocontents{lol} + {\protect\addvspace{\skip_use:N \l__toc_lolskip_skip}} + } + \bool_if:NF \l__class_book_bool + {\msg_error:nn {easybook}{no-chapter}} + } +\__appto_cmd:Nn \@schapter + { + \bool_if:NF \l__class_book_bool + {\msg_error:nn {easybook}{no-chapter}} + } +\msg_new:nnn {easybook}{no-chapter} + { + Your~document~class~is~in~article~mode. \\ + The~\string\chapter\space~command~will~not~be~used. } \cs_new_protected:Npn \__markboth:n #1 @@ -1361,7 +1413,7 @@ The latest version of this license is in \RenewDocumentCommand{\tableofcontents}{o} { \group_begin: - \IfValueT {#1}{\keys_set:nn {listoc}{#1}} + \IfValueT{#1}{\keys_set:nn {listoc}{#1}} \__ifmultoc_pre_set: \__title_mark:n {\contentsname} \vspace*{\dim_use:N \l__toc_offset_dim} @@ -1372,9 +1424,9 @@ The latest version of this license is in \RenewDocumentCommand{\listoffigures}{so} { \group_begin: - \IfValueT {#2}{\keys_set:nn {listoc}{#2}} + \IfValueT{#2}{\keys_set:nn {listoc}{#2}} \__ifmultoc_pre_set: - \IfBooleanTF {#1} + \IfBooleanTF{#1} {\__title_mark:n {\listfigurename}} {\__title_mark_intoc:n {\listfigurename}} \dim_add:NV \l__toc_offset_dim\l__toc_listsoffset_dim @@ -1386,9 +1438,9 @@ The latest version of this license is in \RenewDocumentCommand{\listoftables}{so} { \group_begin: - \IfValueT {#2}{\keys_set:nn {listoc}{#2}} + \IfValueT{#2}{\keys_set:nn {listoc}{#2}} \__ifmultoc_pre_set: - \IfBooleanTF {#1} + \IfBooleanTF{#1} {\__title_mark:n {\listtablename}} {\__title_mark_intoc:n {\listtablename}} \dim_add:NV \l__toc_offset_dim\l__toc_listsoffset_dim @@ -1400,9 +1452,9 @@ The latest version of this license is in \NewDocumentCommand{\listoflistings}{so} { \group_begin: - \IfValueT {#2}{\keys_set:nn {listoc}{#2}} + \IfValueT{#2}{\keys_set:nn {listoc}{#2}} \__ifmultoc_pre_set: - \IfBooleanTF {#1} + \IfBooleanTF{#1} {\__title_mark:n {\lstlistlistingname}} {\__title_mark_intoc:n {\lstlistlistingname}} \dim_add:NV \l__toc_offset_dim\l__toc_listsoffset_dim @@ -1522,9 +1574,20 @@ The latest version of this license is in } } \AtBeginEnvironment{tabularx} - {\exp_args:Nx \linespread{\fp_use:N \l__spread_table_fp}\selectfont\ignorespaces} + { + \exp_args:Nx \linespread{\fp_use:N \l__spread_table_fp} + \selectfont\ignorespaces + } \AtBeginEnvironment{tabular} - {\exp_args:Nx \linespread{\fp_use:N \l__spread_table_fp}\selectfont\ignorespaces} + { + \exp_args:Nx \linespread{\fp_use:N \l__spread_table_fp} + \selectfont\ignorespaces + } +\ctex_after_end_preamble:n + { + \exp_args:Nx \linespread{\fp_use:N \l__spread_line_fp} + \selectfont\ignorespaces + } \fp_new:N \l__spread_line_fp \fp_new:N \l__spread_table_fp @@ -1559,8 +1622,6 @@ The latest version of this license is in \cs_gset:Npn \topfraction{0.85} \cs_gset:Npn \bottomfraction{0.65} \cs_gset:Npn \floatpagefraction{0.60} -\ctex_after_end_preamble:n - {\exp_args:Nx \linespread{\fp_use:N \l__spread_line_fp}\selectfont} \newcolumntype{L}{X} \newcolumntype{C}{>{\centering\arraybackslash}X} @@ -1756,6 +1817,7 @@ The latest version of this license is in \ctex_at_end_package:nn {tcolorbox} { + \__ifpackage_later:nn {tcolorbox}{2020/10/09} \tcbset { thmsty/.style = @@ -1935,11 +1997,11 @@ The latest version of this license is in \NewDocumentCommand{\printbibliography}{so} { \group_begin: - \IfValueT {##2}{\keys_set:nn {listoc}{##2}} + \IfValueT{##2}{\keys_set:nn {listoc}{##2}} \__ifmultoc_pre_set: \cs_set:Npn \bibsection { - \IfBooleanTF {##1} + \IfBooleanTF{##1} {\__title_mark:n {\bibname}} {\__title_mark_intoc:n {\bibname}} } @@ -1987,15 +2049,11 @@ The latest version of this license is in \ctex_at_end_preamble:n { - \skip_set:Nn \footnotemargin{0.5\ccwd} \group_begin: \footnotesize \exp_args:Nx \linespread{\fp_use:N \l__spread_footnote_fp}\selectfont \skip_gset:Nn \footnotesep{\ht\strutbox} \group_end: - \cs_gset:Npn \hangfootparskip{0ex} - \bool_if:NT \l__lang_chinese_bool - {\cs_gset:Npn \hangfootparindent{2\ccwd}} \bool_if:NT \l__chap_withpart_bool {\counterwithin*{chapter}{part}} \tl_if_eq:NnT \l__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 fff5697b188..6af14757398 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/03/19}{1.23v}{} +\ProvidesExplClass{easybook}{2021/03/21}{1.23x}{beta} \cs_generate_variant:Nn \keys_define:nn {nx} \cs_generate_variant:Nn \int_to_arabic:n {v} @@ -134,14 +134,6 @@ withpart .bool_set:N = \l__chap_withpart_bool, withpart .default:n = true, withpart .initial:n = false, - footwith .choice:, - footwith .value_required:n = true, - footwith/part .code:n = - {\tl_set:Nn \l__foot_numberwith_tl{#1}}, - footwith/page .code:n = - {\tl_set:Nn \l__foot_numberwith_tl{#1}}, - footwith/chapter .code:n = {}, - footwith .initial:n = chapter, notomath .bool_set:N = \l__notomath_bool, notomath .default:n = true, notomath .initial:n = true, @@ -150,6 +142,16 @@ uppercase .bool_set:N = \l__uppercase_bool, uppercase .default:n = true, uppercase .initial:n = true, + + footwith .choice:, + footwith .value_required:n = true, + footwith/part .code:n = + {\tl_set:Nn \l__foot_numberwith_tl{#1}}, + footwith/page .code:n = + {\tl_set:Nn \l__foot_numberwith_tl{#1}}, + footwith/chapter .code:n = {}, + footwith .initial:n = chapter, + figure-sep .tl_set:N = \l__figure_separator_tl, table-sep .tl_set:N = \l__table_separator_tl, listing-sep .tl_set:N = \l__lstlisting_separator_tl, @@ -184,6 +186,28 @@ \tl_if_empty:NF \g__config_tl{\file_input:n {\g__config_tl}} } +\cs_new_protected:Npn \__ifpackage_later:nn #1#2 + { + \@ifpackagelater{#1}{#2} + {}{\msg_warning:nnn {easybook}{package-old}{#1}} + } +\msg_new:nnn {easybook}{package-old} + { + Package~#1~has~been~out~of~date. \\ + Some~problems~or~errors~may~occur \\ + if~you~continue~compiling. \\\\ + Please~update~your~macro~package~from~CTAN. + } +\clist_map_inline:nn + { + {expl3}{2020/10/27}, + {xparse}{2020/10/27}, + {l3keys2e}{2020/10/27}, + {ctex}{2020/10/19}, + {thmtools}{2020/08/01}, + {caption-light}{2020/08/24} + }{\__ifpackage_later:nn #1} + \sys_if_engine_xetex:TF { \cs_new_eq:NN \__set_family:nnn \xeCJK_set_family:nnn @@ -288,7 +312,15 @@ \clist_new:N \g__geometry_clist \__ctex_define:nn {geoset} { - unknown .code:n = + footnotemargin .dim_set:N = \footnotemargin, + footnotemargin .initial:n = 0.5\ccwd, + footparskip .tl_set:N = \hangfootparskip, + footparskip .initial:n = 0ex, + footparindent .tl_set:N = \hangfootparindent, + footparindent .initial:n = 2\ccwd, + list-labelsep .dim_set:N = \list@labelsep, + list-labelsep .initial:n = \ccwd, + unknown .code:n = { \clist_gput_right:Nx \g__geometry_clist { @@ -465,7 +497,7 @@ lists/indent .initial:n = 0\ccwd, lists/rule .tl_set:N = \l__toc_lists_rule_tl, lists/rule .initial:n = \tocrule{$\cdot$}, - lists/lolskip .dim_set:N = \l__toc_lolskip_dim, + lists/lolskip .skip_set:N = \l__toc_lolskip_skip, lists/lolskip .initial:n = 0.8pc, lists/belowoffset .dim_set:N = \l__toc_listsoffset_dim, lists/belowoffset .initial:n = 0pc, @@ -499,19 +531,34 @@ }{\__titlecontents_set:nn #1} \ctex_patch_cmd:Nnn \caption@@@addcontentsline {\addcontentsline{#1}{#2}{\protect\numberline{#3}{#4}}} - {\addcontentsline{#1}{#2}{#3\hspace{\ccwd}#4}} + {\addcontentsline{#1}{#2}{#3\hspace{\list@labelsep}#4}} \ctex_patch_cmd:Nnn \lst@MakeCaption { \addcontentsline{lol}{lstlisting} {\protect\numberline{\thelstlisting}\lst@@caption} }{ \addcontentsline{lol}{lstlisting} - {\thelstlisting\hspace{\ccwd}\lst@@caption} + {\thelstlisting\hspace{\list@labelsep}\lst@@caption} } \__appto_cmd:Nn \@chapter { - \addtocontents{lol} - {\protect\addvspace{\dim_use:N \l__toc_lolskip_dim}} + \skip_if_eq:nnF {\l__toc_lolskip_skip}{\c_zero_skip} + { + \addtocontents{lol} + {\protect\addvspace{\skip_use:N \l__toc_lolskip_skip}} + } + \bool_if:NF \l__class_book_bool + {\msg_error:nn {easybook}{no-chapter}} + } +\__appto_cmd:Nn \@schapter + { + \bool_if:NF \l__class_book_bool + {\msg_error:nn {easybook}{no-chapter}} + } +\msg_new:nnn {easybook}{no-chapter} + { + Your~document~class~is~in~article~mode. \\ + The~\string\chapter\space~command~will~not~be~used. } \cs_new_protected:Npn \__markboth:n #1 @@ -594,7 +641,7 @@ \RenewDocumentCommand{\tableofcontents}{o} { \group_begin: - \IfValueT {#1}{\keys_set:nn {listoc}{#1}} + \IfValueT{#1}{\keys_set:nn {listoc}{#1}} \__ifmultoc_pre_set: \__title_mark:n {\contentsname} \vspace*{\dim_use:N \l__toc_offset_dim} @@ -605,9 +652,9 @@ \RenewDocumentCommand{\listoffigures}{so} { \group_begin: - \IfValueT {#2}{\keys_set:nn {listoc}{#2}} + \IfValueT{#2}{\keys_set:nn {listoc}{#2}} \__ifmultoc_pre_set: - \IfBooleanTF {#1} + \IfBooleanTF{#1} {\__title_mark:n {\listfigurename}} {\__title_mark_intoc:n {\listfigurename}} \dim_add:NV \l__toc_offset_dim\l__toc_listsoffset_dim @@ -619,9 +666,9 @@ \RenewDocumentCommand{\listoftables}{so} { \group_begin: - \IfValueT {#2}{\keys_set:nn {listoc}{#2}} + \IfValueT{#2}{\keys_set:nn {listoc}{#2}} \__ifmultoc_pre_set: - \IfBooleanTF {#1} + \IfBooleanTF{#1} {\__title_mark:n {\listtablename}} {\__title_mark_intoc:n {\listtablename}} \dim_add:NV \l__toc_offset_dim\l__toc_listsoffset_dim @@ -633,9 +680,9 @@ \NewDocumentCommand{\listoflistings}{so} { \group_begin: - \IfValueT {#2}{\keys_set:nn {listoc}{#2}} + \IfValueT{#2}{\keys_set:nn {listoc}{#2}} \__ifmultoc_pre_set: - \IfBooleanTF {#1} + \IfBooleanTF{#1} {\__title_mark:n {\lstlistlistingname}} {\__title_mark_intoc:n {\lstlistlistingname}} \dim_add:NV \l__toc_offset_dim\l__toc_listsoffset_dim @@ -755,9 +802,20 @@ } } \AtBeginEnvironment{tabularx} - {\exp_args:Nx \linespread{\fp_use:N \l__spread_table_fp}\selectfont\ignorespaces} + { + \exp_args:Nx \linespread{\fp_use:N \l__spread_table_fp} + \selectfont\ignorespaces + } \AtBeginEnvironment{tabular} - {\exp_args:Nx \linespread{\fp_use:N \l__spread_table_fp}\selectfont\ignorespaces} + { + \exp_args:Nx \linespread{\fp_use:N \l__spread_table_fp} + \selectfont\ignorespaces + } +\ctex_after_end_preamble:n + { + \exp_args:Nx \linespread{\fp_use:N \l__spread_line_fp} + \selectfont\ignorespaces + } \fp_new:N \l__spread_line_fp \fp_new:N \l__spread_table_fp @@ -792,8 +850,6 @@ \cs_gset:Npn \topfraction{0.85} \cs_gset:Npn \bottomfraction{0.65} \cs_gset:Npn \floatpagefraction{0.60} -\ctex_after_end_preamble:n - {\exp_args:Nx \linespread{\fp_use:N \l__spread_line_fp}\selectfont} \newcolumntype{L}{X} \newcolumntype{C}{>{\centering\arraybackslash}X} @@ -989,6 +1045,7 @@ \ctex_at_end_package:nn {tcolorbox} { + \__ifpackage_later:nn {tcolorbox}{2020/10/09} \tcbset { thmsty/.style = @@ -1168,11 +1225,11 @@ \NewDocumentCommand{\printbibliography}{so} { \group_begin: - \IfValueT {##2}{\keys_set:nn {listoc}{##2}} + \IfValueT{##2}{\keys_set:nn {listoc}{##2}} \__ifmultoc_pre_set: \cs_set:Npn \bibsection { - \IfBooleanTF {##1} + \IfBooleanTF{##1} {\__title_mark:n {\bibname}} {\__title_mark_intoc:n {\bibname}} } @@ -1220,15 +1277,11 @@ \ctex_at_end_preamble:n { - \skip_set:Nn \footnotemargin{0.5\ccwd} \group_begin: \footnotesize \exp_args:Nx \linespread{\fp_use:N \l__spread_footnote_fp}\selectfont \skip_gset:Nn \footnotesep{\ht\strutbox} \group_end: - \cs_gset:Npn \hangfootparskip{0ex} - \bool_if:NT \l__lang_chinese_bool - {\cs_gset:Npn \hangfootparindent{2\ccwd}} \bool_if:NT \l__chap_withpart_bool {\counterwithin*{chapter}{part}} \tl_if_eq:NnT \l__foot_numberwith_tl{part} |