summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/easybook
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-01-09 03:00:53 +0000
committerNorbert Preining <norbert@preining.info>2022-01-09 03:00:53 +0000
commitfbacb8167ccd172bb0b177974778f228ad41691d (patch)
tree8ad1c76a4dabddbc25abf75b1bc14238e811e9c4 /macros/latex/contrib/easybook
parentcd2e7ab7ef89a5c3c1935281009729bff0f357e2 (diff)
CTAN sync 202201090300
Diffstat (limited to 'macros/latex/contrib/easybook')
-rw-r--r--macros/latex/contrib/easybook/easybook.dtx164
-rw-r--r--macros/latex/contrib/easybook/easybook.pdfbin595293 -> 590081 bytes
-rw-r--r--macros/latex/contrib/easybook/easybook.tex86
3 files changed, 23 insertions, 227 deletions
diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx
index 7dadbd6f00..b1dae3cc0c 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}{2022/01/06}{1.43}
+\ProvidesExplClass{easybook}{2022/01/08}{1.44}
{Typeset Chinese theses or books}
\bool_set_false:N \l__eb_compile_draft_bool
@@ -306,7 +306,7 @@
%<*package>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e,etoolbox}
-\ProvidesExplPackage{easybase}{2022/01/06}{1.43}
+\ProvidesExplPackage{easybase}{2022/01/08}{1.44}
{Typeset Chinese theses or books}
\cs_generate_variant:Nn \dim_set:Nn { NV }
@@ -1859,14 +1859,9 @@
\setlist[enumerate,2]{label = alph,ref = enumii}
\setlist[enumerate,3]{label = roman,ref = enumiii}
\setlist[description]{font = sf,style = standard}
-\newlist{eb@outline@list}{itemize}{1}
-\newlist{eb@exercise@list}{enumerate}{2}
\newlist{eb@eqcomp@list}{description}{1}
-\setlist[eb@outline@list]{label = outline,itemsep = 0.5ex plus .1ex}
-\setlist[eb@eqcomp@list]{labelsep = 0em}
-\cs_new:Npn \setexerlist #1 { \setlist*[eb@exercise@list]{#1} }
+\setlist[eb@eqcomp@list]{nosep,labelsep = 0em}
\cs_new:Npn \seteqcomplist #1 { \setlist*[eb@eqcomp@list]{#1} }
-\cs_new:Npn \setoutlinelist #1 { \setlist*[eb@outline@list]{#1} }
\keys_define:nn { eb/eqcomp }
{
@@ -1926,7 +1921,7 @@
{\makebox[\box_wd:N \l_tmpa_box][\l__eb_eqsymb_delim_align_tl]{#2}}
\hspace{\l__eb_eqsymb_space_dim}
}
-\cs_new_protected:Npn \eb@itembox { \item\makebox }
+\cs_new_protected:Npn \eb@itembox { \item[]\makebox }
\NewDocumentCommand{\symb}{smO{\l__eb_eqsymb_delim_tl}}
{
\IfBooleanTF{#1}
@@ -2384,13 +2379,11 @@
\labelformat{chapter}{\CTEXthechapter}
\labelformat{figure}{\figurename~#1}
\labelformat{table}{\tablename~#1}
-\labelformat{exercise}{\exercisename~#1}
\providecommand{\bibname}{\refname}
\ctex_define:n
{
lstlistlistingname .tl_set:N = \listlstlistingname,
- lstlistingname .tl_set:N = \lstlistingname,
- exercisename .tl_set:N = \exercisename
+ lstlistingname .tl_set:N = \lstlistingname
}
\tl_if_eq:NnTF \l__ctex_scheme_tl { chinese }
{
@@ -2402,8 +2395,7 @@
listfigurename = 图片索引,
listtablename = 表格索引,
lstlistlistingname = 代码索引,
- lstlistingname = 代码,
- exercisename = 练习
+ lstlistingname = 代码
}
\labelformat{equation}{式(#1)}
\labelformat{section}{节 #1}
@@ -2414,8 +2406,7 @@
{
abstractname = Abstract,
lstlistlistingname = List~of~Codes,
- lstlistingname = Code,
- exercisename = Exercise
+ lstlistingname = Code
}
\labelformat{equation}{Equation~(#1)}
\labelformat{section}{Section~#1}
@@ -2423,11 +2414,9 @@
}
%</package>
%<*tcolorbox>
-\ProvidesExplFile{eb-tcolorbox.cfg}{2022/01/06}{1.43}
+\ProvidesExplFile{eb-tcolorbox.cfg}{2022/01/08}{1.44}
{Customization of tcolorbox for easybook}
-\cs_set_protected:Npn \setexercise #1
- { \keys_set:nn { eb/exercise } {#1} }
\cs_set_protected:Npn \addtotcbstyle #1#2
{ \tcbset{#1/.append~style = {#2}} }
\cs_set_protected:Npn \deftcbstyle #1#2
@@ -2435,22 +2424,6 @@
\cs_new_protected:Npn \tcbappstyle
{ \@ifstar{\deftcbstyle}{\addtotcbstyle} }
\cs_set_eq:NN \newtcbstyle \deftcbstyle
-\keys_define:nn { eb/exercise }
- {
- color .tl_set:N = \eb@tc@background@color,
- color .initial:n = DeepSkyBlue,
- number .tl_set:N = \eb@tc@list@number,
- number .initial:n = 1.,
- title .tl_set:N = \eb@tc@exercise@title,
- title .initial:n = \exercisename,
- numsep .dim_set:N = \eb@toc@exercise@numsep,
- numsep .initial:n = 0.5em,
- tocnumsep .dim_set:N = \eb@toc@exertoc@numsep,
- tocnumsep .initial:n = 1em,
- label .tl_set:N = \eb@tc@exercise@label,
- enumitem .code:n = \setexerlist{#1},
- tcolorbox .code:n = \addtotcbstyle{exercise}{#1}
- }
\tl_gset:Nn \eb@tc@line@skip { 0.5\baselineskip }
\deftcbstyle{tc-theorem}
@@ -2458,36 +2431,15 @@
enhanced~jigsaw,pad~at~break* = 3pt,
opacityback = 0,
colframe = ctex@emph,
- sharpish~corners,
beforeafter~skip = 1.75ex plus .2ex minus .1ex,
left = 8pt,right = 8pt,
top = \eb@tc@line@skip,bottom = \eb@tc@line@skip,
middle = \eb@tc@line@skip
}
-\deftcbstyle{tc-outline}
- {
- enhanced,nofloat,
- tikznode~boxed~title,
- interior~style = white,colframe = ctex@emph,
- colbacktitle = white,coltitle = ctex@emph,
- fonttitle = \large\sffamily,fontupper = \itshape,
- boxed~title~style = {size = normal,opacityframe = 0,boxrule = 0pt},
- attach~boxed~title~to~top~center = {yshift = -\tcboxedtitleheight/2},
- after~skip = 3ex plus .2ex minus .1ex,
- arc = 3pt,
- left = 2pc,right = 2pc,top = 1.5pc,bottom = 1pc
- }
-\deftcbstyle{tc-exercise}
- {
- blank,center,sharpish~corners,
- fontupper = \Large\sffamily,
- beforeafter~skip = 5ex plus .2ex minus .1ex
- }
\deftcbstyle{tc-easybox}
{
enhanced~jigsaw,pad~at~break* = 3pt,
center~title,
- sharpish~corners,
left = 8pt,right = 8pt,
coltitle = black,colframe = black,
top = \eb@tc@line@skip,bottom = \eb@tc@line@skip,
@@ -2501,115 +2453,26 @@
frame~hidden,
enhanced~jigsaw,pad~at~break* = 3pt,
boxrule = 0pt,
- sharpish~corners,
left = 8pt,
middle = \eb@tc@line@skip,bottomtitle = \eb@tc@line@skip,
beforeafter~skip = 1.75ex plus .2ex minus .1ex
}
\deftcbstyle{tc-ebemph}{on~line,blank}
-\deftcbstyle{tc-eblink}
- {
- standard~jigsaw,on~line,
- top = 1.5pt,bottom = 1.5pt,left = 1.5pt,right = 1.5pt,
- arc = 1pt,opacityback = 0.2
- }
\deftcbstyle{tc-ebfbox}
{
- standard~jigsaw,on~line,sharpish~corners,
+ standard~jigsaw,on~line,
top = 3pt,bottom = 3pt,left = 3pt,right = 3pt,
boxrule = 0.4pt,opacityback = 0.2
}
\tcbset
{
breakable,
- boxsep = 0pt,
+ sharpish~corners,
fonttitle = \sffamily,
+ boxsep = 0pt,
boxrule = 0.5pt
}
-\tl_new:N \p@eb@exercise
-\tl_new:N \eb@tc@list@prologue
-\bool_gset_true:N \g__eb_exer_clear_prologue_bool
-\NewDocumentCommand{\exerprologue}{sm}
- {
- \IfBooleanTF{#1}
- {\bool_gset_false:N \g__eb_exer_clear_prologue_bool}
- {\bool_gset_true:N \g__eb_exer_clear_prologue_bool}
- \tl_gset:Nn \eb@tc@list@prologue {#2}
- }
-\cs_new_protected:Npn \tcphantomifname #1#2
- {
- \tl_gset:Nn \eb@tc@exercise@ifnametrue {#1}
- \tl_gset:Nn \eb@tc@exercise@ifnamefalse {#2}
- }
-\tcphantomifname
- {
- \markright
- {
- \eb_tcb_toc_counter_numsep:n { exercise }
- \eb@tc@exercise@title
- }
- \addcontentsline{toc}{section}
- {
- \eb_tcb_toc_counter_numsep:n { exertoc }
- \eb@tc@exercise@title
- }
- }{}
-\cs_new:Npn \eb_exercise_label_noempty_use:
- {
- \eb_current_label:n { exercise }
- \tl_if_empty:NF \eb@tc@exercise@label
- { \exp_args:NV \label \eb@tc@exercise@label }
- }
-\cs_new:Npn \eb_tcb_toc_counter_numsep:n #1
- {
- \thetcbcounter
- \hspace{\use:c { eb@toc@#1@numsep }}
- }
-
-\newtcbox[auto~counter]{\eb@tc@exercise@box}[1]{tc-exercise,#1}
-\newtcolorbox{eb@tc@outline@box}[2]{title = #1,tc-outline,#2}
-\DeclareDocumentEnvironment{outline}{O{}D(){\abstractname}o+b}
- {
- \begin{eb@tc@outline@box}{#2}{IfValueT = {#3}{#3}}
- \begin{eb@outline@list}[#1]
- #4
- \end{eb@outline@list}
- \end{eb@tc@outline@box}
- }{}
-\DeclareDocumentEnvironment{exercise}{st-od()O{}+b}
- {
- \IfValueT{#3}{ \keys_set:nn { eb/exercise } {#3} }
- \IfBooleanF{#2}
- {
- \eb@tc@exercise@box
- {
- fuzzy~halo = 5pt~with~\eb@tc@background@color,
- IfValueT = {#4}{#4},
- phantom =
- {
- \IfBooleanTF{#1}
- {\eb@tc@exercise@ifnamefalse}
- {\eb@tc@exercise@ifnametrue}
- }
- }{
- \IfBooleanF{#1}
- {
- \eb_tcb_toc_counter_numsep:n { exercise }
- \cs_set_eq:NN \theexercise \thetcbcounter
- \eb_exercise_label_noempty_use:
- }
- \eb@tc@exercise@title
- }
- }
- \tl_if_empty:NF \eb@tc@list@prologue { \eb@tc@list@prologue }
- \exp_last_unbraced:NnNo
- \begin{eb@exercise@list}[\eb@tc@list@number,#5]
- #6
- \end{eb@exercise@list}
- \bool_if:NT \g__eb_exer_clear_prologue_bool
- { \tl_gclear:N \eb@tc@list@prologue }
- }{}
\DeclareTColorBox{easybox}{sO{PaleGoldenrod}d()O{}}
{
IfBooleanF = {#1}{frame~hidden,boxrule = 0pt},
@@ -2644,9 +2507,4 @@
fuzzy~halo = 2pt~with~#1,
tc-ebemph,#3
}{#2}
-\DeclareTotalTCBox{\eblink}{O{Aqua}vO{}}
- {
- colback = #1,colframe = #1,
- tc-eblink,#3
- }{#2}
%</tcolorbox> \ No newline at end of file
diff --git a/macros/latex/contrib/easybook/easybook.pdf b/macros/latex/contrib/easybook/easybook.pdf
index ac276244b6..9b5cbcc16d 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 c5aacaa0e1..259bbd6bd4 100644
--- a/macros/latex/contrib/easybook/easybook.tex
+++ b/macros/latex/contrib/easybook/easybook.tex
@@ -4,7 +4,7 @@
\usepackage
{
enumitem,newtxmath,indentfirst,tabularray,
- fancyvrb,geometry,hologo,pifont
+ fancyvrb,geometry,hologo,pifont,changelog
}
\definecolorscheme{blue}
{
@@ -20,8 +20,8 @@
name = easybook,
color-scheme = blue,
title = EASYBOOK 使用手册,
- version = v1.43,
- date = 2022/01/06,
+ version = v1.44,
+ date = 2022/01/08,
authors = 瞿毅,
info = 排版简体中文学位论文和书籍,
email = q1jx@foxmail.com,
@@ -935,6 +935,7 @@
\command*{newlist}[\marg{列表名}\marg{列表类型}\marg{最大级别}]
克隆基本的 \meta{列表类型} 在其基础上新建一个名为 \meta{列表名} 的列表环境。不要将 \meta{最大级别} 设置过大以避免创建过多的计数器和相关宏。
\begin{ctexexam}
+ \setlist{} % 清除所有列表共享的格式
\setlist[1]{labelindent = \parindent}
\setlist[itemize,1]{label = $\triangleleft$}
\setlist[enumerate]{labelsep = *,leftmargin = 1.5pc}
@@ -1029,56 +1030,9 @@
代码目录名与代码环境题注名选项 \option*{lstlistlistingname} 和 \option*{lstlistingname} 用法与 C\TeX 使用手册标题汉化一节类似,可以看作对这节的扩展。
\end{options}
-\subsection{习题}
-\label{subsec:exercise}
-\begin{environments}
- \environment{exercise}[\sarg\harg\oarg{键值列表1}\darg{键值列表2}\oarg{键值列表3}]
- 习题环境的标题使用 \cs*{tcbox} 行内盒子包装样式,内容则使用 \env*{enumerate} 列表环境。它有 5 个可选参数,应当注意用法。当使用星号参数时标题不进行编号,使用 \harg{} 号参数时不显示标题,此时 \meta{键值列表1} 除了 \option{label} 选项失效。
-
- \meta{键值列表2} 包括 \pkg*{tcolorbox} 的盒子样式选项,例如 \option*{boxsep} 和 \option*{fontupper} 等,也可以使用下述 \option{tcolorbox} 选项。在这里可以使用 \cs{addtotcbstyle} 命令设置标题选项 \meta{键值列表2} 的值,第一个参数为 \code{tc-exercise}。
- \begin{ctexexam}
- \tcphantomifname{\markright{\counteruse{tcbcounter}\quad 习题}}{}
- \addtotcbstyle{tc-exercise}{boxsep = 5pt}
- \exerprologue{习题前的一段文本}
- \begin{exercise}*[color = LightSkyBlue](after skip = 2pc)[itemsep = 1ex]
- \item 第一题
- \item 第二题
- \end{exercise}
- \end{ctexexam}
-\end{environments}
-
-\begin{commands}
- \command{setexercise}[\marg{键值列表1}]
- 配置命令 \cs{setexercise} 用于全局设置上述习题环境 \env{exercise} 标题样式可选参数中 \meta{键值列表1} 的默认值,包含的选项如下:
- \begin{options}
- \keyval-{color}{标题背景颜色名}\Default{DeepSkyBlue}
- 习题标题盒子背景颜色,可以使用 \pkg*{xcolor} 自定义颜色或使用色库。
- \keyval-{title}{环境标题}
- 习题的标题,可以匹配中英文模式,习题环境使用 \harg{} 号参数时无效。也可以使用 \option{exercisename} 选项设置习题环境标题的默认值。
- \keyval-{number}{习题编号类型}\Default{1.}
- 标题编号输出选项 \option{number} 为短编号形式,应当包含 \code{A}、\code{a}、\code{I}、\code{i}、或 \code{1} 其中一个符号。
- \keyval-{numsep}{编号与标题的间距}\Default{0.5em}
- 习题标题编号与后方标题文本的间距,习题环境使用星号参数时无效。
- \keyval-{tocnumsep}{目录编号与标题的间距}\Default{1em}
- 目录中习题标题编号与后方标题文本的间距,习题环境使用星号参数时无效。
- \keyval-{tcolorbox}{键值列表2}
- 局部传递 \pkg*{tcolorbox} 宏包的格式选项给习题标题(如果存在)。
- \keyval-{enumitem}{键值列表3}
- 局部传递 \pkg*{enumitem} 宏包的格式选项给习题条目列表。
- \keyval-{label}{标签内容}
- 设置习题环境的引用标签,它与标签格式命令 \cs{labelformat} 对应的计数器是 \code{exercise}。
- \end{options}
- \command{setexerlist}[\marg{键值列表3}]
- 命令 \cs{setexerlist} 用于全局设置习题条目选项 \meta{键值列表3} 的值。\meta{键值列表3} 的选项与 \pkg*{enumitem} 的排序列表相同,也可以使用下述 \option{enumitem} 选项,不过第一个选项无法是短编号形式,这被 \option{number} 选项代替。
- \command{exerprologue}[\sarg\marg{序言内容}]
- 序言命令 \cs{exerprologue} 在习题环境开始前插入一段内容,可以是文本或者代码,需要在每一个习题环境前使用。带有星号参数的命令会使序言在习题环境一直有效。
- \command{tcphantomifname}[\marg{编号代码}\marg{不编号代码}]
- 命令 \cs{tcphantomifname} 根据使用 \pkg*{tcolorbox} 生成的习题标题是否编号,在超链接锚点的位置加入代码,比如使用 \cs*{addcontentsline} 命令将习题标题加入目录。
-\end{commands}
-
\subsection{盒子}
\label{subsec:box}
-使用盒子以及\ref{subsec:exercise} 中的 \env{exercise} 环境需要在导言区\textbf{手动载入} \pkg*{tcolorbox} 宏包,它们 \meta{配置选项} 的键值列表同样由 \pkg*{tcolorbox} 提供支持,具体选项可见宏包文档的 Option Keys 一节,可以进行边距、字体及背景颜色等各种个性化设置,一些配置会覆盖预设。
+文档类预置了两个行间盒子环境和两个行内盒子命令,需要在导言区\textbf{手动载入} \pkg*{tcolorbox} 宏包提供支持。它们 \meta{配置选项} 的键值列表可见宏包文档的 Option Keys 一节,可以进行边距、字体及背景颜色等各种个性化设置。如果 \meta{配置选项} 较长且希望在原有基础上改为全局固定的样式,可以使用 \cs{addtotcbstyle} 命令设置,第一个参数为 \code{tc-}\meta{环境或命令名}。
\begin{commands}
\command{deftcbstyle}[\marg{盒子风格}\marg{键值列表}]
新建或重置一个名称为 \meta{盒子风格} 的 \pkg*{tcolorbox} 宏包盒子风格,可以与 \cs{addtotcbstyle} 命令联用。
@@ -1102,29 +1056,12 @@
\end{ctexexam}
\end{commands}
-\subsubsection{摘要盒子}
-\begin{environments}
- \environment{outline}[\oarg{键值列表1}\darg{标题名称}\oarg{键值列表2}]
- 摘要盒子 \env{outline} 可用于章前摘要,它的标题是可选参数,默认标题是摘要。\meta{键值列表2} 是摘要盒子样式选项,可以使用 \cs{addtotcbstyle} 命令对它进行全局设置,第一个参数为 \code{tc-outline}。
-\end{environments}
-
-\begin{commands}
- \command{setoutlinelist}[\marg{键值列表1}]
- \meta{键值列表1} 与 \pkg*{enumitem} 宏包中列表配置选项相同,可以设置摘要条目的各种距离,要对它进行全局设置可以使用 \cs{setoutlinelist} 命令。
- \begin{ctexexam}
- \addtotcbstyle{tc-outline}{arc = 6pt}
- \begin{outline}[leftmargin = *](摘要标题)
- \item 摘要内容1
- \item 摘要内容2
- \end{outline}
- \end{ctexexam}
-\end{commands}
-
-\subsubsection{段落盒子}
+\subsubsection{行间盒子}
\begin{environments}
\environment{easybox}[\sarg\oarg{颜色名}\darg{段落标题}\oarg{配置选项}]
- 环境 \env{easybox} 创建一个带有三个可选参数的扁平盒子。使用星号参数时给盒子添加边框,\meta{颜色名} 选项设置背景颜色,\meta{段落标题} 选项可以设置标题,默认无标题。如果 \meta{配置选项} 较长且希望在原有基础上改为全局固定的样式,可以使用 \cs{addtotcbstyle} 命令设置,第一个参数为 \code{tc-easybox}。
+ 环境 \env{easybox} 创建一个带有三个可选参数的扁平盒子。使用星号参数时给盒子添加边框,\meta{颜色名} 选项设置背景颜色,\meta{段落标题} 选项可以设置标题,默认无标题。
\begin{ctexexam}
+ \addtotcbstyle{tc-easybox}{arc = 6pt}
\begin{easybox}*[DarkCyan](段落标题)
上半盒子内容
\tcblower % 盒子上下部分分界线
@@ -1137,10 +1074,8 @@
\subsubsection{行内盒子}
\begin{commands}
- \command{eblink}[\oarg{颜色名}\marg{内容}\oarg{配置选项}]
- 使用 \pkg*{tcolorbox} 预置了三个参数选项相同的行内盒子,它们均为抄录命令。盒子 \cs{eblink} 具有类似超链接边框的效果。
\command{ebemph}[\oarg{颜色名}\marg{内容}\oarg{配置选项}]
- 盒子 \cs{ebemph} 具有模糊边缘类似高亮的效果。
+ 行内盒子均为抄录命令。盒子 \cs{ebemph} 具有模糊边缘类似高亮的效果。
\command{ebfbox}[\oarg{颜色名}\marg{内容}\oarg{配置选项}]
盒子 \cs{ebfbox} 则有直角边缘和四周框线,效果类似带颜色的 \cs*{fbox} 盒子。
\end{commands}
@@ -1302,6 +1237,9 @@
\end{commands}
\appendix
+\begin{changelog}[title = 更新日志]
+ \shortversion{v = 1.44,date = 2022/01/08,changes = 经过前期各模块的功能调整和错误修复,稳定版本正式发布。}
+\end{changelog}
\nocite{*}
\end{document} \ No newline at end of file