diff options
author | Karl Berry <karl@freefriends.org> | 2021-04-27 13:31:43 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-04-27 13:31:43 +0000 |
commit | 7c16c26a1bf8f0a8cf17672a295595204d7e821c (patch) | |
tree | 6b71c2d6882904a9ecd947a91f6b9c1e6d01ba1c /Master | |
parent | 1f3f8f2f09e41e60169435266645008a4407f650 (diff) |
easybook (26apr21)
git-svn-id: svn://tug.org/texlive/trunk@58996 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/easybook/easybook-demo.pdf | bin | 268473 -> 268704 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 | 462158 -> 465175 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/easybook/easybook.dtx | 233 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/easybook/easybook.cls | 156 |
5 files changed, 173 insertions, 218 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 5a65caeff25..bcfab496973 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 72944586bf2..3d9bd6212f9 100644 --- a/Master/texmf-dist/doc/latex/easybook/easybook-demo.tex +++ b/Master/texmf-dist/doc/latex/easybook/easybook-demo.tex @@ -106,7 +106,7 @@ \url{https://latexstudio.net} \\ \url{https://gitee.com/texl3/easybook}\thanks{Gitee为项目的主要发布地址。} } -\date{2021/04/23\hskip\ccwd\relax v1.24s} +\date{2021/04/25\hskip\ccwd\relax v1.24t} \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 03d5910ac86..bd22407ff24 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 fe0a1e01bee..dd209df1373 100644 --- a/Master/texmf-dist/source/latex/easybook/easybook.dtx +++ b/Master/texmf-dist/source/latex/easybook/easybook.dtx @@ -8,7 +8,8 @@ % https://creativecommons.org/licenses/by/4.0/legalcode %<*driver> \def\nameofplainTeX{plain} -\ifx\fmtname\nameofplainTeX\else +\ifx\fmtname\nameofplainTeX +\else \expandafter\begingroup \fi %<*install> @@ -55,7 +56,7 @@ The latest version of this license is in % % \title{\sffamily easybook 书籍文档类} % \author{瞿毅} -% \date{2021/04/23\hskip\ccwd\relax v1.24s\thanks{\url{https://gitee.com/texl3/easybook}}} +% \date{2021/04/25\hskip\ccwd\relax v1.24t\thanks{\url{https://gitee.com/texl3/easybook}}} % \maketitle % \begin{abstract} % \cls{easybook} 是基于 \cls{ctexbook} 书籍文档类创建以极简为风格的模板,可以看作对 \cls{ctexbook} 的进一步包装。虽然\CTeX 文档类提供了较好的中文支持,但想实现个性化功能一般需要在其基础上载入更多宏包来定制。\cls{easybook} 考虑了一些细节并载入一些常用宏包实现一般的排版需求,它适用于排版中英文书籍或笔记,甚至可稍加调整成为学位论文模板。 @@ -182,7 +183,7 @@ The latest version of this license is in % \end{syntax} % \opt{multoc} 与 \opt{style/multoc} 选项具有相同的效果,但是具有优先性且可单独设置不同目录是否双栏排版。已经预置了中英文的目录标题,可以使用 \opt{title} 选项更改目录标题的名称。\opt{book} 选项使目录标题按照 \opt{chapter} 级别输出,\opt{article} 选项使目录标题按照 \opt{article} 级别输出,默认为 \opt{chapter} 级别。 % \changes{v1.23}{2021/03/15}{为几个目录增加键值列表的选项,可设置标题输出级别以及是否加入主目录。} -% \changes{v1.24s}{2021/04/04}{目录命令的可选参数增加标题键值。} +% \changes{v1.24t}{2021/04/04}{目录命令的可选参数增加标题键值。} % \end{function} % % \section{接口选项} @@ -265,7 +266,7 @@ The latest version of this license is in % \ding{229} 以上选项路径为 \opt{link/...} \\ % \opt{link} 将超链接选项(包括以上选项)交给 \pkg{hyperref} 处理,除了一些关于 pdf 书签的选项可能会失效,其它由键值选项命令 \tn{hypersetup} 支持的多数选项可用。 % \changes{v1.10}{2021/01/08}{修复了 \opt{linktopage} 选项关闭时目录中标题编号无超链接的问题。} -% \changes{v1.24s}{2021/04/05}{增加 \pkg{hyperref} 超链接选项完整的支持。} +% \changes{v1.24t}{2021/04/05}{增加 \pkg{hyperref} 超链接选项完整的支持。} % \end{function} % % \begin{optdesc} @@ -344,7 +345,7 @@ The latest version of this license is in % \ding{229} 以上选项路径为 \opt{bibset/...} % \changes{v1.21}{2021/01/11}{增加 \opt{bibset} 选项,可以使用 \hologo{BibTeX} 或 \hologo{biber} 编译参考文献。} % \changes{v1.23}{2021/02/23}{使用 \opt{bibset} 选项时可设置标注风格。} -% \changes{v1.24s}{2021/04/09}{可以不载入参考文献包手动配置参考文献格式。} +% \changes{v1.24t}{2021/04/09}{可以不载入参考文献包手动配置参考文献格式。} % \end{function} % % \begin{optdesc} @@ -396,7 +397,7 @@ The latest version of this license is in % \end{function} % % \begin{optdesc} -% \item[thmbox] 开启几个预置定理环境盒子的边框,需载入 \pkg{tcolorbox} 宏包才生效。 +% \item[thmbox] 开启定理环境盒子的边框,需载入 \pkg{tcolorbox} 宏包才生效。 % \item[within] 定理编号跟随的计数器,默认跟随章的编号,也可以跟随其它定理环境的编号,当计数器增加时定理编号会从零开始,空置时不跟随其它计数器。 % \item[headpunct] 定理标题末尾后的标记,在换行符或第一段内容的间隔之前。 % \item[bodyfont] 定理内容部分的字体。 @@ -408,32 +409,42 @@ The latest version of this license is in % \item[spacepost] 定理标题后与第一段内容的间隔。 % \end{optdesc} % -% \begin{function}[added = 2021-01-12,updated = 2021-03-13]{\newtheorem, \declaretheoremstyle} +% \begin{function}[added = 2021-01-12,updated = 2021-04-25]{\newtheorem,\EbNewtheorem,\declaretheoremstyle} % \begin{syntax} % \tn{newtheorem}\oarg{键值列表}\marg{定理环境名} +% \tn{EbNewtheorem}\marg{定理环境名}\oarg{英文标题}\marg{中文标题}\parg{盒子样式|(tc-theorem)}\oarg{键值列表} % \tn{declaretheoremstyle}\oarg{键值列表}\marg{定理样式名} % \end{syntax} % 文档类已预置8个定理环境,环境名及对应的定理标题名见小节 \ref{subsec:theorem},如果需要新的定理标题名或定理样式可使用这两个命令。 % \changes{v1.23}{2021/03/12}{重新定义了新定理环境命令 \tn{newtheorem}。} +% \changes{v1.24t}{2021/04/25}{增加定义定理环境命令 \tn{EbNewtheorem}。} % \end{function} % % \begin{optdesc} % \item[\tn{newtheorem}] 定义新的定理类环境,可选参数与 \pkg{thmtools} 宏包定理命令 \tn{declaretheorem} 的参数一致。常用的选项如下 -% \begin{description} -% \item[name] 定理的标题。默认值是环境的名称,并且首字母大写(英文标题)。 -% \item[numbered] 值为 \opt{no}、\opt{yes} 或 \opt{unless unique}。定理将被编号,而不是编号,或者只有在文档中多次出现时才被编号。 -% \item[numberlike] 定理将使用此计数器进行编号,通常这是另一个定理环境的名称。 -% \item[style] 用 \tn{declaretheoremstyle} 定义的定理样式的名称,定理将使用这种样式的设置。 -% \end{description} +% \begin{description} +% \item[name] 定理的标题。默认值是环境的名称,并且首字母大写(英文标题)。 +% \item[numbered] 值为 \opt{no}、\opt{yes} 或 \opt{unless unique}。定理将被编号,而不是编号,或者只有在文档中多次出现时才被编号。 +% \item[numberlike] 定理将使用此计数器进行编号,通常这是另一个定理环境的名称。 +% \item[style] 用 \tn{declaretheoremstyle} 定义的定理样式的名称,定理将使用这种样式的设置。 +% \end{description} +% \item[\tn{EbNewtheorem}] \tn{EbNewtheorem} 是更便捷的定理命令,它定义一个新的定理环境,键值列表支持的选项与 \tn{newtheorem} 相同,但它们的区别有 +% \begin{itemize} +% \item 中英文模式下标题不同,英文标题为可选项,默认为首字母大写的环境名。 +% \item 自动定义交叉引用的格式,引用标签前缀为定理名称。 +% \item 定理盒子选项 \opt{thmbox} 仍然生效,盒子样式选项是用于设置定理盒子样式的名称,它需要 \pkg{tcolorbox} 的 \tn{tcbset} 接口命令设定,默认为 \opt{tc-theorem}。 +% \item 默认使用 \opt{easy-theorem} 定理样式,可在最后一个选项使用 \opt{style} 更改样式。 +% \end{itemize} % \item[\tn{declaretheoremstyle}] 定义新的定理样式,可选参数中除了包括上述定理样式选项,还包括 \tn{newtheorem} 的选项。 % \end{optdesc} % % \subsubsection{新的定理样式} -% 定理由 \pkg{thmtools} 设置,预置定理的样式为 \opt{easy-thm-sty},上述定理样式选项将对这个定理样式生效。如果使用这个样式而只是增加新的定理名称,可以这样 +% 定理由 \pkg{thmtools} 设置,预置定理的样式为 \opt{easy-theorem},上述定理样式选项将对这个定理样式生效。如果使用这个样式而只是增加新的定理名称,可以这样 % \begin{ctexexam} -% \newtheorem[style = easy-thm-sty,name = 定理名]{定理环境名} +% \EbNewtheorem{定理环境名}{中文标题}[style = other theorem] +% \newtheorem[style = easy-theorem,name = 定理名]{定理环境名} % \end{ctexexam} -% 若要给定理环境增加边框,可以如下进行设置 +% \tn{newtheorem} 定义的定理环境需要手动增加盒子边框,可以如下进行设置 % \begin{ctexexam} % \tcolorboxenvironment{定理环境名}{tc-theorem} % \end{ctexexam} @@ -490,7 +501,7 @@ The latest version of this license is in % \changes{v1.21}{2021/01/13}{增加配置页眉页脚的选项。} % \changes{v1.23}{2021/03/08}{优化页眉页脚设置,增加 \opt{chap-mark} 和 \opt{sec-mark} 标志选项。} % \changes{v1.23}{2021/03/14}{可以手动绘制页眉、页脚和脚注的横线。} -% \changes{v1.24s}{2021/04/09}{增加 \opt{subsec-mark} 标志选项,仅在 \opt{article} 模式生效。} +% \changes{v1.24t}{2021/04/09}{增加 \opt{subsec-mark} 标志选项,仅在 \opt{article} 模式生效。} % \end{function} % % \begin{function}[added = 2021-01-13,updated = 2021-03-14]{\easyhead,\easyfoot} @@ -529,7 +540,7 @@ The latest version of this license is in % % \opt{format} 是目录中标题的格式,可以设置字体和加入垂直间距等,垂直间距最好使用无间距重合的 \tn{addvspace} 命令。\opt{indent} 是目录中标题在页面左侧的缩进距离,应该有长度单位。\opt{rule} 选项中一般应当使用 \tn{tocrule} 命令,将会在接下来介绍。\opt{numsep} 是有编号的标题在目录中编号与标题的间距。 % \changes{v1.21}{2021/01/13}{增加配置目录样式的选项。} -% \changes{v1.24s}{2021/04/20}{增加目录中编号与标题的间距选项 \opt{numsep}。} +% \changes{v1.24t}{2021/04/20}{增加目录中编号与标题的间距选项 \opt{numsep}。} % \end{function} % % \begin{function}[added = 2021-01-13,updated = 2021-04-20]{\tocrule,\EbNumberline} @@ -568,22 +579,22 @@ The latest version of this license is in % indent-all = <目录标题左边缩进> % \end{syntax} % \ding{229} 以上选项路径为 \opt{tocset/lists/...} 或 \opt{tocset/...} -% \changes{v1.24s}{2021/04/05}{可以设置图、表和代码目录的标签。} -% \changes{v1.24s}{2021/04/06}{增加目录引导线右边对齐方式。} -% \changes{v1.24s}{2021/04/19}{给目录增加 \opt{hang} 样式选项。} +% \changes{v1.24t}{2021/04/05}{可以设置图、表和代码目录的标签。} +% \changes{v1.24t}{2021/04/06}{增加目录引导线右边对齐方式。} +% \changes{v1.24t}{2021/04/19}{给目录增加 \opt{hang} 样式选项。} % \end{function} % % \begin{optdesc} % \item[lolskip] \opt{lolskip} 是代码目录中章之间的代码标题的距离,与\CTeX 的表格目录和图片目录中章之间的标题距离选项 \opt{lotskip} 和 \opt{lofskip} 类似,它们的值均默认0.8 pc,在 \opt{article} 模式中此选项失效。 % \item[belowoffset] \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)}。 % \item[tocline] 目录标签整体使用 \opt{tocline} 设置,在图表标签的参数中\#1代表编号,代码标签中则是 \tn{thelstlisting} 代表编号,标签中还可包含标签名称,默认标签名称与图、表和代码环境的标题名称一致。下面举个设置标签的例子 -% \begin{ctexexam} -% \tocset -% { -% tocline-fig = 图#1\hspace{\ccwd} -% tocline-lst = 代码\thelstlisting\hspace{\ccwd} -% } -% \end{ctexexam} +% \begin{ctexexam} +% \tocset +% { +% tocline-fig = 图#1\hspace{\ccwd} +% tocline-lst = 代码\thelstlisting\hspace{\ccwd} +% } +% \end{ctexexam} % \item[line-align] \opt{line-align} 选项可以使目录引导线右边对齐并与页码保持一定间隙,否则会与页码连接。 % \item[hang] \opt{hang} 选项使目录标题为悬挂缩进形式,缩进距离为编号及其与标题间距的长度,但此时目录编号会失去超链接。 % \item[numsep-all] 统一设置所有有编号的标题在目录中编号与标题的间距。 @@ -610,7 +621,7 @@ The latest version of this license is in % \tn{end}\marg{环境名} % \end{syntax} % \pkg{enumitem} 宏包为系统预置的列表环境 \env{enumerate}、\env{itemize}和 \env{description} 提供了更灵活的标签以及间距的控制,可使用 \tn{setlist} 命令设置原有的三种列表格式,也可以直接使用可选参数的键值列表,具体选项见 \pkg{enumitem} 宏包文档。已为三种列表预置了三个级别的格式可相互嵌套,默认标签与 \cls{book} 文档类相同,若自定义标签可例如 -% \changes{v1.24s}{2021/04/08}{重新优化列表环境的配置。} +% \changes{v1.24t}{2021/04/08}{重新优化列表环境的配置。} % \end{function} % % \begin{ctexexam} @@ -651,7 +662,7 @@ The latest version of this license is in % \ <定理内容> % \tn{end}\marg{环境名} % \end{syntax} -% 这些是已预置的定理环境,定理环境除了注和证明跟随章编号并可带有边框,盒子边框可使用 \opt{thmset/thmbox = false} 关闭,证明末尾会自动添加证明结束符。环境名对应的定理标题名如下 +% 这些是已预置的定理环境,它们的盒子边框可使用 \opt{thmset/thmbox = false} 关闭,其中注与证明环境不编号,证明末尾会自动添加证明结束符,声明新的定理环境见小节 \ref{subsec:theorem of style}。环境名对应的定理标题名如下 % \begin{center} % \begin{tabular}{*{8}{c}} % \toprule @@ -729,7 +740,7 @@ The latest version of this license is in % \tn{end}\marg{ebparbox} % \end{syntax} % 环境 \env{ebparbox} 与 \env{easybox} 类似,同样带有三个可选参数。当使用星号参数时盒子左边带有一条竖线,\meta{颜色名} 选项可以自定义竖线颜色,使用不带有星号的环境则盒子带有竖线颜色的浅色背景。\meta{段落标题} 选项可以设置标题,默认无标题。 -% \changes{v1.24s}{2021/04/19}{优化盒子环境的选项,增加可带有标题的扁平盒子 \env{ebparbox}。} +% \changes{v1.24t}{2021/04/19}{优化盒子环境的选项,增加可带有标题的扁平盒子 \env{ebparbox}。} % \end{function} % % \subsubsection{行内盒子} @@ -751,7 +762,7 @@ The latest version of this license is in % \ <行间代码> % \tn{end}\marg{lstlisting} % \end{syntax} -% 加载 \pkg{listings} 宏包以对代码格式进行高度定制,代码样式可使用 \tn{lstset} 命令设置。\opt{lstlistlistingname} 和 \opt{lstlistingname} 分别是代码目录名与代码环境标题名,与\CTeX 使用手册中标题汉化一节用法相同,可使用 \tn{ctexset} 直接定义。 +% 加载 \pkg{listings} 宏包以对代码格式进行高度定制,代码样式可使用 \tn{lstset} 命令设置,预置的代码样式名为 \opt{easy-listings}。\opt{lstlistlistingname} 和 \opt{lstlistingname} 分别是代码目录名与代码环境标题名,与\CTeX 使用手册中标题汉化一节用法相同,可使用 \tn{ctexset} 直接定义。 % \end{function} % % \subsection{物理量} @@ -788,7 +799,7 @@ The latest version of this license is in % \tn{labelformat}\marg{计数器}\marg{标签引用格式} % \end{syntax} % 使用 \tn{ref} 命令进行引用将会自动检测环境并添加相应的前缀,\tn{labelformat} 可以设置标签引用格式,第二个参数中\#1代表 \tn{the}\meta{计数器},可以设置引用序号的前缀和后缀。 -% \changes{v1.24s}{2021/04/11}{取消载入 \pkg{cleveref} 宏包来交叉引用。} +% \changes{v1.24t}{2021/04/11}{取消载入 \pkg{cleveref} 宏包来交叉引用。} % \end{function} % % \subsubsection{索引} @@ -898,7 +909,7 @@ The latest version of this license is in %<*class> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e,etoolbox} -\ProvidesExplClass{easybook}{2021/04/23}{1.24s}{beta} +\ProvidesExplClass{easybook}{2021/04/25}{1.24t}{beta} \cs_generate_variant:Nn \__ctex_define:nn {nx} \cs_generate_variant:Nn \int_to_arabic:n {v} @@ -1550,30 +1561,27 @@ The latest version of this license is in figure = \eb@labelname@lof, table = \eb@labelname@lot } -\ctex_at_end_preamble:n +\cs_gset:Npn \caption@@@addcontentsline#1#2#3#4 { - \cs_gset:Npn \caption@@@addcontentsline#1#2#3#4 + \addcontentsline{#1}{#2} { - \addcontentsline{#1}{#2} - { - \ifodd\eb@titletoc@hang@fix - \protect\numberline - \fi - {\prop_item:Nn \l__eb_label_name_prop{#2}{#3}}{#4} - } + \ifodd\eb@titletoc@hang@fix + \protect\numberline + \fi + {\prop_item:Nn \l__eb_label_name_prop{#2}{#3}}{#4} } - \ctex_patch_cmd:Nnn \lst@MakeCaption + } +\ctex_patch_cmd:Nnn \lst@MakeCaption + { + \addcontentsline{lol}{lstlisting} + {\protect\numberline{\thelstlisting}\lst@@caption} + }{ + \addcontentsline{lol}{lstlisting} { - \addcontentsline{lol}{lstlisting} - {\protect\numberline{\thelstlisting}\lst@@caption} - }{ - \addcontentsline{lol}{lstlisting} - { - \ifodd\eb@titletoc@hang@fix - \protect\numberline - \fi - {\eb@labelname@lol}\lst@@caption - } + \ifodd\eb@titletoc@hang@fix + \protect\numberline + \fi + {\eb@labelname@lol}\lst@@caption } } @@ -1958,17 +1966,25 @@ The latest version of this license is in {\tl_const:cn {c__eb_name_#1_tl}{#3}} {\tl_const:cn {c__eb_name_#1_tl}{#2}} } -\clist_map_inline:nn +\NewDocumentCommand{\EbNewtheorem} + {mO{\text_titlecase_first:n {#1}}mD(){tc-theorem}O{}} { - {proposition}{Proposition}{性质}, - {definition}{Definition}{定义}, - {corollary}{Corollary}{推论}, - {exercise}{Exercise}{练习}, - {theorem}{Theorem}{定理}, - {example}{Example}{例}, - {remark}{Remark}{注}, - {lemma}{Lemma}{引理} - }{\__eb_thmname_set:nnn #1} + \ctex_at_end_preamble:n + { + \__eb_thmname_set:nnn {#1}{#2}{#3} + \exp_args:No \declaretheorem@i + { + name = \use:c {c__eb_name_#1_tl}, + style = easy-theorem,#5 + }{#1}[] + \bool_if:NT \l__eb_thmbox_bool + { + \@ifpackageloaded{tcolorbox} + {\tcolorboxenvironment{#1}{#4}}{} + } + \labelformat{#1}{\use:c {c__eb_name_#1_tl}~##1} + } + } \bool_new:N \l__eb_thmbox_bool \tl_new:N \l__eb_thm_numberwith_tl @@ -2021,32 +2037,23 @@ The latest version of this license is in headformat = \NAME\space\NUMBER\NOTE ] } -\ctex_at_end_preamble:n +\__eb_at_end_preamble:n { - \exp_args:NNc \exp_after:wN - \declaretheoremstyle{c__eb_thmtools_keyval_tl}{easy-thm-sty} + \exp_last_unbraced:No + \declaretheoremstyle\c__eb_thmtools_keyval_tl{easy-theorem} + \__eb_thmname_set:nnn {exercise}{Exercise}{练习} + \cs_undefine:N \proof \clist_map_inline:nn { - example,definition,theorem, - proposition,lemma,corollary - }{ - \declaretheorem[ - style = easy-thm-sty, - name = \use:c {c__eb_name_#1_tl} - ]{#1} - } - \cs_undefine:N \proof - \declaretheorem[ - style = easy-thm-sty, - name = \c__eb_name_remark_tl, - numbered = no - ]{remark} - \declaretheorem[ - style = easy-thm-sty, - name = \proofname, - numbered = no, - qed = \qedsymbol - ]{proof} + {lemma}{引理}, + {example}{例}, + {theorem}{定理}, + {corollary}{推论}, + {definition}{定义}, + {proposition}{性质}, + {remark}{注}[numbered = no], + {{proof}{证明}[numbered = no,qed = \qedsymbol]} + }{\EbNewtheorem#1} } \ctex_at_end_package:nn {tasks} @@ -2085,7 +2092,10 @@ The latest version of this license is in \cs_new_protected:Npn \l__eb_math_restore:n #1 { \AtBeginEnvironment{#1} - {\linespread{\fp_use:N \l__eb_spread_math_fp}\selectfont\ignorespaces} + { + \linespread{\fp_use:N \l__eb_spread_math_fp} + \selectfont\ignorespaces + } } \clist_map_inline:nn { @@ -2200,7 +2210,7 @@ The latest version of this license is in {frame~hidden,boxrule = 0pt,toptitle = 8pt,top = 0pt}, IfValueT = {#3}{title = #3}, colback = #2,colbacktitle = #2, - opacityback = 0.1,opacitybacktitle = 0.1, + opacityback = 0.12,opacitybacktitle = 0.12, coltitle = black,colframe = black, left = 6pt,right = 6pt,bottom = 8pt,middle= 8pt, bottomtitle = 8pt, @@ -2221,7 +2231,7 @@ The latest version of this license is in top = 0pt,bottom = 0pt,toptitle = 0pt }{ colback = #2,colbacktitle = #2, - opacityback = 0.1,opacitybacktitle = 0.1, + opacityback = 0.12,opacitybacktitle = 0.12, IfValueTF = {#3}{title = #3,top = 0pt}{top = 8pt}, bottom = 8pt,toptitle = 8pt }, @@ -2244,21 +2254,6 @@ The latest version of this license is in colback = #1,opacityback = 0.12,colframe = #1,#3 }{#2} } -\ctex_at_end_preamble:n - { - \bool_if:NT \l__eb_thmbox_bool - { - \@ifpackageloaded{tcolorbox} - { - \tcolorboxenvironment{theorem}{tc-theorem} - \tcolorboxenvironment{definition}{tc-theorem} - \tcolorboxenvironment{lemma}{tc-theorem} - \tcolorboxenvironment{corollary}{tc-theorem} - \tcolorboxenvironment{proposition}{tc-theorem} - \tcolorboxenvironment{example}{tc-theorem} - }{} - } - } \bool_set_true:N \l__eb_backend_bibtex_bool \tl_new:N \l__eb_bib_style_tl @@ -2390,20 +2385,22 @@ The latest version of this license is in \__eb_patch_cmd:Nnn \@footnotetext {\reset@font} { - \def\baselinestretch{\fp_use:N \l__eb_spread_footnote_fp} + \linespread{\fp_use:N \l__eb_spread_footnote_fp} + \selectfont\ignorespaces \l__eb_font_footnote_tl } \__eb_patch_cmd:Nnn \@mpfootnotetext {\reset@font} { - \def\baselinestretch{\fp_use:N \l__eb_spread_footnote_fp} + \linespread{\fp_use:N \l__eb_spread_footnote_fp} + \selectfont\ignorespaces \l__eb_font_footnote_tl } \__eb_patch_cmd:Nnn \@makefnmark {\normalfont}{\l__eb_font_footnote_tl} \cs_gset:Npn \thempfootnote{\int_to_alph:n {\c@mpfootnote}} -\lstdefinestyle{easy-lst-sty} +\lstdefinestyle{easy-listings} { language = [LaTeX]TeX, texcsstyle = @@ -2448,7 +2445,7 @@ The latest version of this license is in } \lstset { - style = easy-lst-sty, + style = easy-listings, breaklines = true, resetmargins = true, % numbers = left, @@ -2577,6 +2574,8 @@ The latest version of this license is in \exp_args:NV \hypersetup\l__eb_hyperref_clist \labelformat{part}{\CTEXthepart} \labelformat{chapter}{\CTEXthechapter} + \labelformat{figure}{\figurename~#1} + \labelformat{table}{\tablename~#1} \tl_if_eq:NnTF \l__ctex_scheme_tl{chinese} { \keys_set_known:nn {ctex} @@ -2593,16 +2592,8 @@ The latest version of this license is in \labelformat{align}{式(#1)} \labelformat{multline}{式(#1)} \labelformat{gather}{式(#1)} - \labelformat{figure}{图#1} - \labelformat{table}{表#1} \labelformat{section}{节#1} \labelformat{subsection}{小节#1} - \labelformat{theorem}{定理#1} - \labelformat{definition}{定义#1} - \labelformat{lemma}{引理#1} - \labelformat{corollary}{推论#1} - \labelformat{proposition}{性质#1} - \labelformat{example}{例#1} }{ \keys_set_known:nn {ctex} { @@ -2614,16 +2605,8 @@ The latest version of this license is in \labelformat{align}{Equation~(#1)} \labelformat{multline}{Equation~(#1)} \labelformat{gather}{Equation~(#1)} - \labelformat{figure}{Figure~#1} - \labelformat{table}{Table~#1} \labelformat{section}{Section~#1} \labelformat{subsection}{Subsection~#1} - \labelformat{theorem}{Theorem~#1} - \labelformat{definition}{Definition~#1} - \labelformat{lemma}{Lemma~#1} - \labelformat{corollary}{Corollary~#1} - \labelformat{proposition}{Proposition~#1} - \labelformat{example}{Example~#1} } } diff --git a/Master/texmf-dist/tex/latex/easybook/easybook.cls b/Master/texmf-dist/tex/latex/easybook/easybook.cls index d1a9a4f2c68..519d1f72d66 100644 --- a/Master/texmf-dist/tex/latex/easybook/easybook.cls +++ b/Master/texmf-dist/tex/latex/easybook/easybook.cls @@ -13,7 +13,7 @@ %% https://creativecommons.org/licenses/by/4.0/legalcode \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e,etoolbox} -\ProvidesExplClass{easybook}{2021/04/23}{1.24s}{beta} +\ProvidesExplClass{easybook}{2021/04/25}{1.24t}{beta} \cs_generate_variant:Nn \__ctex_define:nn {nx} \cs_generate_variant:Nn \int_to_arabic:n {v} @@ -665,30 +665,27 @@ figure = \eb@labelname@lof, table = \eb@labelname@lot } -\ctex_at_end_preamble:n +\cs_gset:Npn \caption@@@addcontentsline#1#2#3#4 { - \cs_gset:Npn \caption@@@addcontentsline#1#2#3#4 + \addcontentsline{#1}{#2} { - \addcontentsline{#1}{#2} - { - \ifodd\eb@titletoc@hang@fix - \protect\numberline - \fi - {\prop_item:Nn \l__eb_label_name_prop{#2}{#3}}{#4} - } + \ifodd\eb@titletoc@hang@fix + \protect\numberline + \fi + {\prop_item:Nn \l__eb_label_name_prop{#2}{#3}}{#4} } - \ctex_patch_cmd:Nnn \lst@MakeCaption + } +\ctex_patch_cmd:Nnn \lst@MakeCaption + { + \addcontentsline{lol}{lstlisting} + {\protect\numberline{\thelstlisting}\lst@@caption} + }{ + \addcontentsline{lol}{lstlisting} { - \addcontentsline{lol}{lstlisting} - {\protect\numberline{\thelstlisting}\lst@@caption} - }{ - \addcontentsline{lol}{lstlisting} - { - \ifodd\eb@titletoc@hang@fix - \protect\numberline - \fi - {\eb@labelname@lol}\lst@@caption - } + \ifodd\eb@titletoc@hang@fix + \protect\numberline + \fi + {\eb@labelname@lol}\lst@@caption } } @@ -1073,17 +1070,25 @@ {\tl_const:cn {c__eb_name_#1_tl}{#3}} {\tl_const:cn {c__eb_name_#1_tl}{#2}} } -\clist_map_inline:nn +\NewDocumentCommand{\EbNewtheorem} + {mO{\text_titlecase_first:n {#1}}mD(){tc-theorem}O{}} { - {proposition}{Proposition}{性质}, - {definition}{Definition}{定义}, - {corollary}{Corollary}{推论}, - {exercise}{Exercise}{练习}, - {theorem}{Theorem}{定理}, - {example}{Example}{例}, - {remark}{Remark}{注}, - {lemma}{Lemma}{引理} - }{\__eb_thmname_set:nnn #1} + \ctex_at_end_preamble:n + { + \__eb_thmname_set:nnn {#1}{#2}{#3} + \exp_args:No \declaretheorem@i + { + name = \use:c {c__eb_name_#1_tl}, + style = easy-theorem,#5 + }{#1}[] + \bool_if:NT \l__eb_thmbox_bool + { + \@ifpackageloaded{tcolorbox} + {\tcolorboxenvironment{#1}{#4}}{} + } + \labelformat{#1}{\use:c {c__eb_name_#1_tl}~##1} + } + } \bool_new:N \l__eb_thmbox_bool \tl_new:N \l__eb_thm_numberwith_tl @@ -1136,32 +1141,23 @@ headformat = \NAME\space\NUMBER\NOTE ] } -\ctex_at_end_preamble:n +\__eb_at_end_preamble:n { - \exp_args:NNc \exp_after:wN - \declaretheoremstyle{c__eb_thmtools_keyval_tl}{easy-thm-sty} + \exp_last_unbraced:No + \declaretheoremstyle\c__eb_thmtools_keyval_tl{easy-theorem} + \__eb_thmname_set:nnn {exercise}{Exercise}{练习} + \cs_undefine:N \proof \clist_map_inline:nn { - example,definition,theorem, - proposition,lemma,corollary - }{ - \declaretheorem[ - style = easy-thm-sty, - name = \use:c {c__eb_name_#1_tl} - ]{#1} - } - \cs_undefine:N \proof - \declaretheorem[ - style = easy-thm-sty, - name = \c__eb_name_remark_tl, - numbered = no - ]{remark} - \declaretheorem[ - style = easy-thm-sty, - name = \proofname, - numbered = no, - qed = \qedsymbol - ]{proof} + {lemma}{引理}, + {example}{例}, + {theorem}{定理}, + {corollary}{推论}, + {definition}{定义}, + {proposition}{性质}, + {remark}{注}[numbered = no], + {{proof}{证明}[numbered = no,qed = \qedsymbol]} + }{\EbNewtheorem#1} } \ctex_at_end_package:nn {tasks} @@ -1200,7 +1196,10 @@ \cs_new_protected:Npn \l__eb_math_restore:n #1 { \AtBeginEnvironment{#1} - {\linespread{\fp_use:N \l__eb_spread_math_fp}\selectfont\ignorespaces} + { + \linespread{\fp_use:N \l__eb_spread_math_fp} + \selectfont\ignorespaces + } } \clist_map_inline:nn { @@ -1315,7 +1314,7 @@ {frame~hidden,boxrule = 0pt,toptitle = 8pt,top = 0pt}, IfValueT = {#3}{title = #3}, colback = #2,colbacktitle = #2, - opacityback = 0.1,opacitybacktitle = 0.1, + opacityback = 0.12,opacitybacktitle = 0.12, coltitle = black,colframe = black, left = 6pt,right = 6pt,bottom = 8pt,middle= 8pt, bottomtitle = 8pt, @@ -1336,7 +1335,7 @@ top = 0pt,bottom = 0pt,toptitle = 0pt }{ colback = #2,colbacktitle = #2, - opacityback = 0.1,opacitybacktitle = 0.1, + opacityback = 0.12,opacitybacktitle = 0.12, IfValueTF = {#3}{title = #3,top = 0pt}{top = 8pt}, bottom = 8pt,toptitle = 8pt }, @@ -1359,21 +1358,6 @@ colback = #1,opacityback = 0.12,colframe = #1,#3 }{#2} } -\ctex_at_end_preamble:n - { - \bool_if:NT \l__eb_thmbox_bool - { - \@ifpackageloaded{tcolorbox} - { - \tcolorboxenvironment{theorem}{tc-theorem} - \tcolorboxenvironment{definition}{tc-theorem} - \tcolorboxenvironment{lemma}{tc-theorem} - \tcolorboxenvironment{corollary}{tc-theorem} - \tcolorboxenvironment{proposition}{tc-theorem} - \tcolorboxenvironment{example}{tc-theorem} - }{} - } - } \bool_set_true:N \l__eb_backend_bibtex_bool \tl_new:N \l__eb_bib_style_tl @@ -1505,20 +1489,22 @@ \__eb_patch_cmd:Nnn \@footnotetext {\reset@font} { - \def\baselinestretch{\fp_use:N \l__eb_spread_footnote_fp} + \linespread{\fp_use:N \l__eb_spread_footnote_fp} + \selectfont\ignorespaces \l__eb_font_footnote_tl } \__eb_patch_cmd:Nnn \@mpfootnotetext {\reset@font} { - \def\baselinestretch{\fp_use:N \l__eb_spread_footnote_fp} + \linespread{\fp_use:N \l__eb_spread_footnote_fp} + \selectfont\ignorespaces \l__eb_font_footnote_tl } \__eb_patch_cmd:Nnn \@makefnmark {\normalfont}{\l__eb_font_footnote_tl} \cs_gset:Npn \thempfootnote{\int_to_alph:n {\c@mpfootnote}} -\lstdefinestyle{easy-lst-sty} +\lstdefinestyle{easy-listings} { language = [LaTeX]TeX, texcsstyle = @@ -1563,7 +1549,7 @@ } \lstset { - style = easy-lst-sty, + style = easy-listings, breaklines = true, resetmargins = true, % numbers = left, @@ -1692,6 +1678,8 @@ \exp_args:NV \hypersetup\l__eb_hyperref_clist \labelformat{part}{\CTEXthepart} \labelformat{chapter}{\CTEXthechapter} + \labelformat{figure}{\figurename~#1} + \labelformat{table}{\tablename~#1} \tl_if_eq:NnTF \l__ctex_scheme_tl{chinese} { \keys_set_known:nn {ctex} @@ -1708,16 +1696,8 @@ \labelformat{align}{式(#1)} \labelformat{multline}{式(#1)} \labelformat{gather}{式(#1)} - \labelformat{figure}{图#1} - \labelformat{table}{表#1} \labelformat{section}{节#1} \labelformat{subsection}{小节#1} - \labelformat{theorem}{定理#1} - \labelformat{definition}{定义#1} - \labelformat{lemma}{引理#1} - \labelformat{corollary}{推论#1} - \labelformat{proposition}{性质#1} - \labelformat{example}{例#1} }{ \keys_set_known:nn {ctex} { @@ -1729,16 +1709,8 @@ \labelformat{align}{Equation~(#1)} \labelformat{multline}{Equation~(#1)} \labelformat{gather}{Equation~(#1)} - \labelformat{figure}{Figure~#1} - \labelformat{table}{Table~#1} \labelformat{section}{Section~#1} \labelformat{subsection}{Subsection~#1} - \labelformat{theorem}{Theorem~#1} - \labelformat{definition}{Definition~#1} - \labelformat{lemma}{Lemma~#1} - \labelformat{corollary}{Corollary~#1} - \labelformat{proposition}{Proposition~#1} - \labelformat{example}{Example~#1} } } |