From dd6b93c301afbf883d4b5721713e3c2e1325bb36 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 12 Jan 2021 21:25:10 +0000 Subject: easybook (12jan21) git-svn-id: svn://tug.org/texlive/trunk@57403 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/easybook/README.md | 4 +- .../doc/latex/easybook/easybook-demo.pdf | Bin 309273 -> 308818 bytes .../doc/latex/easybook/easybook-demo.tex | 20 +- Master/texmf-dist/doc/latex/easybook/easybook.pdf | Bin 212031 -> 216430 bytes Master/texmf-dist/doc/latex/easybook/easybook.tex | 83 +++-- Master/texmf-dist/tex/latex/easybook/easybook.cls | 386 +++++++++++---------- 6 files changed, 286 insertions(+), 207 deletions(-) diff --git a/Master/texmf-dist/doc/latex/easybook/README.md b/Master/texmf-dist/doc/latex/easybook/README.md index 57446073602..216ecd2fb7d 100644 --- a/Master/texmf-dist/doc/latex/easybook/README.md +++ b/Master/texmf-dist/doc/latex/easybook/README.md @@ -1,6 +1,6 @@ # Easybook book document class -Easybook is a minimalist style template based on the ctexbook book document class. It is mainly suitable for typesetting Chinese books or notes, and can even be slightly modified to become a dissertation template. Some commonly used macro packages have been loaded to achieve general typesetting requirements. Although some details have been considered as much as possible, there are still deficiencies. +Easybook is a minimalist style template based on the ctexbook book document class. It is mainly suitable for typesetting Chinese books or notes, and can even be slightly modified to become a dissertation template. Some commonly used macro packages have been loaded to achieve general typesetting requirements. Although some details have been considered as much as possible, there are still deficiencies. This project is currently under active development. If you have good suggestions, please feel free to give feedback. ## Compilation method @@ -32,7 +32,7 @@ This work may be distributed and/or modified under the conditions of the CC-BY 4 # easybook 书籍文档类 -easybook 是基于 ctexbook 书籍文档类的极简风格模板。它主要适用于中文书籍或笔记的排版,甚至可以稍作修改成为学位论文模板。已加载一些常用的宏包以实现一般的排版要求。尽管已尽可能多地考虑了一些细节,但仍然存在不足。 +easybook 是基于 ctexbook 书籍文档类的极简风格模板。它主要适用于中文书籍或笔记的排版,甚至可以稍作修改成为学位论文模板。已加载一些常用的宏包以实现一般的排版要求。尽管已尽可能多地考虑了一些细节,但仍然存在不足。目前本项目处于活跃的开发状态,如果您有好的建议欢迎进行反馈。 ## 编译方法 diff --git a/Master/texmf-dist/doc/latex/easybook/easybook-demo.pdf b/Master/texmf-dist/doc/latex/easybook/easybook-demo.pdf index 764f18f4469..14cd62c1c55 100644 Binary files a/Master/texmf-dist/doc/latex/easybook/easybook-demo.pdf and b/Master/texmf-dist/doc/latex/easybook/easybook-demo.pdf differ diff --git a/Master/texmf-dist/doc/latex/easybook/easybook-demo.tex b/Master/texmf-dist/doc/latex/easybook/easybook-demo.tex index ab7a864b753..836d9c8e7b1 100644 --- a/Master/texmf-dist/doc/latex/easybook/easybook-demo.tex +++ b/Master/texmf-dist/doc/latex/easybook/easybook-demo.tex @@ -1,10 +1,14 @@ -\documentclass[zihao = -4,openany]{easybook} +\documentclass[ + zihao = -4, + font = myfont, + openany + ]{easybook} + \ctexset { style = { color = forest, - thmbox = true, % capdash = true, % multoc = true, % withpart = true, @@ -23,7 +27,8 @@ tabspread = 1.05, mathspread = 1, capspread = 1, - fnspread = 1 + fnspread = 1.05, + fnsep = 0.5ex }, elfont = { @@ -33,6 +38,13 @@ fnfont = \rmfamily, marfont = \sffamily\footnotesize }, + thmset = + { + thmbox = true, + numberwith = {chapter}, + bodyfont = \normalfont, + headpunct = {.} + }, bibset = { backend = bibtex, @@ -53,7 +65,7 @@ \textcolor[HTML]{00c2ff}{\faEdge}~\url{https://latexstudio.net} \\ \url{https://ctan.org/pkg/easybook} } - \date{2021/01/11\hskip\ccwd\relax v1.21} + \date{2021/01/12\hskip\ccwd\relax v1.21b} } \begin{document} diff --git a/Master/texmf-dist/doc/latex/easybook/easybook.pdf b/Master/texmf-dist/doc/latex/easybook/easybook.pdf index dc02797df43..8e66427d4af 100644 Binary files a/Master/texmf-dist/doc/latex/easybook/easybook.pdf and b/Master/texmf-dist/doc/latex/easybook/easybook.pdf differ diff --git a/Master/texmf-dist/doc/latex/easybook/easybook.tex b/Master/texmf-dist/doc/latex/easybook/easybook.tex index 0ccfde03c0c..44fc91afd61 100644 --- a/Master/texmf-dist/doc/latex/easybook/easybook.tex +++ b/Master/texmf-dist/doc/latex/easybook/easybook.tex @@ -8,7 +8,7 @@ \title{\sffamily easybook书籍文档类} \author{瞿毅} -\date{2021/01/11\hskip\ccwd\relax v1.21\thanks{\url{https://gitee.com/TeX-doc/easybook}}} +\date{2021/01/12\hskip\ccwd\relax v1.21b\thanks{\url{https://gitee.com/TeX-doc/easybook}}} \begin{document} \maketitle @@ -20,15 +20,16 @@ \end{abstract} \tableofcontents -\section{编译文档} -成功地编译演示文档,可能需要满足以下的条件 +\section{编译方式} +模板含有一个使用示例文件,编译前建议满足以下的条件 \begin{itemize} - \item 使用 \hologo{XeLaTeX}(推荐)或 \hologo{LuaLaTeX} 两种编译方式,参考文献使用 \hologo{BibTeX} 编译。 - \item 默认情况下安装方正与思源字体。 - \item 安装最新的\TeX 发行版并将宏包升级为最新。 + \item 使用 \hologo{XeLaTeX}(推荐)或 \hologo{LuaLaTeX} 两种编译方式, + \item 参考文献支持用 \hologo{BibTeX}(默认)或 \hologo{biber} 后端处理。 + \item 由于用到了一些较新的宏包,建议安装最新的\TeX 发行版并将宏包升级为最新。 \end{itemize} \subsection{编译步骤} + \begin{frameverb} xelatex -shell-escape easybook-demo bibtex easybook-demo @@ -42,10 +43,10 @@ LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right. \end{frameverb} -\subsection{字体设置} -默认中文使用方正系列的{\songti 方正书宋}、{\heiti 方正黑体}、{\kaishu 方正楷体}和{\fangsong 方正仿宋},英文使用思源系列的{\rmfamily Noto Serif}、{\sffamily Noto Sans}和{\ttfamily Noto Sans Mono},数学字体使用 \pkg{notomath}。字体点击此处下载\href{https://wws.lanzous.com/b01ns361i}{下载地址}。 +\subsection{字体设置}\label{subsec1} +默认使用\CTeX 预置中文字库,当开启 \opt{font = myfont} 选项时需要安装开源字体,中文使用方正系列的{\songti 方正书宋}、{\heiti 方正黑体}、{\kaishu 方正楷体}和{\fangsong 方正仿宋},英文使用思源系列的{\rmfamily Noto Serif}、{\sffamily Noto Sans}和{\ttfamily Noto Sans Mono},数学字体使用 \pkg{notomath}。相关选项可以见小节 \ref{subsec2},字体点击此处下载\href{https://wws.lanzous.com/b01ns361i}{下载地址}。 -如果您\textsf{懒于安装字体},可以见小节 \ref{subsec1} 使用\CTeX 预置中文字库。如果您不喜欢方正、思源字体,\textsf{自定义字体}需启用选项 \opt{font = none},并可在导言区设置中文字体,粗体与斜体不设置会产生警告。 +如果您不想使用\CTeX 默认字体和方正、思源字体,\textsf{自定义字体}需启用选项 \opt{font = none},并可在导言区设置中文字体,粗体与斜体不设置会产生警告。 \begin{ctexexam} \setCJKmainfont{SimSun}[BoldFont = SimHei,ItalicFont = KaiTi] \setCJKsansfont{SimHei} @@ -59,7 +60,7 @@ \item 带有 \exptarget\expstar{} 号的选项,需要通过\CTeX 宏集提供的用户接口命令 \tn{ctexset} 设定。 \end{itemize} -\subsection{文档类选项}\label{subsec1} +\subsection{文档类选项}\label{subsec2} \begin{function}[rEXP,added = 2021-01-05]{draft} 开启草稿模式会加快编译速度,表现有显示页面边框、行溢出的地方显示黑色方块、图片变成占位方框、显示当前日期和关闭超链接渲染。 \end{function} @@ -82,11 +83,12 @@ 同时开启 \opt{newline}、\opt{entitle} 和 \opt{english} 三个选项以符合英文原生风格。 \end{function} -\begin{function}[rEXP,added = 2021-01-05]{font} +\begin{function}[rEXP,added = 2021-01-05,updated = 2021-01-12]{font} \begin{syntax} - font = + font = \end{syntax} -传递给 \cls{ctexbook} 设置字体,最好不要使用原有的 \opt{fontset} 选项,默认情况下使用自定义字体而不开启这个选项,可根据安装的字体及电脑系统选取。\opt{overleaf} 是一个各系统通用选项,会检测系统环境选取对应字体。 +\changes{v1.21b}{2021/01/12}{默认字体与\CTeX 一致,不再是自定义字体。} +传递给 \cls{ctexbook} 设置字体,最好不要使用原有的 \opt{fontset} 选项,默认情况下使用自定义字体而不开启这个选项,可根据安装的字体及电脑系统选取。\opt{myfont} 与 \opt{none} 选项的相关描述见小节 \ref{subsec1},\opt{overleaf} 是一个各系统通用选项,会检测系统环境选取对应字体。 \end{function} \begin{function}[rEXP,added = 2021-01-05]{paper} @@ -113,10 +115,9 @@ \end{function} \subsubsection{风格} -\begin{function}[EXP,updated = 2021-01-08]{style/color,style/thmbox,style/capdash,style/multoc,style/withpart,style/perchap,style/perpage} +\begin{function}[EXP,added = 2021-01-05,updated = 2021-01-12]{style/color,style/capdash,style/multoc,style/withpart,style/perchap,style/perpage} \begin{syntax} color = <(none)|forest|energy|cyberpunk> - thmbox = capdash = multoc = withpart = @@ -136,7 +137,6 @@ \changes{v1.10}{2021/01/08}{可以自定义主题颜色。} 主题颜色用到这三个颜色,可以使用 \tn{definecolor} 命令进行更改,类似地更改超链接颜色见小节 \ref{ssubsec1}。 \end{function} - \item[thmbox] 开启定理及习题环境的盒子边框。 \item[capdash] 将图表代码标题风格由例如\textsf{图1.1}变为\textsf{图1\textendash 1}的形式。 \item[multoc] 开启双栏目录,可与 \opt{onecolumn} 和 \opt{twocolumn} 选项配合出单栏正文、单栏目录,双栏正文、单栏目录,单栏正文、双栏目录和双栏正文、双栏目录四种方式 。 \item[withpart] 使章跟随每一部分编号,默认不跟随。 @@ -145,7 +145,7 @@ \end{optdesc} \subsubsection{超链接}\label{ssubsec1} -\begin{function}[EXP,updated = 2021-01-08]{link/hyperlink,link/linkcolor,link/linktopage} +\begin{function}[EXP,added = 2021-01-05,updated = 2021-01-08]{link/hyperlink,link/linkcolor,link/linktopage} \begin{syntax} hyperlink = <(edge)|various|none> linkcolor = <(graphite)|cutepink|skyblue|crimson> @@ -167,15 +167,17 @@ \end{optdesc} \subsubsection{行距} -\begin{function}[EXP,added = 2021-01-05]{spread/linespread,spread/tabspread,spread/mathspread,spread/capspread,spread/fnspread} +\begin{function}[EXP,added = 2021-01-05,updated = 2021-01-12]{spread/linespread,spread/tabspread,spread/mathspread,spread/capspread,spread/fnspread,spread/fnsep} \begin{syntax} linespread = <(1.3)> tabspread = <(1)> mathspread = <(1)> capspread = <(1)> fnspread = <(1)> + fnsep = <(0ex)> \end{syntax} -行距因子用于设置各种行距倍数,只能是浮点数,不能带有长度单位。\tn{ctexset} 原有的行距选项\opt{linespread}失效。各行距既可在导言区全局设置也可正文中设置对后面生效,行距的意义为 +\changes{v1.21b}{2021/01/12}{增加脚注线间的距离选项。} +除了 \opt{fnsep} 选项,其它是行距因子用于设置各种行距倍数,只能是浮点数,不能带有长度单位。\tn{ctexset} 原有的行距选项\opt{linespread}失效。各行距既可在导言区全局设置也可正文中设置对后面生效,行距的意义为 \end{function} \begin{optdesc} @@ -184,6 +186,7 @@ \item[mathspread] 数学环境行距。 \item[capspread] 图表代码标题行距。 \item[fnspread] 脚注行距。 + \item[fnspread] 脚注与脚注线间的距离,需带有长度单位。 \end{optdesc} \subsubsection{其它字体} @@ -226,6 +229,38 @@ \item[\tn{printbibliography}] 两种方式\textsf{均使用}此命令打印参考文献,其中可选项仅在 \hologo{biber} 处理时有效。 \end{optdesc} +\subsubsection{定理样式} +\begin{function}[EXP,added = 2021-01-12]{thmset/thmbox,thmset/numberwith,thmset/headpunct,thmset/bodyfont,thmset/notefont,thmset/headindent,thmset/spaceabove,thmset/spacebelow} +\begin{syntax} + thmbox = + numberwith = <(chapter)|section|其它环境|空置> + headpunct = <(未设置)> + bodyfont = <(未设置)> + notefont = <(未设置)> + headindent = <(0\tn{ccwd})> + spaceabove = <(0.75ex plus .1ex)> + spacebelow = <(0.75ex plus .1ex)> +\end{syntax} +\changes{v1.21b}{2021/01/12}{增加配置定理环境样式的选项。} +\end{function} + +\begin{optdesc} + \item[thmbox] 开启定理及习题环境的盒子边框。 + \item[numberwith] 定理编号格式,默认跟随章的编号,也可以与其它定理环境共享编号,空置时不跟随其它计数器编号。 + \item[headpunct] 定理标题后的标记。 + \item[bodyfont] 定理内容部分的字体。 + \item[notefont] 定理标题内容的字体。 + \item[headindent] 定理标题的缩进,默认无缩进,可用 \tn{parindent} 命令设置为段落缩进。 + \item[spaceabove] 定理环境前的间距。 + \item[spacebelow] 定理环境后的间距。 +\end{optdesc} + +\subsubsection{新的定理样式} +定理由 \pkg{thmtools} 设置,自带定理的样式为 \opt{mythm},如果使用这个样式而只是增加新的定理名称,可以这样 +\begin{ctexexam} + \declaretheorem[style = mythm,name = 定理名]{定理环境名} +\end{ctexexam} +若要重新定义一个全新的定理样式,具体参数可以查看 \pkg{thmtools} 宏包帮助文档。 \section{常用环境} \subsection{公式} @@ -272,14 +307,14 @@ \subsubsection{主题列表} 使用 \opt{description} 环境可创建带有主题词的列表。 \begin{ctexexam} -\begin{description} - \item[主题一] 内容一 - \item[主题二] 内容二 -\end{description} + \begin{description} + \item[主题一] 内容一 + \item[主题二] 内容二 + \end{description} \end{ctexexam} \subsection{定理} -\begin{function}[updated = 2021-01-08]{theorem,definition,lemma,corollary,proposition,example,remark,proof} +\begin{function}[added = 2021-01-05,updated = 2021-01-08]{theorem,definition,lemma,corollary,proposition,example,remark,proof} \begin{syntax} \tn{begin}\marg{环境名} <定理内容> diff --git a/Master/texmf-dist/tex/latex/easybook/easybook.cls b/Master/texmf-dist/tex/latex/easybook/easybook.cls index 48f079ad663..3102ff922fa 100644 --- a/Master/texmf-dist/tex/latex/easybook/easybook.cls +++ b/Master/texmf-dist/tex/latex/easybook/easybook.cls @@ -9,10 +9,12 @@ %% https://creativecommons.org/licenses/by/4.0/legalcode \NeedsTeXFormat{LaTeX2e} \RequirePackage{l3keys2e} -\ProvidesExplClass{easybook}{2021/01/11}{v1.21}{} +\ProvidesExplClass{easybook}{2021/01/12}{v1.21b}{} \cs_generate_variant:Nn \keys_define:nn {nx} \cs_generate_variant:Nn \int_to_arabic:n {v} +\cs_new_protected:Npn \__ctex_define:n #1 + {\keys_define:nn {ctex/#1}} \cs_new_protected:Npn \__put_ctexbook:n #1 {\PassOptionsToClass{#1}{ctexbook}} \cs_new_protected:Npn \__patch_cmd:Nnn #1#2#3 @@ -23,10 +25,9 @@ \bool_set_false:N \l__draft_bool \bool_set_false:N \l__newline_bool \bool_set_false:N \l__enstyle_bool +\bool_set_false:N \l__myfont_bool \bool_set_true:N \l__zhtitle_bool -\bool_set_true:N \l__myfont_bool \bool_set_true:N \l__lang_chinese_bool -\bool_set_false:N \l__paper_bfive_bool \bool_set_true:N \l__paper_afour_bool \bool_set_true:N \l__page_twoside_bool \clist_new:N \g__options_clist @@ -40,43 +41,32 @@ english .code:n = {\bool_set_false:N \l__lang_chinese_bool}, font .choice:, + font .value_required:n = true, + font/overleaf .code:n = {}, font/adobe .code:n = - { - \__put_ctexbook:n {fontset = #1} - \bool_set_false:N \l__myfont_bool - }, + {\__put_ctexbook:n {fontset = #1}}, font/founder .code:n = - { - \__put_ctexbook:n {fontset = #1} - \bool_set_false:N \l__myfont_bool - }, + {\__put_ctexbook:n {fontset = #1}}, font/mac .code:n = - { - \__put_ctexbook:n {fontset = #1} - \bool_set_false:N \l__myfont_bool - }, + {\__put_ctexbook:n {fontset = #1}}, font/windows .code:n = - { - \__put_ctexbook:n {fontset = #1} - \bool_set_false:N \l__myfont_bool - }, + {\__put_ctexbook:n {fontset = #1}}, font/linux .code:n = - { - \__put_ctexbook:n {fontset = ubuntu} - \bool_set_false:N \l__myfont_bool - }, - font/overleaf .code:n = - {\bool_set_false:N \l__myfont_bool}, + {\__put_ctexbook:n {fontset = ubuntu}}, font/none .code:n = + {\__put_ctexbook:n {fontset = #1}}, + font/myfont .code:n = { - \__put_ctexbook:n {fontset = #1} - \bool_set_false:N \l__myfont_bool + \bool_set_true:N \l__myfont_bool + \__put_ctexbook:n {fontset = none} }, - font .default:n = windows, + font .initial:n = overleaf, paper .choice:, + paper .value_required:n = true, paper/a4 .code:n = {}, - paper/b5 .code:n = {\bool_set_true:N \l__paper_bfive_bool}, + paper/b5 .code:n = + {\bool_set_false:N \l__paper_afour_bool}, paper .initial:n = a4, oneside .value_forbidden:n = true, @@ -90,7 +80,6 @@ \ProcessKeysOptions{easybook} -\bool_if:NT \l__myfont_bool{\__put_ctexbook:n {fontset = none}} \bool_if:NT \l__enstyle_bool { \bool_set_false:N \l__lang_chinese_bool @@ -106,28 +95,13 @@ \LoadClass[UTF8]{ctexbook} \bool_set_true:N \l__backend_bibtex_bool -\clist_new:N \l__hyperref_clist -\bool_new:N \l__thmbox_bool -\bool_new:N \l__capdash_bool -\bool_new:N \l__multoc_bool -\bool_new:N \l__chap_withpart_bool -\bool_new:N \l__foot_perpart_bool -\bool_new:N \l__foot_perpage_bool -\fp_new:N \l__line_spread_fp -\fp_new:N \l__tab_spread_fp -\tl_new:N \l__math_spread_tl -\tl_new:N \l__cap_spread_tl -\tl_new:N \l__foot_spread_tl -\tl_new:N \l__tab_font_tl -\tl_new:N \l__fig_font_tl -\tl_new:N \l__lst_font_tl -\tl_new:N \l__foot_font_tl -\tl_new:N \l__margin_font_tl -\tl_new:N \l__bib_mysty_tl -\tl_new:N \l__bib_style_tl -\tl_new:N \l__bib_citesty_tl -\tl_new:N \l__bib_file_tl -\tl_new:N \g__config_tl +\bool_new:N \l__capdash_bool +\bool_new:N \l__multoc_bool +\bool_new:N \l__chap_withpart_bool +\bool_new:N \l__foot_perpart_bool +\bool_new:N \l__foot_perpage_bool +\clist_new:N \l__hyperref_clist +\tl_new:N \g__config_tl \ctex_define:n { @@ -136,75 +110,28 @@ spread .meta:nn = {ctex/spread}{#1}, elfont .meta:nn = {ctex/elfont}{#1}, bibset .meta:nn = {ctex/bibset}{#1}, + thmset .meta:nn = {ctex/thmset}{#1}, config .tl_set:N = \g__config_tl, - - style/thmbox .bool_set:N = \l__thmbox_bool, - style/thmbox .default:n = true, - style/thmbox .initial:n = false, - style/capdash .bool_set:N = \l__capdash_bool, - style/capdash .default:n = true, - style/capdash .initial:n = false, - style/multoc .bool_set:N = \l__multoc_bool, - style/multoc .default:n = true, - style/multoc .initial:n = false, - style/withpart .bool_set:N = \l__chap_withpart_bool, - style/withpart .default:n = true, - style/withpart .initial:n = false, - style/perpart .bool_set:N = \l__foot_perpart_bool, - style/perpart .default:n = true, - style/perpart .initial:n = false, - style/perpage .bool_set:N = \l__foot_perpage_bool, - style/perpage .default:n = true, - style/perpage .initial:n = false, - - spread/linespread .fp_set:N = \l__line_spread_fp, - spread/linespread .initial:n = 1.3, - spread/tabspread .fp_set:N = \l__tab_spread_fp, - spread/tabspread .initial:n = 1, - spread/mathspread .tl_set:N = \l__math_spread_tl, - spread/mathspread .initial:n = 1, - spread/capspread .tl_set:N = \l__cap_spread_tl, - spread/capspread .initial:n = 1, - spread/fnspread .tl_set:N = \l__foot_spread_tl, - spread/fnspread .initial:n = 1, - - elfont/tabfont .tl_set:N = \l__tab_font_tl, - elfont/tabfont .initial:n = \sffamily\small, - elfont/figfont .tl_set:N = \l__fig_font_tl, - elfont/figfont .initial:n = \sffamily\small, - elfont/lstfont .tl_set:N = \l__lst_font_tl, - elfont/lstfont .initial:n = \sffamily\small, - elfont/fnfont .tl_set:N = \l__foot_font_tl, - elfont/fnfont .initial:n = \rmfamily, - elfont/marfont .tl_set:N = \l__margin_font_tl, - elfont/marfont .initial:n = \rmfamily\footnotesize, - - bibset/backend .choice:, - bibset/backend/bibtex .code:n = {}, - bibset/backend/biblatex .code:n = - {\bool_set_false:N \l__backend_bibtex_bool}, - bibset/bibstyle .choice:, - bibset/bibstyle .value_required:n = true, - bibset/bibstyle/number .code:n = - { - \tl_set:Nn \l__bib_style_tl{number} - \tl_clear:N \l__bib_mysty_tl - }, - bibset/bibstyle/authoryear .code:n = - { - \tl_set:Nn \l__bib_style_tl{authoryear} - \tl_clear:N \l__bib_mysty_tl - }, - bibset/bibstyle/unknown .code:n = - {\tl_set_eq:NN \l__bib_mysty_tl\l_keys_value_tl}, - bibset/bibstyle .initial:n = number, - bibset/citestyle .code:n = - {\tl_set:Nn \l__bib_citesty_tl{#1}}, - bibset/bibfile .tl_set:N = \l__bib_file_tl, - bibset/bibfile .initial:n = ref/refs.bib, - - lstlistlistingname .tl_set:N = \lstlistlistingname, - lstlistingname .tl_set:N = \lstlistingname + lstlistlistingname .tl_set:N = \lstlistlistingname, + lstlistingname .tl_set:N = \lstlistingname + } +\__ctex_define:n {style} + { + capdash .bool_set:N = \l__capdash_bool, + capdash .default:n = true, + capdash .initial:n = false, + multoc .bool_set:N = \l__multoc_bool, + multoc .default:n = true, + multoc .initial:n = false, + withpart .bool_set:N = \l__chap_withpart_bool, + withpart .default:n = true, + withpart .initial:n = false, + perpart .bool_set:N = \l__foot_perpart_bool, + perpart .default:n = true, + perpart .initial:n = false, + perpage .bool_set:N = \l__foot_perpage_bool, + perpage .default:n = true, + perpage .initial:n = false } \RequirePackage[svgnames]{xcolor} @@ -333,7 +260,7 @@ } \cs_if_exist:NF \kaishu{\cs_gset_eq:NN \kaishu\normalfont} -\bool_if:NT \l__paper_afour_bool +\bool_if:NTF \l__paper_afour_bool { \geometry { @@ -348,9 +275,7 @@ marginparsep = 8pt, marginparwidth = 2.54cm } - } -\bool_if:NT \l__paper_bfive_bool - { + }{ \geometry { b5paper, @@ -628,6 +553,26 @@ {\@mkboth{\MakeUppercase\indexname}{\MakeUppercase\indexname}} {\__markboth:n \indexname} +\tl_new:N \l__tab_font_tl +\tl_new:N \l__fig_font_tl +\tl_new:N \l__lst_font_tl +\tl_new:N \l__foot_font_tl +\tl_new:N \l__margin_font_tl + +\__ctex_define:n {elfont} + { + tabfont .tl_set:N = \l__tab_font_tl, + tabfont .initial:n = \sffamily\small, + figfont .tl_set:N = \l__fig_font_tl, + figfont .initial:n = \sffamily\small, + lstfont .tl_set:N = \l__lst_font_tl, + lstfont .initial:n = \sffamily\small, + fnfont .tl_set:N = \l__foot_font_tl, + fnfont .initial:n = \rmfamily, + marfont .tl_set:N = \l__margin_font_tl, + marfont .initial:n = \rmfamily\footnotesize + } + \DeclareCaptionLabelSeparator{ccwd}{\hspace{\ccwd}} \DeclareCaptionLabelFormat{parens}{\bothIfFirst{#1}{~}(#2)} \DeclareCaptionFont{tabfont}{\l__tab_font_tl} @@ -679,6 +624,29 @@ \AtBeginEnvironment{tabular} {\exp_args:Nx \linespread{\fp_use:N \l__tab_spread_fp}\selectfont\ignorespaces} +\fp_new:N \l__line_spread_fp +\fp_new:N \l__tab_spread_fp +\tl_new:N \l__math_spread_tl +\tl_new:N \l__cap_spread_tl +\tl_new:N \l__foot_spread_tl +\tl_new:N \l__foot_fnsep_tl + +\__ctex_define:n {spread} + { + linespread .fp_set:N = \l__line_spread_fp, + linespread .initial:n = 1.3, + tabspread .fp_set:N = \l__tab_spread_fp, + tabspread .initial:n = 1, + mathspread .tl_set:N = \l__math_spread_tl, + mathspread .initial:n = 1, + capspread .tl_set:N = \l__cap_spread_tl, + capspread .initial:n = 1, + fnspread .tl_set:N = \l__foot_spread_tl, + fnspread .initial:n = 1, + fnsep .tl_set:N = \l__foot_fnsep_tl, + fnsep .initial:n = 0ex + } + \skip_set:Nn \parskip{0pt plus 2pt minus 1pt} \skip_set:Nn \floatsep{12pt plus 2pt minus 2pt} \skip_set:Nn \intextsep{14pt plus 2pt minus 2pt} @@ -758,37 +726,69 @@ }{\__thmname_set:nn #1} } -\declaretheoremstyle[ - spaceabove = .75ex plus .1ex, - spacebelow = .75ex plus .1ex, - headindent = 0\ccwd, - headfont = \color{ctex@emph}\sffamily, - notefont = {}, - notebraces = {}{}, - bodyfont = \normalfont, - headpunct = {.}, - postheadspace = \ccwd, - numberwithin = chapter, - headformat = \NAME\space\NUMBER\NOTE - ]{mythm} -\declaretheorem[style = mythm,name = \c__name_theorem_tl]{theorem} -\declaretheorem[style = mythm,name = \c__name_definition_tl]{definition} -\declaretheorem[style = mythm,name = \c__name_lemma_tl]{lemma} -\declaretheorem[style = mythm,name = \c__name_corollary_tl]{corollary} -\declaretheorem[style = mythm,name = \c__name_proposition_tl]{proposition} -\declaretheorem[style = mythm,name = \c__name_example_tl]{example} -\cs_gset_eq:NN \proof\relax -\declaretheorem{remark}[ - style = mythm, - name = \faCommentingO\space\c__name_remark_tl, - numbered = no - ] -\declaretheorem{proof}[ - style = mythm, - name = \faPencilSquareO\space\proofname, - numbered = no, - qed = \qedsymbol - ] +\bool_new:N \l__thmbox_bool +\tl_new:N \l__thm_numberwith_tl +\tl_new:N \l__thm_headpunct_tl +\tl_new:N \l__thm_bodyfont_tl +\tl_new:N \l__thm_notefont_tl +\tl_new:N \l__thm_headindent_tl +\tl_new:N \l__thm_spaceabove_tl +\tl_new:N \l__thm_spacebelow_tl + +\__ctex_define:n {thmset} + { + thmbox .bool_set:N = \l__thmbox_bool, + thmbox .default:n = true, + thmbox .initial:n = false, + numberwith .tl_set:N = \l__thm_numberwith_tl, + numberwith .initial:n = {chapter}, + headpunct .tl_set:N = \l__thm_headpunct_tl, + headpunct .initial:n = {}, + bodyfont .tl_set:N = \l__thm_bodyfont_tl, + bodyfont .initial:n = {}, + notefont .tl_set:N = \l__thm_notefont_tl, + notefont .initial:n = {}, + headindent .tl_set:N = \l__thm_headindent_tl, + headindent .initial:n = {0\ccwd}, + spaceabove .tl_set:N = \l__thm_spaceabove_tl, + spaceabove .initial:n = {.75ex plus .1ex}, + spacebelow .tl_set:N = \l__thm_spacebelow_tl, + spacebelow .initial:n = {.75ex plus .1ex} + } +\ctex_at_end_preamble:n + { + \declaretheoremstyle[ + spaceabove = \l__thm_spaceabove_tl, + spacebelow = \l__thm_spacebelow_tl, + headindent = \l__thm_headindent_tl, + headfont = \color{ctex@emph}\sffamily, + notefont = \l__thm_notefont_tl, + notebraces = {}{}, + bodyfont = \l__thm_bodyfont_tl, + headpunct = \l__thm_headpunct_tl, + postheadspace = \ccwd, + numberwithin = \l__thm_numberwith_tl, + headformat = \NAME\space\NUMBER\NOTE + ]{mythm} + \declaretheorem[style = mythm,name = \c__name_theorem_tl]{theorem} + \declaretheorem[style = mythm,name = \c__name_definition_tl]{definition} + \declaretheorem[style = mythm,name = \c__name_lemma_tl]{lemma} + \declaretheorem[style = mythm,name = \c__name_corollary_tl]{corollary} + \declaretheorem[style = mythm,name = \c__name_proposition_tl]{proposition} + \declaretheorem[style = mythm,name = \c__name_example_tl]{example} + \cs_gset_eq:NN \proof\relax + \declaretheorem{remark}[ + style = mythm, + name = \c__name_remark_tl, + numbered = no + ] + \declaretheorem{proof}[ + style = mythm, + name = \proofname, + numbered = no, + qed = \qedsymbol + ] + } \settasks { @@ -930,7 +930,7 @@ center~title, IfValueT = {#2}{title = #2} } -\NewTCBox{\fuzzy}{O{yellow}O{}} +\NewTCBox{\fuzzy}{O{DarkSeaGreen}O{}} {nobeforeafter,tcbox~raise~base,blank,fuzzy~halo = 2pt~with~#1,#2} \DeclareTotalTCBox{\concise}{O{Aqua}O{}v} { @@ -940,6 +940,38 @@ colback = #1!15!white,#2 }{#3} +\tl_new:N \l__bib_mysty_tl +\tl_new:N \l__bib_style_tl +\tl_new:N \l__bib_citesty_tl +\tl_new:N \l__bib_file_tl + +\__ctex_define:n {bibset} + { + backend .choice:, + backend/bibtex .code:n = {}, + backend/biblatex .code:n = + {\bool_set_false:N \l__backend_bibtex_bool}, + bibstyle .choice:, + bibstyle .value_required:n = true, + bibstyle/number .code:n = + { + \tl_set:Nn \l__bib_style_tl{#1} + \tl_clear:N \l__bib_mysty_tl + }, + bibstyle/authoryear .code:n = + { + \tl_set:Nn \l__bib_style_tl{#1} + \tl_clear:N \l__bib_mysty_tl + }, + bibstyle/unknown .code:n = + {\tl_set_eq:NN \l__bib_mysty_tl\l_keys_value_tl}, + bibstyle .initial:n = number, + citestyle .code:n = + {\tl_set:Nn \l__bib_citesty_tl{#1}}, + bibfile .tl_set:N = \l__bib_file_tl, + bibfile .initial:n = ref/refs.bib + } + \cs_new_protected:Npn \__bibtex_set: { \tl_if_empty:NTF \l__bib_mysty_tl @@ -952,7 +984,7 @@ {\bibliographystyle{gbt7714-author-year}} \cs_set_eq:NN \cite\citep } - }{ + }{ \exp_args:NV \bibliographystyle\l__bib_mysty_tl } \cs_set:Npn \bibsection{\__title_mark_intoc:n \bibname} @@ -998,18 +1030,18 @@ } } -\skip_set:Nn \footnotemargin{0.5\ccwd} -\skip_set:Nn \footnotesep{0ex} -\cs_gset:Npn \hangfootparskip{0ex} -\cs_gset:Npn \footnoterule - { - \color{ctex@frame}\hrule width 0.35\columnwidth height 0.75pt - \vspace*{2.6pt}\color{black} - } -\bool_if:NT \l__lang_chinese_bool - {\cs_gset:Npn \hangfootparindent{2\ccwd}} \ctex_at_end_preamble:n { + \skip_set:Nn \footnotemargin{0.5\ccwd} + \skip_set:Nn \footnotesep{\l__foot_fnsep_tl} + \cs_gset:Npn \hangfootparskip{0ex} + \cs_gset:Npn \footnoterule + { + \color{ctex@frame}\hrule width 0.35\columnwidth height 0.75pt + \vspace*{2.6pt}\color{black} + } + \bool_if:NT \l__lang_chinese_bool + {\cs_gset:Npn \hangfootparindent{2\ccwd}} \bool_if:NT \l__chap_withpart_bool {\counterwithin*{chapter}{part}} \bool_if:NT \l__foot_perpart_bool @@ -1249,10 +1281,10 @@ \bool_if:NTF \l__newline_bool {\par\nobreak\vskip 1.5pc}{\hspace{\ccwd}} }, - beforeskip = -1.5ex, - afterskip = 3ex, - lotskip = 0.8pc, - lofskip = 0.8pc, + beforeskip = {-1.5ex}, + afterskip = {3ex}, + lotskip = {0.8pc}, + lofskip = {0.8pc}, tocline = {\CTEXifname{\CTEXthechapter\hspace{\ccwd}}{}#2} }, section = @@ -1260,8 +1292,8 @@ hang = true, format = {\color{ctex@frame}\sffamily\Large}, aftername = {\hspace{0.5\ccwd}}, - beforeskip = 1.5ex plus .2ex minus .1ex, - afterskip = 1.5ex plus .2ex minus .1ex, + beforeskip = {1.5ex plus .2ex minus .1ex}, + afterskip = {1.5ex plus .2ex minus .1ex}, tocline = {\CTEXifname{\CTEXthesection\hspace{\ccwd}}{}#2} }, subsection = @@ -1269,8 +1301,8 @@ hang = true, format = {\color{ctex@frame}\sffamily\large}, aftername = {\hspace{0.5\ccwd}}, - beforeskip = 1.3ex plus .2ex minus .1ex, - afterskip = 1.3ex plus .2ex minus .1ex, + beforeskip = {1.3ex plus .2ex minus .1ex}, + afterskip = {1.3ex plus .2ex minus .1ex}, tocline = {\CTEXifname{\CTEXthesubsection\hspace{\ccwd}}{}#2} }, subsubsection = @@ -1278,8 +1310,8 @@ hang = true, format = {\color{ctex@frame}\sffamily}, aftername = {\hspace{0.5\ccwd}}, - beforeskip = \parskip, - afterskip = \parskip + beforeskip = {\parskip}, + afterskip = {\parskip} } } -- cgit v1.2.3