texlive[57413] Master/texmf-dist: easybook (13jan21)

commits+karl at tug.org commits+karl at tug.org
Wed Jan 13 23:14:08 CET 2021


Revision: 57413
          http://tug.org/svn/texlive?view=revision&revision=57413
Author:   karl
Date:     2021-01-13 23:14:08 +0100 (Wed, 13 Jan 2021)
Log Message:
-----------
easybook (13jan21)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/easybook/README.md
    trunk/Master/texmf-dist/doc/latex/easybook/easybook-demo.pdf
    trunk/Master/texmf-dist/doc/latex/easybook/easybook-demo.tex
    trunk/Master/texmf-dist/doc/latex/easybook/easybook.pdf
    trunk/Master/texmf-dist/doc/latex/easybook/easybook.tex
    trunk/Master/texmf-dist/tex/latex/easybook/easybook.cls

Modified: trunk/Master/texmf-dist/doc/latex/easybook/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/easybook/README.md	2021-01-13 22:13:54 UTC (rev 57412)
+++ trunk/Master/texmf-dist/doc/latex/easybook/README.md	2021-01-13 22:14:08 UTC (rev 57413)
@@ -32,7 +32,7 @@
 
 # easybook 书籍文档类
 
-easybook 是基于 ctexbook 书籍文档类的极简风格模板。它主要适用于中文书籍或笔记的排版,甚至可以稍作修改成为学位论文模板。已加载一些常用的宏包以实现一般的排版要求。尽管已尽可能多地考虑了一些细节,但仍然存在不足。目前本项目处于活跃的开发状态,如果您有好的建议欢迎进行反馈。
+easybook 是基于 ctexbook 书籍文档类的极简风格模板。它主要适用于中文书籍或笔记的排版,甚至可以稍作调整成为学位论文模板。已加载一些常用的宏包以实现一般的排版要求。尽管已尽可能多地考虑了一些细节,但仍然存在不足。目前本项目处于活跃的开发状态,如果您有好的建议欢迎进行反馈。
 
 ## 编译方法
 

Modified: trunk/Master/texmf-dist/doc/latex/easybook/easybook-demo.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/easybook/easybook-demo.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/easybook/easybook-demo.tex	2021-01-13 22:13:54 UTC (rev 57412)
+++ trunk/Master/texmf-dist/doc/latex/easybook/easybook-demo.tex	2021-01-13 22:14:08 UTC (rev 57413)
@@ -1,6 +1,7 @@
 \documentclass[
   zihao = -4,
   font = myfont,
+  paper = a4paper,
   openany
   ]{easybook}
 
@@ -45,6 +46,36 @@
         bodyfont = \normalfont,
         headpunct = {.}
       },
