summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/easybook
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-09-09 03:00:35 +0000
committerNorbert Preining <norbert@preining.info>2021-09-09 03:00:35 +0000
commit30ebcb04bb501c56bfac1652a749eda69ba28c34 (patch)
treec1492b714f76dd6c85a5665308561bdc86e019ed /macros/latex/contrib/easybook
parentf8d688cceb9bee2119c4cf3422a85bd60c0e846c (diff)
CTAN sync 202109090300
Diffstat (limited to 'macros/latex/contrib/easybook')
-rw-r--r--macros/latex/contrib/easybook/easybook.dtx173
-rw-r--r--macros/latex/contrib/easybook/easybook.pdfbin578268 -> 577996 bytes
-rw-r--r--macros/latex/contrib/easybook/easybook.tex32
3 files changed, 99 insertions, 106 deletions
diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx
index 2150fef75c..ee291bcbb1 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/09/06}{1.30}
+\ProvidesExplClass{easybook}{2021/09/08}{1.3a}
{Typeset Chinese theses or books}
\bool_set_false:N \l__eb_compile_draft_bool
@@ -297,14 +297,13 @@
%<*package>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e,etoolbox}
-\ProvidesExplPackage{easybase}{2021/09/06}{1.30}
+\ProvidesExplPackage{easybase}{2021/09/08}{1.3a}
{Typeset Chinese theses or books}
\cs_generate_variant:Nn \dim_set:Nn { NV }
\cs_generate_variant:Nn \dim_sign:n { V }
\cs_generate_variant:Nn \int_to_arabic:n { v }
\cs_generate_variant:Nn \prop_set_from_keyval:Nn { NV }
-\cs_generate_variant:Nn \skip_add:Nn { NV,Nv }
\cs_generate_variant:Nn \skip_set:Nn { NV }
\cs_generate_variant:Nn \seq_set_from_clist:Nn { No }
\cs_generate_variant:Nn \ctex_define:nn { nx }
@@ -1128,12 +1127,6 @@
#1/numsep .dim_set:c = eb@toc@#1@numsep,
#1/unknown .code:n = \eb_msg_unknown_option:n { tocset }
}
- \seq_if_in:NnF \c__ctex_headings_seq { subparagraph }
- {
- \ctex_define:nn { tocset }
- { #1/belowskip .skip_set:c = l__eb_toc_#1_below_skip }
- }
- \seq_pop:NN \c__ctex_headings_seq \l_tmpa_tl
\titlecontents{#1}
[\dim_use:c { l__eb_toc_#1_indent_dim }]
{\tl_use:c { l__eb_toc_#1_format_tl }}
@@ -1155,7 +1148,16 @@
\c__ctex_headings_seq \eb_toc_assign_keys:n
\ctex_define:n { tocset/list .meta:nn = { ctex/tocset/list } {#1} }
\eb_clist_map_inline:nn
- { format,format+,format~+,indent,rule,numsep,belowskip }
+ { figure,table,lstlisting }
+ {
+ \ctex_define:nn { tocset }
+ {
+ #1/voffset .skip_set:c = l__eb_toc_#1_voffset_skip,
+ #1/tocline .cs_set:cp = { eb@labelname@#1 } ##1,
+ }
+ }
+\eb_clist_map_inline:nn
+ { format,format+,format~+,indent,rule,numsep,voffset,tocline }
{
\ctex_define:nn { tocset }
{
@@ -1187,66 +1189,44 @@
\ctex_define:nn { tocset }
{
lolskip .skip_set:N = \eb@toc@lolskip,
- lolskip .initial:n = 0.8pc,
- belowoffset .skip_set:N = \l__eb_toc_offset_skip,
- belowoffset .initial:n =
- { \bool_if:NTF \l__eb_class_book_bool { -1pc } { -0.35pc } },
+ lolskip .initial:n = 10pt,
+ toc-voffset .skip_set:N = \l__eb_toc_voffset_skip,
+ toc-voffset .initial:n =
+ { \bool_if:NTF \l__eb_class_book_bool { 1pc } { 0.35pc } },
line-align .bool_set:N = \l__eb_toc_line_align_bool,
line-align .default:n = true,
line-align .initial:n = true,
- tocline-fig .cs_set:Np = \eb@labelname@lof #1,
- tocline-fig .initial:n =
- {
- \figurename\space #1
- \notbool{eb@titletoc@hang@fix}
- {\hspace{\eb@toc@figure@numsep}}{}
- },
- tocline-tab .cs_set:Np = \eb@labelname@lot #1,
- tocline-tab .initial:n =
- {
- \tablename\space #1
- \notbool{eb@titletoc@hang@fix}
- {\hspace{\eb@toc@table@numsep}}{}
- },
- tocline-lst .tl_set:N = \eb@labelname@lol,
- tocline-lst .initial:n =
- {
- \lstlistingname\space\thelstlisting
- \notbool{eb@titletoc@hang@fix}
- {\hspace{\eb@toc@lstlisting@numsep}}{}
- },
-
hang .choice:,
- hang/true .code:n = \booltrue{eb@titletoc@hang@fix},
- hang/false .code:n = { },
- hang .default:n = true,
- hang .initial:n = false,
-
- numsep-all .meta:n =
- {
- part/numsep = #1,
- chapter/numsep = #1,
- section/numsep = #1,
- subsection/numsep = #1,
- list/numsep = #1
+ hang/true .code:n = \booltrue{eb@titletoc@hang@fix},
+ hang/false .code:n = { },
+ hang .default:n = true,
+ hang .initial:n = false,
+
+ numsep-all .meta:n =
+ {
+ part/numsep = #1,
+ chapter/numsep = #1,
+ section/numsep = #1,
+ subsection/numsep = #1,
+ list/numsep = #1
},
- numsep-all .initial:n = 1em,
- indent-all .meta:n =
- {
- part/indent = #1,
- chapter/indent = #1,
- section/indent = #1,
- subsection/indent = #1,
- list/indent = #1
+ numsep-all .initial:n = 1em,
+ indent-all .meta:n =
+ {
+ part/indent = #1,
+ chapter/indent = #1,
+ section/indent = #1,
+ subsection/indent = #1,
+ list/indent = #1
},
- rule-all .meta:n =
+ rule-all .meta:n =
{
- part/rule = #1,
- chapter/rule = #1,
- section/rule = #1,
- subsection/rule = #1,
- list/rule = #1
+ part/rule = #1,
+ chapter/rule = #1,
+ section/rule = #1,
+ subsection/rule = #1,
+ list/rule = #1
}
}
\ctex_set:n
@@ -1273,45 +1253,64 @@
}
\ctex_set:nn { tocset }
{
- part/format = \addvspace{1pc}\sffamily\large,
- part/indent = 0em,
- part/rule = \tocrule{}[\bfseries],
+ part/format = \addvspace{1pc}\sffamily\large,
+ part/indent = 0em,
+ part/rule = \tocrule{}[\bfseries],
- chapter/format = \addvspace{1pc}\sffamily\large,
- chapter/indent = 0em,
- chapter/rule = \tocrule{$\cdot$}[\bfseries],
+ chapter/format = \addvspace{1pc}\sffamily\large,
+ chapter/indent = 0em,
+ chapter/rule = \tocrule{$\cdot$}[\bfseries],
- section/format =
+ section/format =
{
\addvspace{0.35pc}
\bool_if:NF \l__eb_class_book_bool { \sffamily }
},
- section/indent =
+ section/indent =
{ \bool_if:NTF \l__eb_class_book_bool { 1.5em } { 0em } },
- section/rule =
+ section/rule =
{
\bool_if:NTF \l__eb_class_book_bool
{ \tocrule{$\cdot$} }
{ \tocrule{$\cdot$}[\bfseries] }
},
- subsection/format = \addvspace{0.35pc},
- subsection/indent =
+ subsection/format = \addvspace{0.35pc},
+ subsection/indent =
{ \bool_if:NTF \l__eb_class_book_bool { 3.8em } { 1.4em } },
- subsection/rule = \tocrule{$\cdot$},
+ subsection/rule = \tocrule{$\cdot$},
+
+ list/format = \addvspace{0.2pc},
+ list/indent = 0em,
+ list/rule = \tocrule{$\cdot$},
+ list/voffset =
+ { 0.2pc\bool_if:NT \l__eb_class_book_bool { + 10pt } },
- list/format = \addvspace{0.2pc},
- list/indent = 0em,
- list/rule = \tocrule{$\cdot$},
- list/belowskip =
- { \bool_if:NTF \l__eb_class_book_bool { 0pc } { 0.15pc } }
+ figure/tocline =
+ {
+ \figurename\space #1
+ \notbool{eb@titletoc@hang@fix}
+ {\hspace{\eb@toc@figure@numsep}}{}
+ },
+ table/tocline =
+ {
+ \tablename\space #1
+ \notbool{eb@titletoc@hang@fix}
+ {\hspace{\eb@toc@table@numsep}}{}
+ },
+ lstlisting/tocline =
+ {
+ \lstlistingname\space\thelstlisting
+ \notbool{eb@titletoc@hang@fix}
+ {\hspace{\eb@toc@lstlisting@numsep}}{}
+ }
}
\prop_new:N \l__eb_list_label_name_prop
\prop_set_from_keyval:Nn \l__eb_list_label_name_prop
{
- figure = \eb@labelname@lof,
- table = \eb@labelname@lot
+ figure = \eb@labelname@figure,
+ table = \eb@labelname@table
}
\cs_gset:Npn \caption@@@addcontentsline #1#2#3#4
{
@@ -1330,7 +1329,7 @@
\addcontentsline{lol}{lstlisting}
{
\ifbool{eb@titletoc@hang@fix}{\eb@numberline}{}
- {\eb@labelname@lol}\lst@@caption
+ {\eb@labelname@lstlisting}\lst@@caption
}
}
@@ -1542,9 +1541,7 @@
\tl_set_eq:Nc \eb@toc@title { list#4name }
\IfValueT{#3}{\keys_set:nn { eb/listoc } {#3}}
\eb_title_number_intoc_spec:nn {#2} {#1}
- \skip_add:Nv
- \l__eb_toc_offset_skip { l__eb_toc_#4_below_skip }
- \vspace*{\dim_use:N \l__eb_toc_offset_skip}
+ \vspace*{-\dim_use:c { l__eb_toc_#4_voffset_skip }}
\eb_toc_start_multi_column_ext:n {#5}
\group_end:
}
@@ -1568,12 +1565,12 @@
\tl_set:Nn \eb@bitoc@title { Contents }
\IfValueT{#2}{\keys_set:nn { eb/listoc } {#2}}
\eb_title_mark_notoc:n { \eb@toc@title }
- \vspace*{\dim_use:N \l__eb_toc_offset_skip}
+ \vspace*{-\dim_use:N \l__eb_toc_voffset_skip}
\eb_toc_start_multi_column_ext:n { toc }#3
\IfBooleanT{#1}
{
\eb_title_mark_notoc:n { \eb@bitoc@title }
- \vspace*{\dim_use:N \l__eb_toc_offset_skip}
+ \vspace*{-\dim_use:N \l__eb_toc_voffset_skip}
\eb_toc_start_multi_column_ext:n { tec }
}
\group_end:
@@ -2400,7 +2397,7 @@
}
%</package>
%<*tcolorbox>
-\ProvidesExplFile{eb-tcolorbox.cfg}{2021/09/06}{1.30}
+\ProvidesExplFile{eb-tcolorbox.cfg}{2021/09/08}{1.3a}
{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 62b5067a0f..a27447bba5 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 e8425fef2d..011565190a 100644
--- a/macros/latex/contrib/easybook/easybook.tex
+++ b/macros/latex/contrib/easybook/easybook.tex
@@ -12,8 +12,8 @@
name = easybook,
color-scheme = blue,
title = EASYBOOK 使用手册,
- version = v1.30,
- date = 2021/09/06,
+ version = v1.3a,
+ date = 2021/09/08,
authors = 瞿毅,
info = 排版简体中文学位论文和书籍,
email = quee123@foxmail.com,
@@ -727,9 +727,9 @@
\subsection{目录样式}
\label{subsec:catalog style}
-模块 \module*{tocset} 将使用 \pkg*{titletoc} 处理目录样式,\module*{level} 代表 \code{part}、\code{chapter}、\code{section}、\code{subsection}、\code{figure}、\code{table} 或 \code{lstlisting} 目录级别,而使用 \code{list} 级别可以统一设置图片、表格和代码目录的样式。目前目录支持适用于论文的常规样式,如果您需要例如段落或更复杂的样式可以使用本模块基于的 \cs*{titlecontents} 命令。
+模块 \module*{tocset} 将使用 \pkg*{titletoc} 处理目录样式。模块包括 \module*{part}、\module*{chapter}、\module*{section}、\module*{subsection}、\module*{figure}、\module*{table} 和 \module*{lstlisting} 二级路径,而使用 \module*{list} 路径可以统一设置图片、表格和代码目录的样式。模块中 \option{format}、\option{format+}、\option{indent}、\option{rule} 和 \option{numsep} 这 5 个选项支持所有路径级别,没有特别说明的其它选项则没有二级路径。目前支持常规的论文目录样式,更复杂的样式可以查看 \pkg*{titletoc} 宏包的相关用法。
\begin{options}
- \keyval-{format}{目录标题格式}\Module{/level}
+ \keyval-{format}{目录标题格式}\Module{tocset}
各级别目录中标题的格式,可以设置字体和加入垂直间距等,垂直间距最好使用防止垂直间距重合的 \cs*{addvspace} 命令。
\keyval-{format+}{目录标题格式}
与 \option{format} 用法一样,只是在已有的格式命令后附加代码。
@@ -760,24 +760,20 @@
\end{commands}
\begin{options}
- \keyval-{belowskip}{弹性长度}\Module{/level}\Default{0pc}
- 图片、表格和代码三种目录命令标题下方的额外间距,\module*{level} 代表 \code{figure}、\code{table} 或 \code{lstlisting}。这个距离也可以使用 \code{list} 级别统一设置,或直接用 C\TeX 标题选项 \option*{afterskip} 修改。
- \keyval-{belowoffset}{弹性长度}\Module{tocset}\Default{-1pc}
- 主文档目录标题下方的间距补偿,一般为负值,用于抵消 \option{format} 中额外的垂直间距。
- \keyval-{lolskip}{弹性长度}\Default{0.8pc}
+ \keyval-{lolskip}{弹性长度}\Default{10pt}
代码目录中每章代码标题的额外距离,与 C\TeX 的表格和图片目录中每章间的标题距离选项 \option*{lotskip} 和 \option*{lofskip} 类似,在 \cls*{article} 模式中此选项失效。
- \keyval-{tocline-fig}{图片目录标签}
- 图片目录标签,选项参数中 \code{\#1} 代表编号,还可包含标签名称,默认标签名称与图片题注名称一致。
- \keyval-{tocline-tab}{表格目录标签}
- 表格目录标签,选项参数中 \code{\#1} 代表编号,还可包含标签名称,默认标签名称与表格题注名称一致。
- \keyval-{tocline-lst}{代码目录标签}
- 代码目录标签,选项参数中 \cs*{thelstlisting} 代表编号,还可包含标签名称,默认标签名称与代码题注名称一致。
+ \keyval-{toc-voffset}{弹性长度}
+ 主文档目录标题下方的间距补偿,一般为正值,用于抵消目录中首行的额外垂直间距。
+ \keyval-{voffset}{弹性长度}
+ 图片、表格或代码目录标题下方的间距补偿,一般为正值,用于抵消目录中首行的额外垂直间距。路径为 \module*{figure}、\module*{table} 和 \module*{lstlisting},或者用 \module*{list} 路径统一设置。
+ \keyval-{tocline}{目录标签}
+ 图片、表格或代码的目录标签,图片或表格的选项参数中 \code{\#1} 代表编号,代码中 \cs*{thelstlisting} 代表编号。参数还可包含标签名称,默认标签名称与对应题注名称一致。路径为 \module*{figure}、\module*{table} 和 \module*{lstlisting},或者用 \module*{list} 路径统一设置。
\begin{ctexexam}
\tocset
{
- hang = false,
- tocline-fig = 图 #1\hspace{1em},
- tocline-lst = 代码\thelstlisting\hspace{1em}
+ hang = false,
+ figure/tocline = 图 #1\hspace{1em},
+ lstlisting/tocline = 代码\thelstlisting\hspace{1em}
}
\end{ctexexam}
\keybool{line-align}\Default{true}