diff options
author | Norbert Preining <preining@logic.at> | 2021-04-07 15:02:50 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2021-04-07 15:02:50 +0000 |
commit | a977bff2c2b6232f38876f26c18ee7bd507d6df2 (patch) | |
tree | f3ecbb62df677982ac66c2be8000eda0df81ac05 /Master | |
parent | 3d62c21ac11f8ba5544e0f9d6703827284ba3899 (diff) |
easybook (7apr21)
git-svn-id: svn://tug.org/texlive/trunk@58788 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/easybook/easybook-demo.pdf | bin | 262490 -> 262480 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/easybook/easybook-demo.tex | 3 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/easybook/easybook.pdf | bin | 423028 -> 424141 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/easybook/easybook.dtx | 155 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/easybook/easybook.cls | 111 |
5 files changed, 133 insertions, 136 deletions
diff --git a/Master/texmf-dist/doc/latex/easybook/easybook-demo.pdf b/Master/texmf-dist/doc/latex/easybook/easybook-demo.pdf Binary files differindex 5a2fb630eeb..f98213bf6b6 100644 --- a/Master/texmf-dist/doc/latex/easybook/easybook-demo.pdf +++ b/Master/texmf-dist/doc/latex/easybook/easybook-demo.pdf diff --git a/Master/texmf-dist/doc/latex/easybook/easybook-demo.tex b/Master/texmf-dist/doc/latex/easybook/easybook-demo.tex index 63dc917aab2..af86342bfa0 100644 --- a/Master/texmf-dist/doc/latex/easybook/easybook-demo.tex +++ b/Master/texmf-dist/doc/latex/easybook/easybook-demo.tex @@ -67,6 +67,7 @@ }, tocset = { + line-align = true, part = { format = \addvspace{1pc}\sffamily\large, @@ -99,7 +100,7 @@ \url{https://latexstudio.net} \\ \url{https://gitee.com/texl3/easybook}\thanks{Gitee为项目的主要发布地址。} } -\date{2021/04/05\hskip\ccwd\relax v1.24e} +\date{2021/04/06\hskip\ccwd\relax v1.24f} \frontmatter[roman] \maketitle diff --git a/Master/texmf-dist/doc/latex/easybook/easybook.pdf b/Master/texmf-dist/doc/latex/easybook/easybook.pdf Binary files differindex e5042a675ff..3fd17d4eb63 100644 --- a/Master/texmf-dist/doc/latex/easybook/easybook.pdf +++ b/Master/texmf-dist/doc/latex/easybook/easybook.pdf diff --git a/Master/texmf-dist/source/latex/easybook/easybook.dtx b/Master/texmf-dist/source/latex/easybook/easybook.dtx index 80c214a5277..caa02d9289f 100644 --- a/Master/texmf-dist/source/latex/easybook/easybook.dtx +++ b/Master/texmf-dist/source/latex/easybook/easybook.dtx @@ -55,7 +55,7 @@ The latest version of this license is in % % \title{\sffamily easybook书籍文档类} % \author{瞿毅} -% \date{2021/04/05\hskip\ccwd\relax v1.24e\thanks{\url{https://gitee.com/texl3/easybook}}} +% \date{2021/04/06\hskip\ccwd\relax v1.24f\thanks{\url{https://gitee.com/texl3/easybook}}} % \maketitle % \begin{abstract} % \cls{easybook} 是基于 \cls{ctexbook} 书籍文档类创建以极简为风格的模板,可以看作对 \cls{ctexbook} 的进一步包装。虽然\CTeX 文档类提供了较好的中文支持,但想实现个性化功能一般需要在其基础上载入更多宏包来定制。\cls{easybook} 考虑了一些细节并载入一些常用宏包实现一般的排版需求,它适用于排版中英文书籍或笔记,甚至可稍加调整成为学位论文模板。 @@ -64,10 +64,10 @@ The latest version of this license is in % % \begin{documentation} % \section{编译方式} -% 模板含有一个使用示例文件 \opt{easybook-demo.tex},编译前建议满足以下的条件 +% 文档类含有一个使用示例文件 \opt{easybook-demo.tex},编译前建议满足以下的条件 % \begin{itemize} % \item 使用 \hologo{XeLaTeX}(推荐)或 \hologo{LuaLaTeX} 两种编译方式。 -% \item 由于用到了一些宏包较新的功能,建议安装最新的\TeX 发行版并将所有宏包升级为最新,目前在 \hologo{MiKTeX} 21.2和 \TeX Live 2021可以正常编译。 +% \item 由于用到了一些宏包较新的功能,建议安装最新的\TeX 发行版,例如 \TeX Live 2021或 \hologo{MiKTeX} 21.2之后的版本。 % \end{itemize} % % \subsection{编译步骤} @@ -78,7 +78,7 @@ The latest version of this license is in % xelatex -shell-escape easybook-demo % xelatex -shell-escape easybook-demo % \end{frameverb} -% 需注意,正确\textbf{编译索引}需要增加 \opt{-shell-escape} 命令行选项。 +% \ding{72} 需要注意正确\textbf{编译索引}要增加 \opt{-shell-escape} 命令行选项。 % % \subsection{字体设置} % \label{subsec:font settings} @@ -168,7 +168,7 @@ The latest version of this license is in % \end{syntax} % \opt{multoc} 与 \opt{style/multoc} 选项具有相同的效果,但是具有优先性且可单独设置不同目录是否双栏排版。已经预置了中英文的目录标题,可以使用 \opt{title} 选项更改目录标题的名称。\opt{book} 选项使目录标题按照 \opt{chapter} 级别输出,\opt{article} 选项使目录标题按照 \opt{article} 级别输出,默认为 \opt{chapter} 级别。 % \changes{v1.23}{2021/03/15}{为几个目录增加键值列表的选项,可设置标题输出级别以及是否加入主目录。} -% \changes{v1.24e}{2021/04/04}{目录命令的可选参数增加标题键值。} +% \changes{v1.24f}{2021/04/04}{目录命令的可选参数增加标题键值。} % \end{function} % % \section{接口选项} @@ -256,7 +256,7 @@ The latest version of this license is in % \ding{229} 以上选项路径为 \opt{link/...} \\ % \opt{link} 将超链接选项(包括以上选项)交给 \pkg{hyperref} 处理,除了一些关于 pdf 书签的选项可能会失效,其它由键值选项命令 \tn{hypersetup} 支持的多数选项可用。 % \changes{v1.10}{2021/01/08}{修复了 \opt{linktopage} 选项关闭时目录中标题编号无超链接的问题。} -% \changes{v1.24e}{2021/04/05}{增加 \pkg{hyperref} 超链接选项完整的支持。} +% \changes{v1.24f}{2021/04/05}{增加 \pkg{hyperref} 超链接选项完整的支持。} % \end{function} % % \begin{optdesc} @@ -452,7 +452,7 @@ The latest version of this license is in % % \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{function}[EXP,added = 2021-01-13,updated = 2021-04-06]{head-foot,chap-mark,sec-mark,headrule,footrule,footnoterule} % \begin{syntax} % head-foot = <页眉页脚中的内容> % chap-mark = <\tn{chaptermark} 标志命令 \tn{markboth} 中的内容> @@ -462,14 +462,14 @@ The latest version of this license is in % footnoterule = <脚注横线格式> % \end{syntax} % \ding{229} 以上选项路径为 \opt{hdrset/...} \\ -% \opt{hdrset} 设置的命令由 \pkg{fancyhdr} 宏包提供支持,\opt{headrule}、\opt{footrule} 和 \opt{footnoterule} 三个横线选项一般可以使用 \tn{hrule} width \meta{长度} height \meta{高度} 命令来绘制,脚注横线默认为空。当然,手动绘制横线时线条粗细选项 \opt{style/rulewidth} 会失效。 +% \opt{hdrset} 设置的命令由 \pkg{fancyhdr} 宏包提供支持。章节标志选项 \opt{chap-mark} 和 \opt{sec-mark} 中参数\#1代表当前章或节的标题。\opt{headrule}、\opt{footrule} 和 \opt{footnoterule} 三个横线选项一般可以使用 \tn{hrule} width \meta{长度} height \meta{高度} 命令来绘制,脚注横线默认为空。当然,手动绘制横线时线条粗细选项 \opt{style/rulewidth} 会失效。 % \changes{v1.21}{2021/01/11}{修复单面文档时页眉横线消失的问题。} % \changes{v1.21}{2021/01/13}{增加配置页眉页脚的选项。} % \changes{v1.23}{2021/03/08}{优化页眉页脚设置,增加 \opt{chap-mark} 和 \opt{sec-mark} 选项。} % \changes{v1.23}{2021/03/14}{可以手动绘制页眉、页脚和脚注的横线。} % \end{function} % -% \begin{function}[added = 2021-01-13,updated = 2021-03-14]{,\easyhead,\easyfoot} +% \begin{function}[added = 2021-01-13,updated = 2021-03-14]{\easyhead,\easyfoot} % \begin{syntax} % \tn{easyhead}\oarg{位置}\marg{内容} % \tn{easyfoot}\oarg{位置}\marg{内容} @@ -484,7 +484,7 @@ The latest version of this license is in % \easyhead[OL]{\rightmark} % \easyhead[EL,OR]{\textbf{\thepage}} % }, -% sec-mark = \CTEXthesection\hspace{0.5\ccwd}, +% sec-mark = \CTEXthesection\hspace{0.5\ccwd}#1, % headrule = \hrule width \textwidth height 1pt % } % \end{ctexexam} @@ -505,33 +505,35 @@ The latest version of this license is in % \changes{v1.21}{2021/01/13}{增加配置目录样式的选项。} % \end{function} % -% \begin{function}[EXP,added = 2021-01-13,updated = 2021-04-05]{lists/lolskip,lists/labelname-fig,lists/labelname-tab,lists/labelname-lst,lists/belowoffset,tocset/belowoffset} +% \begin{function}[EXP,added = 2021-01-13,updated = 2021-04-06]{lists/lolskip,lists/belowoffset,tocset/tocline-fig,tocset/tocline-tab,tocset/tocline-lst,tocset/belowoffset,tocset/line-align} % \begin{syntax} % lolskip = <(0.8pc)> -% labelname-fig = <图片目录标签> -% labelname-tab = <表格目录标签> -% labelname-lst = <代码目录标签> % belowoffset = <(0pc)> +% tocline-fig = <图片目录标签> +% tocline-tab = <表格目录标签> +% tocline-lst = <代码目录标签> % belowoffset = <(-1pc)> +% line-align = <(true)|false> % \end{syntax} -% \opt{lolskip} 是代码目录中章之间的代码标题的距离,与\CTeX 的表格目录和图片目录中章之间的标题距离选项 \opt{lotskip} 和 \opt{lofskip} 类似,它们的值均默认0.8 pc,在 \opt{article} 模式中此选项失效。目录标签整体使用 \opt{labelname} 设置,也可使用小节 \ref{subsec:page margins} 的 \opt{list-labelsep} 选项只设置编号与标题的间距。在图表标签的参数中,\#1与\#2分别代表编号和标题,代码标签的编号和标题则是 \tn{thelstlisting} 和 \tn{lst@@caption},标签中还可包含标签名称,默认标签名称与图、表和代码环境的标题名称一致。下面举个设置标签的例子 +% \opt{lolskip} 是代码目录中章之间的代码标题的距离,与\CTeX 的表格目录和图片目录中章之间的标题距离选项 \opt{lotskip} 和 \opt{lofskip} 类似,它们的值均默认0.8 pc,在 \opt{article} 模式中此选项失效。目录标签整体使用 \opt{tocline} 设置,也可使用小节 \ref{subsec:page margins} 的 \opt{list-labelsep} 选项只设置编号与标题的间距。在图表标签的参数中,\#1与\#2分别代表编号和标题,代码标签的编号和标题则是 \tn{thelstlisting} 和 \tn{lstcaption},标签中还可包含标签名称,默认标签名称与图、表和代码环境的标题名称一致。\opt{line-align} 选项可以使目录引导线右边对齐并与页码保持一定间隙,否则会与页码连接。下面举个设置标签的例子 % \begin{ctexexam} % \tocset % { -% lists/labelname-fig = 图#1\hspace{\ccwd}#2 -% lists/labelname-lst = 代码\thelstlisting\hspace{\ccwd}\lst@@caption +% tocline-fig = 图#1\hspace{\ccwd}#2 +% tocline-lst = 代码\thelstlisting\hspace{\ccwd}\lstcaption % } % \end{ctexexam} % % \opt{belowoffset} 选项为主目录标题 \tn{contentsname} 后的间距补偿,一般为负值,用于抵消 \opt{format} 中设置的垂直间距。\opt{lists} 中的 \opt{belowoffset} 与之意义类似,但是一般为正值,可以在 \opt{article} 模式中使用。建议 \opt{lists/lolskip(0.8pc) + lists/format/addvspace(0.2pc) + lists/belowoffset(0pc) = belowoffset(-1pc)}。 -% \changes{v1.24e}{2021/04/05}{可以设置图、表和代码目录的标签。} +% \changes{v1.24f}{2021/04/05}{可以设置图、表和代码目录的标签。} +% \changes{v1.24f}{2021/04/06}{增加目录引导线右边对齐方式。} % \end{function} % -% \begin{function}[added = 2021-01-13,updated = 2021-01-15]{\tocrule} +% \begin{function}[added = 2021-01-13,updated = 2021-04-06]{\tocrule} % \begin{syntax} -% \tn{tocrule} = \oarg{引导点间距|(0.7pc)}\parg{引导点大小|(1.2)}\marg{引导点}\oarg{页码格式} +% \tn{tocrule}*\oarg{引导点间距|(0.7pc)}\parg{引导点大小|(1.2)}\marg{引导点}\oarg{页码格式} % \end{syntax} -% \tn{tocrule} 命令生成目录引导线,需要在 \opt{rule} 选项中使用,其中引导线间距需带有长度单位,引导点大小不带单位,为引导点符号正常大小的倍数,引导点一般为英文句号或 \tn{cdot} 中心点符号。页码格式的内容位于页码前面,可以设置页码字体、距离。 +% \tn{tocrule} 命令生成目录引导线,需要在 \opt{rule} 选项中使用。带有星号的命令会使当前级别的目录引导线右边与页码连接而不是对齐。引导点间距需带有长度单位,引导点大小不带单位,为引导点符号正常大小的倍数,引导点一般为英文句号或 \tn{cdot} 中心点符号。页码格式的内容位于页码前面,可以设置页码字体、距离。 % \begin{ctexexam} % \tocset % { @@ -801,7 +803,7 @@ The latest version of this license is in %<*class> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e} -\ProvidesExplClass{easybook}{2021/04/05}{1.24e}{beta} +\ProvidesExplClass{easybook}{2021/04/06}{1.24f}{beta} \cs_generate_variant:Nn \keys_define:nn {nx} \cs_generate_variant:Nn \int_to_arabic:n {v} @@ -1146,7 +1148,7 @@ The latest version of this license is in \easyhead[OC]{\color{ctex@frame}\kaishu\rightmark} \easyhead[EL,OR]{\color{ctex@frame}\thepage} }, - chap-mark .tl_set:N = \l__fancyhf_chap_mark_tl, + chap-mark .cs_set:Np = \__fancyhf_chap_mark:n #1, chap-mark .initial:n = { \int_compare:nT {\c@secnumdepth > -1} @@ -1156,9 +1158,9 @@ The latest version of this license is in \CTEXthechapter\hspace{\ccwd} \fi \fi - } + }#1 }, - sec-mark .tl_set:N = \l__fancyhf_sec_mark_tl, + sec-mark .cs_set:Np = \__fancyhf_sec_mark:n #1, sec-mark .initial:n = { \int_compare:nT {\c@secnumdepth > 0} @@ -1166,7 +1168,7 @@ The latest version of this license is in \ifodd\CTEX@section@numbering \CTEXthesection\hspace{0.5\ccwd} \fi - } + }#1 }, headrule .tl_gset:N = \headrule, headrule .initial:n = @@ -1188,6 +1190,12 @@ The latest version of this license is in \group_end: } } +\cs_new_protected:Npn \__ifuppercase_chapmark_set:n #1 + { + \bool_if:NTF \l__uppercase_bool + {\text_uppercase:n {\__fancyhf_chap_mark:n {#1}}} + {\text_titlecase_first:n {\__fancyhf_chap_mark:n {#1}}} + } \ctex_at_end_preamble:n { \exp_args:NV \geometry\g__geometry_clist @@ -1198,28 +1206,14 @@ The latest version of this license is in \cs_gset:Npn \chaptermark#1 { \markboth - { - \bool_if:NTF \l__uppercase_bool - {\text_uppercase:n {\l__fancyhf_chap_mark_tl#1}} - {\text_titlecase_first:n {\l__fancyhf_chap_mark_tl#1}} - }{ - \bool_if:NTF \l__uppercase_bool - {\text_uppercase:n {\l__fancyhf_chap_mark_tl#1}} - {\text_titlecase_first:n {\l__fancyhf_chap_mark_tl#1}} - } + {\__ifuppercase_chapmark_set:n {#1}} + {\__ifuppercase_chapmark_set:n {#1}} } \l__fancyhf_content_tl \cs_gset_eq:NN \ps@plain\ps@empty }{ \cs_gset:Npn \chaptermark#1 - { - \markboth - { - \bool_if:NTF \l__uppercase_bool - {\text_uppercase:n {\l__fancyhf_chap_mark_tl#1}} - {\text_titlecase_first:n {\l__fancyhf_chap_mark_tl#1}} - }{} - } + {\markboth{\__ifuppercase_chapmark_set:n {#1}}{}} \l__fancyhf_content_tl \cs_gset_eq:NN \ps@plain\ps@empty } @@ -1228,8 +1222,8 @@ The latest version of this license is in \markright { \bool_if:NTF \l__uppercase_bool - {\text_uppercase:n {\l__fancyhf_sec_mark_tl#1}} - {\text_titlecase_first:n {\l__fancyhf_sec_mark_tl#1}} + {\text_uppercase:n {\__fancyhf_sec_mark:n {#1}}} + {\text_titlecase_first:n {\__fancyhf_sec_mark:n {#1}}} } } \bool_if:NT \l__draft_bool @@ -1255,25 +1249,28 @@ The latest version of this license is in } \__ctex_define:nn {tocset} { - lists/lolskip .skip_set:N = \l__toc_lolskip_skip, - lists/lolskip .initial:n = 0.8pc, - lists/belowoffset .dim_set:N = \l__toc_listsoffset_dim, - lists/belowoffset .initial:n = 0pc, - lists/labelname-fig .cs_set:Np = \labelname@lof#1#2, - lists/labelname-fig .initial:n = + lists/lolskip .skip_set:N = \l__toc_lolskip_skip, + lists/lolskip .initial:n = 0.8pc, + lists/belowoffset .dim_set:N = \l__toc_listsoffset_dim, + lists/belowoffset .initial:n = 0pc, + tocline-fig .cs_set:Np = \labelname@lof#1#2, + tocline-fig .initial:n = {\figurename\space#1\hspace{\list@labelsep}#2}, - lists/labelname-tab .cs_set:Np = \labelname@lot#1#2, - lists/labelname-tab .initial:n = + tocline-tab .cs_set:Np = \labelname@lot#1#2, + tocline-tab .initial:n = {\tablename\space#1\hspace{\list@labelsep}#2}, - lists/labelname-lst .tl_set:N = \labelname@lol, - lists/labelname-lst .initial:n = + tocline-lst .tl_set:N = \labelname@lol, + tocline-lst .initial:n = { \lstlistingname\space \thelstlisting\hspace{\list@labelsep} - \lst@@caption + \lstcaption }, - belowoffset .dim_set:N = \l__toc_offset_dim, - belowoffset .initial:n = -1pc + belowoffset .dim_set:N = \l__toc_offset_dim, + belowoffset .initial:n = -1pc, + line-align .bool_set:N = \l__toc_line_align_bool, + line-align .default:n = true, + line-align .initial:n = true } \ctex_set:nn {tocset} { @@ -1298,10 +1295,16 @@ The latest version of this license is in lists/rule = \tocrule{$\cdot$} } -\NewDocumentCommand{\tocrule}{O{0.7pc}D(){1.2}mO{}} +\NewDocumentCommand{\tocrule}{sO{0.7pc}D(){1.2}mO{}} { \normalsize\normalfont - \titlerule*[#1]{\scalebox{#2}{#3}}#4\contentspage + \titlerule*[#2]{\scalebox{#3}{#4}}#5 + \IfBooleanTF{#1} + {\thecontentspage} + { + \bool_if:NTF \l__toc_line_align_bool + {\contentspage}{\thecontentspage} + } } \cs_new_protected:Npn \__titlecontents_set:nn #1#2 { @@ -1321,6 +1324,7 @@ The latest version of this license is in {table}{lists}, {lstlisting}{lists} }{\__titlecontents_set:nn #1} + \prop_new:N \l_label_name_prop \prop_set_from_keyval:Nn \l_label_name_prop { @@ -1336,7 +1340,10 @@ The latest version of this license is in { \addcontentsline{lol}{lstlisting} {\protect\numberline{\thelstlisting}\lst@@caption} - }{\addcontentsline{lol}{lstlisting}{\labelname@lol}} + }{ + \let\lstcaption\lst@@caption + \addcontentsline{lol}{lstlisting}{\labelname@lol} + } \__appto_cmd:Nn \@chapter { \skip_if_eq:nnF {\l__toc_lolskip_skip}{\c_zero_skip} @@ -1358,28 +1365,20 @@ The latest version of this license is in The~\string\chapter\space~command~will~not~be~used. } +\cs_new_protected:Npn \__ifuppercase_set:n #1 + { + \bool_if:NTF \l__uppercase_bool + {\text_uppercase:n {#1}} + {\text_titlecase_first:n {#1}} + } \cs_new_protected:Npn \__markboth:n #1 { \bool_if:NTF \l__page_twoside_bool { \markboth - { - \bool_if:NTF \l__uppercase_bool - {\text_uppercase:n {#1}} - {\text_titlecase_first:n {#1}} - }{ - \bool_if:NTF \l__uppercase_bool - {\text_uppercase:n {#1}} - {\text_titlecase_first:n {#1}} - } - }{ - \markboth - { - \bool_if:NTF \l__uppercase_bool - {\text_uppercase:n {#1}} - {\text_titlecase_first:n {#1}} - }{} - } + {\__ifuppercase_set:n {#1}} + {\__ifuppercase_set:n {#1}} + }{\markboth{\__ifuppercase_set:n {#1}}{}} } \tl_set:Nn \l__toc_type_tl{book} diff --git a/Master/texmf-dist/tex/latex/easybook/easybook.cls b/Master/texmf-dist/tex/latex/easybook/easybook.cls index bbd9acfebc9..dcd25d8e8e6 100644 --- a/Master/texmf-dist/tex/latex/easybook/easybook.cls +++ b/Master/texmf-dist/tex/latex/easybook/easybook.cls @@ -13,7 +13,7 @@ %% https://creativecommons.org/licenses/by/4.0/legalcode \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e} -\ProvidesExplClass{easybook}{2021/04/05}{1.24e}{beta} +\ProvidesExplClass{easybook}{2021/04/06}{1.24f}{beta} \cs_generate_variant:Nn \keys_define:nn {nx} \cs_generate_variant:Nn \int_to_arabic:n {v} @@ -358,7 +358,7 @@ \easyhead[OC]{\color{ctex@frame}\kaishu\rightmark} \easyhead[EL,OR]{\color{ctex@frame}\thepage} }, - chap-mark .tl_set:N = \l__fancyhf_chap_mark_tl, + chap-mark .cs_set:Np = \__fancyhf_chap_mark:n #1, chap-mark .initial:n = { \int_compare:nT {\c@secnumdepth > -1} @@ -368,9 +368,9 @@ \CTEXthechapter\hspace{\ccwd} \fi \fi - } + }#1 }, - sec-mark .tl_set:N = \l__fancyhf_sec_mark_tl, + sec-mark .cs_set:Np = \__fancyhf_sec_mark:n #1, sec-mark .initial:n = { \int_compare:nT {\c@secnumdepth > 0} @@ -378,7 +378,7 @@ \ifodd\CTEX@section@numbering \CTEXthesection\hspace{0.5\ccwd} \fi - } + }#1 }, headrule .tl_gset:N = \headrule, headrule .initial:n = @@ -400,6 +400,12 @@ \group_end: } } +\cs_new_protected:Npn \__ifuppercase_chapmark_set:n #1 + { + \bool_if:NTF \l__uppercase_bool + {\text_uppercase:n {\__fancyhf_chap_mark:n {#1}}} + {\text_titlecase_first:n {\__fancyhf_chap_mark:n {#1}}} + } \ctex_at_end_preamble:n { \exp_args:NV \geometry\g__geometry_clist @@ -410,28 +416,14 @@ \cs_gset:Npn \chaptermark#1 { \markboth - { - \bool_if:NTF \l__uppercase_bool - {\text_uppercase:n {\l__fancyhf_chap_mark_tl#1}} - {\text_titlecase_first:n {\l__fancyhf_chap_mark_tl#1}} - }{ - \bool_if:NTF \l__uppercase_bool - {\text_uppercase:n {\l__fancyhf_chap_mark_tl#1}} - {\text_titlecase_first:n {\l__fancyhf_chap_mark_tl#1}} - } + {\__ifuppercase_chapmark_set:n {#1}} + {\__ifuppercase_chapmark_set:n {#1}} } \l__fancyhf_content_tl \cs_gset_eq:NN \ps@plain\ps@empty }{ \cs_gset:Npn \chaptermark#1 - { - \markboth - { - \bool_if:NTF \l__uppercase_bool - {\text_uppercase:n {\l__fancyhf_chap_mark_tl#1}} - {\text_titlecase_first:n {\l__fancyhf_chap_mark_tl#1}} - }{} - } + {\markboth{\__ifuppercase_chapmark_set:n {#1}}{}} \l__fancyhf_content_tl \cs_gset_eq:NN \ps@plain\ps@empty } @@ -440,8 +432,8 @@ \markright { \bool_if:NTF \l__uppercase_bool - {\text_uppercase:n {\l__fancyhf_sec_mark_tl#1}} - {\text_titlecase_first:n {\l__fancyhf_sec_mark_tl#1}} + {\text_uppercase:n {\__fancyhf_sec_mark:n {#1}}} + {\text_titlecase_first:n {\__fancyhf_sec_mark:n {#1}}} } } \bool_if:NT \l__draft_bool @@ -467,25 +459,28 @@ } \__ctex_define:nn {tocset} { - lists/lolskip .skip_set:N = \l__toc_lolskip_skip, - lists/lolskip .initial:n = 0.8pc, - lists/belowoffset .dim_set:N = \l__toc_listsoffset_dim, - lists/belowoffset .initial:n = 0pc, - lists/labelname-fig .cs_set:Np = \labelname@lof#1#2, - lists/labelname-fig .initial:n = + lists/lolskip .skip_set:N = \l__toc_lolskip_skip, + lists/lolskip .initial:n = 0.8pc, + lists/belowoffset .dim_set:N = \l__toc_listsoffset_dim, + lists/belowoffset .initial:n = 0pc, + tocline-fig .cs_set:Np = \labelname@lof#1#2, + tocline-fig .initial:n = {\figurename\space#1\hspace{\list@labelsep}#2}, - lists/labelname-tab .cs_set:Np = \labelname@lot#1#2, - lists/labelname-tab .initial:n = + tocline-tab .cs_set:Np = \labelname@lot#1#2, + tocline-tab .initial:n = {\tablename\space#1\hspace{\list@labelsep}#2}, - lists/labelname-lst .tl_set:N = \labelname@lol, - lists/labelname-lst .initial:n = + tocline-lst .tl_set:N = \labelname@lol, + tocline-lst .initial:n = { \lstlistingname\space \thelstlisting\hspace{\list@labelsep} - \lst@@caption + \lstcaption }, - belowoffset .dim_set:N = \l__toc_offset_dim, - belowoffset .initial:n = -1pc + belowoffset .dim_set:N = \l__toc_offset_dim, + belowoffset .initial:n = -1pc, + line-align .bool_set:N = \l__toc_line_align_bool, + line-align .default:n = true, + line-align .initial:n = true } \ctex_set:nn {tocset} { @@ -510,10 +505,16 @@ lists/rule = \tocrule{$\cdot$} } -\NewDocumentCommand{\tocrule}{O{0.7pc}D(){1.2}mO{}} +\NewDocumentCommand{\tocrule}{sO{0.7pc}D(){1.2}mO{}} { \normalsize\normalfont - \titlerule*[#1]{\scalebox{#2}{#3}}#4\contentspage + \titlerule*[#2]{\scalebox{#3}{#4}}#5 + \IfBooleanTF{#1} + {\thecontentspage} + { + \bool_if:NTF \l__toc_line_align_bool + {\contentspage}{\thecontentspage} + } } \cs_new_protected:Npn \__titlecontents_set:nn #1#2 { @@ -533,6 +534,7 @@ {table}{lists}, {lstlisting}{lists} }{\__titlecontents_set:nn #1} + \prop_new:N \l_label_name_prop \prop_set_from_keyval:Nn \l_label_name_prop { @@ -548,7 +550,10 @@ { \addcontentsline{lol}{lstlisting} {\protect\numberline{\thelstlisting}\lst@@caption} - }{\addcontentsline{lol}{lstlisting}{\labelname@lol}} + }{ + \let\lstcaption\lst@@caption + \addcontentsline{lol}{lstlisting}{\labelname@lol} + } \__appto_cmd:Nn \@chapter { \skip_if_eq:nnF {\l__toc_lolskip_skip}{\c_zero_skip} @@ -570,28 +575,20 @@ The~\string\chapter\space~command~will~not~be~used. } +\cs_new_protected:Npn \__ifuppercase_set:n #1 + { + \bool_if:NTF \l__uppercase_bool + {\text_uppercase:n {#1}} + {\text_titlecase_first:n {#1}} + } \cs_new_protected:Npn \__markboth:n #1 { \bool_if:NTF \l__page_twoside_bool { \markboth - { - \bool_if:NTF \l__uppercase_bool - {\text_uppercase:n {#1}} - {\text_titlecase_first:n {#1}} - }{ - \bool_if:NTF \l__uppercase_bool - {\text_uppercase:n {#1}} - {\text_titlecase_first:n {#1}} - } - }{ - \markboth - { - \bool_if:NTF \l__uppercase_bool - {\text_uppercase:n {#1}} - {\text_titlecase_first:n {#1}} - }{} - } + {\__ifuppercase_set:n {#1}} + {\__ifuppercase_set:n {#1}} + }{\markboth{\__ifuppercase_set:n {#1}}{}} } \tl_set:Nn \l__toc_type_tl{book} |