+    geoset =
+      {
+        vmargin = {2.54cm,2.54cm},
+        hmargin = 3.17cm,
+        headheight = 2.04cm,
+        headsep = 0.5cm,
+        ignorefoot
+      },
+    hdrset =
+      {
+        echead = \color{Teal}\kaishu\leftmark,
+        ochead = \color{Teal}\kaishu\rightmark,
+        elhead = \color{Teal}\thepage,
+        orhead = \color{Teal}\thepage
+      },
+    tocset =
+      {
+        part =
+          {
+            format = \addvspace{1pc}\sffamily\large,
+            indent = 0\ccwd,
+            rule = \tocrule{}[\bfseries]
+          },
+        chapter =
+          {
+            format = \addvspace{1pc}\sffamily\large,
+            indent = 0\ccwd,
+            rule = \tocrule[0.7pc][1.2]{$\cdot$}[\bfseries]
+          }
+      },
     bibset =
       {
         backend = bibtex,
@@ -65,7 +96,7 @@
         \textcolor[HTML]{00c2ff}{\faEdge}~\url{https://latexstudio.net} \\
         \url{https://ctan.org/pkg/easybook}
       }
-    \date{2021/01/12\hskip\ccwd\relax v1.21b}
+    \date{2021/01/13\hskip\ccwd\relax v1.21c}
   }
 
 \begin{document}

Modified: trunk/Master/texmf-dist/doc/latex/easybook/easybook.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/easybook/easybook.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/easybook/easybook.tex	2021-01-13 22:13:54 UTC (rev 57412)
+++ trunk/Master/texmf-dist/doc/latex/easybook/easybook.tex	2021-01-13 22:14:08 UTC (rev 57413)
@@ -8,15 +8,14 @@
 
 \title{\sffamily easybook书籍文档类}
 \author{瞿毅}
-\date{2021/01/12\hskip\ccwd\relax v1.21b\thanks{\url{https://gitee.com/TeX-doc/easybook}}}
+\date{2021/01/13\hskip\ccwd\relax v1.21c\thanks{\url{https://gitee.com/TeX-doc/easybook}}}
 
 \begin{document}
 \maketitle
 \changes{v1.20}{2021/01/09}{修改和完善用户文档。}
 \changes{v1.20}{2021/01/09}{模板更改为使用CC-BY许可协议。}
-\changes{v1.21}{2021/01/11}{修复单面文档时页眉横线消失的问题。}
 \begin{abstract}
-  \cls{easybook} 是基于 \cls{ctexbook} 书籍文档类创建以极简为风格的模板,可以看作对 \cls{ctexbook} 的进一步包装。虽然\CTeX 文档类提供了较好的中文支持,但想实现个性化功能一般需要在其基础上载入更多宏包来定制。\cls{easybook} 考虑了一些细节并载入一些常用宏包实现一般的排版需求,它适用于排版中英文书籍或笔记,甚至可稍加修改成为学位论文模板。
+  \cls{easybook} 是基于 \cls{ctexbook} 书籍文档类创建以极简为风格的模板,可以看作对 \cls{ctexbook} 的进一步包装。虽然\CTeX 文档类提供了较好的中文支持,但想实现个性化功能一般需要在其基础上载入更多宏包来定制。\cls{easybook} 考虑了一些细节并载入一些常用宏包实现一般的排版需求,它适用于排版中英文书籍或笔记,甚至可稍加调整成为学位论文模板。
 \end{abstract}
 \tableofcontents
 
@@ -29,7 +28,6 @@
 \end{itemize}
 
 \subsection{编译步骤}
-
 \begin{frameverb}
     xelatex -shell-escape easybook-demo
     bibtex easybook-demo
@@ -53,7 +51,7 @@
     \setCJKmonofont{FangSong}
 \end{ctexexam}
 
-\section{模板选项}
+\section{文档类选项}\label{subsec2}
 标准 \cls{book} 文类与 \cls{ctexbook} 文类的选项同样适用于本文档。除此之外选项分为两类
 \begin{itemize}
   \item 带有 \rexptarget\rexpstar{} 号的选项,需要在引入文档类的时候设定。
@@ -60,7 +58,6 @@
   \item 带有 \exptarget\expstar{} 号的选项,需要通过\CTeX 宏集提供的用户接口命令 \tn{ctexset} 设定。
 \end{itemize}
 
-\subsection{文档类选项}\label{subsec2}
 \begin{function}[rEXP,added = 2021-01-05]{draft}
 开启草稿模式会加快编译速度,表现有显示页面边框、行溢出的地方显示黑色方块、图片变成占位方框、显示当前日期和关闭超链接渲染。
 \end{function}
@@ -91,14 +88,14 @@
 传递给 \cls{ctexbook} 设置字体,最好不要使用原有的 \opt{fontset} 选项,默认情况下使用自定义字体而不开启这个选项,可根据安装的字体及电脑系统选取。\opt{myfont} 与 \opt{none} 选项的相关描述见小节 \ref{subsec1},\opt{overleaf} 是一个各系统通用选项,会检测系统环境选取对应字体。
 \end{function}
 
-\begin{function}[rEXP,added = 2021-01-05]{paper}
+\begin{function}[rEXP,added = 2021-01-05,updated = 2021-01-13]{paper}
 \begin{syntax}
-  paper = <(a4)|b5>
+  paper = <(a4paper)|b5paper|letterpaper|...>
 \end{syntax}
-设置版面规格,有A4和B5两种纸张大小,建议 选项 \opt{a4} 和 \opt{zihao = 5},选项 \opt{b5} 和 \opt{zihao = -4} 配合。
+设置页面大小,交给 \pkg{geometry} 宏包处理,可使用它支持的所有规格。建议选项 \opt{b5paper} 和 \opt{zihao = 5},选项 \opt{a4paper} 和 \opt{zihao = -4} 配合。
 \end{function}
 
-\subsection{接口选项}
+\section{接口选项}
 \begin{function}[added = 2021-01-05]{\ctexset}
 \begin{syntax}
   \tn{ctexset}\marg{键值列表}
@@ -114,7 +111,7 @@
 \opt{config}为载入用户配置选项,配置文件名不需加括号但需带有后缀名如 \opt{tex}、\opt{def} 和 \opt{cfg}。
 \end{function}
 
-\subsubsection{风格}
+\subsection{风格}
 \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>
@@ -135,7 +132,7 @@
       \tn{definecolor}\oarg{类型}\marg{名称}\marg{模式列表}\marg{参数列表}
     \end{syntax}
     \changes{v1.10}{2021/01/08}{可以自定义主题颜色。}
-    主题颜色用到这三个颜色,可以使用 \tn{definecolor} 命令进行更改,类似地更改超链接颜色见小节 \ref{ssubsec1}。
+    主题颜色用到这三个颜色,可以使用 \tn{definecolor} 命令进行更改,类似地更改超链接颜色见小节 \ref{subsec3}。
     \end{function}
   \item[capdash] 将图表代码标题风格由例如\textsf{图1.1}变为\textsf{图1\textendash 1}的形式。
   \item[multoc] 开启双栏目录,可与 \opt{onecolumn} 和 \opt{twocolumn} 选项配合出单栏正文、单栏目录,双栏正文、单栏目录,单栏正文、双栏目录和双栏正文、双栏目录四种方式 。
@@ -144,7 +141,7 @@
   \item[perpage] 使脚注跟随每一页编号,默认不跟随。
 \end{optdesc}
 
-\subsubsection{超链接}\label{ssubsec1}
+\subsection{超链接}\label{subsec3}
 \begin{function}[EXP,added = 2021-01-05,updated = 2021-01-08]{link/hyperlink,link/linkcolor,link/linktopage}
 \begin{syntax}
   hyperlink = <(edge)|various|none>
@@ -166,7 +163,7 @@
   \item[linktopage] 将目录中的超链接置于页码上,默认是置于标题上。
 \end{optdesc}
 
-\subsubsection{行距}
+\subsection{行距}
 \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)>
@@ -189,7 +186,7 @@
   \item[fnspread] 脚注与脚注线间的距离,需带有长度单位。
 \end{optdesc}
 
-\subsubsection{其它字体}
+\subsection{其它字体}
 \begin{function}[EXP,added = 2021-01-08]{elfont/tabfont,elfont/figfont,elfont/lstfont,elfont/fnfont,elfont/marfont}
 \begin{syntax}
   tabfont = <\tn{sffamily}\tn{small}>
@@ -209,7 +206,7 @@
   \item[marfont] 边注的字体设置。
 \end{optdesc}
 
-\subsubsection{参考文献}
+\subsection{参考文献}
 \begin{function}[EXP,added = 2021-01-11]{bibset/backend,bibset/bibstyle,bibset/citestyle,bibset/bibfile,\printbibliography}
 \begin{syntax}
   backend = <(bibtex)|biblatex>
@@ -229,7 +226,7 @@
   \item[\tn{printbibliography}] 两种方式\textsf{均使用}此命令打印参考文献,其中可选项仅在 \hologo{biber} 处理时有效。
 \end{optdesc}
 
-\subsubsection{定理样式}
+\subsection{定理样式}
 \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 = <true|(false))>
@@ -261,6 +258,84 @@
     \declaretheorem[style = mythm,name = 定理名]{定理环境名}
 \end{ctexexam}
 若要重新定义一个全新的定理样式,具体参数可以查看 \pkg{thmtools} 宏包帮助文档。
+
+\subsection{页面边距}
+\begin{function}[EXP,added = 2021-01-13]{geoset/left,geoset/top,geoset/hmargin,geoset/textwidth,geoset/includehead,...}
+\begin{syntax}
+  left = <长度>
+  top = <长度>
+  hmargin = \marg{左边距,右边距}
+  textwidth = <长度>
+  includehead = <true|(false)>
+\end{syntax}
+\changes{v1.21c}{2021/01/13}{增加配置页面边距的选项。}
+\opt{geoset} 将选项交给 \pkg{geometry} 宏包接口命令 \tn{geometry} 处理,并且选项的键值列表与之相同,支持的参数可查阅宏包帮助文档。当在此设置页面大小时,会覆盖 \opt{paper} 选项的设置。
+\begin{ctexexam}
+    \ctexset
+      {
+        geoset =
+          {
+            top = 2.5cm,
+            bottom = 2.5cm,
+            left = 3.2cm,
+            right = 3.2cm
+          }
+      }
+\end{ctexexam}
+\end{function}
+
+\subsection{页眉页脚}
+\begin{function}[EXP,added = 2021-01-13]{hdrset/elhead,hdrset/echead,hdrset/ochead,hdrset/orhead,hdrset/olfoot,...}
+\begin{syntax}
+  elhead = \tn{color{ctex at frame}}\tn{thepage}
+  echead = \tn{color{ctex at frame}}\tn{kaishu}\tn{leftmark}
+  ochead = \tn{color{ctex at frame}}\tn{kaishu}\tn{rightmark}
+  orhead = \tn{color{ctex at frame}}\tn{thepage}
+  olfoot = <未设置>
+\end{syntax}
+\changes{v1.21}{2021/01/11}{修复单面文档时页眉横线消失的问题。}
+\changes{v1.21c}{2021/01/13}{增加配置页眉页脚的选项。}
+\opt{hdrset} 将选项交给 \pkg{fancyhdr} 宏包页面风格命令 \tn{fancyhf} 处理,\pkg{fancyhdr} 将页眉页脚分成左中右和奇数页(odd)、偶数页(even)共12个部分,所以设置了对应的12个选项。\opt{head} 与 \opt{foot} 表示页眉与页脚区域,前缀e、o代表偶数、奇数,前缀l、c、r代表左、中、右部分。单面打印时,偶数前缀的选项无效。
+\begin{ctexexam}
+    \ctexset
+      {
+        hdrset =
+          {
+            erhead = \leftmark,
+            elhead = \textbf{\thepage},
+            olhead = \rightmark,
+            orhead = \textbf{\thepage}
+          }
+      }
+\end{ctexexam}
+\end{function}
+
+\subsection{目录样式}
+\begin{function}[EXP,added = 2021-01-13]{tocset/.../format,tocset/.../indent,tocset/.../rule,\tocrule}
+\begin{syntax}
+  format = <目录标题格式>
+  indent = <目录标题左边缩进>
+  rule = <目录引导线样式>
+  \tn{tocrule} = \oarg{引导点间距}\oarg{引导点大小}\marg{引导点}\oarg{页码格式}
+\end{syntax}
+\changes{v1.21c}{2021/01/13}{增加配置目录样式的选项。}
+\opt{tocset} 将目录样式交给 \pkg{titletoc} 处理,预置了 \opt{part}、\opt{chapter}、\opt{section}、\opt{subsection} 和 \opt{lists} 五种级别的目录标题,键值列表中的...代表它们。\opt{lists} 为图片、表格和代码目录格式的级别。\tn{tocrule} 命令生成目录引导线,需要在 \opt{rule} 选项中使用,其中引导线间距需带有长度单位,引导点大小不带单位,为引导点符号正常大小的倍数,引导点一般为英文句号或 \tn{cdot} 中心点符号。页码格式的内容位于页码前面,可以设置页码字体、距离。
+\begin{ctexexam}
+    \ctexset
+      {
+        tocset =
+          {
+            chapter =
+              {
+                format = \addvspace{8pt}\large,
+                indent = 1.5\ccwd,
+                rule = \tocrule[0.6pc][1.1]{.}[\zihao{5}]
+              }
+          }
+      }
+\end{ctexexam}
+\end{function}
+
 \section{常用环境}
 
 \subsection{公式}
@@ -288,7 +363,7 @@
 \end{ctexexam}
 \end{function}
 
-\subsubsection{排序列表}\label{ssubsec2}
+\subsubsection{排序列表}\label{ssubsec1}
 使用 \opt{enumerate} 环境可创建排序列表,使用 \opt{enumerate*} 环境产生行内部列表,可以使用\textsf{A、a、I、i和1}作为可选项为 \opt{enumerate} 与 \opt{enumerate*} 格式化标签。若生成\textsf{Item I、Item II、Item III}格式可以这样
 \begin{ctexexam}
     \begin{enumerate*}[(a)]
@@ -330,7 +405,7 @@
   \tn{item} <习题内容>
   \tn{end}\marg{exercise}
 \end{syntax}
-习题环境 \opt{exercise} 的标题紧接上一节编号并加入目录与页眉,当使用星号环境时不进行编号。三个可选参数中颜色为自定义或 \pkg{xcolor} 包含的颜色名称(深色),正文编号格式与小节 \ref{ssubsec2} 排序列表相同,标题名默认为摘要,参数只能\textsf{从右往左}省略。
+习题环境 \opt{exercise} 的标题紧接上一节编号并加入目录与页眉,当使用星号环境时不进行编号。三个可选参数中颜色为自定义或 \pkg{xcolor} 包含的颜色名称(深色),正文编号格式与小节 \ref{ssubsec1} 排序列表相同,标题名默认为摘要,参数只能\textsf{从右往左}省略。
 \begin{ctexexam}
     \begin{exercise}[black][1.][习题]
     \item 习题内容

Modified: trunk/Master/texmf-dist/tex/latex/easybook/easybook.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/easybook/easybook.cls	2021-01-13 22:13:54 UTC (rev 57412)
+++ trunk/Master/texmf-dist/tex/latex/easybook/easybook.cls	2021-01-13 22:14:08 UTC (rev 57413)
@@ -9,7 +9,7 @@
 %%   https://creativecommons.org/licenses/by/4.0/legalcode
 \NeedsTeXFormat{LaTeX2e}
 \RequirePackage{l3keys2e}
-\ProvidesExplClass{easybook}{2021/01/12}{v1.21b}{}
+\ProvidesExplClass{easybook}{2021/01/13}{v1.21c}{}
 
 \cs_generate_variant:Nn \keys_define:nn {nx}
 \cs_generate_variant:Nn \int_to_arabic:n {v}
@@ -28,7 +28,6 @@
 \bool_set_false:N \l__myfont_bool
 \bool_set_true:N  \l__zhtitle_bool
 \bool_set_true:N  \l__lang_chinese_bool
-\bool_set_true:N  \l__paper_afour_bool
 \bool_set_true:N  \l__page_twoside_bool
 \clist_new:N      \g__options_clist
 
@@ -64,10 +63,9 @@
 
     paper         .choice:,
     paper         .value_required:n = true,
-    paper/a4      .code:n = {},
-    paper/b5      .code:n =
-      {\bool_set_false:N \l__paper_afour_bool},
-    paper         .initial:n = a4,
+    paper/unknown .code:n =
+      {\PassOptionsToPackage{#1}{geometry}},
+    paper         .initial:n = a4paper,
 
     oneside       .value_forbidden:n = true,
     twoside       .value_forbidden:n = true,
@@ -95,13 +93,12 @@
 \LoadClass[UTF8]{ctexbook}
 
 \bool_set_true:N \l__backend_bibtex_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
-\clist_new:N  \l__hyperref_clist
-\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
+\tl_new:N   \g__config_tl
 
 \ctex_define:n
   {
@@ -111,6 +108,9 @@
     elfont              .meta:nn = {ctex/elfont}{#1},
     bibset              .meta:nn = {ctex/bibset}{#1},
     thmset              .meta:nn = {ctex/thmset}{#1},
+    geoset              .meta:nn = {ctex/geoset}{#1},
+    hdrset              .meta:nn = {ctex/hdrset}{#1},
+    tocset              .meta:nn = {ctex/tocset}{#1},
     config              .tl_set:N = \g__config_tl,
     lstlistlistingname  .tl_set:N = \lstlistlistingname,
     lstlistingname      .tl_set:N = \lstlistingname
@@ -218,7 +218,7 @@
   {\__set_zhfont_kaishu:nn {#1}{\__option_zhfont:}}
 \cs_new_protected:Npx \__set_zhfont_fangsong:n #1
   {\__set_zhfont_fangsong:nn {#1}{\__option_zhfont:}}
-  
+
 \bool_if:NT \l__myfont_bool
   {
     \__setmainfont:nn {NotoSerif}
@@ -260,35 +260,30 @@
   }
 \cs_if_exist:NF \kaishu{\cs_gset_eq:NN \kaishu\normalfont}
 
-\bool_if:NTF \l__paper_afour_bool
+\clist_new:N \g__geometry_clist
+\__ctex_define:n {geoset}
   {
-    \geometry
+    unknown .code:n =
       {
-        a4paper,
-        columnsep = 2\ccwd,
-        vmargin = 2.54cm,
-        hmargin = 3.17cm,
-        headheight = 2.04cm,
-        headsep = 0.5cm,
-        footskip = 0.79cm,
-        footnotesep = 0.5cm,
-        marginparsep = 8pt,
-        marginparwidth = 2.54cm
+        \clist_gput_right:Nx \g__geometry_clist
+          {
+            \l_keys_key_str
+            \tl_if_empty:NF \l_keys_value_tl{ = {#1}}
+          }
       }
-  }{
-    \geometry
-      {
-        b5paper,
-        columnsep = 2\ccwd,
-        margin = 2.54cm,
-        headheight = 2.09cm,
-        headsep = 0.45cm,
-        footskip = 0.7cm,
-        footnotesep = 0.45cm,
-        marginparsep = 0.25cm,
-        marginparwidth = 2.25cm
-      }
   }
+\geometry
+  {
+    vmargin = 2.54cm,
+    hmargin = 3.17cm,
+    columnsep = 2\ccwd,
+    headheight = 2.04cm,
+    headsep = 0.5cm,
+    footskip = 0.79cm,
+    footnotesep = 0.5cm,
+    marginparsep = 8pt,
+    marginparwidth = 2.54cm
+  }
 
 \cs_gset:Npn \cleardoublepage
   {
@@ -305,127 +300,214 @@
     \@mainmatterfalse
     \pagenumbering{Roman}
   }
-\pagestyle{fancy}
-\fancyhf{}
-\bool_if:NTF \l__page_twoside_bool
+
+\__ctex_define:n {hdrset}
   {
-    \cs_gset:Npn \chaptermark#1
+    elhead  .tl_set:N = \l__fancyhead_EL_tl,
+    elhead  .initial:n = \color{ctex at frame}\thepage,
+    echead  .tl_set:N = \l__fancyhead_EC_tl,
+    echead  .initial:n = \color{ctex at frame}\kaishu\leftmark,
+    erhead  .tl_set:N = \l__fancyhead_ER_tl,
+    erhead  .initial:n = {},
+    olhead  .tl_set:N = \l__fancyhead_OL_tl,
+    olhead  .initial:n = {},
+    ochead  .tl_set:N = \l__fancyhead_OC_tl,
+    ochead  .initial:n = \color{ctex at frame}\kaishu\rightmark,
+    orhead  .tl_set:N = \l__fancyhead_OR_tl,
+    orhead  .initial:n = \color{ctex at frame}\thepage,
+    elfoot  .tl_set:N = \l__fancyfoot_EL_tl,
+    elfoot  .initial:n = {},
+    ecfoot  .tl_set:N = \l__fancyfoot_EC_tl,
+    ecfoot  .initial:n = {},
+    erfoot  .tl_set:N = \l__fancyfoot_ER_tl,
+    erfoot  .initial:n = {},
+    olfoot  .tl_set:N = \l__fancyfoot_OL_tl,
+    olfoot  .initial:n = {},
+    ocfoot  .tl_set:N = \l__fancyfoot_OC_tl,
+    ocfoot  .initial:n = {},
+    orfoot  .tl_set:N = \l__fancyfoot_OR_tl,
+    orfoot  .initial:n = {}
+  }
+
+\ctex_at_end_preamble:n
+  {
+    \exp_args:NV \geometry\g__geometry_clist
+    \pagestyle{fancy}
+    \fancyhf{}
+    \bool_if:NTF \l__page_twoside_bool
       {
-        \markboth
+        \cs_gset:Npn \chaptermark#1
           {
-            \MakeUppercase
+            \markboth
               {
-                \ifnum\c at secnumdepth>\m at ne
-                  \if at mainmatter
-                    \ifodd\CTEX at chapter@numbering
-                      \CTEXthechapter\hspace{\ccwd}
-                    \fi
-                  \fi
-                \fi#1
+                \MakeUppercase
+                  {
+                    \ifnum\c at secnumdepth>\m at ne
+                      \if at mainmatter
+                        \ifodd\CTEX at chapter@numbering
+                          \CTEXthechapter\hspace{\ccwd}
+                        \fi
+                      \fi
+                    \fi#1
+                  }
+              }{
+                \MakeUppercase
+                  {
+                    \ifnum\c at secnumdepth>\m at ne
+                      \if at mainmatter
+                        \ifodd\CTEX at chapter@numbering
+                          \CTEXthechapter\hspace{\ccwd}
+                        \fi
+                      \fi
+                    \fi#1
+                  }
               }
-          }{
-            \MakeUppercase
+          }
+        \fancyhead[EL]{\l__fancyhead_EL_tl}
+        \fancyhead[EC]{\l__fancyhead_EC_tl}
+        \fancyhead[ER]{\l__fancyhead_ER_tl}
+        \fancyhead[OL]{\l__fancyhead_OL_tl}
+        \fancyhead[OC]{\l__fancyhead_OC_tl}
+        \fancyhead[OR]{\l__fancyhead_OR_tl}
+        \fancyfoot[EL]{\l__fancyfoot_EL_tl}
+        \fancyfoot[EC]{\l__fancyfoot_EC_tl}
+        \fancyfoot[ER]{\l__fancyfoot_ER_tl}
+        \fancyfoot[OL]{\l__fancyfoot_OL_tl}
+        \fancyfoot[OC]{\l__fancyfoot_OC_tl}
+        \fancyfoot[OR]{\l__fancyfoot_OR_tl}
+        \cs_gset_eq:NN \ps at plain\ps at empty
+      }{
+        \cs_gset:Npn \chaptermark#1
+          {
+            \markboth
               {
-                \ifnum\c at secnumdepth>\m at ne
-                  \if at mainmatter
-                    \ifodd\CTEX at chapter@numbering
-                      \CTEXthechapter\hspace{\ccwd}
-                    \fi
-                  \fi
-                \fi#1
-              }
+                \MakeUppercase
+                  {
+                    \ifnum\c at secnumdepth>\m at ne
+                      \if at mainmatter
+                        \ifodd\CTEX at chapter@numbering
+                          \CTEXthechapter\hspace{\ccwd}
+                        \fi
+                      \fi
+                    \fi#1
+                  }
+              }{}
           }
+        \fancyhead[L]{\l__fancyhead_OL_tl}
+        \fancyhead[C]{\l__fancyhead_OC_tl}
+        \fancyhead[R]{\l__fancyhead_OR_tl}
+        \fancyfoot[L]{\l__fancyfoot_OL_tl}
+        \fancyfoot[C]{\l__fancyfoot_OC_tl}
+        \fancyfoot[R]{\l__fancyfoot_OR_tl}
+        \cs_gset_eq:NN \ps at plain\ps at empty
       }
-    \fancyhead[EC]{\color{ctex at frame}\kaishu\leftmark}
-    \fancyhead[OC]{\color{ctex at frame}\kaishu\rightmark}
-    \fancyhead[EL,OR]{\color{ctex at frame}\thepage}
-    \cs_gset_eq:NN \ps at plain\ps at empty
-  }{
-    \cs_gset:Npn \chaptermark#1
+    \cs_gset:Npn \sectionmark#1
       {
-        \markboth
+        \markright
           {
-            \MakeUppercase
-              {
-                \ifnum\c at secnumdepth>\m at ne
-                  \if at mainmatter
-                    \ifodd\CTEX at chapter@numbering
-                      \CTEXthechapter\hspace{\ccwd}
-                    \fi
-                  \fi
-                \fi#1
-              }
-          }{}
+            \ifnum\c at secnumdepth>\z@
+              \ifodd\CTEX at section@numbering
+                \CTEXthesection\hspace{0.5\ccwd}
+              \fi
+            \fi#1
+          }
       }
-    \fancyhead[L]{\color{ctex at frame}\kaishu\leftmark}
-    \fancyhead[R]{\color{ctex at frame}\kaishu\rightmark}
-    \fancyfoot[C]{\color{ctex at frame}\thepage}
-    \fancypagestyle{plain}
+    \cs_gset:Npn \headrule
       {
-        \fancyhf{}\cs_set:Npn \headrule{}
-        \fancyfoot[C]{\color{ctex at frame}\thepage}
+        \color{ctex at frame}\vspace{2.5pt}
+        \hrule width\textwidth height 0.75pt
       }
-  }
-\cs_gset:Npn \sectionmark#1
-  {
-    \markright
+    \bool_if:NT \l__draft_bool
       {
-        \ifnum\c at secnumdepth>\z@
-          \ifodd\CTEX at section@numbering
-            \CTEXthesection\hspace{0.5\ccwd}
-          \fi
-        \fi#1
+        \bool_if:NTF \l__page_twoside_bool
+          {\fancyfoot[C]{\color{gray!60}\sffamily\today}}
+          {\fancyhead[L]{\color{gray!60}\sffamily\today}}
+        \geometry{showframe}
       }
   }
-\cs_gset:Npn \headrule
+
+\ctex_define:n
   {
-    \color{ctex at frame}\vspace{2.5pt}
-    \hrule width\textwidth height 0.75pt
+    tocset/part       .meta:nn = {ctex/tocset/part}{#1},
+    tocset/chapter    .meta:nn = {ctex/tocset/chapter}{#1},
+    tocset/section    .meta:nn = {ctex/tocset/section}{#1},
+    tocset/subsection .meta:nn = {ctex/tocset/subsection}{#1},
+    tocset/list       .meta:nn = {ctex/tocset/list}{#1},
   }
-\bool_if:NT \l__draft_bool
+\__ctex_define:n {tocset}
   {
-    \bool_if:NTF \l__page_twoside_bool
-      {\fancyfoot[C]{\color{gray!60}\sffamily\today}}
-      {\fancyhead[C]{\color{gray!60}\sffamily\today}}
-    \geometry{showframe}
+    part/format       .tl_set:N = \l__toc_part_format_tl,
+    part/format       .initial:n = 
+      {\addvspace{1pc}\sffamily\large},
+    part/indent       .tl_set:N = \l__toc_part_indent_tl,
+    part/indent       .initial:n = 0\ccwd,
+    part/rule         .tl_set:N = \l__toc_part_rule_tl,
+    part/rule         .initial:n = \tocrule{}[\bfseries],
+
+    chapter/format    .tl_set:N = \l__toc_chap_format_tl,
+    chapter/format    .initial:n =
+      {\addvspace{1pc}\sffamily\large},
+    chapter/indent    .tl_set:N = \l__toc_chap_indent_tl,
+    chapter/indent    .initial:n = 0\ccwd,
+    chapter/rule      .tl_set:N = \l__toc_chap_rule_tl,
+    chapter/rule      .initial:n = \tocrule{$\cdot$}[\bfseries],
+
+    section/format    .tl_set:N = \l__toc_sec_format_tl,
+    section/format    .initial:n = \addvspace{0.35pc},
+    section/indent    .tl_set:N = \l__toc_sec_indent_tl,
+    section/indent    .initial:n = 1.5\ccwd,    
+    section/rule      .tl_set:N = \l__toc_sec_rule_tl,
+    section/rule      .initial:n = \tocrule{$\cdot$},
+
+    subsection/format .tl_set:N = \l__toc_subsec_format_tl,
+    subsection/forma  .initial:n = \addvspace{0.35pc},
+    subsection/indent .tl_set:N = \l__toc_subsec_indent_tl,
+    subsection/indent .initial:n = 3.8\ccwd,
+    subsection/rule   .tl_set:N = \l__toc_subsec_rule_tl,
+    subsection/rule   .initial:n = \tocrule{$\cdot$},
+
+    lists/format      .tl_set:N = \l__toc_lists_format_tl,
+    lists/format      .initial:n = \addvspace{0.2pc},
+    lists/indent      .tl_set:N = \l__toc_lists_indent_tl,
+    lists/indent      .initial:n = 0\ccwd,
+    lists/rule        .tl_set:N = \l__toc_lists_rule_tl,
+    lists/rule        .initial:n = \tocrule{$\cdot$}
   }
 
+\NewDocumentCommand{\tocrule}{O{0.7pc}O{1.2}mO{}}
+  {
+    \normalsize\normalfont
+    \titlerule*[#1]{\scalebox{#2}{#3}}#4\contentspage
+  }
 \titlecontents{part}
-  [0\ccwd]
-  {\addvspace{1pc}\sffamily\large}
-  {}{}
-  {\normalsize\titlerule*{}\bf\contentspage}
+  [\l__toc_part_indent_tl]
+  {\l__toc_part_format_tl}{}{}
+  {\l__toc_part_rule_tl}
 \titlecontents{chapter}
-  [0\ccwd]
-  {\addvspace{1pc}\sffamily\large}
-  {}{}
-  {\normalsize\titlerule*[0.65pc]{\scalebox{1.2}{$\cdot$}}\bf\contentspage}
+  [\l__toc_chap_indent_tl]
+  {\l__toc_chap_format_tl}{}{}
+  {\l__toc_chap_rule_tl}
 \titlecontents{section}
-  [1.5\ccwd]
-  {\addvspace{0.35pc}}
-  {}{}
-  {\titlerule*[0.65pc]{\scalebox{1.2}{$\cdot$}}\contentspage}
+  [\l__toc_sec_indent_tl]
+  {\l__toc_sec_format_tl}{}{}
+  {\l__toc_sec_rule_tl}
 \titlecontents{subsection}
-  [3.8\ccwd]
-  {\addvspace{0.35pc}}
-  {}{}
-  {\titlerule*[0.65pc]{\scalebox{1.2}{$\cdot$}}\contentspage}
+  [\l__toc_subsec_indent_tl]
+  {\l__toc_subsec_format_tl}{}{}
+  {\l__toc_subsec_rule_tl}
 \titlecontents{figure}
-  [0\ccwd]
-  {\addvspace{0.2pc}}
-  {}{}
-  {\titlerule*[0.65pc]{\scalebox{1.2}{$\cdot$}}\contentspage}
+  [\l__toc_lists_indent_tl]
+  {\l__toc_lists_format_tl}{}{}
+  {\l__toc_lists_rule_tl}
 \titlecontents{table}
-  [0\ccwd]
-  {\addvspace{0.2pc}}
-  {}{}
-  {\titlerule*[0.65pc]{\scalebox{1.2}{$\cdot$}}\contentspage}
+  [\l__toc_lists_indent_tl]
+  {\l__toc_lists_format_tl}{}{}
+  {\l__toc_lists_rule_tl}
 \contentsuse{lstlisting}{lol}
 \titlecontents{lstlisting}
-  [0\ccwd]
-  {\addvspace{0.2pc}}
-  {}{}
-  {\titlerule*[0.65pc]{\scalebox{1.2}{$\cdot$}}\contentspage}
+  [\l__toc_lists_indent_tl]
+  {\l__toc_lists_format_tl}{}{}
+  {\l__toc_lists_rule_tl}
 \ctex_patch_cmd:Nnn \caption@@@addcontentsline
   {\addcontentsline{#1}{#2}{\protect\numberline{#3}{#4}}}
   {\addcontentsline{#1}{#2}{#3\hspace{\ccwd}#4}}
@@ -951,6 +1033,7 @@
     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 =
@@ -966,6 +1049,7 @@
     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,
@@ -976,14 +1060,14 @@
   {
     \tl_if_empty:NTF \l__bib_mysty_tl
       {
-        \tl_if_eq:VnTF \l__bib_style_tl{numerber}
+        \tl_if_eq:VnT \l__bib_style_tl{number}
           {
             \bibliographystyle{gbt7714-numerical}
-          }{
-            \tl_if_eq:VnT \l__bib_style_tl{authoryear}
-              {\bibliographystyle{gbt7714-author-year}}
-            \cs_set_eq:NN \cite\citep
+            \setcitestyle{square,comma,super}
           }
+        \tl_if_eq:VnT \l__bib_style_tl{authoryear}
+          {\bibliographystyle{gbt7714-author-year}}
+        \cs_set_eq:NN \cite\citep
       }{
         \exp_args:NV \bibliographystyle\l__bib_mysty_tl
       }
@@ -998,13 +1082,10 @@
   {
     \tl_if_empty:NTF \l__bib_mysty_tl
       {
-        \tl_if_eq:VnTF \l__bib_style_tl{number}
-          {
-            \__put_biblatex:n {style = gb7714-2015}
-          }{
-            \tl_if_eq:VnT \l__bib_style_tl{authoryear}
-              {\__put_biblatex:n {style = gb7714-2015ay}}
-          }
+        \tl_if_eq:VnT \l__bib_style_tl{number}
+          {\__put_biblatex:n {style = gb7714-2015}}
+        \tl_if_eq:VnT \l__bib_style_tl{authoryear}
+          {\__put_biblatex:n {style = gb7714-2015ay}}
       }{
         \__put_biblatex:n {style = \l__bib_mysty_tl}
       }
@@ -1021,7 +1102,7 @@
   {
     \bool_if:NTF \l__backend_bibtex_bool
       {
-        \RequirePackage[sort&compress]{gbt7714}
+        \RequirePackage[sort&compress]{natbib}
         \__bibtex_set:
       }{
         \__biblatex_pre_set:
@@ -1107,7 +1188,8 @@
 \lstloadlanguages{C,C++,Java,Python,Matlab}
 \AtBeginEnvironment{verbatim}{\microtypesetup{activate=false}}
 
-\cs_new_protected:Npn \__clist_put_hyperref:n #1
+\clist_new:N \l__hyperref_clist
+\cs_new_protected:Npn \__put_hyperref:n #1
   {\clist_put_right:Nn \l__hyperref_clist{#1}}
 \cs_new_protected:Npn \__define_linkcolor:nnn #1#2#3
   {\definecolorset{HTML}{ctex@}{}{link,#1;url,#2;cite,#3}}
@@ -1121,7 +1203,7 @@
           {\clist_item:nn {#1}{2}}
           {\clist_item:nn {#1}{3}}
           {\clist_item:nn {#1}{4}}
-        \__clist_put_hyperref:n
+        \__put_hyperref:n
           {
             linkcolor = ctex at link,linkbordercolor = ctex at link,
             urlcolor = ctex at url,urlbordercolor = ctex at url,
@@ -1154,8 +1236,8 @@
   {
     hyperlink         .choice:,
     hyperlink/edge    .code:n = {},
-    hyperlink/various .code:n = {\__clist_put_hyperref:n {colorlinks}},
-    hyperlink/none    .code:n = {\__clist_put_hyperref:n {hidelinks}},
+    hyperlink/various .code:n = {\__put_hyperref:n {colorlinks}},
+    hyperlink/none    .code:n = {\__put_hyperref:n {hidelinks}},
     hyperlink         .default:n = edge,
     hyperlink         .initial:n = edge,
 
@@ -1172,7 +1254,7 @@
     linkcolor         .initial:n = graphite,
 
     linktopage        .choice:,
-    linktopage/true   .code:n = {\__clist_put_hyperref:n {linktocpage}},
+    linktopage/true   .code:n = {\__put_hyperref:n {linktocpage}},
     linktopage/false  .code:n = {},
     linktopage        .default:n = true,
     linktopage        .initial:n = false



More information about the tex-live-commits mailing list.