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.dtx145
-rw-r--r--macros/latex/contrib/easybook/easybook.pdfbin577839 -> 579388 bytes
-rw-r--r--macros/latex/contrib/easybook/easybook.tex31
3 files changed, 121 insertions, 55 deletions
diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx
index a7d77a29ae..eed7155bee 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/18}{1.3O}
+\ProvidesExplClass{easybook}{2021/10/18}{1.3P}
{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/18}{1.3O}
+\ProvidesExplPackage{easybase}{2021/10/18}{1.3P}
{Typeset Chinese theses or books}
\cs_generate_variant:Nn \dim_set:Nn { NV }
@@ -868,7 +868,28 @@
{ \tl_set:Nn \l__eb_footnote_choice_tl {#1} }
}
}
+\cs_new_protected:Npn \eb_fn_shift_set:nnn #1#2#3
+ {
+ \str_if_eq:nnTF {#1} { match }
+ {
+ \tl_set:cv { l__eb_fn#2_#3shift_tl }
+ { l__spb_super_script_#3shift_dim }
+ }
+ { \tl_set:cn { l__eb_fn#2_#3shift_tl } {#1} }
+ }
+\cs_new_protected:Npn \eb_fn_format_set:nn #1#2
+ {
+ \str_if_eq:nnTF {#1} { match }
+ { \bool_set_true:c { l__eb_fn#2_format_match_bool } }
+ {
+ \bool_set_false:c { l__eb_fn#2_format_match_bool }
+ \tl_set:cn { l__eb_fn#2_format_tl } {#1}
+ }
+ }
+
\bool_new:N \l__eb_fnpara_bottom_bool
+\tl_new:N \l__eb_fnmate_format_tl
+\tl_new:N \l__eb_fncust_format_tl
\clist_new:N \l__eb_footnote_mulchoice_clist
\ctex_define:nn { hdrset }
{
@@ -880,14 +901,14 @@
fnparindent .initial:n = 2em,
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,
+ fntext-pos .tl_set:N = \l__eb_fntext_position_tl,
+ fntext-pos .initial:n = super,
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 },
+ { ,\tl_if_eq:NnF \l__eb_fntext_position_tl { super } { \space } },
+ fnmate-form .code:n = \eb_fn_format_set:nn {#1} { mate },
+ fncust-form .code:n = \eb_fn_format_set:nn {#1} { cust },
+ fnboth-form .meta:n = { fnmate-form = #1,fncust-form = #1 },
footnotetype .multichoices:nn =
{ default,hang,bottom,para,flush }
@@ -895,6 +916,13 @@
footnotetype .value_required:n = true,
footnotetype .initial:n = hang,
+ fnmark-vshift .code:n = \eb_fn_shift_set:nnn {#1} { mark } { v },
+ fnmark-hshift .code:n = \eb_fn_shift_set:nnn {#1} { mark } { h },
+ fntext-vshift .code:n = \eb_fn_shift_set:nnn {#1} { text } { v },
+ fnmark-vshift .initial:n = 0pt,
+ fnmark-hshift .initial:n = 0pt,
+ fntext-vshift .initial:n = 0pt,
+
fnmark-num .choices:nn =
{ plain,pifont,pifont*,pifont-sans,pifont-sans* }
{ \eb_fnmark_normal_label_set:nn {#1} { the@footnote } },
@@ -968,6 +996,7 @@
}
}
}
+
\cs_new_protected:Npn \eb_footnote_direct_hang:
{
\hbox_set:Nn \l_tmpa_box
@@ -1028,15 +1057,7 @@
\@ifpackagewith{footmisc}{hang}
{\cs_set_eq:NN \@makefntext \eb@makefntext}{}
}
-\eb_at_end_patch_cmd:nnn { \@footnotetext,\@mpfootnotetext }
- { \reset@font }
- {
- \linespread{\fp_use:N \l__eb_spread_footnote_fp}
- \selectfont\ignorespaces
- \l__eb_subfont_footnote_tl
- }
-\ProvideDocumentCommand{\super}{d()mo}{\textsuperscript{#2}}
-\providecommand{\spbset}{\use_none:n}
+
\cs_set_protected:Npn \footref #1
{
\group_begin:
@@ -1067,6 +1088,13 @@
\@footnotemark
}
}
+\eb_at_end_patch_cmd:nnn { \@footnotetext,\@mpfootnotetext }
+ { \reset@font }
+ {
+ \linespread{\fp_use:N \l__eb_spread_footnote_fp}
+ \selectfont\ignorespaces
+ \l__eb_subfont_footnote_tl
+ }
\ctex_at_end_package:nn { hyperref }
{
\cs_set:Npn \@xfootnotemark [#1]
@@ -1078,22 +1106,45 @@
\H@@footnotemark
}
}
+
+\ProvideDocumentCommand{\super}{od()mo}{\textsuperscript{#3}}
+\providecommand{\spbset}{\use_none:n}
\NewDocumentCommand{\eb@fnmark@super}{sm}
{
\IfBooleanTF{#1}
- {\super{#2}[0pt]}
- {\super(\l__eb_fnmark_format_tl){#2}[0pt]}
+ {\super[\l__eb_fntext_vshift_tl]{#2}[0pt]}
+ {
+ \super[\l__eb_fnmark_vshift_tl]
+ (\l__eb_fnmate_format_tl){#2}
+ [\l__eb_fnmark_hshift_tl]
+ }
}
\cs_new_protected:Npn \eb_fnmark_format_initial:
{
- \spbset{super-format = { },nohshift}
+ \bool_if:NF \l__eb_fnmate_format_match_bool
+ { \spbset{super-format = { }} }
\tl_use:N \l__eb_subfont_footnote_tl
}
+\bool_set_true:N \l__eb_normal_footnote_bool
+\bool_new:N \l__eb_fnmate_format_match_bool
+\bool_new:N \l__eb_fncust_format_match_bool
+\cs_new_protected:Npn \eb_fn_format_if_match:T #1
+ {
+ \bool_if:NTF \l__eb_normal_footnote_bool
+ { \bool_if:NT \l__eb_fnmate_format_match_bool {#1} }
+ { \bool_if:NT \l__eb_fncust_format_match_bool {#1} }
+ }
+\cs_new_protected:Npn \eb_fn_set_eq_format:
+ {
+ \tl_set_eq:NN
+ \l__eb_fnmate_format_tl \l__spb_super_script_formati_tl
+ }
\cs_set:Npn \@makefnmark
{
\hbox:n
{
\eb_fnmark_format_initial:
+ \eb_fn_format_if_match:T { \eb_fn_set_eq_format: }
\tl_if_eq:NnTF \@mpfn { footnote }
{ \eb@fnmark@super{\eb@thefnmark} }
{ \eb@fnmark@super{\@thefnmark} }
@@ -1104,15 +1155,18 @@
\hbox:n
{
\eb_fnmark_format_initial:
- \tl_if_eq:NnT \l__eb_fnmark_position_tl { super }
- { \eb@fnmark@super* }
+ \tl_use:N \l__eb_fnmark_before_tl
+ \tl_if_eq:NnTF \l__eb_fntext_position_tl { super }
{
- \tl_use:N \l__eb_fnmark_before_tl
- {\l__eb_fnmark_format_tl{\@thefnmark}}
- \tl_use:N \l__eb_fnmark_after_tl
+ \eb_fn_format_if_match:T { \tl_clear:N \l__eb_fnmate_format_tl }
+ \eb@fnmark@super*
}
+ { \eb_fn_format_if_match:T { \eb_fn_set_eq_format: } }
+ {\l__eb_fnmate_format_tl{\@thefnmark}}
+ \tl_use:N \l__eb_fnmark_after_tl
}
}
+
\tl_clear:N \@thefnmark
\tl_new:N \eb@thefnmark
\cs_new:Npn \eb@@makefnmark #1#2
@@ -1128,8 +1182,12 @@
\cs_new_protected:Npn \eb_fncust_format_initial:
{
% \hdrset{fntext-code = { }}
- \tl_set_eq:NN
- \l__eb_fnmark_format_tl \l__eb_fncust_format_tl
+ \bool_set_false:N \l__eb_normal_footnote_bool
+ \bool_if:NF \l__eb_fncust_format_match_bool
+ {
+ \tl_set_eq:NN
+ \l__eb_fnmate_format_tl \l__eb_fncust_format_tl
+ }
}
\NewDocumentCommand{\Footnote}{O{#2}mm}
{
@@ -1163,6 +1221,19 @@
\seq_put_right:Nn \c__ctex_headings_seq { table }
\seq_put_right:Nn \c__ctex_headings_seq { lstlisting }
\seq_remove_duplicates:N \c__ctex_headings_seq
+\cs_new_protected:Npn \eb_titletoc_hang_fix:n #1
+ {
+ \bool_if:NT \eb@titletoc@hang@fix@bool
+ {
+ \contentspush
+ {
+ \bool_if:NT \l__eb_toc_number_color_bool
+ { \color{ctex@toc@number} }
+ \thecontentslabel
+ \hspace{\use:c { eb@toc@#1@numsep }}
+ }
+ }
+ }
\cs_new_protected:Npn \eb_toc_assign_keys:n #1
{
\ctex_define:n { tocset/#1 .meta:nn = { ctex/tocset/#1 } {##1} }
@@ -1181,18 +1252,7 @@
\titlecontents{#1}
[\dim_use:c { l__eb_toc_#1_indent_dim }]
{\tl_use:c { l__eb_toc_#1_format_tl }}
- {
- \bool_if:NT \eb@titletoc@hang@fix@bool
- {
- \contentspush
- {
- \bool_if:NT \l__eb_toc_number_color_bool
- { \color{ctex@toc@number} }
- \thecontentslabel
- \hspace{\use:c { eb@toc@#1@numsep }}
- }
- }
- }{}
+ {\eb_titletoc_hang_fix:n {#1}}{}
{\tl_use:c { l__eb_toc_#1_rule_tl }}
}
\seq_map_function:NN
@@ -2187,8 +2247,7 @@
\LoadPackage[backend = biber]{biblatex}
\clist_map_function:NN \l__eb_bib_datafile_clist \addbibresource
\tl_gset:Nn \blx@default@theheading { bibintoc }
- \defbibheading{bibintoc}[\bibname]
- {\eb_biber_title_level_spec:n {##1}}
+ \defbibheading{bibintoc}[\bibname]{\eb_biber_title_level_spec:n {##1}}
\skip_zero:N \bibitemsep
}
\eb_at_end_preamble:n
@@ -2292,6 +2351,7 @@
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,
@@ -2337,7 +2397,6 @@
linkcol-all .code:n =
{ \eb_define_link_color:n { \exp_not:n {#1} } }
}
-\colorlet{ctex@toc@number}{ctex@link}
\ctex_define:nx { style }
{
color .choice:,
@@ -2422,7 +2481,7 @@
}
%</package>
%<*tcolorbox>
-\ProvidesExplFile{eb-tcolorbox.cfg}{2021/10/18}{1.3O}
+\ProvidesExplFile{eb-tcolorbox.cfg}{2021/10/18}{1.3P}
{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 a6c182352e..fb49ff7e2f 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 209ca5efe6..8e26df50a9 100644
--- a/macros/latex/contrib/easybook/easybook.tex
+++ b/macros/latex/contrib/easybook/easybook.tex
@@ -20,7 +20,7 @@
name = easybook,
color-scheme = blue,
title = EASYBOOK 使用手册,
- version = v1.3O,
+ version = v1.3P,
date = 2021/10/18,
authors = 瞿毅,
info = 排版简体中文学位论文和书籍,
@@ -79,6 +79,7 @@
\newsplitarg[\spemmeta]{\spemcoarg}{[}{]}
\renewcommand{\cnltx@package@abstract@width}{0.85\linewidth}
\newcommand{\noitemsep}{\setlength{\itemsep}{0ex}}
+\newcommand{\black}[1]{\textcolor{black}{#1}}
\renewcommand{\cmltx@list@setup}
{
\setlength{\leftmargin}{0em}
@@ -386,7 +387,7 @@
统一调整页眉、定理盒子以及代码框等线条的粗细。
\keybool{uppercase}\Default{true}
使用 \cs*{rightmark} 及 \cs*{leftmark} 标题标记命令获取标题内容时英文是否大写。
- \kvsplit{brackets}{左括号,右括号}\Default{\Carg{(,)}}
+ \kvsplit{brackets}{左括号,右括号}\Default{\Carg{(\black{,})}}
设置行间公式编号标签的括号,以英文逗号分隔,分别代表左右括号。
\kvsplit*{figurepath}{\meta{路径名1}\code{\}\{}\meta{路径名2}}\Default
设置插入图片的文件夹路径名,可以有多个路径名,每个路径包含在括号分隔,只有一个路径时需要包含在两层括号内。
@@ -442,7 +443,7 @@
\keychoice{linktype}{edge,colors,none}\Module{refset}\Default{edge}
超链接类型,\code{edge} 使超链接形式为边框,\code{colors} 使超链接字体为彩色,\code{none} 关闭超链接边框与颜色,此时 \option{linkcolor} 选项无效。
\keychoice{linkcolor}{fresh,cutepink,navyblue,crimson}\Default{navyblue}
- 超链接颜色样式,预置了四种超链接颜色风格。
+ 超链接颜色样式,预置了四种超链接颜色风格。为使相关颜色能够正确显示,\option{linkcolor} 选项应当在 \option{linktype} 前使用。
\begin{commands}
\command{DeclareLinkColor}[\splitmarg{风格名称,ctex@link,ctex@url,ctex@cite}]
可以使用 \cs{DeclareLinkColor} 命令声明新的超链接颜色样式,它的参数以英文逗号分隔,第一部分为颜色风格名称,后面三部分为 \code{HTML} 颜色代码,构成超链接颜色。
@@ -709,7 +710,7 @@
\hdrset{footnotetype = default,footnotetype = bottom}
\hdrset{footnotetype = {hang,bottom}}
\end{ctexexam}
- \keychoice{fnmark-pos}{normal,super}\Default{super}
+ \keychoice{fntext-pos}{normal,super}\Default{super}
设置脚注内容标记的位置,正常文本或是上标形式。
\keychoice{fnmark-num}{plain,pifont,pifont*,pisans,pisans*,short num}\Default{plain}
脚注正文标记编号的类型,默认为原生样式 \code{plain},还可以改为 \code{pifont} 的各个版本,从左往右依次为普通版、阴文衬线版、阳文无衬线版和阴文无衬线版,缺点是它们的编号仅包括 1-10。
@@ -723,20 +724,26 @@
脚注内容标记编号的类型,用法与 \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} 给脚注标记添加圆圈:
+ \keychoice{fnmark-vshift}{fixed length,match}\Default{0pt}
+ 脚注正文标记的垂直偏移,可以设为刚性长度,或用 \code{match} 匹配 \option*{super-vshift} 全局的值。
+ \keychoice{fnmark-hshift}{fixed length,match}\Default{0pt}
+ 脚注正文标记的水平偏移,可以设为刚性长度,或用 \code{match} 匹配 \option*{super-hshift} 全局的值。
+ \keychoice{fntext-vshift}{fixed length,match}\Default{0pt}
+ 脚注内容标记的垂直偏移,可以设为刚性长度,或用 \code{match} 匹配 \option*{super-vshift} 全局的值。
+ \keychoice{fnmate-form}{format code,match}\Default
+ 默认脚注标记的格式,\code{match} 可以匹配 \option*{super-format} 全局的值。一般配合选项 \keyis-{fnmark-num}{plain} 使用,例如配合 \pkg*{circledsteps} 宏包的带圈符号命令 \cs*{Circled} 给脚注标记添加圆圈:
\begin{ctexexam}
\usepackage{circledsteps}
\hdrset
{
- fnmark-pos = normal,
- fnmark-form = \tiny\Circled
+ fntext-pos = normal,
+ fnmate-form = \tiny\Circled
}
\end{ctexexam}
- \keyval-{fncust-form}{格式代码}\Default
- 单独设定自定义脚注标记的格式,自定义脚注的命令与用法见小节 \ref{subsubsec:custom footnotes}。
- \keyval-{fnboth-form}{格式代码}\Default
- 同时设定脚注标记 \option{fnmark-form} 和自定义脚注标记 \option{fncust-form} 的格式。标记格式选项含有字体命令会覆盖 \module*{subfont/}\option{footnote} 的设置,最后一个格式命令可以带有一个参数接受脚注标记。
+ \keychoice{fncust-form}{format code,match}\Default
+ 单独设定自定义脚注标记的格式,\code{match} 可以匹配 \option*{super-format} 全局的值。自定义脚注的命令与用法见小节 \ref{subsubsec:custom footnotes}。
+ \keychoice{fnboth-form}{format code,match}\Default
+ 同时设定默认脚注标记 \option{fnmate-form} 和自定义脚注标记 \option{fncust-form} 的格式,两种脚注标记匹配上标格式 \option*{super-format} 的值是独立的,使用 \code{match} 则可以同时匹配。标记格式选项含有字体命令会覆盖 \module*{subfont/}\option{footnote} 的设置,最后一个格式命令可以带有一个参数接受脚注标记。
\keyval-{fnpara-form}{格式代码}\Default
脚注内容的格式,在此设置字体命令会覆盖 \module*{subfont/}\option{footnote} 的设置,最后一个格式命令可以带有一个参数接受脚注内容。
\kvsplit{fntext-code}{前代码,后代码}\newline