summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/easybook
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/easybook')
-rw-r--r--macros/latex/contrib/easybook/easybook.dtx101
-rw-r--r--macros/latex/contrib/easybook/easybook.pdfbin581908 -> 581906 bytes
-rw-r--r--macros/latex/contrib/easybook/easybook.tex52
3 files changed, 81 insertions, 72 deletions
diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx
index fb8203e55f..659bc9e1e8 100644
--- a/macros/latex/contrib/easybook/easybook.dtx
+++ b/macros/latex/contrib/easybook/easybook.dtx
@@ -15,7 +15,7 @@
%<*class>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e}
-\ProvidesExplClass{easybook}{2021/10/25}{1.40H}
+\ProvidesExplClass{easybook}{2021/10/30}{1.40I}
{Typeset Chinese theses or books}
\bool_set_false:N \l__eb_compile_draft_bool
@@ -325,7 +325,7 @@
%<*package>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e,etoolbox}
-\ProvidesExplPackage{easybase}{2021/10/25}{1.40H}
+\ProvidesExplPackage{easybase}{2021/10/30}{1.40I}
{Typeset Chinese theses or books}
\cs_generate_variant:Nn \dim_set:Nn { NV }
@@ -2302,49 +2302,6 @@
{ color } { theme }
}
{ \eb_color_assign_cmd_set:nn #1 }
-
-\bool_set_false:N \l__eb_toc_number_color_bool
-\ctex_define:nn { refset }
- {
- linktype .choice:,
- linktype .value_required:n = true,
- linktype/edge .code:n =
- { \AtBeginDocument[hyperref]{\tl_set:Nn \@pdfborder { 0~0~1 }} },
- linktype/none .code:n =
- { \AtBeginDocument[hyperref]{\tl_set:Nn \@pdfborder { 0~0~0 }} },
- linktype/colors .code:n =
- {
- \bool_set_true:N \l__eb_toc_number_color_bool
- \colorlet{ctex@toc@number}{ctex@link}
- \eb_put_hyperref:n { colorlinks }
- },
- linktype/various .meta:n = linktype/colors,
- linktype .initial:n = edge,
-
- linktoc .choice:,
- linktoc/unknown .code:n =
- {
- \eb_put_hyperref:n { linktoc = #1 }
- \eb_clist_map_inline:nn { page,none }
- {
- \tl_if_eq:NnT \l_keys_value_tl {##1}
- {
- \colorlet{ctex@toc@number}{black}
- \seq_map_break:
- }
- }
- },
- linktoc .default:n = all,
- linktoc .initial:n = all,
- unknown .code:n =
- {
- \eb_put_hyperref:x
- {
- \l_keys_key_str
- \tl_if_empty:NF \l_keys_value_tl { = {#1} }
- }
- }
- }
\ctex_define:nx { refset }
{
linkcolor .choice:,
@@ -2378,6 +2335,58 @@
{ \eb_define_theme_color:n { \exp_not:n {#1} } }
}
+\bool_set_false:N \l__eb_toc_number_color_bool
+\cs_new_protected:Npn \eb_link_border_set:n #1
+ {
+ \AtBeginDocument
+ {
+ \def\@pdfborder{#1}
+ \def\Hy@colorlink ##1 {\begingroup}
+ \def\Hy@endcolorlink{\endgroup}
+ }
+ }
+\cs_new_protected:Npn \eb_link_colors_set:
+ {
+ \bool_set_true:N \l__eb_toc_number_color_bool
+ \colorlet{ctex@toc@number}{ctex@link}
+ \eb_put_hyperref:n { colorlinks }
+ }
+\cs_new_protected:Npn \eb_link_toc_put:n #1
+ {
+ \eb_put_hyperref:n { linktoc = #1 }
+ \eb_clist_map_inline:nn { page,none }
+ {
+ \tl_if_eq:NnT \l_keys_value_tl {##1}
+ {
+ \colorlet{ctex@toc@number}{black}
+ \seq_map_break:
+ }
+ }
+ }
+\ctex_define:nn { refset }
+ {
+ linktype .choice:,
+ linktype .value_required:n = true,
+ linktype/edge .code:n = \eb_link_border_set:n { 0~0~1 },
+ linktype/none .code:n = \eb_link_border_set:n { 0~0~0 },
+ linktype/colors .code:n = \eb_link_colors_set:,
+ linktype/various .meta:n = linktype/colors,
+ linktype .initial:n = edge,
+
+ linktoc .choice:,
+ linktoc/unknown .code:n = \eb_link_toc_put:n {#1},
+ linktoc .default:n = all,
+ linktoc .initial:n = all,
+ unknown .code:n =
+ {
+ \eb_put_hyperref:x
+ {
+ \l_keys_key_str
+ \tl_if_empty:NF \l_keys_value_tl { = {#1} }
+ }
+ }
+ }
+
\cs_new:Npn \eb_allow_url_break:
{
\eb_appto_cmd:Nn \UrlBreaks
@@ -2445,7 +2454,7 @@
}
%</package>
%<*tcolorbox>
-\ProvidesExplFile{eb-tcolorbox.cfg}{2021/10/25}{1.40H}
+\ProvidesExplFile{eb-tcolorbox.cfg}{2021/10/30}{1.40I}
{Customization of tcolorbox for easybook}
\tl_gset:Nn \eb@tc@line@skip { 0.5\baselineskip }
diff --git a/macros/latex/contrib/easybook/easybook.pdf b/macros/latex/contrib/easybook/easybook.pdf
index c0fe946ad0..43e2e4af1f 100644
--- a/macros/latex/contrib/easybook/easybook.pdf
+++ b/macros/latex/contrib/easybook/easybook.pdf
Binary files differ
diff --git a/macros/latex/contrib/easybook/easybook.tex b/macros/latex/contrib/easybook/easybook.tex
index a97dfc7c4b..abea3e943a 100644
--- a/macros/latex/contrib/easybook/easybook.tex
+++ b/macros/latex/contrib/easybook/easybook.tex
@@ -20,8 +20,8 @@
name = easybook,
color-scheme = blue,
title = EASYBOOK 使用手册,
- version = v1.40H,
- date = 2021/10/28,
+ version = v1.40I,
+ date = 2021/10/30,
authors = 瞿毅,
info = 排版简体中文学位论文和书籍,
email = q1jx@foxmail.com,
@@ -49,8 +49,6 @@
\setcounter{tocdepth}{2}
\ExplSyntaxOn\makeatletter
-\NewDocumentCommand{\passto}{smm}
- {\IfBooleanF{#1}{\color{Blue}}#3\ifblank{#2}{}{\ttfamily[#2]}}
\newcommand{\splitmeta}[2][\code{,}]
{
\clist_clear:N \l_tmpa_clist
@@ -77,9 +75,19 @@
\newsplitarg{\splitmarg}{\{}{\}}
\newcommand{\spemmeta}{\splitmeta[\code{|}]}
\newsplitarg[\spemmeta]{\spemcoarg}{[}{]}
-\renewcommand{\cnltx@package@abstract@width}{0.85\linewidth}
-\newcommand{\noitemsep}{\setlength{\itemsep}{0ex}}
+\NewDocumentCommand{\passto}{smm}
+ {\IfBooleanF{#1}{\color{Blue}}#3\ifblank{#2}{}{\ttfamily[#2]}}
+\newcommand{\insertblr}[2]
+ {
+ \begin{center}
+ \begin{tblr}{#1}
+ #2
+ \end{tblr}
+ \end{center}
+ }
\newcommand{\black}[1]{\textcolor{black}{#1}}
+\newcommand{\noitemsep}{\setlength{\itemsep}{0ex}}
+\renewcommand{\cnltx@package@abstract@width}{0.85\linewidth}
\renewcommand{\cmltx@list@setup}
{
\setlength{\leftmargin}{0em}
@@ -177,21 +185,19 @@
\subsection{依赖宏包}
以下为 \pkg*{easybase} 直接调用的关键宏包清单。灰色的宏包表示并未调用它们,但做了一些预配置,可在导言区手动载入以实现相关的功能。
-\begin{center}
- \begin{tblr}
+\insertblr
{
colspec = @{}*{5}{c}@{},
hline{1,6} = {1pt,Blue},
cells = {cmd = \pkg*},
cell{5}{2-5} = {font = \color{gray}}
- }
+ }{
ctex & spbmark & ulem & enumitem & etoolbox \\
siunitx & pifont & amsthm & thmtools & marginnote \\
pdfpages & multicol & fancyhdr & titletoc & tabularray \\
setspace & listings & chemformula & geometry & caption \\
hyperref & bicaption & imakeidx & mathtools & tcolorbox
- \end{tblr}
-\end{center}
+ }
\section{文档类选项}
\label{sec:document class options}
@@ -231,15 +237,14 @@
\begin{options}
\keychoice{font}{noto,garamond,times,times*,libertine,palatino,auto}\Default{auto}
预置的英文字体相关配置方案如下表所示,这些字体已经包含在了 \TeX Live 发行版中,所以通常不需要再专门安装。如果您想使用其他英文字体,可以使用 \pkg*{fontspec} 宏包的相关命令进行设置。
- \begin{center}
- \begin{tblr}
+ \insertblr
{
colspec = @{}*{4}{c}@{},
hline{1,8} = {1pt,Blue},
hline{2} = {0.6pt,Blue},
row{1} = {font = \sffamily},
column{1} = {cmd = \code}
- }
+ }{
& 正文字体 & 无衬线字体 & 等宽字体 \\
noto & Noto Serif & Noto Sans & Noto Sans Mono \\
garamond & EB Garamond & Libertinus Sans & LM Mono \\
@@ -247,8 +252,7 @@
libertine & Libertinus Serif & Libertinus Sans & LM Mono \\
times & XITS & TG Heros & TG Cursor \\
times* & Times New Roman & Arial & Courier New
- \end{tblr}
- \end{center}
+ }
\end{options}
\subsection{数学字体}
@@ -357,21 +361,19 @@
\begin{commands}
\command*{ctexset}[\marg{键值列表}]
\cls*{easybook} 扩展了 C\TeX 宏集 \hologo{LaTeX3} 风格键值的通用控制命令 \cs*{ctexset},接口选项同样可用它设置, 原有的 \meta{键值列表} 仍然可用。本文档类目前有 9 个模块用于实现常规的排版功能,如下表所示,它们既是统一接口 \cs*{ctexset} 的路径,也是相关模块的接口命令名:
- \begin{center}
- \begin{tblr}
+ \insertblr
{
colspec = @{}*{5}{c}@{},
hline{1,5} = {1pt,Blue},
hline{3} = {0.6pt,Blue},
row{1,3} = {font = \sffamily,belowsep = 0pt},
row{2,4} = {cmd = \module*}
- }
+ }{
\hyperref[subsec:style]{风格} & \hyperref[subsec:other font]{其它字体} & \hyperref[subsec:spacing]{行距} & \hyperref[subsec:hyperlinks]{超链接} & \hyperref[subsec:reference]{参考文献} \\
style & subfont & spread & refset & bibset \\
\hyperref[subsec:theorem of style]{定理样式} & \hyperref[subsec:page margins]{页面尺寸} & \hyperref[subsec:header and footer]{页眉页脚} & \hyperref[subsec:catalog style]{目录样式} & \\
thmset & geoset & hdrset & tocset &
- \end{tblr}
- \end{center}
+ }
例如使用下面小节 \ref{subsec:style} 介绍的风格 \module*{style} 模块,路径名与所属下级选项之间可以 \code{/} 或 \code{=} 号分开,斜线 \code{/} 后不能有空格或者换行:
\begin{ctexexam}
@@ -907,19 +909,17 @@
\environment{remark}\default{}
\environment{proof}
这些是预置的定理环境,可使用选项 \option{thmframe} 为它们添加盒子边框,其中注与证明环境不编号,证明末尾会自动添加证明结束符,声明新的定理环境或更改定理盒子样式见小节 \ref{subsec:theorem of style}。环境名与之对应的定理名如下:
- \begin{center}
- \begin{tblr}
+ \insertblr
{
colspec = @{}*{8}{c}@{},
hline{1,3} = {1pt,Blue},
hline{2} = {0.6pt,Blue},
row{1} = {font = \sffamily},
row{2} = {cmd = \env}
- }
+ }{
定理 & 定义 & 引理 & 推论& 性质 & 例 & 注 & 证明 \\
theorem & definition & lemma & corollary & proposition & example & remark & proof
- \end{tblr}
- \end{center}
+ }
\end{environments}
\subsection{悬挂缩进}