diff options
Diffstat (limited to 'macros/latex/contrib/easybook/easybook.dtx')
-rw-r--r-- | macros/latex/contrib/easybook/easybook.dtx | 94 |
1 files changed, 54 insertions, 40 deletions
diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx index e71b2b46e4..6578c6d5fe 100644 --- a/macros/latex/contrib/easybook/easybook.dtx +++ b/macros/latex/contrib/easybook/easybook.dtx @@ -73,7 +73,7 @@ The latest version of this license is in % % \title{\sffamily easybook书籍文档类} % \author{瞿毅} -% \date{2021/03/25\hskip\ccwd\relax v1.24\thanks{\url{https://gitee.com/texl3/easybook}}} +% \date{2021/03/31\hskip\ccwd\relax v1.24a\thanks{\url{https://gitee.com/texl3/easybook}}} % \maketitle % \begin{abstract} % \cls{easybook} 是基于 \cls{ctexbook} 书籍文档类创建以极简为风格的模板,可以看作对 \cls{ctexbook} 的进一步包装。虽然\CTeX 文档类提供了较好的中文支持,但想实现个性化功能一般需要在其基础上载入更多宏包来定制。\cls{easybook} 考虑了一些细节并载入一些常用宏包实现一般的排版需求,它适用于排版中英文书籍或笔记,甚至可稍加调整成为学位论文模板。 @@ -118,7 +118,7 @@ The latest version of this license is in % 标准 \cls{book} 文类与 \cls{ctexbook} 文类的选项同样适用于本文档。除此之外选项分为两类 % \begin{itemize} % \item 带有 \rexptarget\rexpstar{} 号的选项,需要在引入文档类的时候设定。 -% \item 带有 \exptarget\expstar{} 号的选项,需要通过\CTeX 宏集提供的用户接口命令 \tn{ctexset} 设定。 +% \item 带有 \exptarget\expstar{} 号的选项,需要通过\CTeX 宏集提供的用户接口命令 \tn{ctexset} 或节 \ref{sec:interface options} 中此选项所属模块接口命令设定。 % \end{itemize} % % \begin{function}[rEXP,added = 2021-01-05]{draft} @@ -192,11 +192,23 @@ The latest version of this license is in % \end{function} % % \section{接口选项} +% \label{sec:interface options} % \begin{function}[added = 2021-01-05]{\ctexset} % \begin{syntax} % \tn{ctexset}\marg{键值列表} % \end{syntax} -% \cls{easybook} 扩展了\CTeX 宏集\LaTeX 3风格键值的通用控制命令 \tn{ctexset},接口选项同样用它设置, 原有的键值列表仍然可用。 +% \cls{easybook} 扩展了\CTeX 宏集\LaTeX 3风格键值的通用控制命令 \tn{ctexset},接口选项同样用它设置, 原有的键值列表仍然可用。本文档类目前有九个模块用于完成排版的常规功能,如下表所示,它们也是相关接口的命令名 +% \begin{center} +% \begin{tabular}{*{5}{c}} +% \toprule +% \hyperref[subsec:style]{风格} & \hyperref[subsec:hyperlinks]{超链接} & \hyperref[subsec:other font]{其它字体} & \hyperref[subsec:spacing]{行距} & \hyperref[subsec:reference]{参考文献} \\ +% style & link & elsefont & spread & bibset \\ +% \midrule +% \hyperref[subsec:theorem of style]{定理样式} & \hyperref[subsec:page margins]{页面边距} & \hyperref[subsec:header and footer]{页眉页脚} & \hyperref[subsec:catalog style]{目录样式} & \\ +% thmset & geoset & hdrset & tocset & \\ +% \bottomrule +% \end{tabular} +% \end{center} % \end{function} % % \begin{function}[EXP,added = 2021-01-08]{config} @@ -208,6 +220,7 @@ The latest version of this license is in % \end{function} % % \subsection{风格} +% \label{subsec:style} % \begin{function}[EXP,added = 2021-01-05,updated = 2021-03-18]{color,multoc,withpart,footwith,notomath,rulewidth,uppercase,figure-sep,table-sep,listing-sep,equation-sep,number-sep} % \begin{syntax} % color = <(none)|seaside|energy|cyberpunk> @@ -242,7 +255,7 @@ The latest version of this license is in % \item[multoc] 开启双栏目录,可与 \opt{onecolumn} 和 \opt{twocolumn} 选项配合出单栏正文、单栏目录,双栏正文、单栏目录,单栏正文、双栏目录和双栏正文、双栏目录四种方式。 % \item[withpart] 使章跟随每一部分编号,默认不跟随。 % \item[footwith] 使脚注跟随编号的计数器,默认跟随章,当开启新的一章时脚注编号从1开始。 -% \item[notomath] 使用 \opt{noto} 风格的数学字体,将会加载 \pkg{newtxmath} 宏包。 +% \item[notomath] 使用 \opt{noto} 风格的数学字体,将会加载 \pkg{newtxmath} 宏包。此选项默认关闭,此时可以使用 \pkg{unicode-math} 等宏包自定义数学字体。 % \item[rulewidth] 调整页眉、定理盒子以及代码框线条的粗细。 % \item[uppercase] 使用 \tn{rightmark} 及 \tn{leftmark} 获取标题内容设置页眉页脚时英文是否大小写。 % \item[figure-sep] 图片标题编号的连接符。 @@ -278,6 +291,7 @@ The latest version of this license is in % \end{optdesc} % % \subsection{行距} +% \label{subsec:spacing} % \begin{function}[EXP,added = 2021-01-05,updated = 2021-02-13]{line,table,math,caption,footnote} % \begin{syntax} % line = <(1.3)> @@ -301,6 +315,7 @@ The latest version of this license is in % \end{optdesc} % % \subsection{其它字体} +% \label{subsec:other font} % \begin{function}[EXP,added = 2021-01-08,updated = 2021-02-13]{table-cap,figure-cap,listing-cap,footnote,marginpar} % \begin{syntax} % table-cap = <\tn{sffamily}\tn{small}> @@ -323,6 +338,7 @@ The latest version of this license is in % \end{optdesc} % % \subsection{参考文献} +% \label{subsec:reference} % \begin{function}[EXP,added = 2021-01-11,updated = 2021-03-15]{backend,bib-style,cite-style,bibfile} % \begin{syntax} % backend = <(bibtex)|biblatex> @@ -358,10 +374,11 @@ The latest version of this license is in % \end{function} % % \subsection{定理样式} -% \begin{function}[EXP,added = 2021-01-12,updated = 2021-03-13]{thmbox,numberwith,headpunct,bodyfont,notefont,headfont,headindent,spaceabove,spacebelow,spacepost} +% \label{subsec:theorem of style} +% \begin{function}[EXP,added = 2021-01-12,updated = 2021-03-13]{thmbox,within,headpunct,bodyfont,notefont,headfont,headindent,spaceabove,spacebelow,spacepost} % \begin{syntax} % thmbox = <true|(false)> -% numberwith = <(chapter)|section|其它环境|空置> +% within = <(chapter)|section|其它环境|空置> % headpunct = <(未设置)> % bodyfont = <(未设置)> % notefont = <(未设置)> @@ -377,7 +394,7 @@ The latest version of this license is in % % \begin{optdesc} % \item[thmbox] 开启定理及习题环境的盒子边框,需载入 \pkg{tcolorbox} 宏包才生效。 -% \item[numberwith] 定理编号跟随的计数器,默认跟随章的编号,也可以跟随其它定理环境的编号,当计数器增加时定理编号会从零开始,空置时不跟随其它计数器。 +% \item[within] 定理编号跟随的计数器,默认跟随章的编号,也可以跟随其它定理环境的编号,当计数器增加时定理编号会从零开始,空置时不跟随其它计数器。 % \item[headpunct] 定理标题末尾后的标记,在换行符或第一段内容的间隔之前。 % \item[bodyfont] 定理内容部分的字体。 % \item[notefont] 定理副标题内容的字体。 @@ -423,6 +440,7 @@ The latest version of this license is in % \end{ctexexam} % % \subsection{页面边距} +% \label{subsec:page margins} % \begin{function}[EXP,added = 2021-01-13,updated = 2021-03-21]{footnotemargin,footparskip,footparindent,list-labelsep,left,top,hmargin,textwidth,includehead} % \begin{syntax} % footnotemargin = <脚注首行缩进|(0.5\tn{ccwd})> @@ -438,22 +456,20 @@ The latest version of this license is in % \ding{229} 以上选项路径为 \opt{geoset/...} \\ % \opt{geoset} 会将前4个选项以外的其它选项交给 \pkg{geometry} 宏包接口命令 \tn{geometry} 处理,并且选项的键值列表与之相同,上面的选项仅是一小部分,支持的参数可查阅宏包帮助文档。当在此设置页面大小时,会覆盖 \opt{paper} 选项的设置。 % \begin{ctexexam} -% \ctexset +% \geoset % { -% geoset = -% { -% top = 2.5cm, -% bottom = 2.5cm, -% left = 3.2cm, -% right = 3.2cm, -% list-labelsep = \hspace{0.5\ccwd} -% } +% top = 2.5cm, +% bottom = 2.5cm, +% left = 3.2cm, +% right = 3.2cm, +% list-labelsep = \hspace{0.5\ccwd} % } % \end{ctexexam} % \changes{v1.21}{2021/01/13}{增加配置页面边距的选项。} % \end{function} % % \subsection{页眉页脚} +% \label{subsec:header and footer} % \begin{function}[EXP,added = 2021-01-13,updated = 2021-03-14]{head-foot,chap-mark,sec-mark,headrule,footrule,footnoterule} % \begin{syntax} % head-foot = <页眉页脚中的内容> @@ -478,24 +494,22 @@ The latest version of this license is in % \end{syntax} % 命令 \tn{easyhead} 和 \tn{easyfoot} 的含义与 \tn{fancyhead} 和 \tn{fancyfoot} 相同,它们用于 \opt{head-foot} 选项中,设置的是一个名为 \opt{fancy} 的页面风格。\pkg{fancyhdr} 将页眉页脚分成了左中右和奇数页(odd)、偶数页(even)共12个部分,可选参数中E、O代表偶数、奇数,L、C、R代表左、中、右部分。单面打印时,含有偶数的选项无效。 % \begin{ctexexam} -% \ctexset +% \hdrset % { -% hdrset = +% head-foot = % { -% head-foot = -% { -% \easyhead[ER]{\leftmark} -% \easyhead[OL]{\rightmark} -% \easyhead[EL,OR]{\textbf{\thepage}} -% }, -% sec-mark = {\CTEXthesection\hspace{0.5\ccwd}}, -% headrule = {\hrule width \textwidth height 1pt} -% } +% \easyhead[ER]{\leftmark} +% \easyhead[OL]{\rightmark} +% \easyhead[EL,OR]{\textbf{\thepage}} +% }, +% sec-mark = {\CTEXthesection\hspace{0.5\ccwd}}, +% headrule = {\hrule width \textwidth height 1pt} % } % \end{ctexexam} % \end{function} % % \subsection{目录样式} +% \label{subsec:catalog style} % \begin{function}[EXP,added = 2021-01-13,updated = 2021-01-15]{format,indent,rule} % \begin{syntax} % format = <目录标题格式> @@ -524,16 +538,13 @@ The latest version of this license is in % \end{syntax} % \tn{tocrule} 命令生成目录引导线,需要在 \opt{rule} 选项中使用,其中引导线间距需带有长度单位,引导点大小不带单位,为引导点符号正常大小的倍数,引导点一般为英文句号或 \tn{cdot} 中心点符号。页码格式的内容位于页码前面,可以设置页码字体、距离。 % \begin{ctexexam} -% \ctexset +% \tocset % { -% tocset = +% chapter = % { -% chapter = -% { -% format = \addvspace{8pt}\large, -% indent = 1.5\ccwd, -% rule = \tocrule[0.6pc](1.1){.}[\zihao{5}] -% } +% format = \addvspace{8pt}\large, +% indent = 1.5\ccwd, +% rule = \tocrule[0.6pc](1.1){.}[\zihao{5}] % } % } % \end{ctexexam} @@ -785,7 +796,7 @@ The latest version of this license is in %<*class> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e} -\ProvidesExplClass{easybook}{2021/03/25}{1.24}{beta} +\ProvidesExplClass{easybook}{2021/03/31}{1.24a}{beta} \cs_generate_variant:Nn \keys_define:nn {nx} \cs_generate_variant:Nn \int_to_arabic:n {v} @@ -891,7 +902,10 @@ The latest version of this license is in geoset,hdrset,tocset } \seq_map_inline:Nn \c__options_path_seq - {\ctex_define:n {#1 .meta:nn = {ctex/#1}{##1}}} + { + \ctex_define:n {#1 .meta:nn = {ctex/#1}{##1}} + \cs_new:cpn {#1}##1{\keys_set:nn {ctex/#1}{##1}} + } \ctex_define:n { config .tl_set:N = \g__config_tl, @@ -1690,6 +1704,8 @@ The latest version of this license is in thmbox .bool_set:N = \l__thmbox_bool, thmbox .default:n = true, thmbox .initial:n = false, + within .tl_set:N = \l__thm_numberwith_tl, + within .initial:n = chapter, bodyfont .tl_set:N = \l__thm_bodyfont_tl, bodyfont .initial:n = {}, notefont .tl_set:N = \l__thm_notefont_tl, @@ -1700,8 +1716,6 @@ The latest version of this license is in headpunct .initial:n = {}, spacepost .tl_set:N = \l__thm_spacepost_tl, spacepost .initial:n = \ccwd, - numberwith .tl_set:N = \l__thm_numberwith_tl, - numberwith .initial:n = chapter, headindent .tl_set:N = \l__thm_headindent_tl, headindent .initial:n = 0\ccwd, spaceabove .tl_set:N = \l__thm_spaceabove_tl, @@ -1721,7 +1735,7 @@ The latest version of this license is in bodyfont = \l__thm_bodyfont_tl, headpunct = \l__thm_headpunct_tl, postheadspace = \l__thm_spacepost_tl, - numberwithin = \l__thm_numberwith_tl, + within = \l__thm_numberwith_tl, headformat = \NAME\space\NUMBER\NOTE ]{easythm} \clist_map_inline:nn |