From 24a26d6f89a97e7ba548a2c42c0e6a6c80e6fb2a Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 19 Jun 2015 22:32:36 +0000 Subject: ctex (19jun15) git-svn-id: svn://tug.org/texlive/trunk@37615 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/ctex/README | 1 + Master/texmf-dist/doc/latex/ctex/ctex.pdf | Bin 973893 -> 889512 bytes Master/texmf-dist/source/latex/ctex/ctex.dtx | 1414 ++++++++++++-------- .../texmf-dist/tex/generic/ctex/zhadobefonts.tex | 12 +- .../texmf-dist/tex/generic/ctex/zhfandolfonts.tex | 12 +- .../texmf-dist/tex/generic/ctex/zhfounderfonts.tex | 12 +- .../texmf-dist/tex/generic/ctex/zhubuntufonts.tex | 12 +- .../texmf-dist/tex/generic/ctex/zhwindowsfonts.tex | 12 +- .../tex/latex/ctex/config/ctex-name-gbk.cfg | 4 +- .../tex/latex/ctex/config/ctex-name-utf8.cfg | 4 +- Master/texmf-dist/tex/latex/ctex/config/ctex.cfg | 4 +- .../texmf-dist/tex/latex/ctex/config/ctexopts.cfg | 4 +- Master/texmf-dist/tex/latex/ctex/ctex-article.def | 74 +- Master/texmf-dist/tex/latex/ctex/ctex-book.def | 92 +- Master/texmf-dist/tex/latex/ctex/ctex-c5size.clo | 4 +- Master/texmf-dist/tex/latex/ctex/ctex-cs4size.clo | 4 +- Master/texmf-dist/tex/latex/ctex/ctex-report.def | 92 +- Master/texmf-dist/tex/latex/ctex/ctex.sty | 159 ++- Master/texmf-dist/tex/latex/ctex/ctexart.cls | 199 +-- Master/texmf-dist/tex/latex/ctex/ctexbook.cls | 217 +-- Master/texmf-dist/tex/latex/ctex/ctexcap.sty | 7 +- Master/texmf-dist/tex/latex/ctex/ctexheading.sty | 278 ++++ Master/texmf-dist/tex/latex/ctex/ctexrep.cls | 217 +-- Master/texmf-dist/tex/latex/ctex/ctexsize.sty | 7 +- Master/texmf-dist/tex/latex/ctex/ctexspa.def | 2 +- .../tex/latex/ctex/engine/ctex-engine-luatex.def | 6 +- .../tex/latex/ctex/engine/ctex-engine-pdftex.def | 64 +- .../tex/latex/ctex/engine/ctex-engine-xetex.def | 18 +- Master/texmf-dist/tex/latex/ctex/fd/c19rm.fd | 2 +- Master/texmf-dist/tex/latex/ctex/fd/c19sf.fd | 2 +- Master/texmf-dist/tex/latex/ctex/fd/c19tt.fd | 2 +- Master/texmf-dist/tex/latex/ctex/fd/c70rm.fd | 2 +- Master/texmf-dist/tex/latex/ctex/fd/c70sf.fd | 2 +- Master/texmf-dist/tex/latex/ctex/fd/c70tt.fd | 2 +- .../tex/latex/ctex/fontset/ctex-fontset-adobe.def | 4 +- .../tex/latex/ctex/fontset/ctex-fontset-fandol.def | 4 +- .../latex/ctex/fontset/ctex-fontset-founder.def | 4 +- .../tex/latex/ctex/fontset/ctex-fontset-mac.def | 4 +- .../tex/latex/ctex/fontset/ctex-fontset-ubuntu.def | 7 +- .../latex/ctex/fontset/ctex-fontset-windows.def | 4 +- .../latex/ctex/fontset/ctex-fontset-windowsnew.def | 4 +- .../latex/ctex/fontset/ctex-fontset-windowsold.def | 4 +- .../ctex/scheme/ctex-scheme-chinese-article.def | 12 +- .../latex/ctex/scheme/ctex-scheme-chinese-book.def | 12 +- .../ctex/scheme/ctex-scheme-chinese-report.def | 12 +- .../tex/latex/ctex/scheme/ctex-scheme-chinese.def | 11 +- .../ctex/scheme/ctex-scheme-plain-article.def | 10 +- .../latex/ctex/scheme/ctex-scheme-plain-book.def | 11 +- .../latex/ctex/scheme/ctex-scheme-plain-report.def | 11 +- .../tex/latex/ctex/scheme/ctex-scheme-plain.def | 4 +- 50 files changed, 2015 insertions(+), 1046 deletions(-) create mode 100644 Master/texmf-dist/tex/latex/ctex/ctexheading.sty (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/latex/ctex/README b/Master/texmf-dist/doc/latex/ctex/README index abf637a8f09..e4c1135eef3 100644 --- a/Master/texmf-dist/doc/latex/ctex/README +++ b/Master/texmf-dist/doc/latex/ctex/README @@ -29,6 +29,7 @@ This package consists of the file ctex.dtx, and the derived files ctex.sty, ctexcap.sty, ctexsize.sty, + ctexheading.sty, ctexart.cls, ctexbook.cls, ctexrep.cls, diff --git a/Master/texmf-dist/doc/latex/ctex/ctex.pdf b/Master/texmf-dist/doc/latex/ctex/ctex.pdf index caf11940a3d..c67685ec9cc 100644 Binary files a/Master/texmf-dist/doc/latex/ctex/ctex.pdf and b/Master/texmf-dist/doc/latex/ctex/ctex.pdf differ diff --git a/Master/texmf-dist/source/latex/ctex/ctex.dtx b/Master/texmf-dist/source/latex/ctex/ctex.dtx index af7f077cb5b..b635785a8d9 100644 --- a/Master/texmf-dist/source/latex/ctex/ctex.dtx +++ b/Master/texmf-dist/source/latex/ctex/ctex.dtx @@ -57,6 +57,7 @@ This package consists of the file ctex.dtx, and the derived files ctex.sty, ctexcap.sty, ctexsize.sty, + ctexheading.sty, ctexart.cls, ctexbook.cls, ctexrep.cls, @@ -192,6 +193,7 @@ This package consists of the file ctex.dtx, and the derived files ctex.sty, ctexcap.sty, ctexsize.sty, + ctexheading.sty, ctexart.cls, ctexbook.cls, ctexrep.cls, @@ -248,9 +250,10 @@ This package consists of the file ctex.dtx, and the derived files \generate { \usedir{tex/latex/ctex} - \file{ctex.sty} {\from{\jobname.dtx}{package,style}} - \file{ctexcap.sty} {\from{\jobname.dtx}{package,ctexcap}} - \file{ctexsize.sty} {\from{\jobname.dtx}{package,ctexsize}} + \file{ctex.sty} {\from{\jobname.dtx}{style,ctex}} + \file{ctexcap.sty} {\from{\jobname.dtx}{ctexcap}} + \file{ctexsize.sty} {\from{\jobname.dtx}{style,ctexsize}} + \file{ctexheading.sty} {\from{\jobname.dtx}{style,ctexheading}} \file{ctexart.cls} {\from{\jobname.dtx}{class,article}} \file{ctexbook.cls} {\from{\jobname.dtx}{class,book}} \file{ctexrep.cls} {\from{\jobname.dtx}{class,report}} @@ -320,6 +323,7 @@ This package consists of the file ctex.dtx, and the derived files \Msg{* ctex.sty *} \Msg{* ctexcap.sty *} \Msg{* ctexsize.sty *} +\Msg{* ctexheading.sty *} \Msg{* ctexart.cls *} \Msg{* ctexbook.cls *} \Msg{* ctexrep.cls *} @@ -380,10 +384,10 @@ This package consists of the file ctex.dtx, and the derived files % %<*!(readme|install|zhmap|spa)> %<*!(c19|c70|ctexspa)> -%<*driver|package|class> +%<*driver|class|style|ctexcap> \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -% +% %<.!(readme|install|zhmap|spa|c19|c70|ctexspa)>\ctexPutVersion %<*driver> \InputIfFileExists{ctex.ver}{}{ @@ -392,12 +396,14 @@ This package consists of the file ctex.dtx, and the derived files {ctex source file} \ProvidesExplFile{\ExplFileName.\ExplFileExtension} % -% % \end{macrocode} % % \subsection{用户设置接口} @@ -3554,8 +3734,9 @@ This package consists of the file ctex.dtx, and the derived files % % \begin{macro}{\ctexset} % \begin{macrocode} -\NewDocumentCommand \ctexset { +m } - { \keys_set:nn { ctex } {#1} } +%<*class|ctex|ctexheading> +\NewDocumentCommand \ctexset { } { \keys_set:nn { ctex } } +% % \end{macrocode} % \end{macro} % @@ -3563,6 +3744,7 @@ This package consists of the file ctex.dtx, and the derived files % \begin{macro}{\CTEXsetup,\CTEXoptions} % 过时命令。 % \begin{macrocode} +%<*class|ctex> \NewDocumentCommand \CTEXsetup { +o > { \TrimSpaces } m } { \msg_warning:nnnn { ctex } { deprecated-command } { \CTEXsetup } @@ -3575,13 +3757,10 @@ This package consists of the file ctex.dtx, and the derived files { \ctexset~ {~ #1~ }~ is~ set. } \IfNoValueF {#1} { \keys_set:nn { ctex } {#1} } } +% % \end{macrocode} % \end{macro} % -% \begin{macrocode} -% -% \end{macrocode} -% % \subsection{特定引擎支持与设置} % % \subsubsection{\pkg{ctex-engine-pdftex.def}} @@ -3590,6 +3769,81 @@ This package consists of the file ctex.dtx, and the derived files %<*pdftex> % \end{macrocode} % +% \changes{v2.1}{2015/05/18}{给 \pdfLaTeX{} 下的非 UTF8 编码 CJK 字体族加上 CMap。} +% +% \begin{variable}[int]{\c_@@_cmap_encoding_seq} +% 需要加上 CMap 的 CJK 字体编码。 +% \begin{macrocode} +\seq_new:N \c_@@_cmap_encoding_seq +\seq_set_from_clist:Nn \c_@@_cmap_encoding_seq + { C19 , C10 , C00 , C09 , C40 , C60 } +% \end{macrocode} +% \end{variable} +% +% \begin{macro}[int]{\ctex_family_cmap:nn} +% 在 \tn{DeclareFontFamily} 的 \meta{loading-settings} 中给 CJK 字体族加上 CMap。 +% \begin{macrocode} +\cs_new_protected_nopar:Npn \ctex_family_cmap:nn #1#2 + { + \cs_if_free:cF { #1 + #2 } + { + \seq_if_in:NnT \c_@@_cmap_encoding_seq {#1} + { \tl_gput_right:cn { #1 + #2 } { \ctex_add_cmap:n {#1} } } + } + } +\cs_generate_variant:Nn \ctex_family_cmap:nn { x } +\cs_new_eq:NN \CTEX@Family@CMap \ctex_family_cmap:xn +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[int]{\ctex_add_cmap:n} +% 给 |#1| 编码的 CJK 字体加上 CMap。 +% \begin{macrocode} +\cs_new_protected_nopar:Npn \ctex_add_cmap:n #1 + { + \cs_if_free:NF \CJK@plane + { \ctex_add_cmap:cn { @@_add_cmap_ #1 \CJK@plane : } {#1} } + } +\cs_new_protected_nopar:Npn \ctex_add_cmap:Nn #1#2 + { + \cs_if_exist:NF #1 { \@@_save_cmap:Nn #1 {#2} } + #1 + } +\cs_generate_variant:Nn \ctex_add_cmap:Nn { c } +\cs_new_protected_nopar:Npn \@@_save_cmap:Nn #1#2 + { + \tex_lowercase:D { \tl_set:Nx \l_@@_tmp_tl { #2 \CJK@plane } } + \tex_immediate:D \pdfobj stream ~ file { \l_@@_tmp_tl .cmap } + \cs_new_protected_nopar:Npx #1 + { + \exp_not:N \pdffontattr \exp_not:N \font + { /ToUnicode ~ \int_use:N \pdflastobj \c_space_tl 0 ~ R } + } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[int]{\DeclareFontFamily} +% 只在 \pdfLaTeX{} 下加 CMap。如 \pkg{cmap} 宏包被引入,则不重复设置。 +% \begin{macrocode} +\group_begin: +\char_set_catcode_other:N \# +\ctex_if_pdfmode:TF + { + \group_end: + \ExplSyntaxOff + \ctex_appto_cmd:NnTF \DeclareFontFamily { \CTEX@Family@CMap {#1} {#2} } + { + \ctex_at_end_package:nn { cmap } + { \cs_gset_eq:NN \CTEX@Family@CMap \use_none:nn } + } + { \ctex_patch_failure:N \DeclareFontFamily } + \ExplSyntaxOn + } + { \group_end: } +% \end{macrocode} +% \end{macro} +% % 首先检查选项,决定是否载入 \pkg{zhmCJK} 宏包。 % \begin{macrocode} \if_bool:N \g_@@_zhmCJK_bool @@ -3605,7 +3859,7 @@ This package consists of the file ctex.dtx, and the derived files \RequirePackage { CJKpunct , CJKspace } % \end{macrocode} % -% \begin{macro}[internal]{\ctex_load_zhmap:nnnn} +% \begin{macro}[int]{\ctex_load_zhmap:nnnn} % 载入 \pkg{zhmetrics} 的字体映射文件,同时设置 \tn{CJKrmdefault} 等。 % \begin{macrocode} \cs_new_protected_nopar:Npn \ctex_load_zhmap:nnnn #1#2#3#4 @@ -3643,7 +3897,7 @@ This package consists of the file ctex.dtx, and the derived files \fi: % \end{macrocode} % -% \begin{macro}[internal]{\ctex_CJK_input:n,\CJK@input} +% \begin{macro}[int]{\ctex_CJK_input:n,\CJK@input} % \pkg{breqn} 包可能会在正文中将 |^| 的 \tn{catcode} 改为 $12$ 或 $13$,这将 % 破坏 \pkg{CJK} 对汉字的首字节的定义(\tn{CJK@loadBinding} 和 % \tn{CJK@loadEncoding})。因此需要确保载入 \file{.enc} 和 \file{.bdg} 文件时, @@ -3668,7 +3922,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_plane_to_utfxvibe:Nn,\CJK@surr} +% \begin{macro}[int]{\ctex_plane_to_utfxvibe:Nn,\CJK@surr} % \changes{v2.0}{2014/04/08}{解决与 \tn{nouppercase} 的冲突。} % \pkg{fancyhdr} 宏包的 \tn{nouppercase} 会将 \tn{uppercase} 定义为 \tn{relax},而 % \tn{CJK@surr} 需要用它将 \tn{CJK@plane} 转化成大写字母,这就造成了冲突^^A @@ -3765,7 +4019,7 @@ This package consists of the file ctex.dtx, and the derived files \fi: % \end{macrocode} % -% \begin{macro}[internal]{\ctex_auto_ignorespaces:} +% \begin{macro}[int]{\ctex_auto_ignorespaces:} % 关闭名字空间,保存 \tn{CJK@@ignorespaces} 的定义,方便使用。 % \begin{macrocode} %<@@=> @@ -3777,7 +4031,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_ignorespaces_case:N,\ctex_set_ignorespaces:} +% \begin{macro}[int]{\ctex_ignorespaces_case:N,\ctex_set_ignorespaces:} % 设置忽略空格的的方式。根据 \opt{space} 选项的值重定义 \tn{CJK@ignorespaces}, % 并保存起来供 \tn{CJKhook} 备用。 % \begin{macrocode} @@ -3792,16 +4046,16 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\CJKhook} +% \begin{macro}[int]{\CJKhook} % \env{CJK} 和 \env{CJK*} 环境都会重新定义 \tn{CJK@ignorespaces}。我们在 \pkg{CJK} % 宏包提供的 \tn{CJKhook} 里重新设置它,让这两个环境忽略空格的方式都受 \opt{space} % 选项的控制。这对 \pkg{zhmCJK} 是必要的。 % \begin{macrocode} -\ctex_add_hook:Nn \CJKhook { \ctex_set_ignorespaces: } +\ctex_gadd_hook:Nn \CJKhook { \ctex_set_ignorespaces: } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_punct_set:n} +% \begin{macro}[int]{\ctex_punct_set:n} % 设置 CJK 族对应到实际的字体。|#1| 是 \opt{fontset} 的名字。 % \begin{macrocode} \cs_new_protected_nopar:Npn \ctex_punct_set:n #1 @@ -3824,7 +4078,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_punct_map_family:nn} +% \begin{macro}[int]{\ctex_punct_map_family:nn} % CJK 族 |#1| 使用族 |#2| 的边界信息。 % \begin{macrocode} \cs_new_protected_nopar:Npn \ctex_punct_map_family:nn #1#2 @@ -3835,7 +4089,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_punct_map_bfseries:nn} +% \begin{macro}[int]{\ctex_punct_map_bfseries:nn} % CJK 族 |#1| 的 \tn{bfseries} 使用族 |#2| 的边界信息。 % \begin{macrocode} \cs_new_protected_nopar:Npn \ctex_punct_map_bfseries:nn #1#2 @@ -3858,7 +4112,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_punct_map_itshape:nn} +% \begin{macro}[int]{\ctex_punct_map_itshape:nn} % CJK 族 |#1| 的 \tn{itshape} 使用族 |#2| 的边界信息。 % \begin{macrocode} \cs_new_protected_nopar:Npn \ctex_punct_map_itshape:nn #1#2 @@ -3873,7 +4127,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_punct_space:nn,\ctexspadef} +% \begin{macro}[int]{\ctex_punct_space:nn,\ctexspadef} % 定义标点的边界信息。 % \begin{macrocode} \cs_new_protected_nopar:Npn \ctex_punct_space:nn #1#2 @@ -4069,7 +4323,7 @@ This package consists of the file ctex.dtx, and the derived files % % \paragraph{字体切换方式} % -% \begin{macro}[internal]{\ctex_ltj_select_font:,\CJK@family} +% \begin{macro}[int]{\ctex_ltj_select_font:,\CJK@family} % \tn{CJK@family} 保存的是当前 CJK 实际的字体族名,如果为空表示没有设置过字体。 % \begin{macrocode} \cs_new_protected_nopar:Npn \ctex_ltj_select_font: @@ -4084,7 +4338,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\@@_select_font_aux:} +% \begin{macro}[int]{\@@_select_font_aux:} % 使用 \tn{pickup@font} 取得字体名称前,总需要先设置 \tn{font@name}。在这里将 % \tn{f@family} 换成 CJK 字体族,并确保编码正确。 % \begin{macrocode} @@ -4117,7 +4371,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_ltj_pickup_font:} +% \begin{macro}[int]{\ctex_ltj_pickup_font:} % 替换 \tn{define@newfont} 内部调用的 \tn{extract@font} 和 \tn{do@subst@correction}。 % \begin{macrocode} \cs_new_protected_nopar:Npn \ctex_ltj_pickup_font: @@ -4135,7 +4389,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_ltj_extract_font:} +% \begin{macro}[int]{\ctex_ltj_extract_font:} % \pkg{LuaTeX-ja} 的 \tn{globaljfont} 在 \pkg{luatexja-core} 中定义: % \begin{verbatim} % %%%%%%%% \jfont\CS={...:...;jfm=metric;...}, \globaljfont @@ -4170,14 +4424,14 @@ This package consists of the file ctex.dtx, and the derived files % 赋值总是全局的,不会受到分组的影响。 % \begin{macrocode} \font@name - \ctex_lua_now_x:n { font.current(tex.attribute['ltj@curjfnt']) } + \ctex_lua_now_x:n { font.current(tex.getattribute('ltj@curjfnt')) } \use:c { \f@encoding + \f@family } \use:c { \curr@fontshape } } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_ltj_subst_font:} +% \begin{macro}[int]{\ctex_ltj_subst_font:} % \tn{do@subst@correction} 在设置通过 \texttt{sub} 或者 \texttt{ssub} 函数定义的 % 字体时会用到。如果没有设置 \opt{SlantedFont},\pkg{fontspec} 会设置 % \tn{itdefault} 作为 \tn{sldefault} 的替代字形,因而会用到这个函数。它的本来定义是: @@ -4217,7 +4471,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal,TF]{\ctex_ltj_if_alternate_shape_exist:n} +% \begin{macro}[int,TF]{\ctex_ltj_if_alternate_shape_exist:n} % 即 \pkg{LuaTeX-ja} 中的 \tn{ltj@@does@alt@set},判断是否存在替代字体。 % \begin{macrocode} \prg_new_conditional:Npnn \ctex_ltj_if_alternate_shape_exist:n #1 { T , F , TF } @@ -4245,7 +4499,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_ltj_select_alternate_font:} +% \begin{macro}[int]{\ctex_ltj_select_alternate_font:} % 在 \tn{selectfont} 中更新替代字体。 % \begin{macrocode} \cs_new_protected_nopar:Npn \ctex_ltj_select_alternate_font: @@ -4266,7 +4520,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ltj@pickup@altfont@auxy} +% \begin{macro}[int]{\ltj@pickup@altfont@auxy} % 被用在函数 |output_alt_font_cmd| 中,作用是定义替代字体。 % \begin{macrocode} \cs_new_protected_nopar:Npn \ltj@pickup@altfont@auxy #1 @@ -4288,7 +4542,7 @@ This package consists of the file ctex.dtx, and the derived files %<@@=> % \end{macrocode} % -% \begin{macro}[internal]{\ltj@pickup@altfont@copy} +% \begin{macro}[int]{\ltj@pickup@altfont@copy} % 被用在函数 |pickup_alt_font_a| 中。\tn{ltj@@getjfontnumber} 的作用是将字体命令 % |#1| 对应的 \texttt{font.id} 保存到 \tn{ltj@tempcntc} 中。 % \begin{macrocode} @@ -4355,7 +4609,7 @@ This package consists of the file ctex.dtx, and the derived files \ExplSyntaxOn % \end{macrocode} % -% \begin{macro}[internal]{\ctex_mono_jfm:n,\l_@@_jfm_tl} +% \begin{macro}[int]{\ctex_mono_jfm:n,\l_@@_jfm_tl} % \pkg{LuaTeX-ja} 中与标点格式 \opt{plain} 对应的 \texttt{JFM} 是 \opt{mono}。 % \begin{macrocode} \cs_new_protected_nopar:Npn \ctex_mono_jfm:n #1 @@ -4370,7 +4624,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\CJK@encoding,\@@_change_encoding:} +% \begin{macro}[int]{\CJK@encoding,\@@_change_encoding:} % 在 \LaTeX 下,\pkg{LuaTeX-ja} 依赖字体编码来实现特殊设置。例如上述的 % \tn{ltj@@IsFontJapanese} 就是通过判断编码来实现的,它在设置数学字体时会用到。所以 % 不应该与西文共用 \texttt{EU2}。定义字体族 song 为 \tn{CJK@encoding} 的默认替换 @@ -4416,7 +4670,7 @@ This package consists of the file ctex.dtx, and the derived files \cs_new:Npn \@@_noembed_wrap:n #1 { psft: #1 } % \end{macrocode} % -% \begin{macro}[internal]{\ctex_ltj_set_family:nnn} +% \begin{macro}[int]{\ctex_ltj_set_family:nnn} % 将自定义的字体族名与 \pkg{fontspec} 实际设置的名字对应起来。 % \begin{macrocode} \cs_new_protected:Npn \ctex_ltj_set_family:nnn #1#2#3 @@ -4450,7 +4704,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{variable}[internal] +% \begin{variable}[int] % {\g_@@_family_name_prop,\g_@@_family_font_name_prop,\g_@@_family_font_options_prop} % 分别保存 \pkg{fontspec} 设置的字体族名、字体名称和字体选项。 % \begin{macrocode} @@ -4460,7 +4714,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{variable} % -% \begin{macro}[internal]{\@@_check_family:n} +% \begin{macro}[int]{\@@_check_family:n} % 删除重复的定义,清除替代字体的先前设置。 % \begin{macrocode} \cs_new_protected_nopar:Npn \@@_check_family:n #1 @@ -4485,7 +4739,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\@@_gset_family_cs:nn} +% \begin{macro}[int]{\@@_gset_family_cs:nn} % 在设置字体时,实际上并不是马上就定义。而是只保存相关参数,在通过 \tn{CJKfamily} % 第一次使用时才定义。需要注意将编码改为 \tn{CJK@encoding}。 % \begin{macrocode} @@ -4520,7 +4774,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\CJKfamily} +% \begin{macro}[int]{\CJKfamily} % 切换字体。 % \begin{macrocode} \NewDocumentCommand \CJKfamily { m } @@ -4539,7 +4793,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal,TF]{\ctex_ltj_family_if_exist:n} +% \begin{macro}[int,TF]{\ctex_ltj_family_if_exist:n} % 判断 CJK 字体族 |#1| 是否存在,若存在则把实际族名保存到 |#2| 中。 % \begin{macrocode} \prg_new_protected_conditional:Npnn \ctex_ltj_family_if_exist:xN #1#2 { T , F , TF } @@ -4559,7 +4813,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\@@_family_unknown_warning:n} +% \begin{macro}[int]{\@@_family_unknown_warning:n} % \begin{macrocode} \cs_new_protected_nopar:Npn \@@_family_unknown_warning:n #1 { @@ -4602,7 +4856,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_ltj_fontspec:nn} +% \begin{macro}[int]{\ctex_ltj_fontspec:nn} % \begin{macrocode} \cs_new_protected_nopar:Npn \ctex_ltj_fontspec:nn #1#2 { @@ -4643,7 +4897,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal] +% \begin{macro}[int] % {\ctex_ltj_add_font_features:n,\ctex_ltj_add_font_features:nn} % \begin{macrocode} \cs_new_protected_nopar:Npn \ctex_ltj_add_font_features:n #1 @@ -4674,7 +4928,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal] +% \begin{macro}[int] % {\setCJKfamilyfont,\newCJKfontfamily,\CJKfontspec,\addCJKfontfeatures} % \begin{macrocode} \NewDocumentCommand \setCJKfamilyfont { m O { } m } @@ -4701,7 +4955,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal] +% \begin{macro}[int] % {\setCJKmainfont,\setCJKsansfont,\setCJKmonofont, % \setCJKmathfont,\defaultCJKfontfeatures} % \begin{macrocode} @@ -4752,7 +5006,7 @@ This package consists of the file ctex.dtx, and the derived files { \ctex_patch_failure:N \normalfont } % \end{macrocode} % -% \begin{macro}[internal]{\ctex_ltj_ensure_default_family:} +% \begin{macro}[int]{\ctex_ltj_ensure_default_family:} % 在导言区结束确认 \tn{CJKfamilydefault} 确实存在。 % \begin{macrocode} \cs_new_protected_nopar:Npn \ctex_ltj_ensure_default_family: @@ -4783,7 +5037,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_ltj_update_mathfont:} +% \begin{macro}[int]{\ctex_ltj_update_mathfont:} % 更新数学字体为实际的字体。 % \begin{macrocode} \cs_new_protected_nopar:Npn \ctex_ltj_update_mathfont: @@ -4829,7 +5083,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_ltj_set_alternate_seq:n} +% \begin{macro}[int]{\ctex_ltj_set_alternate_seq:n} % 我们使用 \verb=||= 作为替代字体序列的分隔标志。它可能被设置为活动字符,为此 % 需要先“消毒”,同时过滤掉空元素。 % \begin{macrocode} @@ -4858,7 +5112,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_ltj_set_alternate_family:nnF} +% \begin{macro}[int]{\ctex_ltj_set_alternate_family:nnF} % 如果在字体的选项中设置了 \opt{CharRange},则只设置替代字体。 % \begin{macrocode} \cs_new_protected_nopar:Npn \ctex_ltj_set_alternate_family:nnF #1#2#3 @@ -4875,7 +5129,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal] +% \begin{macro}[int] % {\ctex_ltj_save_alternate_seq:Nn,\ctex_ltj_save_alternate_seq:Nnnwn} % 保存由 \opt{AlternateFont} 设置的替代字体序列。 % \begin{macrocode} @@ -4909,7 +5163,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_ltj_set_alternate_family:nn} +% \begin{macro}[int]{\ctex_ltj_set_alternate_family:nn} % 设置选项 \opt{CharRange} 范围内的替代字体。如果已经定义了主字体,我们也马上 % 定义替代字体,否则只保存起来备用。 % \begin{macrocode} @@ -4932,7 +5186,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_ltj_save_alternate_family:Nnnn} +% \begin{macro}[int]{\ctex_ltj_save_alternate_family:Nnnn} % 保存替代字体序列的定义,以备定义主字体时使用。 % \begin{macrocode} \cs_new_protected_nopar:Npn \ctex_ltj_save_alternate_family:Nnnn #1#2#3#4 @@ -4944,7 +5198,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_ltj_set_alternate_family:nnn} +% \begin{macro}[int]{\ctex_ltj_set_alternate_family:nnn} % 实际定义替代字体族。 % \begin{macrocode} \cs_new_protected_nopar:Npn \ctex_ltj_set_alternate_family:nnn #1#2#3 @@ -4962,7 +5216,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_ltj_swap_cs:NN} +% \begin{macro}[int]{\ctex_ltj_swap_cs:NN} % 交换两个控制序列的意义。 % \begin{macrocode} \cs_new_protected:Npn \ctex_ltj_swap_cs:NN #1#2 @@ -4975,7 +5229,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{LTJFONTUID,\@@_update_family_uid:N} +% \begin{macro}[int]{LTJFONTUID,\@@_update_family_uid:N} % \pkg{fontspec} 在一个字体族的选项和字体名称相同的时候,就不定义新字体。为了 % 避免混淆替代字体的设置,我们新定义一个虚拟的选项 \opt{LTJFONTUID},确保 % \pkg{fontspec} 对 CJK 字体族总是定义新字体。 @@ -4990,7 +5244,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_ltj_declare_alternate_shape:nnnnnn} +% \begin{macro}[int]{\ctex_ltj_declare_alternate_shape:nnnnnn} % 在定义替代字体的字形时,通过字符范围与主字体的对应字形关联起来。 % \tn{DeclareFontShape@} 一个有六个参数,我们只需要使用它的第三个参数 \meta{series} % 和第四个参数 \meta{shape}。 @@ -5005,7 +5259,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_ltj_set_alternate_shape:Nnnnnnn} +% \begin{macro}[int]{\ctex_ltj_set_alternate_shape:Nnnnnnn} % 与 \pkg{LuaTeX-ja} 的 \tn{DeclareAlternateKanjiFont} 的功能类似,区别是固定编码 % 为 \tn{CJK@encoding}。这个设置总是全局的。 % \begin{macrocode} @@ -5028,7 +5282,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_ltj_set_alternate_shape:nnn} +% \begin{macro}[int]{\ctex_ltj_set_alternate_shape:nnn} % 我们使用 \texttt{->} 而不是像 \pkg{LuaTeX-ja} 一样使用 \texttt{-} 作为区间的 % 分隔符。\pkg{LuaTeX-ja} 支持使用负数来引用由 \texttt{JFM} 设置的字符类。如果 % 使用 \texttt{-} 作为分隔符,那么负数单独使用时,就需要把它放在两层花括号之内 @@ -5061,7 +5315,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_ltj_set_alternate_shape:nnN} +% \begin{macro}[int]{\ctex_ltj_set_alternate_shape:nnN} % 若字符范围预先由 \texttt{declarecharrange} 声明,则可以直接使用。 % \begin{macrocode} \cs_new_protected_nopar:Npn \ctex_ltj_set_alternate_shape:nnN #1#2#3 @@ -5158,7 +5412,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_ltj_declare_char_range:nn,\g_@@_char_range_prop} +% \begin{macro}[int]{\ctex_ltj_declare_char_range:nn,\g_@@_char_range_prop} % |#1| 是名字,|#2| 是范围。 % \begin{macrocode} \cs_new_protected_nopar:Npn \ctex_ltj_declare_char_range:nn #1#2 @@ -5174,7 +5428,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_ltj_save_char_range:n} +% \begin{macro}[int]{\ctex_ltj_save_char_range:n} % 预先解释字符区间的意义。 % \begin{macrocode} \NewDocumentCommand \ctex_ltj_save_char_range:n @@ -5195,7 +5449,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_ltj_def_char_range_key:n} +% \begin{macro}[int]{\ctex_ltj_def_char_range_key:n} % 在字体设置选项中定义字符范围键。 % \begin{macrocode} \cs_new_protected_nopar:Npn \ctex_ltj_def_char_range_key:n #1 @@ -5209,7 +5463,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_ltj_char_range_key:nn} +% \begin{macro}[int]{\ctex_ltj_char_range_key:nn} % 如果字符范围键没有值,则只设置的这个字符范围内的替代字体。 % \begin{macrocode} \cs_new_protected:Npn \ctex_ltj_char_range_key:nn #1#2 @@ -5227,7 +5481,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\@@_char_range_parse_feature:w} +% \begin{macro}[int]{\@@_char_range_parse_feature:w} % 可以使用加方括号的方式,通过文件名来调用字体。这容易与字体选项混淆。例如,需要 % 将 |[simsun.ttc]| 设置为 \opt{range} 的主字体,就需要使用 % |range={{[simsun.ttc]}}| 或者 |[]{[simsun.ttc]}|。下面的目的是,支持直接使用 @@ -5252,7 +5506,7 @@ This package consists of the file ctex.dtx, and the derived files % % \paragraph{其它设置} % -% \begin{macro}[internal]{\ctex_ltj_update_xkanjiskip:,\l_@@_xkanjiskip_skip} +% \begin{macro}[int]{\ctex_ltj_update_xkanjiskip:,\l_@@_xkanjiskip_skip} % \tn{ltjsetparameter} 对 \opt{xkanjiskip} 是即时赋值。\tn{zw} 与字体相关,因此 % 需要每次 \tn{selectfont} 的时候更新一次 \opt{xkanjiskip}。如果用户设置过 % \opt{xkanjiskip},就不更新。注意,同 \TeX{} 的 \tn{baselineskip} 一样,如果在 @@ -5312,7 +5566,7 @@ This package consists of the file ctex.dtx, and the derived files % % \subsubsection{调整 \tn{CJKfamilydefault}} % -% \begin{macro}[internal]{\ctex_update_default_family:} +% \begin{macro}[int]{\ctex_update_default_family:} % 在导言区结束,如果 \tn{CJKfamilydefault} 没有被更改,则在此时根据西文字体的情况 % 更新 \tn{CJKfamilydefault}。\pkg{xeCJK} 已经有这个功能,不需要再调整。 % \begin{macrocode} @@ -5347,7 +5601,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\l_@@_family_default_init_tl} +% \begin{macro}[int]{\l_@@_family_default_init_tl} % 往 \tn{CJKfamilydefault} 中加入标志,用于判断它是否被更改。 % \begin{macrocode} \tl_new:N \l_@@_family_default_init_tl @@ -5366,7 +5620,7 @@ This package consists of the file ctex.dtx, and the derived files % % \changes{v2.0}{2014/04/16}{自动检测操作系统,载入对应的字体配置。} % -% \begin{macro}[internal]{\ctex_detected_platform:} +% \begin{macro}[int]{\ctex_detected_platform:} % 在 \LuaTeX{} 下直接用调用 |os.name| 来判断。 % \begin{macrocode} %<*luatex> @@ -5415,8 +5669,9 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_if_macosx:TF} -% 以 \file{/mach_kernel} 为特征文件判断 Mac~OS~X。 +% \begin{macro}[int]{\ctex_if_macosx:TF} +% \changes{v2.1}{2015/06/17}{改用 \file{/Library/Fonts/Songti.ttc} 为特征文件。} +% 以 \file{/Library/Fonts/Songti.ttc} 为特征文件判断 Mac~OS~X。 % \begin{macrocode} \cs_new_protected_nopar:Npn \ctex_if_macosx:TF #1#2 { @@ -5424,23 +5679,25 @@ This package consists of the file ctex.dtx, and the derived files { \tl_gset:Nn \g_@@_fontset_tl {#1} } { \tl_gset:Nn \g_@@_fontset_tl {#2} } } -\tl_const:Nn \c_@@_macosx_file_tl { /mach_kernel } +\tl_const:Nn \c_@@_macosx_file_tl { /Library/Fonts/Songti.ttc } % % \end{macrocode} % \end{macro} % % \subsubsection{\pkg{hyperref} 兼容性处理} % +% \changes{v2.1}{2015/06/16}{不再设置 \pkg{hyperref} 宏包的 \opt{colorlinks} 选项。} +% % 现在处理各个引擎下的 PDF 中文书签问题。根据编译引擎与文件编码的不 % 同,\pkg{ctex} 向 \pkg{hyperref} 传递适当的参数,完成中文书签的正确设置。用 % 户仍需要自己载入 \pkg{hyperref} 宏包。 % -% \begin{macro}[internal]{\ctex_hypersetup:n} +% \begin{macro}[int]{\ctex_hypersetup:n} % 如果已经载入 \pkg{hyperref} 宏包,则直接使用其定义设置选项;否则 % \cs{ctex_hypersetup:n} 的效果与 \tn{PassOptionsToPackage} 一致,只传递宏包参 % 数。如果用户不载入 \pkg{hyperref} 宏包,相关参数即被丢弃。 % \begin{macrocode} -%<*class|style> +%<*class|ctex> \@ifpackageloaded { hyperref } { \cs_new_protected_nopar:Npn \ctex_hypersetup:n #1 @@ -5450,8 +5707,7 @@ This package consists of the file ctex.dtx, and the derived files \cs_new_protected_nopar:Npn \ctex_hypersetup:n #1 { \PassOptionsToPackage {#1} { hyperref } } } -\ctex_hypersetup:n { colorlinks = true } -% +% % \end{macrocode} % \end{macro} % @@ -5536,7 +5792,7 @@ This package consists of the file ctex.dtx, and the derived files % % \subsubsection{\pkg{CJKfntef}、\pkg{xeCJKfntef} 相关设置} % -% \CTeX{} 套件对 \pdfTeX{} 与 \XeTeX{} 引擎,分别载入 \pkg{CJKfntef} 或 +% \CTeX{} 宏集对 \pdfTeX{} 与 \XeTeX{} 引擎,分别载入 \pkg{CJKfntef} 或 % \pkg{xeCJKfntef} 宏包,并关闭宏包默认的彩色等多余格式。 % % \changes{v2.0}{2015/03/25}{默认关闭 \pkg{CJKfntef} 或 \pkg{xeCJKfntef} 的彩 @@ -5549,8 +5805,25 @@ This package consists of the file ctex.dtx, and the derived files % 的宏定义是过时命令,仅做兼容性保留。 % % \begin{macrocode} -%\RequirePackage { CJKfntef } \normalem -%\RequirePackage { xeCJKfntef } +%<*pdftex> +\RequirePackage { CJKfntef } +\normalem +\cs_new_protected_nopar:Npn \@@_clear_fntef_color:n #1 + { \tl_clear:c { CJK#1color } } +% +%<*xetex> +\RequirePackage { xeCJKfntef } +\@ifpackagelater { xeCJKfntef } { 2014/11/04 } + { + + \cs_new_protected_nopar:Npn \@@_clear_fntef_color:n #1 + { \xeCJKsetup { #1 / format = { } } } + } + { + \cs_new_protected_nopar:Npn \@@_clear_fntef_color:n #1 + { \tl_clear:c { CJK#1color } } + } +% %<*luatex> \msg_new:nnn { ctex } { fntef-not-available } { Functions~ of~ `CJKfntef'~ is~ not~ available~ in~ LuaLaTeX. } @@ -5560,8 +5833,7 @@ This package consists of the file ctex.dtx, and the derived files { underdot , underline , underdblline , underwave , sout , xout } %<*pdftex|xetex> { -% \tl_clear:c { CJK#1color } -% \keys_set:nn { xeCJK / options } { #1 / format = { } } + \@@_clear_fntef_color:n {#1} \cs_new_protected_nopar:cpx { CTEX#1 } { \msg_warning:nnnn { ctex } { deprecated-command } { \exp_not:c { CTEX#1 } } @@ -5600,7 +5872,7 @@ This package consists of the file ctex.dtx, and the derived files % % \subsubsection{\tn{ccwd} 的更新} % -% \begin{macro}[internal]{\ctex_update_ccwd:,\ccwd} +% \begin{macro}[int]{\ctex_update_ccwd:,\ccwd} % \begin{macrocode} \cs_new_protected_nopar:Npn \ctex_update_ccwd: %<*pdftex|xetex> @@ -5616,7 +5888,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_update_ccglue:} +% \begin{macro}[int]{\ctex_update_ccglue:} % 更新字间距。 % \begin{macrocode} \cs_new_protected_nopar:Npn \ctex_update_ccglue: @@ -5636,7 +5908,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal,pTF]{\ctex_if_ccglue_touched:} +% \begin{macro}[int,pTF]{\ctex_if_ccglue_touched:} % 检查用户是否修改过汉字间距。 % \begin{macrocode} \prg_new_conditional:Npnn \ctex_if_ccglue_touched: { TF } @@ -5660,7 +5932,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_update_em_unit:} +% \begin{macro}[int]{\ctex_update_em_unit:} % 将当前汉字的宽度保存到 \tn{ccwd} 中备用。不采用 \texttt{1 em},因为这时的 % \texttt{1 em} 实际上来自西文字体的信息,未必等于汉字的宽度,这似乎在传统的 % \file{.tfm} 字体上表现更明显。在 \pdfTeX{} 和 \XeTeX{} 下,直接使用 |\f@size\p@| @@ -5678,7 +5950,7 @@ This package consists of the file ctex.dtx, and the derived files % % \subsubsection{其它} % -% \begin{macro}[internal]{\ctex_add_to_selectfont:n,\CTEX@selectfont@hook} +% \begin{macro}[int]{\ctex_add_to_selectfont:n,\CTEX@selectfont@hook} % \tn{EverySelectfont} 直到文档开始时才有效。为了 \tn{ccwd} 和 \pkg{LuaTeX-ja} 的 % 字体设置在导言区也可用,我们还需要在这里手工修改 \tn{selectfont}。\pkg{everysel} % 宏包会用 \tn{CheckCommand} 来检查 \tn{selectfont} 是否为标准定义。我们修改了 @@ -5779,7 +6051,7 @@ This package consists of the file ctex.dtx, and the derived files % % \begin{macrocode} % -%<*class|style> +%<*class|ctex> % \end{macrocode} % % \subsubsection{载入引擎定义文件} @@ -5833,7 +6105,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_update_size:} +% \begin{macro}[int]{\ctex_update_size:} % 在字号变化时更新 \tn{ccwd}、\tn{parindent} 和汉字间距。字距为零则恢复正常设置。 % \begin{macrocode} \cs_new_protected_nopar:Npn \ctex_update_size: @@ -5876,7 +6148,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_update_stretch:} +% \begin{macro}[int]{\ctex_update_stretch:} % 首先计算一行上汉字的字数,\tn{CJKglue} 相当于将 \tn{linewidth} 与汉字总宽度之差 % 均匀地填充到汉字之间。\hologo{eTeX} 的除法是四舍五入,而我们这里应该用截断。由于 % 没有可展性的要求,直接用原语 \cs{tex_divide:D} 要比 \cs{int_div_truncate:nn} @@ -5923,7 +6195,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_update_parindent:} +% \begin{macro}[int]{\ctex_update_parindent:} % 更新段落首行缩进。此函数在字号变化时调用。 % \begin{macrocode} \cs_new_protected_nopar:Npn \ctex_update_parindent: @@ -5950,7 +6222,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_update_ziju:} +% \begin{macro}[int]{\ctex_update_ziju:} % 更新字距。若字距不大于 $-1$,即 \tn{ccwd} 为非正值,则不计算伸缩值。 % 否则,首先假定汉字的宽度为正常宽度加上字距,看一行上能正常放下多少个汉字。 % \begin{macrocode} @@ -6092,7 +6364,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % % \begin{macrocode} -%<*style> +%<*ctex> \msg_new:nnn { ctex } { ctexbibname } { Neither~`\token_to_str:N \bibname'~nor~`\token_to_str:N \refname'~can~be~found.\\ @@ -6108,11 +6380,11 @@ This package consists of the file ctex.dtx, and the derived files \keys_define:nn { ctex } { bibname .tl_set:N = \ctexbibname } } } -% +% % \end{macrocode} % % \begin{macrocode} -% +% % \end{macrocode} % % \subsection{中文化的标题结构} @@ -6124,7 +6396,7 @@ This package consists of the file ctex.dtx, and the derived files % % \subsubsection{定义标题格式选项} % -% \begin{variable}[internal]{\c_@@_headings_seq} +% \begin{variable}[int]{\c_@@_headings_seq} % \begin{macrocode} \seq_new:N \c_@@_headings_seq \seq_gset_from_clist:Nn \c_@@_headings_seq @@ -6136,7 +6408,9 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{variable} % -% \begin{macro}[internal]{\@@_initial_heading:n} +% \changes{v2.1}{2015/06/19}{\opt{nameformat} 可以接受章节名字为参数。} +% +% \begin{macro}[int]{\@@_initial_heading:n} % \begin{macrocode} \cs_new_protected_nopar:Npn \@@_initial_heading:n #1 { @@ -6151,23 +6425,29 @@ This package consists of the file ctex.dtx, and the derived files \tl_const:cx { CTEX@#1name } { \exp_not:c { CTEX@#1@nameformat } - \exp_not:c { CTEX@pre#1 } - \exp_not:N \tl_if_empty:NTF \exp_not:c { CTEX@#1@numberformat } - { \exp_not:c { CTEX@the#1 } } { - \group_begin: - \exp_not:c { CTEX@#1@numberformat } - \exp_not:c { CTEX@the#1 } - \group_end: + \exp_not:c { CTEX@pre#1 } + \exp_not:N \tl_if_empty:NTF \exp_not:c { CTEX@#1@numberformat } + { \exp_not:c { CTEX@the#1 } } + { + \group_begin: + \exp_not:c { CTEX@#1@numberformat } + \exp_not:c { CTEX@the#1 } + \group_end: + } + \exp_not:c { CTEX@post#1 } } - \exp_not:c { CTEX@post#1 } \exp_not:c { CTEX@#1@aftername } } } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\@@_def_heading_keys:n} +% \changes{v2.1}{2015/05/22}{\opt{format+}, \opt{nameformat+} 等带加号的选项, +% 加号与前面的文字之间可以有可选的空格。} +% \changes{v2.1}{2015/06/19}{新的标题格式选项 \opt{aftertitle}。} +% +% \begin{macro}[int]{\@@_def_heading_keys:n} % \begin{macrocode} \cs_new_protected_nopar:Npn \@@_def_heading_keys:n #1 { @@ -6182,19 +6462,34 @@ This package consists of the file ctex.dtx, and the derived files #1 / numberformat .tl_set:N = \exp_not:c { CTEX@#1@numberformat } , #1 / aftername .tl_set:N = \exp_not:c { CTEX@#1@aftername } , #1 / titleformat .tl_set:N = \exp_not:c { CTEX@#1@titleformat } , + #1 / aftertitle .tl_set:N = \exp_not:c { CTEX@#1@aftertitle } , #1 / beforeskip .tl_set:N = \exp_not:c { CTEX@#1@beforeskip } , #1 / afterskip .tl_set:N = \exp_not:c { CTEX@#1@afterskip} , #1 / indent .tl_set:N = \exp_not:c { CTEX@#1@indent } , #1 / format+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@format } { ####1 } } , + #1 / format~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@format } { ####1 } } , #1 / nameformat+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@nameformat } { ####1 } } , + #1 / nameformat~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@nameformat } { ####1 } } , #1 / numberformat+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@numberformat } { ####1 } } , + #1 / numberformat~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@numberformat } { ####1 } } , #1 / aftername+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftername } { ####1 } } , + #1 / aftername~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftername } { ####1 } } , #1 / titleformat+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@titleformat } { ####1 } } , + #1 / titleformat~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@titleformat } { ####1 } } , + #1 / aftertitle+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftertitle } { ####1 } } , + #1 / aftertitle~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftertitle } { ####1 } } , #1 / beforeskip .initial:n = \c_zero_skip , #1 / afterskip .initial:n = \c_zero_skip , #1 / indent .initial:n = \c_zero_dim , @@ -6206,7 +6501,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_assign_heading_name:nn,\@@_assign_heading_name:nnn} +% \begin{macro}[int]{\ctex_assign_heading_name:nn,\@@_assign_heading_name:nnn} % \opt{name} 的值是一个至多两个元素的逗号分隔列表。由于 \LTXIII{} 的 % \texttt{clist} 总是会自动忽略空元素,所以设置 |name={,章}| 后,第一个元素将会 % 是“章”,必须用空的分组保护空元素:|name={{},章}|,这在使用中有些许不便。我们 @@ -6226,32 +6521,32 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macrocode} -\tl_clear:N \l_@@_tmp_tl -\seq_map_inline:Nn \c_@@_headings_seq - { - \@@_initial_heading:n {#1} - \@@_def_heading_keys:n {#1} - } -\use:x { \keys_define:nn { ctex } { \exp_not:o { \l_@@_tmp_tl } } } -\tl_clear:N \l_@@_tmp_tl -% \end{macrocode} -% % \changes{v2.0}{2014/03/21}{标题设置新增 \opt{pagestyle} 选项。} % -% \begin{macro}{pagestyle} +% \begin{macro}{part/pagestyle,chapter/pagestyle} % 只在 \cls{ctexbook} 和 \cls{ctexrep} 下有定义。 % \begin{macrocode} %<*book|report> -\keys_define:nn { ctex } +\tl_set:Nn \l_@@_tmp_tl { part / pagestyle .tl_set:N = \CTEX@part@pagestyle , - chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle + chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle , } % % \end{macrocode} % \end{macro} % +% 定义标题键值选项。 +% \begin{macrocode} +\seq_map_inline:Nn \c_@@_headings_seq + { + \@@_initial_heading:n {#1} + \@@_def_heading_keys:n {#1} + } +\use:x { \keys_define:nn { ctex } { \exp_not:o { \l_@@_tmp_tl } } } +\tl_clear:N \l_@@_tmp_tl +% \end{macrocode} +% % % \subsubsection{标准标题命令的修改} % @@ -6261,7 +6556,7 @@ This package consists of the file ctex.dtx, and the derived files %<@@=> % \end{macrocode} % -% \begin{macro}[internal]{\part} +% \begin{macro}[int]{\part} % \begin{macrocode} %<*article> \renewcommand\part{% @@ -6280,7 +6575,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\@part} +% \begin{macro}[int]{\@part} % \begin{macrocode} %<*article> \def\@part[#1]#2{% @@ -6300,7 +6595,8 @@ This package consists of the file ctex.dtx, and the derived files \fi % \huge\bfseries #2% \CTEX@part@titleformat{#2}% - \markboth{}{}\par}% + \markboth{}{}% + \CTEX@part@aftertitle}% \nobreak % \vskip 3ex \vskip \CTEX@part@afterskip @@ -6330,13 +6626,14 @@ This package consists of the file ctex.dtx, and the derived files \CTEX@partname \fi % \Huge\bfseries #2\par}% - \CTEX@part@titleformat{#2}\par}% + \CTEX@part@titleformat{#2}% + \CTEX@part@aftertitle}% \@endpart} % % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\@spart} +% \begin{macro}[int]{\@spart} % \begin{macrocode} %<*article> \def\@spart#1{% @@ -6344,7 +6641,8 @@ This package consists of the file ctex.dtx, and the derived files % \normalfont \parindent \z@ \raggedright \normalfont \parindent \CTEX@part@indent \CTEX@part@format % \huge \bfseries #1\par}% - \CTEX@part@titleformat{#1}\par}% + \CTEX@part@titleformat{#1}% + \CTEX@part@aftertitle}% \nobreak % \vskip 3ex \vskip \CTEX@part@afterskip @@ -6356,7 +6654,8 @@ This package consists of the file ctex.dtx, and the derived files % \normalfont \centering \normalfont \CTEX@part@format % \Huge \bfseries #1\par}% - \CTEX@part@titleformat{#1}\par}% + \CTEX@part@titleformat{#1}% + \CTEX@part@aftertitle}% \@endpart} % % \end{macrocode} @@ -6368,7 +6667,7 @@ This package consists of the file ctex.dtx, and the derived files %<*book|report> % \end{macrocode} % -% \begin{macro}[internal]{\@chapter} +% \begin{macro}[int]{\@chapter} % \begin{macrocode} \def\@chapter[#1]#2{% \ifnum \c@secnumdepth >\m@ne @@ -6397,7 +6696,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\@makechapterhead} +% \begin{macro}[int]{\@makechapterhead} % \begin{macrocode} \def\@makechapterhead#1{% \thispagestyle{\CTEX@chapter@pagestyle}% @@ -6419,14 +6718,16 @@ This package consists of the file ctex.dtx, and the derived files \fi \interlinepenalty\@M % \Huge \bfseries #1\par\nobreak - \CTEX@chapter@titleformat{#1}\par\nobreak + \CTEX@chapter@titleformat{#1}% + \CTEX@chapter@aftertitle + \nobreak % \vskip 40\p@ \vskip \CTEX@chapter@afterskip }} % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\@makeschapterhead} +% \begin{macro}[int]{\@makeschapterhead} % \begin{macrocode} \def\@makeschapterhead#1{% \thispagestyle{\CTEX@chapter@pagestyle}% @@ -6442,7 +6743,9 @@ This package consists of the file ctex.dtx, and the derived files {\normalfont \parindent \CTEX@chapter@indent \CTEX@chapter@format \interlinepenalty\@M % \Huge \bfseries #1\par\nobreak - \CTEX@chapter@titleformat{#1}\par\nobreak + \CTEX@chapter@titleformat{#1} + \CTEX@chapter@aftertitle + \nobreak % \vskip 40\p@ \vskip \CTEX@chapter@afterskip }} @@ -6455,7 +6758,7 @@ This package consists of the file ctex.dtx, and the derived files % % \paragraph{section 类的标题} % -% \begin{macro}[internal]{\@seccntformat} +% \begin{macro}[int]{\@seccntformat} % \begin{macrocode} \def\@seccntformat#1{% \@ifundefined{CTEX@#1name}% @@ -6464,7 +6767,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\@sect} +% \begin{macro}[int]{\@sect} % \begin{macrocode} \def\@sect#1#2#3#4#5#6[#7]#8{% \ifnum #2>\c@secnumdepth @@ -6480,7 +6783,8 @@ This package consists of the file ctex.dtx, and the derived files \@hangfrom{\hskip #3\relax\@svsec}% % \interlinepenalty \@M #8\@@par}% \interlinepenalty \@M - \csname CTEX@#1@titleformat\endcsname{#8}\@@par}% + \csname CTEX@#1@titleformat\endcsname{#8}% + \csname CTEX@#1@aftertitle\endcsname}% \endgroup \csname #1mark\endcsname{#7}% \addcontentsline{toc}{#1}{% @@ -6495,7 +6799,9 @@ This package consists of the file ctex.dtx, and the derived files \def\@svsechd{% #6{\hskip #3\relax % \@svsec #8}% - \@svsec \csname CTEX@#1@titleformat\endcsname{#8}}% + \@svsec + \csname CTEX@#1@titleformat\endcsname{#8}% + \csname CTEX@#1@aftertitle\endcsname}% \csname #1mark\endcsname{#7}% \addcontentsline{toc}{#1}{% \ifnum #2>\c@secnumdepth \else @@ -6510,7 +6816,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\@ssect} +% \begin{macro}[int]{\@ssect} % \tn{@ssect} 并没有参数给出当前标题的名字,扩展它的参数会与 \pkg{hyperref} 冲突。 % 它的第二个参数是 BEFORESKIP(\tn{@startsection} 的第四个参数),在定义中并没有 % 被用到,应该可以用它来传递名字。我们这里通过函数 \tn{CTEX@titleformat@n} 来传递, @@ -6524,11 +6830,12 @@ This package consists of the file ctex.dtx, and the derived files \@hangfrom{\hskip #1}% % \interlinepenalty \@M #5\@@par}% \interlinepenalty \@M - \CTEX@titleformat@n{#5}\@@par}% + \CTEX@titleformat@n{#5}% + \CTEX@aftertitle}% \endgroup \else % \def\@svsechd{#4{\hskip #1\relax #5}}% - \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}}}% + \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}\CTEX@aftertitle}}% \fi \@xsect{#3}} % \end{macrocode} @@ -6538,12 +6845,16 @@ This package consists of the file ctex.dtx, and the derived files %<@@=ctex> % \end{macrocode} % -% \begin{macro}[internal]{\CTEX@set@titleformat@n, \CTEX@titleformat@n} +% \begin{macro}[int]{\CTEX@set@titleformat@n, \CTEX@titleformat@n} % 在 \tn{@startsection} 中设置 \tn{CTEX@titleformat@n} 为相应函数。 % \begin{macrocode} \cs_new_protected_nopar:Npn \CTEX@set@titleformat@n #1 - { \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat } } + { + \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat } + \cs_set_eq:Nc \CTEX@aftertitle { CTEX@#1@aftertitle } + } \cs_new_eq:NN \CTEX@titleformat@n \use:n +\cs_new_eq:NN \CTEX@aftertitle \prg_do_nothing: % \end{macrocode} % \end{macro} % @@ -6571,19 +6882,21 @@ This package consists of the file ctex.dtx, and the derived files % % \paragraph{附录标题} % +% \begin{macro}[int]{appendix/name,appendix/number} % \begin{macrocode} -\tl_new:N \CTEX@preappendix -\tl_new:N \CTEX@postappendix \keys_define:nn { ctex } - { appendix .meta:nn = { ctex / appendix } {#1} } -\keys_define:nn { ctex / appendix } { - name .code:n = { \ctex_assign_heading_name:nn { appendix } {#1} } , - number .tl_set:N = \CTEX@appendixnumber + appendix .meta:nn = { ctex / appendix } {#1} , + appendix / name .code:n = + { \ctex_assign_heading_name:nn { appendix } {#1} } , + appendix / number .tl_set:N = \CTEX@appendixnumber } +\tl_new:N \CTEX@preappendix +\tl_new:N \CTEX@postappendix % \end{macrocode} +% \end{macro} % -% \begin{macro}[internal]{\appendix} +% \begin{macro}[int]{\appendix} % \begin{macrocode} \cs_new_eq:NN \CTEX@save@appendix \appendix \cs_gset_protected_nopar:Npn \appendix @@ -6605,7 +6918,7 @@ This package consists of the file ctex.dtx, and the derived files % % \subsubsection{目录标签的宽度} % -% \begin{macro}[internal]{\numberline} +% \begin{macro}[int]{\numberline} % \begin{macrocode} \cs_new_protected:Npn \CTEX@toc@width@n #1 { @@ -6640,7 +6953,7 @@ This package consists of the file ctex.dtx, and the derived files % % \subsubsection{页眉信息的修改} % -% \begin{macro}[internal]{\ps@headings} +% \begin{macro}[int]{\ps@headings} % \begin{macrocode} %<*article> \ctex_patch_cmd:Nnn \ps@headings { \thesection } { \CTEXthesection } @@ -6659,7 +6972,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macro} % % -% \begin{macro}[internal]{\ps@fancy} +% \begin{macro}[int]{\ps@fancy} % 这里对 \pkg{fancyhdr} 宏包打补丁。原来 \pkg{fancyhdr} 宏包中使用 % \tn{thesection} 等宏表示页眉中的章节编号,这里改用 \pkg{ctex} 包所用的 % \tn{CTEXthesection} 系列宏。 @@ -6685,7 +6998,7 @@ This package consists of the file ctex.dtx, and the derived files % % \subsubsection{标签引用数字的汉化} % -% \begin{macro}[internal]{\refstepcounter} +% \begin{macro}[int]{\refstepcounter} % 对标题进行引用时,设置标签为通过 \opt{number} 选项设置的形式。 % \begin{macrocode} \cs_new_protected_nopar:Npn \CTEX@setcurrentlabel@n #1 @@ -6700,7 +7013,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_varioref_hook:} +% \begin{macro}[int]{\ctex_varioref_hook:} % 关于标签引用的宏包可能会修改 \tn{refstepcounter}。其中 \pkg{cleveref} 和 % \pkg{hyperref} 宏包都会保存之前的定义,并且它们都要求尽可能晚的被载入,所以 % 对我们上述的修改影响不大。需要注意的是 \pkg{varioref} 宏包,如果它在 @@ -6714,7 +7027,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\@@_fix_varioref_label:n} +% \begin{macro}[int]{\@@_fix_varioref_label:n} % \pkg{varioref} 宏包的 \tn{labelformat} 实际上是定义一个以 |\the<#1>| 为参数的宏 % |\p@<#1>|。\LaTeX{} 在定义计数器 |<#1>| 时,都会将 |\p@<#1>| 初始化为 \tn{@empty}。 % 如果这个宏非空,说明用户自定义了标签格式,我们就不再修改。这里不能使用 @@ -6767,13 +7080,19 @@ This package consists of the file ctex.dtx, and the derived files %<*scheme&(article|book|report)> % \end{macrocode} % +% \changes{v2.1}{2015/05/30}{修复 \cls{ctexbook} 和 \cls{ctexrep} 类的中文 +% \opt{part/number} 选项初值为空的错误。} % \begin{macrocode} \keys_set:nn { ctex / part } { + aftertitle = \par , %<*plain> name = \partname \space , number = \thepart , % +%<*chinese> + number = \chinese { part } , +% %<*article> nameformat = \Large \bfseries , afterskip = 3ex , @@ -6784,7 +7103,6 @@ This package consists of the file ctex.dtx, and the derived files beforeskip = -4ex % %<*chinese> - number = \chinese { part } , format = \centering , aftername = \quad , titleformat = \Large \bfseries , @@ -6812,6 +7130,7 @@ This package consists of the file ctex.dtx, and the derived files { pagestyle = plain , nameformat = \huge \bfseries , + aftertitle = \par , afterskip = 40 \p@ , %<*plain> name = \chaptername \space , @@ -6833,10 +7152,15 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % % \begin{macrocode} +%<@@=> +% \end{macrocode} +% +% \begin{macrocode} \keys_set:nn { ctex / section } { number = \thesection , aftername = \quad , + aftertitle = \@@par , afterskip = 2.3ex \@plus .2ex , %<*plain> format = \Large \bfseries , @@ -6855,6 +7179,7 @@ This package consists of the file ctex.dtx, and the derived files number = \thesubsection , format = \large \bfseries , aftername = \quad , + aftertitle = \@@par , afterskip = 1.5ex \@plus .2ex , %<*plain> beforeskip = -3.25ex \@plus -1ex \@minus -.2ex @@ -6871,6 +7196,7 @@ This package consists of the file ctex.dtx, and the derived files number = \thesubsubsection , format = \normalsize \bfseries , aftername = \quad , + aftertitle = \@@par , afterskip = 1.5ex \@plus .2ex , %<*plain> beforeskip = -3.25ex \@plus -1ex \@minus -.2ex @@ -6901,10 +7227,11 @@ This package consists of the file ctex.dtx, and the derived files % % 处理 \opt{sub3section} 与 \opt{sub4section} 的格式。 % \begin{macrocode} -\int_compare:nNnTF \g_@@_section_depth_flag > \c_two +\int_compare:nNnTF \g__ctex_section_depth_flag > \c_two { \keys_set:nn { ctex / paragraph } { + aftertitle = \@@par , %<*plain> beforeskip = -3.25ex \@plus -1ex \@minus -.2ex , % @@ -6921,10 +7248,11 @@ This package consists of the file ctex.dtx, and the derived files afterskip = -1em } } -\int_compare:nNnTF \g_@@_section_depth_flag > \c_three +\int_compare:nNnTF \g__ctex_section_depth_flag > \c_three { \keys_set:nn { ctex / subparagraph } { + aftertitle = \@@par , %<*plain> beforeskip = -3.25ex \@plus -1ex \@minus -.2ex , % @@ -6941,11 +7269,15 @@ This package consists of the file ctex.dtx, and the derived files afterskip = -1em } } -\int_compare:nNnTF \g_@@_section_depth_flag > \c_two +\int_compare:nNnTF \g__ctex_section_depth_flag > \c_two { \keys_set:nn { ctex / subparagraph } { indent = \c_zero_dim } } { \keys_set:nn { ctex / subparagraph } { indent = \parindent } } % \end{macrocode} % +% \begin{macrocode} +%<@@=ctex> +% \end{macrocode} +% % 处理附录的格式。 % \begin{macrocode} \keys_set:nn { ctex / appendix } @@ -6967,9 +7299,23 @@ This package consists of the file ctex.dtx, and the derived files % \subsubsection{\pkg{ctex.sty} 的 \opt{heading} 选项} % % \begin{macrocode} -%<*style> +%<*ctex|ctexheading> +% \end{macrocode} +% +% \begin{variable}[int]{\c_@@_std_class_tl} +% 用于记录被引入的标准文档类。 +% \begin{macrocode} +\clist_map_inline:nn { article , book , report } + { + \@ifclassloaded {#1} + { \clist_map_break:n { \tl_const:Nn \c_@@_std_class_tl {#1} } } + { } + } % \end{macrocode} +% \end{variable} % +% 若标准文档类被引入,则载入对应的标题定义文件。否则视 \tn{chapter} 是否有定义来 +% 引入 \cls{book} 或者 \cls{article}。 % \begin{macrocode} \msg_new:nnn { ctex } { not-standard-class } { @@ -6977,14 +7323,11 @@ This package consists of the file ctex.dtx, and the derived files Heading~`#1'~is~selected.\\ ctex~may~not~work~as~expected. } -\bool_if:NTF \l_@@_heading_bool +%\bool_if:NTF \l_@@_heading_bool +%\use:n { - \clist_map_inline:nn { article , book , report } - { - \@ifclassloaded {#1} - { \clist_map_break:n { \tl_const:Nn \c_@@_class_tl {#1} } } { } - } - \tl_if_exist:NF \c_@@_class_tl + \tl_if_exist:NTF \c_@@_std_class_tl + { \cs_new_eq:NN \c_@@_class_tl \c_@@_std_class_tl } { \cs_if_exist:NTF \chapter { @@ -6997,11 +7340,11 @@ This package consists of the file ctex.dtx, and the derived files } \ctex_file_input:n { ctex- \c_@@_class_tl .def } } - { \ctex_scheme_input:o { \l_@@_scheme_tl } } +% { \ctex_scheme_input:o { \l_@@_scheme_tl } } % \end{macrocode} % % \begin{macrocode} -% +% % \end{macrocode} % % \subsubsection{标题配置文件} @@ -7081,17 +7424,14 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % % \changes{v2.0.2}{2015/05/16}{修复加载 \pkg{ctex} 宏包后章节标题后第一段 -% 无段首缩进的问题} +% 无段首缩进的问题。} % 若 \pkg{ctex} 宏包与标准文档类及其衍生文档类联用,则将载入 \pkg{indentfirst} 宏包, % 实现章节标题后首个段落的段首缩进。 % \begin{macrocode} -%<*!(article|book|report)> -\clist_map_inline:nn { article , book , report } - { - \@ifclassloaded {#1} - { \RequirePackage{ indentfirst } } { } - } -% +%<*generic> +\tl_if_exist:NT \c_@@_std_class_tl + { \RequirePackage{ indentfirst } } +% % \end{macrocode} % % \begin{macrocode} @@ -7101,7 +7441,7 @@ This package consists of the file ctex.dtx, and the derived files % \subsection{中文字号} % % \begin{macrocode} -%<*class|style|ctexsize> +%<*class|ctex|ctexsize> % \end{macrocode} % % \changes{v2.0}{2014/03/08}{将中文字号功能提取到可以独立使用的 \pkg{ctexsize}。} @@ -7113,7 +7453,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_zihao:n} +% \begin{macro}[int]{\ctex_zihao:n} % \begin{macrocode} \cs_new_protected_nopar:Npn \ctex_zihao:n #1 { @@ -7135,7 +7475,7 @@ This package consists of the file ctex.dtx, and the derived files % % \changes{v2.0}{2014/03/08}{中文字号不再采用近似值。} % -% \begin{variable}[internal]{\c_@@_font_size_prop} +% \begin{variable}[int]{\c_@@_font_size_prop} % \begin{macro}[aux]{\@@_save_font_size:nn} % 基础行距是字号的 $1.2$ 倍,采用 \hologo{eTeX} 的 scaling 运算得到的结果 % 要比简单的 |1.2\dimexpr| 精确^^A @@ -7179,7 +7519,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macro} % \end{variable} % -% \begin{macro}[internal]{\ctex_declare_math_sizes:nnnn} +% \begin{macro}[int]{\ctex_declare_math_sizes:nnnn} % \begin{macrocode} \cs_new_protected_nopar:Npn \ctex_declare_math_sizes:nnnn #1#2#3#4 { @@ -7229,7 +7569,7 @@ This package consists of the file ctex.dtx, and the derived files % % \subsubsection{修改默认字号大小} % -% \begin{macro}[internal]{\ctex_set_font_size:Nnn} +% \begin{macro}[int]{\ctex_set_font_size:Nnn} % \begin{macrocode} \cs_new_protected:Npn \ctex_set_font_size:Nnn #1#2#3 { @@ -7251,7 +7591,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % % \begin{macrocode} -% +% % \end{macrocode} % % \begin{macrocode} @@ -7340,7 +7680,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % % \begin{macrocode} -%<*class|style> +%<*class|ctex> % \end{macrocode} % % \subsection{更新行距} @@ -7354,7 +7694,7 @@ This package consists of the file ctex.dtx, and the derived files % % \changes{v2.0}{2014/04/23}{调整 \tn{footnotesep} 的大小,以适合行距的变化。} % -% \begin{variable}[internal]{\footnotesep} +% \begin{variable}[int]{\footnotesep} % 我们调整了行距,可能导致脚注的间距与行距不协调,需要调整 \tn{footnotesep}。标准 % 文档类对 \tn{footnotesep} 的设置是,字体大小为 \tn{footnotesize} 时 \tn{strutbox} % 的高度(默认值是 |.7\baselineskip|)。我们沿用这个设置方法,只需要更新具体的大小。 @@ -7382,16 +7722,13 @@ This package consists of the file ctex.dtx, and the derived files % \begin{macrocode} \NewDocumentCommand \CTeX { } { \ifincsname CTeX \else: C \TeX \fi: } -\AtBeginDocument - { - \cs_if_exist_use:NT \pdfstringdefDisableCommands - { { \tl_set:Nn \CTeX { CTeX } } } - } +\ctex_at_end_package:nn { hyperref } + { \pdfstringdefDisableCommands { \tl_set:Nn \CTeX { CTeX } } } % \end{macrocode} % \end{macro} % % \changes{v2.0}{2014/03/28}{\opt{captiondelimiter} 是过时选项。} -% \begin{macro}[internal]{captiondelimiter} +% \begin{macro}{captiondelimiter} % 过时选项。 % \begin{macrocode} \keys_define:nn { ctex } @@ -7406,12 +7743,12 @@ This package consists of the file ctex.dtx, and the derived files % \end{macro} % % \begin{macrocode} -% +% % \end{macrocode} % % \subsubsection{列表环境的缩进} % -% \begin{macro}[internal]{\verse,\quotation} +% \begin{macro}[int]{\verse,\quotation} % 只在使用文档类的时候修改诗歌和引用环境的缩进。 % \begin{macrocode} %<*scheme&!generic&chinese> @@ -7423,12 +7760,12 @@ This package consists of the file ctex.dtx, and the derived files % \end{macro} % % \begin{macrocode} -%<*class|style> +%<*class|ctex> % \end{macrocode} % % \subsubsection{其他兼容性修改} % -% \begin{macro}[internal]{\end} +% \begin{macro}[int]{\end} % \changes{v2.0}{2014/03/09} % {解决 \pkg{etoolbox} 与 \pkg{breqn} 关于 \tn{end} 的冲突。} % \pkg{breqn} 宏包对 \tn{end} 作了如下处理,然而这个处理并不保险。 @@ -7469,7 +7806,7 @@ This package consists of the file ctex.dtx, and the derived files % % \subsection{载入中文字体} % -% \begin{macro}[internal]{\ctex_fontset_error:n} +% \begin{macro}[int]{\ctex_fontset_error:n} % 字库不可用时给出紧急错误信息,停止读取定义文件。 % \begin{macrocode} \cs_new_protected_nopar:Npn \ctex_fontset_error:n #1 @@ -7479,7 +7816,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ctex_load_fontset:} +% \begin{macro}[int]{\ctex_load_fontset:} % 如果用户没有指定字体,则探测操作系统,载入相应的字体配置。 % \begin{macrocode} \cs_new_protected_nopar:Npn \ctex_load_fontset: @@ -7567,7 +7904,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % % \begin{macrocode} -% +% % \end{macrocode} % % \begin{macrocode} @@ -7712,7 +8049,7 @@ This package consists of the file ctex.dtx, and the derived files % 旧的 Windows 字体设置使用黑体作为无衬线体,楷体和仿宋是 GB2312 编码;新的 % Windows 字体设置使用微软雅黑作为无衬线体,楷体和仿宋是大字库。 % \begin{macrocode} -%<*windowsnew,windowsold> +%<*windowsnew|windowsold> \pdftex_if_engine:TF { \ctex_zhmap_case:nnn @@ -7795,7 +8132,7 @@ This package consists of the file ctex.dtx, and the derived files [ BoldFont = { *~Bold } ] { Microsoft~YaHei } % } -% +% % \end{macrocode} % % \subsubsection{\pkg{ctex-fontset-adobe.def}} @@ -8130,7 +8467,8 @@ This package consists of the file ctex.dtx, and the derived files { \ctex_fontset_error:n { ubuntu } } } { - \setCJKmainfont [ ItalicFont = AR~PL~UKai~CN ] { AR~PL~UMing~CN } + \setCJKmainfont + [ BoldFont = WenQuanYi~Zen~Hei , ItalicFont = AR~PL~UKai~CN ] { AR~PL~UMing~CN } \setCJKsansfont { WenQuanYi~Zen~Hei } \setCJKmonofont { AR~PL~UMing~CN } \setCJKfamilyfont { zhsong } { AR~PL~UMing~CN } @@ -8207,7 +8545,13 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % % \begin{macrocode} -\input ifpdf.sty\relax +\begingroup\expandafter\endgroup +\expandafter\let\csname ifzhmappdf\expandafter\endcsname\csname + \expandafter\ifx\csname ifctexpdf\endcsname\relax + \expandafter\ifx\csname pdfoutput\endcsname\relax + iffalse\else\ifnum\pdfoutput < 1 iffalse\else iftrue\fi\fi + \else ifctexpdf\fi +\endcsname % \end{macrocode} % % 提供非 \LaTeX{} 格式下的 \tn{ProvidesFile}。 @@ -8228,9 +8572,9 @@ This package consists of the file ctex.dtx, and the derived files % \begin{macrocode} %<*windows> \ProvidesFile{zhwindowsfonts.tex}% - [2014/06/03 v2.0 Windows font map loader for pdfTeX and DVIPDFMx (CTEX)] + [2015/05/25 v2.1 Windows font map loader for pdfTeX and DVIPDFMx (CTEX)] -\ifpdf +\ifzhmappdf \pdfmapline{=gbk@UGBK@ \ProvidesFile{zhadobefonts.tex}% - [2014/06/03 v2.0 Adobe font map loader for DVIPDFMx (CTEX)] + [2015/05/25 v2.1 Adobe font map loader for DVIPDFMx (CTEX)] -\ifpdf +\ifzhmappdf %% pdfTeX does not support OTF fonts \else @@ -8336,9 +8680,9 @@ This package consists of the file ctex.dtx, and the derived files % \begin{macrocode} %<*fandol> \ProvidesFile{zhfandolfonts.tex}% - [2014/06/03 v2.0 Fandol font map loader for DVIPDFMx (CTEX)] + [2015/05/25 v2.1 Fandol font map loader for DVIPDFMx (CTEX)] -\ifpdf +\ifzhmappdf %% pdfTeX does not support OTF fonts \else @@ -8372,9 +8716,9 @@ This package consists of the file ctex.dtx, and the derived files % \begin{macrocode} %<*founder> \ProvidesFile{zhfounderfonts.tex}% - [2014/06/03 v2.0 Founder font map loader for pdfTeX and DVIPDFMx (CTEX)] + [2015/05/25 v2.1 Founder font map loader for pdfTeX and DVIPDFMx (CTEX)] -\ifpdf +\ifzhmappdf \pdfmapline{=gbk@UGBK@ \ProvidesFile{zhubuntufonts.tex}% - [2014/06/03 v2.0 Ubuntu font map loader for pdfTeX and DVIPDFMx (CTEX)] + [2015/05/25 v2.1 Ubuntu font map loader for pdfTeX and DVIPDFMx (CTEX)] -\ifpdf +\ifzhmappdf \pdfmapline{=gbk@UGBK@ $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {Caption with encoding GBK (CTEX)} \ProvidesExplFile{ctex-name-gbk.cfg} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} \keys_set:nn { ctex } { contentsname = Ŀ¼ , diff --git a/Master/texmf-dist/tex/latex/ctex/config/ctex-name-utf8.cfg b/Master/texmf-dist/tex/latex/ctex/config/ctex-name-utf8.cfg index 4f86d6bebf7..28f8903bb40 100644 --- a/Master/texmf-dist/tex/latex/ctex/config/ctex-name-utf8.cfg +++ b/Master/texmf-dist/tex/latex/ctex/config/ctex-name-utf8.cfg @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {Caption with encoding UTF8 (CTEX)} \ProvidesExplFile{ctex-name-utf8.cfg} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} \keys_set:nn { ctex } { contentsname = 目录 , diff --git a/Master/texmf-dist/tex/latex/ctex/config/ctex.cfg b/Master/texmf-dist/tex/latex/ctex/config/ctex.cfg index 1c91052f246..9441ebf9045 100644 --- a/Master/texmf-dist/tex/latex/ctex/config/ctex.cfg +++ b/Master/texmf-dist/tex/latex/ctex/config/ctex.cfg @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {Configuration file (CTEX)} \ProvidesExplFile{\ExplFileName.cfg} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} %% %% %% diff --git a/Master/texmf-dist/tex/latex/ctex/config/ctexopts.cfg b/Master/texmf-dist/tex/latex/ctex/config/ctexopts.cfg index be98a7d9e94..0d1bf614b7e 100644 --- a/Master/texmf-dist/tex/latex/ctex/config/ctexopts.cfg +++ b/Master/texmf-dist/tex/latex/ctex/config/ctexopts.cfg @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {Option configuration file (CTEX)} \ProvidesExplFile{ctexopts.cfg} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} %% %% \keys_set:nn { ctex / option } { fontset = windowsnew } %% diff --git a/Master/texmf-dist/tex/latex/ctex/ctex-article.def b/Master/texmf-dist/tex/latex/ctex/ctex-article.def index ba0af7ce82d..be98bfc12e0 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctex-article.def +++ b/Master/texmf-dist/tex/latex/ctex/ctex-article.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {Heading modification for article (CTEX)} \ProvidesExplFile{ctex-article.def} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} \seq_new:N \c__ctex_headings_seq \seq_gset_from_clist:Nn \c__ctex_headings_seq { @@ -49,16 +49,18 @@ \tl_const:cx { CTEX@#1name } { \exp_not:c { CTEX@#1@nameformat } - \exp_not:c { CTEX@pre#1 } - \exp_not:N \tl_if_empty:NTF \exp_not:c { CTEX@#1@numberformat } - { \exp_not:c { CTEX@the#1 } } { - \group_begin: - \exp_not:c { CTEX@#1@numberformat } - \exp_not:c { CTEX@the#1 } - \group_end: + \exp_not:c { CTEX@pre#1 } + \exp_not:N \tl_if_empty:NTF \exp_not:c { CTEX@#1@numberformat } + { \exp_not:c { CTEX@the#1 } } + { + \group_begin: + \exp_not:c { CTEX@#1@numberformat } + \exp_not:c { CTEX@the#1 } + \group_end: + } + \exp_not:c { CTEX@post#1 } } - \exp_not:c { CTEX@post#1 } \exp_not:c { CTEX@#1@aftername } } } @@ -75,19 +77,34 @@ #1 / numberformat .tl_set:N = \exp_not:c { CTEX@#1@numberformat } , #1 / aftername .tl_set:N = \exp_not:c { CTEX@#1@aftername } , #1 / titleformat .tl_set:N = \exp_not:c { CTEX@#1@titleformat } , + #1 / aftertitle .tl_set:N = \exp_not:c { CTEX@#1@aftertitle } , #1 / beforeskip .tl_set:N = \exp_not:c { CTEX@#1@beforeskip } , #1 / afterskip .tl_set:N = \exp_not:c { CTEX@#1@afterskip} , #1 / indent .tl_set:N = \exp_not:c { CTEX@#1@indent } , #1 / format+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@format } { ####1 } } , + #1 / format~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@format } { ####1 } } , #1 / nameformat+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@nameformat } { ####1 } } , + #1 / nameformat~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@nameformat } { ####1 } } , #1 / numberformat+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@numberformat } { ####1 } } , + #1 / numberformat~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@numberformat } { ####1 } } , #1 / aftername+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftername } { ####1 } } , + #1 / aftername~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftername } { ####1 } } , #1 / titleformat+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@titleformat } { ####1 } } , + #1 / titleformat~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@titleformat } { ####1 } } , + #1 / aftertitle+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftertitle } { ####1 } } , + #1 / aftertitle~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftertitle } { ####1 } } , #1 / beforeskip .initial:n = \c_zero_skip , #1 / afterskip .initial:n = \c_zero_skip , #1 / indent .initial:n = \c_zero_dim , @@ -106,7 +123,6 @@ { \tl_clear:c { CTEX@post#1 } } { \tl_set:cn { CTEX@post#1 } {#3} } } -\tl_clear:N \l__ctex_tmp_tl \seq_map_inline:Nn \c__ctex_headings_seq { \__ctex_initial_heading:n {#1} @@ -138,14 +154,16 @@ \CTEX@partname \fi \CTEX@part@titleformat{#2}% - \markboth{}{}\par}% + \markboth{}{}% + \CTEX@part@aftertitle}% \nobreak \vskip \CTEX@part@afterskip \@afterheading} \def\@spart#1{% {\interlinepenalty \@M \normalfont \parindent \CTEX@part@indent \CTEX@part@format - \CTEX@part@titleformat{#1}\par}% + \CTEX@part@titleformat{#1}% + \CTEX@part@aftertitle}% \nobreak \vskip \CTEX@part@afterskip \@afterheading} @@ -166,7 +184,8 @@ #6{% \@hangfrom{\hskip #3\relax\@svsec}% \interlinepenalty \@M - \csname CTEX@#1@titleformat\endcsname{#8}\@@par}% + \csname CTEX@#1@titleformat\endcsname{#8}% + \csname CTEX@#1@aftertitle\endcsname}% \endgroup \csname #1mark\endcsname{#7}% \addcontentsline{toc}{#1}{% @@ -179,7 +198,9 @@ \else \def\@svsechd{% #6{\hskip #3\relax - \@svsec \csname CTEX@#1@titleformat\endcsname{#8}}% + \@svsec + \csname CTEX@#1@titleformat\endcsname{#8}% + \csname CTEX@#1@aftertitle\endcsname}% \csname #1mark\endcsname{#7}% \addcontentsline{toc}{#1}{% \ifnum #2>\c@secnumdepth \else @@ -197,15 +218,20 @@ #4{% \@hangfrom{\hskip #1}% \interlinepenalty \@M - \CTEX@titleformat@n{#5}\@@par}% + \CTEX@titleformat@n{#5}% + \CTEX@aftertitle}% \endgroup \else - \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}}}% + \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}\CTEX@aftertitle}}% \fi \@xsect{#3}} \cs_new_protected_nopar:Npn \CTEX@set@titleformat@n #1 - { \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat } } + { + \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat } + \cs_set_eq:Nc \CTEX@aftertitle { CTEX@#1@aftertitle } + } \cs_new_eq:NN \CTEX@titleformat@n \use:n +\cs_new_eq:NN \CTEX@aftertitle \prg_do_nothing: \int_zero:N \l__ctex_tmp_int \clist_map_inline:nn { section , subsection , subsubsection , paragraph , subparagraph } @@ -224,15 +250,15 @@ } } } -\tl_new:N \CTEX@preappendix -\tl_new:N \CTEX@postappendix \keys_define:nn { ctex } - { appendix .meta:nn = { ctex / appendix } {#1} } -\keys_define:nn { ctex / appendix } { - name .code:n = { \ctex_assign_heading_name:nn { appendix } {#1} } , - number .tl_set:N = \CTEX@appendixnumber + appendix .meta:nn = { ctex / appendix } {#1} , + appendix / name .code:n = + { \ctex_assign_heading_name:nn { appendix } {#1} } , + appendix / number .tl_set:N = \CTEX@appendixnumber } +\tl_new:N \CTEX@preappendix +\tl_new:N \CTEX@postappendix \cs_new_eq:NN \CTEX@save@appendix \appendix \cs_gset_protected_nopar:Npn \appendix { diff --git a/Master/texmf-dist/tex/latex/ctex/ctex-book.def b/Master/texmf-dist/tex/latex/ctex/ctex-book.def index 82bd4be7ebb..43125e9a69b 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctex-book.def +++ b/Master/texmf-dist/tex/latex/ctex/ctex-book.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {Heading modification for book (CTEX)} \ProvidesExplFile{ctex-book.def} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} \seq_new:N \c__ctex_headings_seq \seq_gset_from_clist:Nn \c__ctex_headings_seq { @@ -49,16 +49,18 @@ \tl_const:cx { CTEX@#1name } { \exp_not:c { CTEX@#1@nameformat } - \exp_not:c { CTEX@pre#1 } - \exp_not:N \tl_if_empty:NTF \exp_not:c { CTEX@#1@numberformat } - { \exp_not:c { CTEX@the#1 } } { - \group_begin: - \exp_not:c { CTEX@#1@numberformat } - \exp_not:c { CTEX@the#1 } - \group_end: + \exp_not:c { CTEX@pre#1 } + \exp_not:N \tl_if_empty:NTF \exp_not:c { CTEX@#1@numberformat } + { \exp_not:c { CTEX@the#1 } } + { + \group_begin: + \exp_not:c { CTEX@#1@numberformat } + \exp_not:c { CTEX@the#1 } + \group_end: + } + \exp_not:c { CTEX@post#1 } } - \exp_not:c { CTEX@post#1 } \exp_not:c { CTEX@#1@aftername } } } @@ -75,19 +77,34 @@ #1 / numberformat .tl_set:N = \exp_not:c { CTEX@#1@numberformat } , #1 / aftername .tl_set:N = \exp_not:c { CTEX@#1@aftername } , #1 / titleformat .tl_set:N = \exp_not:c { CTEX@#1@titleformat } , + #1 / aftertitle .tl_set:N = \exp_not:c { CTEX@#1@aftertitle } , #1 / beforeskip .tl_set:N = \exp_not:c { CTEX@#1@beforeskip } , #1 / afterskip .tl_set:N = \exp_not:c { CTEX@#1@afterskip} , #1 / indent .tl_set:N = \exp_not:c { CTEX@#1@indent } , #1 / format+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@format } { ####1 } } , + #1 / format~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@format } { ####1 } } , #1 / nameformat+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@nameformat } { ####1 } } , + #1 / nameformat~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@nameformat } { ####1 } } , #1 / numberformat+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@numberformat } { ####1 } } , + #1 / numberformat~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@numberformat } { ####1 } } , #1 / aftername+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftername } { ####1 } } , + #1 / aftername~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftername } { ####1 } } , #1 / titleformat+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@titleformat } { ####1 } } , + #1 / titleformat~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@titleformat } { ####1 } } , + #1 / aftertitle+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftertitle } { ####1 } } , + #1 / aftertitle~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftertitle } { ####1 } } , #1 / beforeskip .initial:n = \c_zero_skip , #1 / afterskip .initial:n = \c_zero_skip , #1 / indent .initial:n = \c_zero_dim , @@ -106,7 +123,11 @@ { \tl_clear:c { CTEX@post#1 } } { \tl_set:cn { CTEX@post#1 } {#3} } } -\tl_clear:N \l__ctex_tmp_tl +\tl_set:Nn \l__ctex_tmp_tl + { + part / pagestyle .tl_set:N = \CTEX@part@pagestyle , + chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle , + } \seq_map_inline:Nn \c__ctex_headings_seq { \__ctex_initial_heading:n {#1} @@ -114,11 +135,6 @@ } \use:x { \keys_define:nn { ctex } { \exp_not:o { \l__ctex_tmp_tl } } } \tl_clear:N \l__ctex_tmp_tl -\keys_define:nn { ctex } - { - part / pagestyle .tl_set:N = \CTEX@part@pagestyle , - chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle - } \def\@part[#1]#2{% \thispagestyle{\CTEX@part@pagestyle}% \ifnum \c@secnumdepth >-2\relax @@ -133,12 +149,14 @@ \ifnum \c@secnumdepth >-2\relax \CTEX@partname \fi - \CTEX@part@titleformat{#2}\par}% + \CTEX@part@titleformat{#2}% + \CTEX@part@aftertitle}% \@endpart} \def\@spart#1{% {\interlinepenalty \@M \normalfont \CTEX@part@format - \CTEX@part@titleformat{#1}\par}% + \CTEX@part@titleformat{#1}% + \CTEX@part@aftertitle}% \@endpart} \def\@chapter[#1]#2{% \ifnum \c@secnumdepth >\m@ne @@ -178,7 +196,9 @@ \fi \fi \interlinepenalty\@M - \CTEX@chapter@titleformat{#1}\par\nobreak + \CTEX@chapter@titleformat{#1}% + \CTEX@chapter@aftertitle + \nobreak \vskip \CTEX@chapter@afterskip }} \def\@makeschapterhead#1{% @@ -192,7 +212,9 @@ \vspace*{\@tempskipa}% {\normalfont \parindent \CTEX@chapter@indent \CTEX@chapter@format \interlinepenalty\@M - \CTEX@chapter@titleformat{#1}\par\nobreak + \CTEX@chapter@titleformat{#1} + \CTEX@chapter@aftertitle + \nobreak \vskip \CTEX@chapter@afterskip }} \def\@seccntformat#1{% @@ -212,7 +234,8 @@ #6{% \@hangfrom{\hskip #3\relax\@svsec}% \interlinepenalty \@M - \csname CTEX@#1@titleformat\endcsname{#8}\@@par}% + \csname CTEX@#1@titleformat\endcsname{#8}% + \csname CTEX@#1@aftertitle\endcsname}% \endgroup \csname #1mark\endcsname{#7}% \addcontentsline{toc}{#1}{% @@ -225,7 +248,9 @@ \else \def\@svsechd{% #6{\hskip #3\relax - \@svsec \csname CTEX@#1@titleformat\endcsname{#8}}% + \@svsec + \csname CTEX@#1@titleformat\endcsname{#8}% + \csname CTEX@#1@aftertitle\endcsname}% \csname #1mark\endcsname{#7}% \addcontentsline{toc}{#1}{% \ifnum #2>\c@secnumdepth \else @@ -243,15 +268,20 @@ #4{% \@hangfrom{\hskip #1}% \interlinepenalty \@M - \CTEX@titleformat@n{#5}\@@par}% + \CTEX@titleformat@n{#5}% + \CTEX@aftertitle}% \endgroup \else - \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}}}% + \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}\CTEX@aftertitle}}% \fi \@xsect{#3}} \cs_new_protected_nopar:Npn \CTEX@set@titleformat@n #1 - { \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat } } + { + \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat } + \cs_set_eq:Nc \CTEX@aftertitle { CTEX@#1@aftertitle } + } \cs_new_eq:NN \CTEX@titleformat@n \use:n +\cs_new_eq:NN \CTEX@aftertitle \prg_do_nothing: \int_zero:N \l__ctex_tmp_int \clist_map_inline:nn { section , subsection , subsubsection , paragraph , subparagraph } @@ -270,15 +300,15 @@ } } } -\tl_new:N \CTEX@preappendix -\tl_new:N \CTEX@postappendix \keys_define:nn { ctex } - { appendix .meta:nn = { ctex / appendix } {#1} } -\keys_define:nn { ctex / appendix } { - name .code:n = { \ctex_assign_heading_name:nn { appendix } {#1} } , - number .tl_set:N = \CTEX@appendixnumber + appendix .meta:nn = { ctex / appendix } {#1} , + appendix / name .code:n = + { \ctex_assign_heading_name:nn { appendix } {#1} } , + appendix / number .tl_set:N = \CTEX@appendixnumber } +\tl_new:N \CTEX@preappendix +\tl_new:N \CTEX@postappendix \cs_new_eq:NN \CTEX@save@appendix \appendix \cs_gset_protected_nopar:Npn \appendix { diff --git a/Master/texmf-dist/tex/latex/ctex/ctex-c5size.clo b/Master/texmf-dist/tex/latex/ctex/ctex-c5size.clo index d77593121a1..963071bf90b 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctex-c5size.clo +++ b/Master/texmf-dist/tex/latex/ctex/ctex-c5size.clo @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {c5size option (CTEX)} \ProvidesExplFile{ctex-c5size.clo} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} \ctex_set_font_size:Nnn \normalsize { 5 } { \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@ diff --git a/Master/texmf-dist/tex/latex/ctex/ctex-cs4size.clo b/Master/texmf-dist/tex/latex/ctex/ctex-cs4size.clo index a93c92bae43..36ea15530d6 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctex-cs4size.clo +++ b/Master/texmf-dist/tex/latex/ctex/ctex-cs4size.clo @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {cs4size option (CTEX)} \ProvidesExplFile{ctex-cs4size.clo} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} \ctex_set_font_size:Nnn \normalsize { -4 } { \abovedisplayskip 12\p@ \@plus3\p@ \@minus7\p@ diff --git a/Master/texmf-dist/tex/latex/ctex/ctex-report.def b/Master/texmf-dist/tex/latex/ctex/ctex-report.def index ed27e9c8adb..42b4b0b15bd 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctex-report.def +++ b/Master/texmf-dist/tex/latex/ctex/ctex-report.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {Heading modification for report (CTEX)} \ProvidesExplFile{ctex-report.def} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} \seq_new:N \c__ctex_headings_seq \seq_gset_from_clist:Nn \c__ctex_headings_seq { @@ -49,16 +49,18 @@ \tl_const:cx { CTEX@#1name } { \exp_not:c { CTEX@#1@nameformat } - \exp_not:c { CTEX@pre#1 } - \exp_not:N \tl_if_empty:NTF \exp_not:c { CTEX@#1@numberformat } - { \exp_not:c { CTEX@the#1 } } { - \group_begin: - \exp_not:c { CTEX@#1@numberformat } - \exp_not:c { CTEX@the#1 } - \group_end: + \exp_not:c { CTEX@pre#1 } + \exp_not:N \tl_if_empty:NTF \exp_not:c { CTEX@#1@numberformat } + { \exp_not:c { CTEX@the#1 } } + { + \group_begin: + \exp_not:c { CTEX@#1@numberformat } + \exp_not:c { CTEX@the#1 } + \group_end: + } + \exp_not:c { CTEX@post#1 } } - \exp_not:c { CTEX@post#1 } \exp_not:c { CTEX@#1@aftername } } } @@ -75,19 +77,34 @@ #1 / numberformat .tl_set:N = \exp_not:c { CTEX@#1@numberformat } , #1 / aftername .tl_set:N = \exp_not:c { CTEX@#1@aftername } , #1 / titleformat .tl_set:N = \exp_not:c { CTEX@#1@titleformat } , + #1 / aftertitle .tl_set:N = \exp_not:c { CTEX@#1@aftertitle } , #1 / beforeskip .tl_set:N = \exp_not:c { CTEX@#1@beforeskip } , #1 / afterskip .tl_set:N = \exp_not:c { CTEX@#1@afterskip} , #1 / indent .tl_set:N = \exp_not:c { CTEX@#1@indent } , #1 / format+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@format } { ####1 } } , + #1 / format~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@format } { ####1 } } , #1 / nameformat+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@nameformat } { ####1 } } , + #1 / nameformat~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@nameformat } { ####1 } } , #1 / numberformat+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@numberformat } { ####1 } } , + #1 / numberformat~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@numberformat } { ####1 } } , #1 / aftername+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftername } { ####1 } } , + #1 / aftername~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftername } { ####1 } } , #1 / titleformat+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@titleformat } { ####1 } } , + #1 / titleformat~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@titleformat } { ####1 } } , + #1 / aftertitle+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftertitle } { ####1 } } , + #1 / aftertitle~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftertitle } { ####1 } } , #1 / beforeskip .initial:n = \c_zero_skip , #1 / afterskip .initial:n = \c_zero_skip , #1 / indent .initial:n = \c_zero_dim , @@ -106,7 +123,11 @@ { \tl_clear:c { CTEX@post#1 } } { \tl_set:cn { CTEX@post#1 } {#3} } } -\tl_clear:N \l__ctex_tmp_tl +\tl_set:Nn \l__ctex_tmp_tl + { + part / pagestyle .tl_set:N = \CTEX@part@pagestyle , + chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle , + } \seq_map_inline:Nn \c__ctex_headings_seq { \__ctex_initial_heading:n {#1} @@ -114,11 +135,6 @@ } \use:x { \keys_define:nn { ctex } { \exp_not:o { \l__ctex_tmp_tl } } } \tl_clear:N \l__ctex_tmp_tl -\keys_define:nn { ctex } - { - part / pagestyle .tl_set:N = \CTEX@part@pagestyle , - chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle - } \def\@part[#1]#2{% \thispagestyle{\CTEX@part@pagestyle}% \ifnum \c@secnumdepth >-2\relax @@ -133,12 +149,14 @@ \ifnum \c@secnumdepth >-2\relax \CTEX@partname \fi - \CTEX@part@titleformat{#2}\par}% + \CTEX@part@titleformat{#2}% + \CTEX@part@aftertitle}% \@endpart} \def\@spart#1{% {\interlinepenalty \@M \normalfont \CTEX@part@format - \CTEX@part@titleformat{#1}\par}% + \CTEX@part@titleformat{#1}% + \CTEX@part@aftertitle}% \@endpart} \def\@chapter[#1]#2{% \ifnum \c@secnumdepth >\m@ne @@ -172,7 +190,9 @@ \CTEX@chaptername \fi \interlinepenalty\@M - \CTEX@chapter@titleformat{#1}\par\nobreak + \CTEX@chapter@titleformat{#1}% + \CTEX@chapter@aftertitle + \nobreak \vskip \CTEX@chapter@afterskip }} \def\@makeschapterhead#1{% @@ -186,7 +206,9 @@ \vspace*{\@tempskipa}% {\normalfont \parindent \CTEX@chapter@indent \CTEX@chapter@format \interlinepenalty\@M - \CTEX@chapter@titleformat{#1}\par\nobreak + \CTEX@chapter@titleformat{#1} + \CTEX@chapter@aftertitle + \nobreak \vskip \CTEX@chapter@afterskip }} \def\@seccntformat#1{% @@ -206,7 +228,8 @@ #6{% \@hangfrom{\hskip #3\relax\@svsec}% \interlinepenalty \@M - \csname CTEX@#1@titleformat\endcsname{#8}\@@par}% + \csname CTEX@#1@titleformat\endcsname{#8}% + \csname CTEX@#1@aftertitle\endcsname}% \endgroup \csname #1mark\endcsname{#7}% \addcontentsline{toc}{#1}{% @@ -219,7 +242,9 @@ \else \def\@svsechd{% #6{\hskip #3\relax - \@svsec \csname CTEX@#1@titleformat\endcsname{#8}}% + \@svsec + \csname CTEX@#1@titleformat\endcsname{#8}% + \csname CTEX@#1@aftertitle\endcsname}% \csname #1mark\endcsname{#7}% \addcontentsline{toc}{#1}{% \ifnum #2>\c@secnumdepth \else @@ -237,15 +262,20 @@ #4{% \@hangfrom{\hskip #1}% \interlinepenalty \@M - \CTEX@titleformat@n{#5}\@@par}% + \CTEX@titleformat@n{#5}% + \CTEX@aftertitle}% \endgroup \else - \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}}}% + \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}\CTEX@aftertitle}}% \fi \@xsect{#3}} \cs_new_protected_nopar:Npn \CTEX@set@titleformat@n #1 - { \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat } } + { + \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat } + \cs_set_eq:Nc \CTEX@aftertitle { CTEX@#1@aftertitle } + } \cs_new_eq:NN \CTEX@titleformat@n \use:n +\cs_new_eq:NN \CTEX@aftertitle \prg_do_nothing: \int_zero:N \l__ctex_tmp_int \clist_map_inline:nn { section , subsection , subsubsection , paragraph , subparagraph } @@ -264,15 +294,15 @@ } } } -\tl_new:N \CTEX@preappendix -\tl_new:N \CTEX@postappendix \keys_define:nn { ctex } - { appendix .meta:nn = { ctex / appendix } {#1} } -\keys_define:nn { ctex / appendix } { - name .code:n = { \ctex_assign_heading_name:nn { appendix } {#1} } , - number .tl_set:N = \CTEX@appendixnumber + appendix .meta:nn = { ctex / appendix } {#1} , + appendix / name .code:n = + { \ctex_assign_heading_name:nn { appendix } {#1} } , + appendix / number .tl_set:N = \CTEX@appendixnumber } +\tl_new:N \CTEX@preappendix +\tl_new:N \CTEX@postappendix \cs_new_eq:NN \CTEX@save@appendix \appendix \cs_gset_protected_nopar:Npn \appendix { diff --git a/Master/texmf-dist/tex/latex/ctex/ctex.sty b/Master/texmf-dist/tex/latex/ctex/ctex.sty index c7201874053..615e615d807 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctex.sty +++ b/Master/texmf-dist/tex/latex/ctex/ctex.sty @@ -4,7 +4,7 @@ %% %% The original source files were: %% -%% ctex.dtx (with options: `package,style') +%% ctex.dtx (with options: `style,ctex') %% %% Copyright (C) 2003--2015 %% CTEX.ORG and any individual authors listed in the documentation. @@ -28,48 +28,43 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {Chinese adapter in LaTeX (CTEX)} \ProvidesExplPackage{\ExplFileName} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} +\tl_const:Nx \c__ctex_version_tl + { \cs_if_exist_use:cF { ver@ \@currname . \@currext } { 9999/99/99 } } +\msg_new:nnnn { ctex } { subpackage-loaded } + { Package~`#1'~can~not~be~loaded~with~`ctex'. } + { + `#1'~is~actually~a~part~of~`ctex'.\\ + It~is~not~necessary~to~load~it~separately. + } +\@ifpackageloaded { ctexsize } + { \msg_error:nnn { ctex } { subpackage-loaded } { ctexsize } } + { \cs_new_eq:cN { ver@ctexsize. \@pkgextension } \c__ctex_version_tl } +\@ifpackageloaded { ctexheading } + { \msg_error:nnn { ctex } { subpackage-loaded } { ctexheading } } + { \cs_new_eq:cN { ver@ctexheading. \@pkgextension } \c__ctex_version_tl } \RequirePackage { xparse , l3keys2e } -\RequirePackage { etoolbox , ifpdf , fix-cm , everysel } +\RequirePackage { etoolbox } +\RequirePackage { fix-cm , everysel } \tl_new:N \l__ctex_tmp_tl \int_new:N \l__ctex_tmp_int \dim_new:N \l__ctex_tmp_dim \box_new:N \l__ctex_tmp_box -\msg_new:nnnn { ctex } { package-too-old } - { Support~package~`#1'~too~old. } - { - Please~update~an~up~to~date~version~of~the~package~`#1'\\ - using~your~TeX~package~manager~or~from~CTAN. - } -\cs_new_eq:NN \ctex_lua_now_x:n \luatex_directlua:D -\ifpdf - \cs_new_eq:NN \ctex_if_pdfmode:TF \use_i:nn -\else: - \cs_new_eq:NN \ctex_if_pdfmode:TF \use_ii:nn -\fi: -\prg_new_conditional:Npnn \ctex_if_preamble: { TF } - { - \if_meaning:w \@onlypreamble \@notprerr - \prg_return_false: - \else: - \prg_return_true: - \fi: - } \cs_new_protected:Npn \ctex_at_end_package:nn #1#2 { - \@ifpackageloaded { #1 } - { #2 } - { \ctex_add_hook:cn { g__ctex_at_end_ #1 _hook_tl } { #2 } } + \@ifpackageloaded {#1} + {#2} + { \ctex_gadd_hook:cn { g__ctex_at_end_ #1 _hook_tl } {#2} } } -\cs_new_protected:Npn \ctex_add_hook:Nn #1#2 +\cs_new_protected:Npn \ctex_gadd_hook:Nn #1#2 { \tl_if_exist:NF #1 { \tl_new:N #1 } - \tl_gput_right:Nn #1 { #2 } + \tl_gput_right:Nn #1 {#2} } -\cs_generate_variant:Nn \ctex_add_hook:Nn { c } +\cs_generate_variant:Nn \ctex_gadd_hook:Nn { c } \cs_new_protected_nopar:Npn \ctex_package_end_hook:n #1 { \cs_if_exist_use:cT { g__ctex_at_end_ #1 _hook_tl } @@ -77,7 +72,10 @@ } \cs_generate_variant:Nn \ctex_package_end_hook:n { o } \tl_put_left:Nn \@popfilename - { \ctex_package_end_hook:o { \@currname } } + { + \cs_if_eq:NNT \@currext \@pkgextension + { \ctex_package_end_hook:o { \@currname } } + } \cs_new_protected:Npn \ctex_file_wrapper:nnn #1#2#3 { \use:x @@ -127,15 +125,15 @@ \group_begin: \use:x { + \group_end: \__ctex_parse_name:nNNNnN { \token_get_replacement_spec:N #2 } - \exp_not:N #2 \exp_not:c { #3 ~ } \exp_not:c { /#3 } {#3} - } #1 + \exp_not:N #2 \exp_not:c { #3 ~ } \exp_not:c { /#3 } + } {#3} #1 } { #1#2 } } \cs_new_protected:Npn \__ctex_parse_name:nNNNnN #1#2#3#4#5#6 { - \group_end: \exp_args:Nc #6 { \str_case:nnTF {#1} @@ -164,9 +162,9 @@ \cs_new:Npn \__ctex_parse_name:w #1 AESAOPA ~ #2 < #3 \q_stop { #1#2 } } \cs_generate_variant:Nn \ctex_parse_name:NNn { NNx } -\cs_new_protected:Npn \ctex_patch_cmd:NnnTF { \ctex_parse_name:NN \patchcmd } -\cs_new_protected:Npn \ctex_preto_cmd:NnTF { \ctex_parse_name:NN \pretocmd } -\cs_new_protected:Npn \ctex_appto_cmd:NnTF { \ctex_parse_name:NN \apptocmd } +\cs_new_protected_nopar:Npn \ctex_patch_cmd:NnnTF { \ctex_parse_name:NN \patchcmd } +\cs_new_protected_nopar:Npn \ctex_preto_cmd:NnTF { \ctex_parse_name:NN \pretocmd } +\cs_new_protected_nopar:Npn \ctex_appto_cmd:NnTF { \ctex_parse_name:NN \apptocmd } \cs_new_protected:Npn \ctex_patch_cmd:Nnn { \group_begin: @@ -194,6 +192,29 @@ Patching~command~`#1'~failed.\\ ctex~may~not~work~as~expected. } +\cs_new_eq:NN \g__ctex_section_depth_flag \c_two +\msg_new:nnnn { ctex } { package-too-old } + { Support~package~`#1'~too~old. } + { + Please~update~an~up~to~date~version~of~the~package~`#1'\\ + using~your~TeX~package~manager~or~from~CTAN. + } +\cs_new_eq:NN \ctex_lua_now_x:n \luatex_directlua:D +\cs_if_exist:NTF \pdftex_pdfoutput:D + { + \int_compare:nNnTF \pdftex_pdfoutput:D > \c_zero + { + \cs_new_eq:NN \ifctexpdf \tex_iftrue:D + \cs_new_eq:NN \ctex_if_pdfmode:TF \use_i:nn + } + } + { \use:n } + { + \cs_new_eq:NN \ifctexpdf \tex_iffalse:D + \cs_new_eq:NN \ctex_if_pdfmode:TF \use_ii:nn + } +\cs_new_eq:NN \ctex_if_preamble:TF \use_i:nn +\AfterEndPreamble { \cs_set_eq:NN \ctex_if_preamble:TF \use_ii:nn } \cs_new:Npn \ctex_set_default_ccwd:Nn #1#2 { \dim_compare:nNnTF @@ -217,7 +238,6 @@ \tl_new:N \l__ctex_encoding_tl \tl_set:Nx \l__ctex_encoding_tl { \pdftex_if_engine:TF { GBK } { UTF8 } } -\cs_new_eq:NN \g__ctex_section_depth_flag \c_two \bool_new:N \g__ctex_zhmCJK_bool \tl_new:N \l__ctex_autoindent_tl \cs_new_eq:NN \ctex_if_autoindent_touched:F \use:n @@ -316,7 +336,7 @@ Option~ `fontset=adobe'~ is~ set.~ It~ is~ better~ to~ use~ fontset~ option. } - \keys_set:nn { ctex / option } { fontset = none } + \keys_set:nn { ctex / option } { fontset = adobe } } , winfonts .code:n = { @@ -325,7 +345,7 @@ Option~ `fontset=windows'~ is~ set.~ It~ is~ better~ to~ use~ fontset~ option. } - \keys_set:nn { ctex / option } { fontset = none } + \keys_set:nn { ctex / option } { fontset = windows } } , nofonts .value_forbidden: , winfonts .value_forbidden: , @@ -379,9 +399,15 @@ } , nospace .value_forbidden: , heading .bool_set:N = \l__ctex_heading_bool , + sub3section .code:n = + { \cs_gset_eq:NN \g__ctex_section_depth_flag \c_three } , + sub4section .code:n = + { \cs_gset_eq:NN \g__ctex_section_depth_flag \c_four } , + sub3section .value_forbidden: , + sub4section .value_forbidden: , scheme .tl_set:N = \l__ctex_scheme_tl , - scheme .default:n = { chinese }, - scheme .initial:n = { chinese }, + scheme .default:n = { chinese } , + scheme .initial:n = { chinese } , cap .code:n = { \msg_warning:nnn { ctex } { deprecated-option } @@ -396,12 +422,6 @@ } , cap .value_forbidden: , nocap .value_forbidden: , - sub3section .code:n = - { \cs_gset_eq:NN \g__ctex_section_depth_flag \c_three } , - sub4section .code:n = - { \cs_gset_eq:NN \g__ctex_section_depth_flag \c_four } , - sub3section .value_forbidden: , - sub4section .value_forbidden: , fntef .code:n = { \msg_warning:nnn { ctex } { deprecated-option } @@ -411,12 +431,17 @@ { \msg_warning:nnn { ctex } { deprecated-option } { `fancyhdr'~ package~ is~ loaded. } - \RequirePackage{ fancyhdr } + \RequirePackage { fancyhdr } } , hyperref .code:n = { \msg_warning:nnn { ctex } { deprecated-option } { `hyperref'~ package~ will~ be~ loaded. } + \ctex_at_end:n + { + \cs_if_exist:NF \hypersetup + { \cs_new_eq:NN \hypersetup \ctex_hypersetup:n } + } \AtEndPreamble { \RequirePackage { hyperref } } } , } @@ -438,18 +463,7 @@ \tl_clear:N \l__ctex_tmp_tl \ctex_file_input:n { ctexopts.cfg } \ProcessKeysOptions { ctex / option } -\tl_set_eq:Nc \l__ctex_tmp_tl { ver@ \@currname . \@currext } -\msg_new:nnnn { ctex } { ctexsize-loaded } - { Package~`ctexsize'~can~not~be~loaded~before~`ctex'. } - { - `ctexsize'~is~actually~a~part~of~`ctex'.\\ - It~is~not~necessary~to~load~it~separately. - } -\@ifpackageloaded { ctexsize } - { \msg_error:nn { ctex } { ctexsize-loaded } } - { \cs_new_eq:cN { ver@ctexsize. \@pkgextension } \l__ctex_tmp_tl } -\NewDocumentCommand \ctexset { +m } - { \keys_set:nn { ctex } {#1} } +\NewDocumentCommand \ctexset { } { \keys_set:nn { ctex } } \NewDocumentCommand \CTEXsetup { +o > { \TrimSpaces } m } { \msg_warning:nnnn { ctex } { deprecated-command } { \CTEXsetup } @@ -471,7 +485,6 @@ \cs_new_protected_nopar:Npn \ctex_hypersetup:n #1 { \PassOptionsToPackage {#1} { hyperref } } } -\ctex_hypersetup:n { colorlinks = true } \pdftex_if_engine:TF { \tl_set:Nx \l__ctex_encoding_tl { \l__ctex_encoding_tl } @@ -677,6 +690,12 @@ \keys_define:nn { ctex } { bibname .tl_set:N = \ctexbibname } } } +\clist_map_inline:nn { article , book , report } + { + \@ifclassloaded {#1} + { \clist_map_break:n { \tl_const:Nn \c__ctex_std_class_tl {#1} } } + { } + } \msg_new:nnn { ctex } { not-standard-class } { None~of~the~standard~document~classes~was~loaded.\\ @@ -685,12 +704,8 @@ } \bool_if:NTF \l__ctex_heading_bool { - \clist_map_inline:nn { article , book , report } - { - \@ifclassloaded {#1} - { \clist_map_break:n { \tl_const:Nn \c__ctex_class_tl {#1} } } { } - } - \tl_if_exist:NF \c__ctex_class_tl + \tl_if_exist:NTF \c__ctex_std_class_tl + { \cs_new_eq:NN \c__ctex_class_tl \c__ctex_std_class_tl } { \cs_if_exist:NTF \chapter { @@ -810,11 +825,8 @@ \normalsize \NewDocumentCommand \CTeX { } { \ifincsname CTeX \else: C \TeX \fi: } -\AtBeginDocument - { - \cs_if_exist_use:NT \pdfstringdefDisableCommands - { { \tl_set:Nn \CTeX { CTeX } } } - } +\ctex_at_end_package:nn { hyperref } + { \pdfstringdefDisableCommands { \tl_set:Nn \CTeX { CTeX } } } \keys_define:nn { ctex } { captiondelimiter .code:n = @@ -918,6 +930,7 @@ %% ctex.sty, %% ctexcap.sty, %% ctexsize.sty, +%% ctexheading.sty, %% ctexart.cls, %% ctexbook.cls, %% ctexrep.cls, diff --git a/Master/texmf-dist/tex/latex/ctex/ctexart.cls b/Master/texmf-dist/tex/latex/ctex/ctexart.cls index ed34c9d861a..0af93272ce1 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctexart.cls +++ b/Master/texmf-dist/tex/latex/ctex/ctexart.cls @@ -28,10 +28,16 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {Chinese adapter for class article (CTEX)} \ProvidesExplClass{ctexart} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} +\tl_const:Nx \c__ctex_version_tl + { \cs_if_exist_use:cF { ver@ \@currname . \@currext } { 9999/99/99 } } +\cs_new_eq:cN { ver@ctex. \@pkgextension } \c__ctex_version_tl +\cs_new_eq:cN { ver@ctexcap. \@pkgextension } \c__ctex_version_tl +\cs_new_eq:cN { ver@ctexsize. \@pkgextension } \c__ctex_version_tl +\cs_new_eq:cN { ver@ctexheading. \@pkgextension } \c__ctex_version_tl \RequirePackage { xparse , l3keys2e } \msg_new:nnnn { ctex } { l3-too-old } { Support~package~`#1'~too~old. } @@ -44,43 +50,24 @@ { \msg_error:nnn { ctex } { l3-too-old } { expl3 } } \@ifpackagelater { l3keys2e } { 2014/05/05 } { } { \msg_error:nnn { ctex } { l3-too-old } { l3keys2e } } -\RequirePackage { etoolbox , ifpdf , fix-cm , everysel } +\RequirePackage { etoolbox } +\RequirePackage { fix-cm , everysel } \tl_new:N \l__ctex_tmp_tl \int_new:N \l__ctex_tmp_int \dim_new:N \l__ctex_tmp_dim \box_new:N \l__ctex_tmp_box -\msg_new:nnnn { ctex } { package-too-old } - { Support~package~`#1'~too~old. } - { - Please~update~an~up~to~date~version~of~the~package~`#1'\\ - using~your~TeX~package~manager~or~from~CTAN. - } -\cs_new_eq:NN \ctex_lua_now_x:n \luatex_directlua:D -\ifpdf - \cs_new_eq:NN \ctex_if_pdfmode:TF \use_i:nn -\else: - \cs_new_eq:NN \ctex_if_pdfmode:TF \use_ii:nn -\fi: -\prg_new_conditional:Npnn \ctex_if_preamble: { TF } - { - \if_meaning:w \@onlypreamble \@notprerr - \prg_return_false: - \else: - \prg_return_true: - \fi: - } \cs_new_protected:Npn \ctex_at_end_package:nn #1#2 { - \@ifpackageloaded { #1 } - { #2 } - { \ctex_add_hook:cn { g__ctex_at_end_ #1 _hook_tl } { #2 } } + \@ifpackageloaded {#1} + {#2} + { \ctex_gadd_hook:cn { g__ctex_at_end_ #1 _hook_tl } {#2} } } -\cs_new_protected:Npn \ctex_add_hook:Nn #1#2 +\cs_new_protected:Npn \ctex_gadd_hook:Nn #1#2 { \tl_if_exist:NF #1 { \tl_new:N #1 } - \tl_gput_right:Nn #1 { #2 } + \tl_gput_right:Nn #1 {#2} } -\cs_generate_variant:Nn \ctex_add_hook:Nn { c } +\cs_generate_variant:Nn \ctex_gadd_hook:Nn { c } \cs_new_protected_nopar:Npn \ctex_package_end_hook:n #1 { \cs_if_exist_use:cT { g__ctex_at_end_ #1 _hook_tl } @@ -88,7 +75,10 @@ } \cs_generate_variant:Nn \ctex_package_end_hook:n { o } \tl_put_left:Nn \@popfilename - { \ctex_package_end_hook:o { \@currname } } + { + \cs_if_eq:NNT \@currext \@pkgextension + { \ctex_package_end_hook:o { \@currname } } + } \cs_new_protected:Npn \ctex_file_wrapper:nnn #1#2#3 { \use:x @@ -138,15 +128,15 @@ \group_begin: \use:x { + \group_end: \__ctex_parse_name:nNNNnN { \token_get_replacement_spec:N #2 } - \exp_not:N #2 \exp_not:c { #3 ~ } \exp_not:c { /#3 } {#3} - } #1 + \exp_not:N #2 \exp_not:c { #3 ~ } \exp_not:c { /#3 } + } {#3} #1 } { #1#2 } } \cs_new_protected:Npn \__ctex_parse_name:nNNNnN #1#2#3#4#5#6 { - \group_end: \exp_args:Nc #6 { \str_case:nnTF {#1} @@ -175,9 +165,9 @@ \cs_new:Npn \__ctex_parse_name:w #1 AESAOPA ~ #2 < #3 \q_stop { #1#2 } } \cs_generate_variant:Nn \ctex_parse_name:NNn { NNx } -\cs_new_protected:Npn \ctex_patch_cmd:NnnTF { \ctex_parse_name:NN \patchcmd } -\cs_new_protected:Npn \ctex_preto_cmd:NnTF { \ctex_parse_name:NN \pretocmd } -\cs_new_protected:Npn \ctex_appto_cmd:NnTF { \ctex_parse_name:NN \apptocmd } +\cs_new_protected_nopar:Npn \ctex_patch_cmd:NnnTF { \ctex_parse_name:NN \patchcmd } +\cs_new_protected_nopar:Npn \ctex_preto_cmd:NnTF { \ctex_parse_name:NN \pretocmd } +\cs_new_protected_nopar:Npn \ctex_appto_cmd:NnTF { \ctex_parse_name:NN \apptocmd } \cs_new_protected:Npn \ctex_patch_cmd:Nnn { \group_begin: @@ -205,6 +195,29 @@ Patching~command~`#1'~failed.\\ ctex~may~not~work~as~expected. } +\cs_new_eq:NN \g__ctex_section_depth_flag \c_two +\msg_new:nnnn { ctex } { package-too-old } + { Support~package~`#1'~too~old. } + { + Please~update~an~up~to~date~version~of~the~package~`#1'\\ + using~your~TeX~package~manager~or~from~CTAN. + } +\cs_new_eq:NN \ctex_lua_now_x:n \luatex_directlua:D +\cs_if_exist:NTF \pdftex_pdfoutput:D + { + \int_compare:nNnTF \pdftex_pdfoutput:D > \c_zero + { + \cs_new_eq:NN \ifctexpdf \tex_iftrue:D + \cs_new_eq:NN \ctex_if_pdfmode:TF \use_i:nn + } + } + { \use:n } + { + \cs_new_eq:NN \ifctexpdf \tex_iffalse:D + \cs_new_eq:NN \ctex_if_pdfmode:TF \use_ii:nn + } +\cs_new_eq:NN \ctex_if_preamble:TF \use_i:nn +\AfterEndPreamble { \cs_set_eq:NN \ctex_if_preamble:TF \use_ii:nn } \cs_new:Npn \ctex_set_default_ccwd:Nn #1#2 { \dim_compare:nNnTF @@ -228,7 +241,6 @@ \tl_new:N \l__ctex_encoding_tl \tl_set:Nx \l__ctex_encoding_tl { \pdftex_if_engine:TF { GBK } { UTF8 } } -\cs_new_eq:NN \g__ctex_section_depth_flag \c_two \bool_new:N \g__ctex_zhmCJK_bool \tl_new:N \l__ctex_autoindent_tl \cs_new_eq:NN \ctex_if_autoindent_touched:F \use:n @@ -328,7 +340,7 @@ Option~ `fontset=adobe'~ is~ set.~ It~ is~ better~ to~ use~ fontset~ option. } - \keys_set:nn { ctex / option } { fontset = none } + \keys_set:nn { ctex / option } { fontset = adobe } } , winfonts .code:n = { @@ -337,7 +349,7 @@ Option~ `fontset=windows'~ is~ set.~ It~ is~ better~ to~ use~ fontset~ option. } - \keys_set:nn { ctex / option } { fontset = none } + \keys_set:nn { ctex / option } { fontset = windows } } , nofonts .value_forbidden: , winfonts .value_forbidden: , @@ -391,9 +403,15 @@ } , nospace .value_forbidden: , heading .bool_set:N = \l__ctex_heading_bool , + sub3section .code:n = + { \cs_gset_eq:NN \g__ctex_section_depth_flag \c_three } , + sub4section .code:n = + { \cs_gset_eq:NN \g__ctex_section_depth_flag \c_four } , + sub3section .value_forbidden: , + sub4section .value_forbidden: , scheme .tl_set:N = \l__ctex_scheme_tl , - scheme .default:n = { chinese }, - scheme .initial:n = { chinese }, + scheme .default:n = { chinese } , + scheme .initial:n = { chinese } , cap .code:n = { \msg_warning:nnn { ctex } { deprecated-option } @@ -408,12 +426,6 @@ } , cap .value_forbidden: , nocap .value_forbidden: , - sub3section .code:n = - { \cs_gset_eq:NN \g__ctex_section_depth_flag \c_three } , - sub4section .code:n = - { \cs_gset_eq:NN \g__ctex_section_depth_flag \c_four } , - sub3section .value_forbidden: , - sub4section .value_forbidden: , fntef .code:n = { \msg_warning:nnn { ctex } { deprecated-option } @@ -423,12 +435,17 @@ { \msg_warning:nnn { ctex } { deprecated-option } { `fancyhdr'~ package~ is~ loaded. } - \RequirePackage{ fancyhdr } + \RequirePackage { fancyhdr } } , hyperref .code:n = { \msg_warning:nnn { ctex } { deprecated-option } { `hyperref'~ package~ will~ be~ loaded. } + \ctex_at_end:n + { + \cs_if_exist:NF \hypersetup + { \cs_new_eq:NN \hypersetup \ctex_hypersetup:n } + } \AtEndPreamble { \RequirePackage { hyperref } } } , } @@ -466,12 +483,7 @@ \tl_const:Nn \c__ctex_class_tl { article } \PassOptionsToClass { \g__ctex_std_options_clist } { article } \LoadClass { article } -\tl_set_eq:Nc \l__ctex_tmp_tl { ver@ \@currname . \@currext } -\cs_new_eq:cN { ver@ctex. \@pkgextension } \l__ctex_tmp_tl -\cs_new_eq:cN { ver@ctexcap. \@pkgextension } \l__ctex_tmp_tl -\cs_new_eq:cN { ver@ctexsize. \@pkgextension } \l__ctex_tmp_tl -\NewDocumentCommand \ctexset { +m } - { \keys_set:nn { ctex } {#1} } +\NewDocumentCommand \ctexset { } { \keys_set:nn { ctex } } \NewDocumentCommand \CTEXsetup { +o > { \TrimSpaces } m } { \msg_warning:nnnn { ctex } { deprecated-command } { \CTEXsetup } @@ -493,7 +505,6 @@ \cs_new_protected_nopar:Npn \ctex_hypersetup:n #1 { \PassOptionsToPackage {#1} { hyperref } } } -\ctex_hypersetup:n { colorlinks = true } \pdftex_if_engine:TF { \tl_set:Nx \l__ctex_encoding_tl { \l__ctex_encoding_tl } @@ -704,16 +715,18 @@ \tl_const:cx { CTEX@#1name } { \exp_not:c { CTEX@#1@nameformat } - \exp_not:c { CTEX@pre#1 } - \exp_not:N \tl_if_empty:NTF \exp_not:c { CTEX@#1@numberformat } - { \exp_not:c { CTEX@the#1 } } { - \group_begin: - \exp_not:c { CTEX@#1@numberformat } - \exp_not:c { CTEX@the#1 } - \group_end: + \exp_not:c { CTEX@pre#1 } + \exp_not:N \tl_if_empty:NTF \exp_not:c { CTEX@#1@numberformat } + { \exp_not:c { CTEX@the#1 } } + { + \group_begin: + \exp_not:c { CTEX@#1@numberformat } + \exp_not:c { CTEX@the#1 } + \group_end: + } + \exp_not:c { CTEX@post#1 } } - \exp_not:c { CTEX@post#1 } \exp_not:c { CTEX@#1@aftername } } } @@ -730,19 +743,34 @@ #1 / numberformat .tl_set:N = \exp_not:c { CTEX@#1@numberformat } , #1 / aftername .tl_set:N = \exp_not:c { CTEX@#1@aftername } , #1 / titleformat .tl_set:N = \exp_not:c { CTEX@#1@titleformat } , + #1 / aftertitle .tl_set:N = \exp_not:c { CTEX@#1@aftertitle } , #1 / beforeskip .tl_set:N = \exp_not:c { CTEX@#1@beforeskip } , #1 / afterskip .tl_set:N = \exp_not:c { CTEX@#1@afterskip} , #1 / indent .tl_set:N = \exp_not:c { CTEX@#1@indent } , #1 / format+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@format } { ####1 } } , + #1 / format~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@format } { ####1 } } , #1 / nameformat+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@nameformat } { ####1 } } , + #1 / nameformat~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@nameformat } { ####1 } } , #1 / numberformat+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@numberformat } { ####1 } } , + #1 / numberformat~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@numberformat } { ####1 } } , #1 / aftername+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftername } { ####1 } } , + #1 / aftername~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftername } { ####1 } } , #1 / titleformat+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@titleformat } { ####1 } } , + #1 / titleformat~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@titleformat } { ####1 } } , + #1 / aftertitle+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftertitle } { ####1 } } , + #1 / aftertitle~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftertitle } { ####1 } } , #1 / beforeskip .initial:n = \c_zero_skip , #1 / afterskip .initial:n = \c_zero_skip , #1 / indent .initial:n = \c_zero_dim , @@ -761,7 +789,6 @@ { \tl_clear:c { CTEX@post#1 } } { \tl_set:cn { CTEX@post#1 } {#3} } } -\tl_clear:N \l__ctex_tmp_tl \seq_map_inline:Nn \c__ctex_headings_seq { \__ctex_initial_heading:n {#1} @@ -793,14 +820,16 @@ \CTEX@partname \fi \CTEX@part@titleformat{#2}% - \markboth{}{}\par}% + \markboth{}{}% + \CTEX@part@aftertitle}% \nobreak \vskip \CTEX@part@afterskip \@afterheading} \def\@spart#1{% {\interlinepenalty \@M \normalfont \parindent \CTEX@part@indent \CTEX@part@format - \CTEX@part@titleformat{#1}\par}% + \CTEX@part@titleformat{#1}% + \CTEX@part@aftertitle}% \nobreak \vskip \CTEX@part@afterskip \@afterheading} @@ -821,7 +850,8 @@ #6{% \@hangfrom{\hskip #3\relax\@svsec}% \interlinepenalty \@M - \csname CTEX@#1@titleformat\endcsname{#8}\@@par}% + \csname CTEX@#1@titleformat\endcsname{#8}% + \csname CTEX@#1@aftertitle\endcsname}% \endgroup \csname #1mark\endcsname{#7}% \addcontentsline{toc}{#1}{% @@ -834,7 +864,9 @@ \else \def\@svsechd{% #6{\hskip #3\relax - \@svsec \csname CTEX@#1@titleformat\endcsname{#8}}% + \@svsec + \csname CTEX@#1@titleformat\endcsname{#8}% + \csname CTEX@#1@aftertitle\endcsname}% \csname #1mark\endcsname{#7}% \addcontentsline{toc}{#1}{% \ifnum #2>\c@secnumdepth \else @@ -852,15 +884,20 @@ #4{% \@hangfrom{\hskip #1}% \interlinepenalty \@M - \CTEX@titleformat@n{#5}\@@par}% + \CTEX@titleformat@n{#5}% + \CTEX@aftertitle}% \endgroup \else - \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}}}% + \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}\CTEX@aftertitle}}% \fi \@xsect{#3}} \cs_new_protected_nopar:Npn \CTEX@set@titleformat@n #1 - { \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat } } + { + \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat } + \cs_set_eq:Nc \CTEX@aftertitle { CTEX@#1@aftertitle } + } \cs_new_eq:NN \CTEX@titleformat@n \use:n +\cs_new_eq:NN \CTEX@aftertitle \prg_do_nothing: \int_zero:N \l__ctex_tmp_int \clist_map_inline:nn { section , subsection , subsubsection , paragraph , subparagraph } @@ -879,15 +916,15 @@ } } } -\tl_new:N \CTEX@preappendix -\tl_new:N \CTEX@postappendix \keys_define:nn { ctex } - { appendix .meta:nn = { ctex / appendix } {#1} } -\keys_define:nn { ctex / appendix } { - name .code:n = { \ctex_assign_heading_name:nn { appendix } {#1} } , - number .tl_set:N = \CTEX@appendixnumber + appendix .meta:nn = { ctex / appendix } {#1} , + appendix / name .code:n = + { \ctex_assign_heading_name:nn { appendix } {#1} } , + appendix / number .tl_set:N = \CTEX@appendixnumber } +\tl_new:N \CTEX@preappendix +\tl_new:N \CTEX@postappendix \cs_new_eq:NN \CTEX@save@appendix \appendix \cs_gset_protected_nopar:Npn \appendix { @@ -1072,11 +1109,8 @@ \normalsize \NewDocumentCommand \CTeX { } { \ifincsname CTeX \else: C \TeX \fi: } -\AtBeginDocument - { - \cs_if_exist_use:NT \pdfstringdefDisableCommands - { { \tl_set:Nn \CTeX { CTeX } } } - } +\ctex_at_end_package:nn { hyperref } + { \pdfstringdefDisableCommands { \tl_set:Nn \CTeX { CTeX } } } \keys_define:nn { ctex } { captiondelimiter .code:n = @@ -1180,6 +1214,7 @@ %% ctex.sty, %% ctexcap.sty, %% ctexsize.sty, +%% ctexheading.sty, %% ctexart.cls, %% ctexbook.cls, %% ctexrep.cls, diff --git a/Master/texmf-dist/tex/latex/ctex/ctexbook.cls b/Master/texmf-dist/tex/latex/ctex/ctexbook.cls index 9c713e37a3f..3e6a5d76736 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctexbook.cls +++ b/Master/texmf-dist/tex/latex/ctex/ctexbook.cls @@ -28,10 +28,16 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {Chinese adapter for class book (CTEX)} \ProvidesExplClass{ctexbook} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} +\tl_const:Nx \c__ctex_version_tl + { \cs_if_exist_use:cF { ver@ \@currname . \@currext } { 9999/99/99 } } +\cs_new_eq:cN { ver@ctex. \@pkgextension } \c__ctex_version_tl +\cs_new_eq:cN { ver@ctexcap. \@pkgextension } \c__ctex_version_tl +\cs_new_eq:cN { ver@ctexsize. \@pkgextension } \c__ctex_version_tl +\cs_new_eq:cN { ver@ctexheading. \@pkgextension } \c__ctex_version_tl \RequirePackage { xparse , l3keys2e } \msg_new:nnnn { ctex } { l3-too-old } { Support~package~`#1'~too~old. } @@ -44,43 +50,24 @@ { \msg_error:nnn { ctex } { l3-too-old } { expl3 } } \@ifpackagelater { l3keys2e } { 2014/05/05 } { } { \msg_error:nnn { ctex } { l3-too-old } { l3keys2e } } -\RequirePackage { etoolbox , ifpdf , fix-cm , everysel } +\RequirePackage { etoolbox } +\RequirePackage { fix-cm , everysel } \tl_new:N \l__ctex_tmp_tl \int_new:N \l__ctex_tmp_int \dim_new:N \l__ctex_tmp_dim \box_new:N \l__ctex_tmp_box -\msg_new:nnnn { ctex } { package-too-old } - { Support~package~`#1'~too~old. } - { - Please~update~an~up~to~date~version~of~the~package~`#1'\\ - using~your~TeX~package~manager~or~from~CTAN. - } -\cs_new_eq:NN \ctex_lua_now_x:n \luatex_directlua:D -\ifpdf - \cs_new_eq:NN \ctex_if_pdfmode:TF \use_i:nn -\else: - \cs_new_eq:NN \ctex_if_pdfmode:TF \use_ii:nn -\fi: -\prg_new_conditional:Npnn \ctex_if_preamble: { TF } - { - \if_meaning:w \@onlypreamble \@notprerr - \prg_return_false: - \else: - \prg_return_true: - \fi: - } \cs_new_protected:Npn \ctex_at_end_package:nn #1#2 { - \@ifpackageloaded { #1 } - { #2 } - { \ctex_add_hook:cn { g__ctex_at_end_ #1 _hook_tl } { #2 } } + \@ifpackageloaded {#1} + {#2} + { \ctex_gadd_hook:cn { g__ctex_at_end_ #1 _hook_tl } {#2} } } -\cs_new_protected:Npn \ctex_add_hook:Nn #1#2 +\cs_new_protected:Npn \ctex_gadd_hook:Nn #1#2 { \tl_if_exist:NF #1 { \tl_new:N #1 } - \tl_gput_right:Nn #1 { #2 } + \tl_gput_right:Nn #1 {#2} } -\cs_generate_variant:Nn \ctex_add_hook:Nn { c } +\cs_generate_variant:Nn \ctex_gadd_hook:Nn { c } \cs_new_protected_nopar:Npn \ctex_package_end_hook:n #1 { \cs_if_exist_use:cT { g__ctex_at_end_ #1 _hook_tl } @@ -88,7 +75,10 @@ } \cs_generate_variant:Nn \ctex_package_end_hook:n { o } \tl_put_left:Nn \@popfilename - { \ctex_package_end_hook:o { \@currname } } + { + \cs_if_eq:NNT \@currext \@pkgextension + { \ctex_package_end_hook:o { \@currname } } + } \cs_new_protected:Npn \ctex_file_wrapper:nnn #1#2#3 { \use:x @@ -138,15 +128,15 @@ \group_begin: \use:x { + \group_end: \__ctex_parse_name:nNNNnN { \token_get_replacement_spec:N #2 } - \exp_not:N #2 \exp_not:c { #3 ~ } \exp_not:c { /#3 } {#3} - } #1 + \exp_not:N #2 \exp_not:c { #3 ~ } \exp_not:c { /#3 } + } {#3} #1 } { #1#2 } } \cs_new_protected:Npn \__ctex_parse_name:nNNNnN #1#2#3#4#5#6 { - \group_end: \exp_args:Nc #6 { \str_case:nnTF {#1} @@ -175,9 +165,9 @@ \cs_new:Npn \__ctex_parse_name:w #1 AESAOPA ~ #2 < #3 \q_stop { #1#2 } } \cs_generate_variant:Nn \ctex_parse_name:NNn { NNx } -\cs_new_protected:Npn \ctex_patch_cmd:NnnTF { \ctex_parse_name:NN \patchcmd } -\cs_new_protected:Npn \ctex_preto_cmd:NnTF { \ctex_parse_name:NN \pretocmd } -\cs_new_protected:Npn \ctex_appto_cmd:NnTF { \ctex_parse_name:NN \apptocmd } +\cs_new_protected_nopar:Npn \ctex_patch_cmd:NnnTF { \ctex_parse_name:NN \patchcmd } +\cs_new_protected_nopar:Npn \ctex_preto_cmd:NnTF { \ctex_parse_name:NN \pretocmd } +\cs_new_protected_nopar:Npn \ctex_appto_cmd:NnTF { \ctex_parse_name:NN \apptocmd } \cs_new_protected:Npn \ctex_patch_cmd:Nnn { \group_begin: @@ -205,6 +195,29 @@ Patching~command~`#1'~failed.\\ ctex~may~not~work~as~expected. } +\cs_new_eq:NN \g__ctex_section_depth_flag \c_two +\msg_new:nnnn { ctex } { package-too-old } + { Support~package~`#1'~too~old. } + { + Please~update~an~up~to~date~version~of~the~package~`#1'\\ + using~your~TeX~package~manager~or~from~CTAN. + } +\cs_new_eq:NN \ctex_lua_now_x:n \luatex_directlua:D +\cs_if_exist:NTF \pdftex_pdfoutput:D + { + \int_compare:nNnTF \pdftex_pdfoutput:D > \c_zero + { + \cs_new_eq:NN \ifctexpdf \tex_iftrue:D + \cs_new_eq:NN \ctex_if_pdfmode:TF \use_i:nn + } + } + { \use:n } + { + \cs_new_eq:NN \ifctexpdf \tex_iffalse:D + \cs_new_eq:NN \ctex_if_pdfmode:TF \use_ii:nn + } +\cs_new_eq:NN \ctex_if_preamble:TF \use_i:nn +\AfterEndPreamble { \cs_set_eq:NN \ctex_if_preamble:TF \use_ii:nn } \cs_new:Npn \ctex_set_default_ccwd:Nn #1#2 { \dim_compare:nNnTF @@ -228,7 +241,6 @@ \tl_new:N \l__ctex_encoding_tl \tl_set:Nx \l__ctex_encoding_tl { \pdftex_if_engine:TF { GBK } { UTF8 } } -\cs_new_eq:NN \g__ctex_section_depth_flag \c_two \bool_new:N \g__ctex_zhmCJK_bool \tl_new:N \l__ctex_autoindent_tl \cs_new_eq:NN \ctex_if_autoindent_touched:F \use:n @@ -328,7 +340,7 @@ Option~ `fontset=adobe'~ is~ set.~ It~ is~ better~ to~ use~ fontset~ option. } - \keys_set:nn { ctex / option } { fontset = none } + \keys_set:nn { ctex / option } { fontset = adobe } } , winfonts .code:n = { @@ -337,7 +349,7 @@ Option~ `fontset=windows'~ is~ set.~ It~ is~ better~ to~ use~ fontset~ option. } - \keys_set:nn { ctex / option } { fontset = none } + \keys_set:nn { ctex / option } { fontset = windows } } , nofonts .value_forbidden: , winfonts .value_forbidden: , @@ -391,9 +403,15 @@ } , nospace .value_forbidden: , heading .bool_set:N = \l__ctex_heading_bool , + sub3section .code:n = + { \cs_gset_eq:NN \g__ctex_section_depth_flag \c_three } , + sub4section .code:n = + { \cs_gset_eq:NN \g__ctex_section_depth_flag \c_four } , + sub3section .value_forbidden: , + sub4section .value_forbidden: , scheme .tl_set:N = \l__ctex_scheme_tl , - scheme .default:n = { chinese }, - scheme .initial:n = { chinese }, + scheme .default:n = { chinese } , + scheme .initial:n = { chinese } , cap .code:n = { \msg_warning:nnn { ctex } { deprecated-option } @@ -408,12 +426,6 @@ } , cap .value_forbidden: , nocap .value_forbidden: , - sub3section .code:n = - { \cs_gset_eq:NN \g__ctex_section_depth_flag \c_three } , - sub4section .code:n = - { \cs_gset_eq:NN \g__ctex_section_depth_flag \c_four } , - sub3section .value_forbidden: , - sub4section .value_forbidden: , fntef .code:n = { \msg_warning:nnn { ctex } { deprecated-option } @@ -423,12 +435,17 @@ { \msg_warning:nnn { ctex } { deprecated-option } { `fancyhdr'~ package~ is~ loaded. } - \RequirePackage{ fancyhdr } + \RequirePackage { fancyhdr } } , hyperref .code:n = { \msg_warning:nnn { ctex } { deprecated-option } { `hyperref'~ package~ will~ be~ loaded. } + \ctex_at_end:n + { + \cs_if_exist:NF \hypersetup + { \cs_new_eq:NN \hypersetup \ctex_hypersetup:n } + } \AtEndPreamble { \RequirePackage { hyperref } } } , } @@ -466,12 +483,7 @@ \tl_const:Nn \c__ctex_class_tl { book } \PassOptionsToClass { \g__ctex_std_options_clist } { book } \LoadClass { book } -\tl_set_eq:Nc \l__ctex_tmp_tl { ver@ \@currname . \@currext } -\cs_new_eq:cN { ver@ctex. \@pkgextension } \l__ctex_tmp_tl -\cs_new_eq:cN { ver@ctexcap. \@pkgextension } \l__ctex_tmp_tl -\cs_new_eq:cN { ver@ctexsize. \@pkgextension } \l__ctex_tmp_tl -\NewDocumentCommand \ctexset { +m } - { \keys_set:nn { ctex } {#1} } +\NewDocumentCommand \ctexset { } { \keys_set:nn { ctex } } \NewDocumentCommand \CTEXsetup { +o > { \TrimSpaces } m } { \msg_warning:nnnn { ctex } { deprecated-command } { \CTEXsetup } @@ -493,7 +505,6 @@ \cs_new_protected_nopar:Npn \ctex_hypersetup:n #1 { \PassOptionsToPackage {#1} { hyperref } } } -\ctex_hypersetup:n { colorlinks = true } \pdftex_if_engine:TF { \tl_set:Nx \l__ctex_encoding_tl { \l__ctex_encoding_tl } @@ -704,16 +715,18 @@ \tl_const:cx { CTEX@#1name } { \exp_not:c { CTEX@#1@nameformat } - \exp_not:c { CTEX@pre#1 } - \exp_not:N \tl_if_empty:NTF \exp_not:c { CTEX@#1@numberformat } - { \exp_not:c { CTEX@the#1 } } { - \group_begin: - \exp_not:c { CTEX@#1@numberformat } - \exp_not:c { CTEX@the#1 } - \group_end: + \exp_not:c { CTEX@pre#1 } + \exp_not:N \tl_if_empty:NTF \exp_not:c { CTEX@#1@numberformat } + { \exp_not:c { CTEX@the#1 } } + { + \group_begin: + \exp_not:c { CTEX@#1@numberformat } + \exp_not:c { CTEX@the#1 } + \group_end: + } + \exp_not:c { CTEX@post#1 } } - \exp_not:c { CTEX@post#1 } \exp_not:c { CTEX@#1@aftername } } } @@ -730,19 +743,34 @@ #1 / numberformat .tl_set:N = \exp_not:c { CTEX@#1@numberformat } , #1 / aftername .tl_set:N = \exp_not:c { CTEX@#1@aftername } , #1 / titleformat .tl_set:N = \exp_not:c { CTEX@#1@titleformat } , + #1 / aftertitle .tl_set:N = \exp_not:c { CTEX@#1@aftertitle } , #1 / beforeskip .tl_set:N = \exp_not:c { CTEX@#1@beforeskip } , #1 / afterskip .tl_set:N = \exp_not:c { CTEX@#1@afterskip} , #1 / indent .tl_set:N = \exp_not:c { CTEX@#1@indent } , #1 / format+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@format } { ####1 } } , + #1 / format~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@format } { ####1 } } , #1 / nameformat+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@nameformat } { ####1 } } , + #1 / nameformat~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@nameformat } { ####1 } } , #1 / numberformat+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@numberformat } { ####1 } } , + #1 / numberformat~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@numberformat } { ####1 } } , #1 / aftername+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftername } { ####1 } } , + #1 / aftername~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftername } { ####1 } } , #1 / titleformat+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@titleformat } { ####1 } } , + #1 / titleformat~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@titleformat } { ####1 } } , + #1 / aftertitle+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftertitle } { ####1 } } , + #1 / aftertitle~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftertitle } { ####1 } } , #1 / beforeskip .initial:n = \c_zero_skip , #1 / afterskip .initial:n = \c_zero_skip , #1 / indent .initial:n = \c_zero_dim , @@ -761,7 +789,11 @@ { \tl_clear:c { CTEX@post#1 } } { \tl_set:cn { CTEX@post#1 } {#3} } } -\tl_clear:N \l__ctex_tmp_tl +\tl_set:Nn \l__ctex_tmp_tl + { + part / pagestyle .tl_set:N = \CTEX@part@pagestyle , + chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle , + } \seq_map_inline:Nn \c__ctex_headings_seq { \__ctex_initial_heading:n {#1} @@ -769,11 +801,6 @@ } \use:x { \keys_define:nn { ctex } { \exp_not:o { \l__ctex_tmp_tl } } } \tl_clear:N \l__ctex_tmp_tl -\keys_define:nn { ctex } - { - part / pagestyle .tl_set:N = \CTEX@part@pagestyle , - chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle - } \def\@part[#1]#2{% \thispagestyle{\CTEX@part@pagestyle}% \ifnum \c@secnumdepth >-2\relax @@ -788,12 +815,14 @@ \ifnum \c@secnumdepth >-2\relax \CTEX@partname \fi - \CTEX@part@titleformat{#2}\par}% + \CTEX@part@titleformat{#2}% + \CTEX@part@aftertitle}% \@endpart} \def\@spart#1{% {\interlinepenalty \@M \normalfont \CTEX@part@format - \CTEX@part@titleformat{#1}\par}% + \CTEX@part@titleformat{#1}% + \CTEX@part@aftertitle}% \@endpart} \def\@chapter[#1]#2{% \ifnum \c@secnumdepth >\m@ne @@ -833,7 +862,9 @@ \fi \fi \interlinepenalty\@M - \CTEX@chapter@titleformat{#1}\par\nobreak + \CTEX@chapter@titleformat{#1}% + \CTEX@chapter@aftertitle + \nobreak \vskip \CTEX@chapter@afterskip }} \def\@makeschapterhead#1{% @@ -847,7 +878,9 @@ \vspace*{\@tempskipa}% {\normalfont \parindent \CTEX@chapter@indent \CTEX@chapter@format \interlinepenalty\@M - \CTEX@chapter@titleformat{#1}\par\nobreak + \CTEX@chapter@titleformat{#1} + \CTEX@chapter@aftertitle + \nobreak \vskip \CTEX@chapter@afterskip }} \def\@seccntformat#1{% @@ -867,7 +900,8 @@ #6{% \@hangfrom{\hskip #3\relax\@svsec}% \interlinepenalty \@M - \csname CTEX@#1@titleformat\endcsname{#8}\@@par}% + \csname CTEX@#1@titleformat\endcsname{#8}% + \csname CTEX@#1@aftertitle\endcsname}% \endgroup \csname #1mark\endcsname{#7}% \addcontentsline{toc}{#1}{% @@ -880,7 +914,9 @@ \else \def\@svsechd{% #6{\hskip #3\relax - \@svsec \csname CTEX@#1@titleformat\endcsname{#8}}% + \@svsec + \csname CTEX@#1@titleformat\endcsname{#8}% + \csname CTEX@#1@aftertitle\endcsname}% \csname #1mark\endcsname{#7}% \addcontentsline{toc}{#1}{% \ifnum #2>\c@secnumdepth \else @@ -898,15 +934,20 @@ #4{% \@hangfrom{\hskip #1}% \interlinepenalty \@M - \CTEX@titleformat@n{#5}\@@par}% + \CTEX@titleformat@n{#5}% + \CTEX@aftertitle}% \endgroup \else - \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}}}% + \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}\CTEX@aftertitle}}% \fi \@xsect{#3}} \cs_new_protected_nopar:Npn \CTEX@set@titleformat@n #1 - { \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat } } + { + \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat } + \cs_set_eq:Nc \CTEX@aftertitle { CTEX@#1@aftertitle } + } \cs_new_eq:NN \CTEX@titleformat@n \use:n +\cs_new_eq:NN \CTEX@aftertitle \prg_do_nothing: \int_zero:N \l__ctex_tmp_int \clist_map_inline:nn { section , subsection , subsubsection , paragraph , subparagraph } @@ -925,15 +966,15 @@ } } } -\tl_new:N \CTEX@preappendix -\tl_new:N \CTEX@postappendix \keys_define:nn { ctex } - { appendix .meta:nn = { ctex / appendix } {#1} } -\keys_define:nn { ctex / appendix } { - name .code:n = { \ctex_assign_heading_name:nn { appendix } {#1} } , - number .tl_set:N = \CTEX@appendixnumber + appendix .meta:nn = { ctex / appendix } {#1} , + appendix / name .code:n = + { \ctex_assign_heading_name:nn { appendix } {#1} } , + appendix / number .tl_set:N = \CTEX@appendixnumber } +\tl_new:N \CTEX@preappendix +\tl_new:N \CTEX@postappendix \cs_new_eq:NN \CTEX@save@appendix \appendix \cs_gset_protected_nopar:Npn \appendix { @@ -1119,11 +1160,8 @@ \normalsize \NewDocumentCommand \CTeX { } { \ifincsname CTeX \else: C \TeX \fi: } -\AtBeginDocument - { - \cs_if_exist_use:NT \pdfstringdefDisableCommands - { { \tl_set:Nn \CTeX { CTeX } } } - } +\ctex_at_end_package:nn { hyperref } + { \pdfstringdefDisableCommands { \tl_set:Nn \CTeX { CTeX } } } \keys_define:nn { ctex } { captiondelimiter .code:n = @@ -1227,6 +1265,7 @@ %% ctex.sty, %% ctexcap.sty, %% ctexsize.sty, +%% ctexheading.sty, %% ctexart.cls, %% ctexbook.cls, %% ctexrep.cls, diff --git a/Master/texmf-dist/tex/latex/ctex/ctexcap.sty b/Master/texmf-dist/tex/latex/ctex/ctexcap.sty index 840c30bcb31..f899abbf14f 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctexcap.sty +++ b/Master/texmf-dist/tex/latex/ctex/ctexcap.sty @@ -4,7 +4,7 @@ %% %% The original source files were: %% -%% ctex.dtx (with options: `package,ctexcap') +%% ctex.dtx (with options: `ctexcap') %% %% Copyright (C) 2003--2015 %% CTEX.ORG and any individual authors listed in the documentation. @@ -28,10 +28,10 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {Chinese adapter in LaTeX (CTEX)} \ProvidesExplPackage{ctexcap} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} \PassOptionsToPackage { heading = true } { ctexcap } \RequirePackageWithOptions { ctex } %% @@ -41,6 +41,7 @@ %% ctex.sty, %% ctexcap.sty, %% ctexsize.sty, +%% ctexheading.sty, %% ctexart.cls, %% ctexbook.cls, %% ctexrep.cls, diff --git a/Master/texmf-dist/tex/latex/ctex/ctexheading.sty b/Master/texmf-dist/tex/latex/ctex/ctexheading.sty new file mode 100644 index 00000000000..efff90fbbdd --- /dev/null +++ b/Master/texmf-dist/tex/latex/ctex/ctexheading.sty @@ -0,0 +1,278 @@ +%% +%% This is file `ctexheading.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% ctex.dtx (with options: `style,ctexheading') +%% +%% Copyright (C) 2003--2015 +%% CTEX.ORG and any individual authors listed in the documentation. +%% ------------------------------------------------------------------------------ +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. This version of this license is in +%% http://www.latex-project.org/lppl/lppl-1-3c.txt +%% and the latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang. +%% +%% ------------------------------------------------------------------------------ +%% +\NeedsTeXFormat{LaTeX2e} +\RequirePackage{expl3} +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ + {Heading style modification (CTEX)} +\ProvidesExplPackage{ctexheading} + {\ExplFileDate}{2.1}{\ExplFileDescription} +\RequirePackage { xparse , l3keys2e } +\RequirePackage { etoolbox } +\tl_new:N \l__ctex_tmp_tl +\int_new:N \l__ctex_tmp_int +\box_new:N \l__ctex_tmp_box +\cs_new_protected:Npn \ctex_at_end_package:nn #1#2 + { + \@ifpackageloaded {#1} + {#2} + { \ctex_gadd_hook:cn { g__ctex_at_end_ #1 _hook_tl } {#2} } + } +\cs_new_protected:Npn \ctex_gadd_hook:Nn #1#2 + { + \tl_if_exist:NF #1 { \tl_new:N #1 } + \tl_gput_right:Nn #1 {#2} + } +\cs_generate_variant:Nn \ctex_gadd_hook:Nn { c } +\cs_new_protected_nopar:Npn \ctex_package_end_hook:n #1 + { + \cs_if_exist_use:cT { g__ctex_at_end_ #1 _hook_tl } + { \cs_undefine:c { g__ctex_at_end_ #1 _hook_tl } } + } +\cs_generate_variant:Nn \ctex_package_end_hook:n { o } +\tl_put_left:Nn \@popfilename + { + \cs_if_eq:NNT \@currext \@pkgextension + { \ctex_package_end_hook:o { \@currname } } + } +\cs_new_protected:Npn \ctex_file_wrapper:nnn #1#2#3 + { + \use:x + { + \ExplSyntaxOff + \char_set_catcode_letter:n { 64 } + #1 + \exp_not:n {#2} + \bool_if:NTF \l__kernel_expl_bool + { \ExplSyntaxOn } + { \ExplSyntaxOff } + \char_set_catcode:nn { 64 } { \char_value_catcode:n { 64 } } + #3 + } + } +\cs_new_protected_nopar:Npn \ctex_file_input:n #1 + { \ctex_file_wrapper:nnn { } { \file_input:n {#1} } { } } +\cs_new_protected_nopar:Npn \ctex_scheme_input:n #1 + { + \ctex_file_wrapper:nnn + { } + { + \tl_if_exist:NTF \c__ctex_class_tl + { + \file_if_exist_input:nF { ctex-scheme- #1 - \c__ctex_class_tl .def } + { \file_input:n { ctex-scheme- #1 .def } } + } + { \file_input:n { ctex-scheme- #1 .def } } + } + { } + } +\cs_generate_variant:Nn \ctex_scheme_input:n { o } +\cs_new_protected:Npn \ctex_parse_name:NN #1#2 + { \ctex_parse_name:NNx #1#2 { \cs_to_str:N #2 } } +\group_begin: +\char_set_lccode:nn { `\< } { `\{ } +\char_set_lccode:nn { `\/ } { `\\ } +\char_set_lccode:nn { `\A } { `\t } +\tl_map_function:nN { \A \E \S \O \P } \char_set_catcode_other:N +\tex_lowercase:D + { + \group_end: + \cs_new_protected:Npn \ctex_parse_name:NNn #1#2#3 + { + \bool_if:nTF { \cs_if_exist_p:c { #3 ~ } || \cs_if_exist_p:c { /#3 } } + { + \group_begin: + \use:x + { + \group_end: + \__ctex_parse_name:nNNNnN { \token_get_replacement_spec:N #2 } + \exp_not:N #2 \exp_not:c { #3 ~ } \exp_not:c { /#3 } + } {#3} #1 + } + { #1#2 } + } + \cs_new_protected:Npn \__ctex_parse_name:nNNNnN #1#2#3#4#5#6 + { + \exp_args:Nc #6 + { + \str_case:nnTF {#1} + { + { \protect #3 } { } + { \x@protect #2 \protect #3 } { } + } + { + \str_if_eq_x:nnTF { \exp_not:n { /@protected@ #3 /#3 } } + { + \exp_last_unbraced:Nf \__ctex_parse_name:w + \token_get_replacement_spec:N #3 AESAOPA ~ < \q_stop + } + { /#5 ~ } { #5 ~ } + } + { + \str_case:onTF { \__ctex_parse_name:w #1 AESAOPA ~ < \q_stop } + { + { /@protected@ #2 #4 } { } + { /@ #4 } { } + } + { /#5 } {#5} + } + } + } + \cs_new:Npn \__ctex_parse_name:w #1 AESAOPA ~ #2 < #3 \q_stop { #1#2 } + } +\cs_generate_variant:Nn \ctex_parse_name:NNn { NNx } +\cs_new_protected_nopar:Npn \ctex_patch_cmd:NnnTF { \ctex_parse_name:NN \patchcmd } +\cs_new_protected_nopar:Npn \ctex_preto_cmd:NnTF { \ctex_parse_name:NN \pretocmd } +\cs_new_protected_nopar:Npn \ctex_appto_cmd:NnTF { \ctex_parse_name:NN \apptocmd } +\cs_new_protected:Npn \ctex_patch_cmd:Nnn + { + \group_begin: + \char_set_catcode_other:N \# + \__ctex_patch_cmd:Nnn + } +\cs_new_protected:Npn \__ctex_patch_cmd:Nnn #1#2#3 + { + \group_end: + \group_begin: + \ExplSyntaxOff + \ctex_patch_cmd:NnnTF #1 {#2} {#3} + { + \cs_gset_eq:NN \__ctex_tmp:w #1 + \group_end: + \cs_set_eq:NN #1 \__ctex_tmp:w + \cs_undefine:N \__ctex_tmp:w + } + { \group_end: \ctex_patch_failure:N #1 } + } +\cs_new_protected:Npn \ctex_patch_failure:N #1 + { \msg_warning:nnx { ctex } { patch-failure } { \token_to_str:N #1 } } +\msg_new:nnn { ctex } { patch-failure } + { + Patching~command~`#1'~failed.\\ + ctex~may~not~work~as~expected. + } +\cs_new_eq:NN \g__ctex_section_depth_flag \c_two +\keys_define:nn { ctex / option } + { + sub3section .code:n = + { \cs_gset_eq:NN \g__ctex_section_depth_flag \c_three } , + sub4section .code:n = + { \cs_gset_eq:NN \g__ctex_section_depth_flag \c_four } , + sub3section .value_forbidden: , + sub4section .value_forbidden: , + scheme .tl_set:N = \l__ctex_scheme_tl , + scheme .default:n = { plain } , + scheme .initial:n = { plain } + } +\ProcessKeysOptions { ctex / option } +\NewDocumentCommand \ctexset { } { \keys_set:nn { ctex } } +\clist_map_inline:nn { article , book , report } + { + \@ifclassloaded {#1} + { \clist_map_break:n { \tl_const:Nn \c__ctex_std_class_tl {#1} } } + { } + } +\msg_new:nnn { ctex } { not-standard-class } + { + None~of~the~standard~document~classes~was~loaded.\\ + Heading~`#1'~is~selected.\\ + ctex~may~not~work~as~expected. + } +\use:n + { + \tl_if_exist:NTF \c__ctex_std_class_tl + { \cs_new_eq:NN \c__ctex_class_tl \c__ctex_std_class_tl } + { + \cs_if_exist:NTF \chapter + { + \cs_if_exist:NF \if@mainmatter + { \cs_new_eq:NN \if@mainmatter \tex_iftrue:D } + \tl_const:Nn \c__ctex_class_tl { book } + } + { \tl_const:Nn \c__ctex_class_tl { article } } + \msg_warning:nnx { ctex } { not-standard-class } { \c__ctex_class_tl } + } + \ctex_file_input:n { ctex- \c__ctex_class_tl .def } + } +%% +%% This package consists of the file ctex.dtx, +%% and the derived files ctex.pdf, +%% ctex.ins, +%% ctex.sty, +%% ctexcap.sty, +%% ctexsize.sty, +%% ctexheading.sty, +%% ctexart.cls, +%% ctexbook.cls, +%% ctexrep.cls, +%% ctex-c5size.clo, +%% ctex-cs4size.clo, +%% ctex-article.def, +%% ctex-book.def, +%% ctex-report.def, +%% ctex-scheme-plain.def, +%% ctex-scheme-plain-article.def, +%% ctex-scheme-plain-book.def, +%% ctex-scheme-plain-report.def, +%% ctex-scheme-chinese.def, +%% ctex-scheme-chinese-article.def, +%% ctex-scheme-chinese-book.def, +%% ctex-scheme-chinese-report.def, +%% ctex-name-gbk.cfg, +%% ctex-name-utf8.cfg, +%% ctex.cfg, +%% ctexopts.cfg, +%% ctex-engine-pdftex.def, +%% ctex-engine-xetex.def, +%% ctex-engine-luatex.def, +%% c19rm.fd, +%% c19sf.fd, +%% c19tt.fd, +%% c70rm.fd, +%% c70sf.fd, +%% c70tt.fd, +%% ctex-fontset-windows.def, +%% ctex-fontset-windowsnew.def, +%% ctex-fontset-windowsold.def, +%% ctex-fontset-adobe.def, +%% ctex-fontset-fandol.def, +%% ctex-fontset-mac.def, +%% ctex-fontset-founder.def, +%% ctex-fontset-ubuntu.def, +%% ctexspa.def, +%% ctexpunct.spa, +%% ctexmakespa.tex, +%% ctexspamacro.tex, +%% zhadobefonts.tex, +%% zhfandolfonts.tex, +%% zhfounderfonts.tex, +%% zhubuntufonts.tex, +%% zhwindowsfonts.tex, and +%% README. +%% +%% End of file `ctexheading.sty'. diff --git a/Master/texmf-dist/tex/latex/ctex/ctexrep.cls b/Master/texmf-dist/tex/latex/ctex/ctexrep.cls index d32a3d7e999..0f7dfdeff5a 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctexrep.cls +++ b/Master/texmf-dist/tex/latex/ctex/ctexrep.cls @@ -28,10 +28,16 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {Chinese adapter for class report (CTEX)} \ProvidesExplClass{ctexrep} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} +\tl_const:Nx \c__ctex_version_tl + { \cs_if_exist_use:cF { ver@ \@currname . \@currext } { 9999/99/99 } } +\cs_new_eq:cN { ver@ctex. \@pkgextension } \c__ctex_version_tl +\cs_new_eq:cN { ver@ctexcap. \@pkgextension } \c__ctex_version_tl +\cs_new_eq:cN { ver@ctexsize. \@pkgextension } \c__ctex_version_tl +\cs_new_eq:cN { ver@ctexheading. \@pkgextension } \c__ctex_version_tl \RequirePackage { xparse , l3keys2e } \msg_new:nnnn { ctex } { l3-too-old } { Support~package~`#1'~too~old. } @@ -44,43 +50,24 @@ { \msg_error:nnn { ctex } { l3-too-old } { expl3 } } \@ifpackagelater { l3keys2e } { 2014/05/05 } { } { \msg_error:nnn { ctex } { l3-too-old } { l3keys2e } } -\RequirePackage { etoolbox , ifpdf , fix-cm , everysel } +\RequirePackage { etoolbox } +\RequirePackage { fix-cm , everysel } \tl_new:N \l__ctex_tmp_tl \int_new:N \l__ctex_tmp_int \dim_new:N \l__ctex_tmp_dim \box_new:N \l__ctex_tmp_box -\msg_new:nnnn { ctex } { package-too-old } - { Support~package~`#1'~too~old. } - { - Please~update~an~up~to~date~version~of~the~package~`#1'\\ - using~your~TeX~package~manager~or~from~CTAN. - } -\cs_new_eq:NN \ctex_lua_now_x:n \luatex_directlua:D -\ifpdf - \cs_new_eq:NN \ctex_if_pdfmode:TF \use_i:nn -\else: - \cs_new_eq:NN \ctex_if_pdfmode:TF \use_ii:nn -\fi: -\prg_new_conditional:Npnn \ctex_if_preamble: { TF } - { - \if_meaning:w \@onlypreamble \@notprerr - \prg_return_false: - \else: - \prg_return_true: - \fi: - } \cs_new_protected:Npn \ctex_at_end_package:nn #1#2 { - \@ifpackageloaded { #1 } - { #2 } - { \ctex_add_hook:cn { g__ctex_at_end_ #1 _hook_tl } { #2 } } + \@ifpackageloaded {#1} + {#2} + { \ctex_gadd_hook:cn { g__ctex_at_end_ #1 _hook_tl } {#2} } } -\cs_new_protected:Npn \ctex_add_hook:Nn #1#2 +\cs_new_protected:Npn \ctex_gadd_hook:Nn #1#2 { \tl_if_exist:NF #1 { \tl_new:N #1 } - \tl_gput_right:Nn #1 { #2 } + \tl_gput_right:Nn #1 {#2} } -\cs_generate_variant:Nn \ctex_add_hook:Nn { c } +\cs_generate_variant:Nn \ctex_gadd_hook:Nn { c } \cs_new_protected_nopar:Npn \ctex_package_end_hook:n #1 { \cs_if_exist_use:cT { g__ctex_at_end_ #1 _hook_tl } @@ -88,7 +75,10 @@ } \cs_generate_variant:Nn \ctex_package_end_hook:n { o } \tl_put_left:Nn \@popfilename - { \ctex_package_end_hook:o { \@currname } } + { + \cs_if_eq:NNT \@currext \@pkgextension + { \ctex_package_end_hook:o { \@currname } } + } \cs_new_protected:Npn \ctex_file_wrapper:nnn #1#2#3 { \use:x @@ -138,15 +128,15 @@ \group_begin: \use:x { + \group_end: \__ctex_parse_name:nNNNnN { \token_get_replacement_spec:N #2 } - \exp_not:N #2 \exp_not:c { #3 ~ } \exp_not:c { /#3 } {#3} - } #1 + \exp_not:N #2 \exp_not:c { #3 ~ } \exp_not:c { /#3 } + } {#3} #1 } { #1#2 } } \cs_new_protected:Npn \__ctex_parse_name:nNNNnN #1#2#3#4#5#6 { - \group_end: \exp_args:Nc #6 { \str_case:nnTF {#1} @@ -175,9 +165,9 @@ \cs_new:Npn \__ctex_parse_name:w #1 AESAOPA ~ #2 < #3 \q_stop { #1#2 } } \cs_generate_variant:Nn \ctex_parse_name:NNn { NNx } -\cs_new_protected:Npn \ctex_patch_cmd:NnnTF { \ctex_parse_name:NN \patchcmd } -\cs_new_protected:Npn \ctex_preto_cmd:NnTF { \ctex_parse_name:NN \pretocmd } -\cs_new_protected:Npn \ctex_appto_cmd:NnTF { \ctex_parse_name:NN \apptocmd } +\cs_new_protected_nopar:Npn \ctex_patch_cmd:NnnTF { \ctex_parse_name:NN \patchcmd } +\cs_new_protected_nopar:Npn \ctex_preto_cmd:NnTF { \ctex_parse_name:NN \pretocmd } +\cs_new_protected_nopar:Npn \ctex_appto_cmd:NnTF { \ctex_parse_name:NN \apptocmd } \cs_new_protected:Npn \ctex_patch_cmd:Nnn { \group_begin: @@ -205,6 +195,29 @@ Patching~command~`#1'~failed.\\ ctex~may~not~work~as~expected. } +\cs_new_eq:NN \g__ctex_section_depth_flag \c_two +\msg_new:nnnn { ctex } { package-too-old } + { Support~package~`#1'~too~old. } + { + Please~update~an~up~to~date~version~of~the~package~`#1'\\ + using~your~TeX~package~manager~or~from~CTAN. + } +\cs_new_eq:NN \ctex_lua_now_x:n \luatex_directlua:D +\cs_if_exist:NTF \pdftex_pdfoutput:D + { + \int_compare:nNnTF \pdftex_pdfoutput:D > \c_zero + { + \cs_new_eq:NN \ifctexpdf \tex_iftrue:D + \cs_new_eq:NN \ctex_if_pdfmode:TF \use_i:nn + } + } + { \use:n } + { + \cs_new_eq:NN \ifctexpdf \tex_iffalse:D + \cs_new_eq:NN \ctex_if_pdfmode:TF \use_ii:nn + } +\cs_new_eq:NN \ctex_if_preamble:TF \use_i:nn +\AfterEndPreamble { \cs_set_eq:NN \ctex_if_preamble:TF \use_ii:nn } \cs_new:Npn \ctex_set_default_ccwd:Nn #1#2 { \dim_compare:nNnTF @@ -228,7 +241,6 @@ \tl_new:N \l__ctex_encoding_tl \tl_set:Nx \l__ctex_encoding_tl { \pdftex_if_engine:TF { GBK } { UTF8 } } -\cs_new_eq:NN \g__ctex_section_depth_flag \c_two \bool_new:N \g__ctex_zhmCJK_bool \tl_new:N \l__ctex_autoindent_tl \cs_new_eq:NN \ctex_if_autoindent_touched:F \use:n @@ -328,7 +340,7 @@ Option~ `fontset=adobe'~ is~ set.~ It~ is~ better~ to~ use~ fontset~ option. } - \keys_set:nn { ctex / option } { fontset = none } + \keys_set:nn { ctex / option } { fontset = adobe } } , winfonts .code:n = { @@ -337,7 +349,7 @@ Option~ `fontset=windows'~ is~ set.~ It~ is~ better~ to~ use~ fontset~ option. } - \keys_set:nn { ctex / option } { fontset = none } + \keys_set:nn { ctex / option } { fontset = windows } } , nofonts .value_forbidden: , winfonts .value_forbidden: , @@ -391,9 +403,15 @@ } , nospace .value_forbidden: , heading .bool_set:N = \l__ctex_heading_bool , + sub3section .code:n = + { \cs_gset_eq:NN \g__ctex_section_depth_flag \c_three } , + sub4section .code:n = + { \cs_gset_eq:NN \g__ctex_section_depth_flag \c_four } , + sub3section .value_forbidden: , + sub4section .value_forbidden: , scheme .tl_set:N = \l__ctex_scheme_tl , - scheme .default:n = { chinese }, - scheme .initial:n = { chinese }, + scheme .default:n = { chinese } , + scheme .initial:n = { chinese } , cap .code:n = { \msg_warning:nnn { ctex } { deprecated-option } @@ -408,12 +426,6 @@ } , cap .value_forbidden: , nocap .value_forbidden: , - sub3section .code:n = - { \cs_gset_eq:NN \g__ctex_section_depth_flag \c_three } , - sub4section .code:n = - { \cs_gset_eq:NN \g__ctex_section_depth_flag \c_four } , - sub3section .value_forbidden: , - sub4section .value_forbidden: , fntef .code:n = { \msg_warning:nnn { ctex } { deprecated-option } @@ -423,12 +435,17 @@ { \msg_warning:nnn { ctex } { deprecated-option } { `fancyhdr'~ package~ is~ loaded. } - \RequirePackage{ fancyhdr } + \RequirePackage { fancyhdr } } , hyperref .code:n = { \msg_warning:nnn { ctex } { deprecated-option } { `hyperref'~ package~ will~ be~ loaded. } + \ctex_at_end:n + { + \cs_if_exist:NF \hypersetup + { \cs_new_eq:NN \hypersetup \ctex_hypersetup:n } + } \AtEndPreamble { \RequirePackage { hyperref } } } , } @@ -466,12 +483,7 @@ \tl_const:Nn \c__ctex_class_tl { report } \PassOptionsToClass { \g__ctex_std_options_clist } { report } \LoadClass { report } -\tl_set_eq:Nc \l__ctex_tmp_tl { ver@ \@currname . \@currext } -\cs_new_eq:cN { ver@ctex. \@pkgextension } \l__ctex_tmp_tl -\cs_new_eq:cN { ver@ctexcap. \@pkgextension } \l__ctex_tmp_tl -\cs_new_eq:cN { ver@ctexsize. \@pkgextension } \l__ctex_tmp_tl -\NewDocumentCommand \ctexset { +m } - { \keys_set:nn { ctex } {#1} } +\NewDocumentCommand \ctexset { } { \keys_set:nn { ctex } } \NewDocumentCommand \CTEXsetup { +o > { \TrimSpaces } m } { \msg_warning:nnnn { ctex } { deprecated-command } { \CTEXsetup } @@ -493,7 +505,6 @@ \cs_new_protected_nopar:Npn \ctex_hypersetup:n #1 { \PassOptionsToPackage {#1} { hyperref } } } -\ctex_hypersetup:n { colorlinks = true } \pdftex_if_engine:TF { \tl_set:Nx \l__ctex_encoding_tl { \l__ctex_encoding_tl } @@ -704,16 +715,18 @@ \tl_const:cx { CTEX@#1name } { \exp_not:c { CTEX@#1@nameformat } - \exp_not:c { CTEX@pre#1 } - \exp_not:N \tl_if_empty:NTF \exp_not:c { CTEX@#1@numberformat } - { \exp_not:c { CTEX@the#1 } } { - \group_begin: - \exp_not:c { CTEX@#1@numberformat } - \exp_not:c { CTEX@the#1 } - \group_end: + \exp_not:c { CTEX@pre#1 } + \exp_not:N \tl_if_empty:NTF \exp_not:c { CTEX@#1@numberformat } + { \exp_not:c { CTEX@the#1 } } + { + \group_begin: + \exp_not:c { CTEX@#1@numberformat } + \exp_not:c { CTEX@the#1 } + \group_end: + } + \exp_not:c { CTEX@post#1 } } - \exp_not:c { CTEX@post#1 } \exp_not:c { CTEX@#1@aftername } } } @@ -730,19 +743,34 @@ #1 / numberformat .tl_set:N = \exp_not:c { CTEX@#1@numberformat } , #1 / aftername .tl_set:N = \exp_not:c { CTEX@#1@aftername } , #1 / titleformat .tl_set:N = \exp_not:c { CTEX@#1@titleformat } , + #1 / aftertitle .tl_set:N = \exp_not:c { CTEX@#1@aftertitle } , #1 / beforeskip .tl_set:N = \exp_not:c { CTEX@#1@beforeskip } , #1 / afterskip .tl_set:N = \exp_not:c { CTEX@#1@afterskip} , #1 / indent .tl_set:N = \exp_not:c { CTEX@#1@indent } , #1 / format+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@format } { ####1 } } , + #1 / format~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@format } { ####1 } } , #1 / nameformat+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@nameformat } { ####1 } } , + #1 / nameformat~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@nameformat } { ####1 } } , #1 / numberformat+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@numberformat } { ####1 } } , + #1 / numberformat~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@numberformat } { ####1 } } , #1 / aftername+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftername } { ####1 } } , + #1 / aftername~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftername } { ####1 } } , #1 / titleformat+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@titleformat } { ####1 } } , + #1 / titleformat~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@titleformat } { ####1 } } , + #1 / aftertitle+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftertitle } { ####1 } } , + #1 / aftertitle~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftertitle } { ####1 } } , #1 / beforeskip .initial:n = \c_zero_skip , #1 / afterskip .initial:n = \c_zero_skip , #1 / indent .initial:n = \c_zero_dim , @@ -761,7 +789,11 @@ { \tl_clear:c { CTEX@post#1 } } { \tl_set:cn { CTEX@post#1 } {#3} } } -\tl_clear:N \l__ctex_tmp_tl +\tl_set:Nn \l__ctex_tmp_tl + { + part / pagestyle .tl_set:N = \CTEX@part@pagestyle , + chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle , + } \seq_map_inline:Nn \c__ctex_headings_seq { \__ctex_initial_heading:n {#1} @@ -769,11 +801,6 @@ } \use:x { \keys_define:nn { ctex } { \exp_not:o { \l__ctex_tmp_tl } } } \tl_clear:N \l__ctex_tmp_tl -\keys_define:nn { ctex } - { - part / pagestyle .tl_set:N = \CTEX@part@pagestyle , - chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle - } \def\@part[#1]#2{% \thispagestyle{\CTEX@part@pagestyle}% \ifnum \c@secnumdepth >-2\relax @@ -788,12 +815,14 @@ \ifnum \c@secnumdepth >-2\relax \CTEX@partname \fi - \CTEX@part@titleformat{#2}\par}% + \CTEX@part@titleformat{#2}% + \CTEX@part@aftertitle}% \@endpart} \def\@spart#1{% {\interlinepenalty \@M \normalfont \CTEX@part@format - \CTEX@part@titleformat{#1}\par}% + \CTEX@part@titleformat{#1}% + \CTEX@part@aftertitle}% \@endpart} \def\@chapter[#1]#2{% \ifnum \c@secnumdepth >\m@ne @@ -827,7 +856,9 @@ \CTEX@chaptername \fi \interlinepenalty\@M - \CTEX@chapter@titleformat{#1}\par\nobreak + \CTEX@chapter@titleformat{#1}% + \CTEX@chapter@aftertitle + \nobreak \vskip \CTEX@chapter@afterskip }} \def\@makeschapterhead#1{% @@ -841,7 +872,9 @@ \vspace*{\@tempskipa}% {\normalfont \parindent \CTEX@chapter@indent \CTEX@chapter@format \interlinepenalty\@M - \CTEX@chapter@titleformat{#1}\par\nobreak + \CTEX@chapter@titleformat{#1} + \CTEX@chapter@aftertitle + \nobreak \vskip \CTEX@chapter@afterskip }} \def\@seccntformat#1{% @@ -861,7 +894,8 @@ #6{% \@hangfrom{\hskip #3\relax\@svsec}% \interlinepenalty \@M - \csname CTEX@#1@titleformat\endcsname{#8}\@@par}% + \csname CTEX@#1@titleformat\endcsname{#8}% + \csname CTEX@#1@aftertitle\endcsname}% \endgroup \csname #1mark\endcsname{#7}% \addcontentsline{toc}{#1}{% @@ -874,7 +908,9 @@ \else \def\@svsechd{% #6{\hskip #3\relax - \@svsec \csname CTEX@#1@titleformat\endcsname{#8}}% + \@svsec + \csname CTEX@#1@titleformat\endcsname{#8}% + \csname CTEX@#1@aftertitle\endcsname}% \csname #1mark\endcsname{#7}% \addcontentsline{toc}{#1}{% \ifnum #2>\c@secnumdepth \else @@ -892,15 +928,20 @@ #4{% \@hangfrom{\hskip #1}% \interlinepenalty \@M - \CTEX@titleformat@n{#5}\@@par}% + \CTEX@titleformat@n{#5}% + \CTEX@aftertitle}% \endgroup \else - \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}}}% + \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}\CTEX@aftertitle}}% \fi \@xsect{#3}} \cs_new_protected_nopar:Npn \CTEX@set@titleformat@n #1 - { \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat } } + { + \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat } + \cs_set_eq:Nc \CTEX@aftertitle { CTEX@#1@aftertitle } + } \cs_new_eq:NN \CTEX@titleformat@n \use:n +\cs_new_eq:NN \CTEX@aftertitle \prg_do_nothing: \int_zero:N \l__ctex_tmp_int \clist_map_inline:nn { section , subsection , subsubsection , paragraph , subparagraph } @@ -919,15 +960,15 @@ } } } -\tl_new:N \CTEX@preappendix -\tl_new:N \CTEX@postappendix \keys_define:nn { ctex } - { appendix .meta:nn = { ctex / appendix } {#1} } -\keys_define:nn { ctex / appendix } { - name .code:n = { \ctex_assign_heading_name:nn { appendix } {#1} } , - number .tl_set:N = \CTEX@appendixnumber + appendix .meta:nn = { ctex / appendix } {#1} , + appendix / name .code:n = + { \ctex_assign_heading_name:nn { appendix } {#1} } , + appendix / number .tl_set:N = \CTEX@appendixnumber } +\tl_new:N \CTEX@preappendix +\tl_new:N \CTEX@postappendix \cs_new_eq:NN \CTEX@save@appendix \appendix \cs_gset_protected_nopar:Npn \appendix { @@ -1113,11 +1154,8 @@ \normalsize \NewDocumentCommand \CTeX { } { \ifincsname CTeX \else: C \TeX \fi: } -\AtBeginDocument - { - \cs_if_exist_use:NT \pdfstringdefDisableCommands - { { \tl_set:Nn \CTeX { CTeX } } } - } +\ctex_at_end_package:nn { hyperref } + { \pdfstringdefDisableCommands { \tl_set:Nn \CTeX { CTeX } } } \keys_define:nn { ctex } { captiondelimiter .code:n = @@ -1221,6 +1259,7 @@ %% ctex.sty, %% ctexcap.sty, %% ctexsize.sty, +%% ctexheading.sty, %% ctexart.cls, %% ctexbook.cls, %% ctexrep.cls, diff --git a/Master/texmf-dist/tex/latex/ctex/ctexsize.sty b/Master/texmf-dist/tex/latex/ctex/ctexsize.sty index 575169b7625..59d56038732 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctexsize.sty +++ b/Master/texmf-dist/tex/latex/ctex/ctexsize.sty @@ -4,7 +4,7 @@ %% %% The original source files were: %% -%% ctex.dtx (with options: `package,ctexsize') +%% ctex.dtx (with options: `style,ctexsize') %% %% Copyright (C) 2003--2015 %% CTEX.ORG and any individual authors listed in the documentation. @@ -28,10 +28,10 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {Chinese font size definition (CTEX)} \ProvidesExplPackage{ctexsize} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} \RequirePackage { xparse , l3keys2e } \cs_new_eq:NN \g__ctex_font_size_flag \c_minus_one \keys_define:nn { ctex / option } @@ -164,6 +164,7 @@ %% ctex.sty, %% ctexcap.sty, %% ctexsize.sty, +%% ctexheading.sty, %% ctexart.cls, %% ctexbook.cls, %% ctexrep.cls, diff --git a/Master/texmf-dist/tex/latex/ctex/ctexspa.def b/Master/texmf-dist/tex/latex/ctex/ctexspa.def index 3f5c6a67a98..91048dd0a27 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctexspa.def +++ b/Master/texmf-dist/tex/latex/ctex/ctexspa.def @@ -28,7 +28,7 @@ %% ------------------------------------------------------------------------------ %% \ProvidesFile{ctexspa.def}% - [2015/05/15 v2.0.2 Space info for CJKpunct (CTEX)] + [2015/05/15 v2.1 Space info for CJKpunct (CTEX)] \ctexspadef{adobezhsong}{70,15,61,8,63,14,58,7,64,13,62,12,60,11,61,15,62,14,51,6,58,5,58,8,7,5,12,12,10,68,13,63,17,63,20,69,19,69,17,63,19,70,17,55,10,10,14,63,10,65,10,61,13,62,15,61,7,49,7,56,8,58,15,69,8,61,14,63,8,57,,,} \ctexspadef{adobezhhei}{78,3,64,3,64,2,61,3,72,3,70,3,72,3,70,3,60,3,51,3,62,3,66,3,0,0,10,10,3,70,5,70,6,75,6,78,17,67,13,67,17,67,4,50,8,8,3,72,3,70,3,72,3,70,3,60,3,51,3,62,3,66,3,78,7,62,3,63,3,61,,,} \ctexspadef{adobezhkai}{76,10,55,8,63,4,62,4,71,4,65,4,71,4,74,4,54,4,54,4,62,4,62,4,0,0,11,11,5,72,6,71,7,78,7,79,18,68,18,68,18,68,2,46,14,12,4,71,4,65,4,71,4,74,4,54,4,54,4,62,4,62,10,76,8,55,4,63,4,62,,,} diff --git a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-luatex.def b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-luatex.def index 04434db1c8b..b8c8b3e325b 100644 --- a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-luatex.def +++ b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-luatex.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {LuaLaTeX adapter (CTEX)} \ProvidesExplFile{ctex-engine-luatex.def} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} \msg_new:nnn { ctex } { luatexja-loaded } { Package~`luatexja'~can~not~be~loaded~before~`ctex'.\\ @@ -171,7 +171,7 @@ } \exp_after:wN \globaljfont \font@name \external@font \scan_stop: \font@name - \ctex_lua_now_x:n { font.current(tex.attribute['ltj@curjfnt']) } + \ctex_lua_now_x:n { font.current(tex.getattribute('ltj@curjfnt')) } \use:c { \f@encoding + \f@family } \use:c { \curr@fontshape } } diff --git a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-pdftex.def b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-pdftex.def index acaafe40e19..8b8d9f876cb 100644 --- a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-pdftex.def +++ b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-pdftex.def @@ -26,10 +26,59 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {(pdf)LaTeX adapter (CTEX)} \ProvidesExplFile{ctex-engine-pdftex.def} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} +\seq_new:N \c__ctex_cmap_encoding_seq +\seq_set_from_clist:Nn \c__ctex_cmap_encoding_seq + { C19 , C10 , C00 , C09 , C40 , C60 } +\cs_new_protected_nopar:Npn \ctex_family_cmap:nn #1#2 + { + \cs_if_free:cF { #1 + #2 } + { + \seq_if_in:NnT \c__ctex_cmap_encoding_seq {#1} + { \tl_gput_right:cn { #1 + #2 } { \ctex_add_cmap:n {#1} } } + } + } +\cs_generate_variant:Nn \ctex_family_cmap:nn { x } +\cs_new_eq:NN \CTEX@Family@CMap \ctex_family_cmap:xn +\cs_new_protected_nopar:Npn \ctex_add_cmap:n #1 + { + \cs_if_free:NF \CJK@plane + { \ctex_add_cmap:cn { __ctex_add_cmap_ #1 \CJK@plane : } {#1} } + } +\cs_new_protected_nopar:Npn \ctex_add_cmap:Nn #1#2 + { + \cs_if_exist:NF #1 { \__ctex_save_cmap:Nn #1 {#2} } + #1 + } +\cs_generate_variant:Nn \ctex_add_cmap:Nn { c } +\cs_new_protected_nopar:Npn \__ctex_save_cmap:Nn #1#2 + { + \tex_lowercase:D { \tl_set:Nx \l__ctex_tmp_tl { #2 \CJK@plane } } + \tex_immediate:D \pdfobj stream ~ file { \l__ctex_tmp_tl .cmap } + \cs_new_protected_nopar:Npx #1 + { + \exp_not:N \pdffontattr \exp_not:N \font + { /ToUnicode ~ \int_use:N \pdflastobj \c_space_tl 0 ~ R } + } + } +\group_begin: +\char_set_catcode_other:N \# +\ctex_if_pdfmode:TF + { + \group_end: + \ExplSyntaxOff + \ctex_appto_cmd:NnTF \DeclareFontFamily { \CTEX@Family@CMap {#1} {#2} } + { + \ctex_at_end_package:nn { cmap } + { \cs_gset_eq:NN \CTEX@Family@CMap \use_none:nn } + } + { \ctex_patch_failure:N \DeclareFontFamily } + \ExplSyntaxOn + } + { \group_end: } \if_bool:N \g__ctex_zhmCJK_bool \PassOptionsToPackage { encoding = \l__ctex_encoding_tl } { zhmCJK } \RequirePackage { zhmCJK } @@ -127,7 +176,7 @@ } \cs_new_protected_nopar:Npn \ctex_set_ignorespaces: { \cs_set_eq:NN \CJK@ignorespaces \ctex_auto_ignorespaces: } -\ctex_add_hook:Nn \CJKhook { \ctex_set_ignorespaces: } +\ctex_gadd_hook:Nn \CJKhook { \ctex_set_ignorespaces: } \cs_new_protected_nopar:Npn \ctex_punct_set:n #1 { \clist_map_inline:Nn \c__ctex_punct_family_clist @@ -233,7 +282,7 @@ { \tl_gset:Nn \g__ctex_fontset_tl {#1} } { \tl_gset:Nn \g__ctex_fontset_tl {#2} } } -\tl_const:Nn \c__ctex_macosx_file_tl { /mach_kernel } +\tl_const:Nn \c__ctex_macosx_file_tl { /Library/Fonts/Songti.ttc } \ctex_hypersetup:n { driverfallback = dvipdfmx } \str_if_eq:onTF { \l__ctex_encoding_tl } { GBK } { @@ -253,11 +302,14 @@ } } { \ctex_hypersetup:n { pdfencoding = unicode } } -\RequirePackage { CJKfntef } \normalem +\RequirePackage { CJKfntef } +\normalem +\cs_new_protected_nopar:Npn \__ctex_clear_fntef_color:n #1 + { \tl_clear:c { CJK#1color } } \clist_map_inline:nn { underdot , underline , underdblline , underwave , sout , xout } { - \tl_clear:c { CJK#1color } + \__ctex_clear_fntef_color:n {#1} \cs_new_protected_nopar:cpx { CTEX#1 } { \msg_warning:nnnn { ctex } { deprecated-command } { \exp_not:c { CTEX#1 } } diff --git a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-xetex.def b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-xetex.def index 138f0e14797..11f036799e0 100644 --- a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-xetex.def +++ b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-xetex.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {XeLaTeX adapter (CTEX)} \ProvidesExplFile{ctex-engine-xetex.def} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} \RequirePackage { xeCJK } \exp_args:Nx \xeCJKsetup { @@ -64,13 +64,23 @@ { \tl_gset:Nn \g__ctex_fontset_tl {#1} } { \tl_gset:Nn \g__ctex_fontset_tl {#2} } } -\tl_const:Nn \c__ctex_macosx_file_tl { /mach_kernel } +\tl_const:Nn \c__ctex_macosx_file_tl { /Library/Fonts/Songti.ttc } \ctex_hypersetup:n { pdfencoding = unicode } \RequirePackage { xeCJKfntef } +\@ifpackagelater { xeCJKfntef } { 2014/11/04 } + { + + \cs_new_protected_nopar:Npn \__ctex_clear_fntef_color:n #1 + { \xeCJKsetup { #1 / format = { } } } + } + { + \cs_new_protected_nopar:Npn \__ctex_clear_fntef_color:n #1 + { \tl_clear:c { CJK#1color } } + } \clist_map_inline:nn { underdot , underline , underdblline , underwave , sout , xout } { - \keys_set:nn { xeCJK / options } { #1 / format = { } } + \__ctex_clear_fntef_color:n {#1} \cs_new_protected_nopar:cpx { CTEX#1 } { \msg_warning:nnnn { ctex } { deprecated-command } { \exp_not:c { CTEX#1 } } diff --git a/Master/texmf-dist/tex/latex/ctex/fd/c19rm.fd b/Master/texmf-dist/tex/latex/ctex/fd/c19rm.fd index a2f2a1b9831..30d2f7fce75 100644 --- a/Master/texmf-dist/tex/latex/ctex/fd/c19rm.fd +++ b/Master/texmf-dist/tex/latex/ctex/fd/c19rm.fd @@ -27,7 +27,7 @@ %% ------------------------------------------------------------------------------ %% \ProvidesFile{c19rm.fd}% - [2015/05/15 v2.0.2 Chinese font definition (CTEX)] + [2015/05/15 v2.1 Chinese font definition (CTEX)] %% %% Chinese characters %% diff --git a/Master/texmf-dist/tex/latex/ctex/fd/c19sf.fd b/Master/texmf-dist/tex/latex/ctex/fd/c19sf.fd index ddd788a1e39..704ad030883 100644 --- a/Master/texmf-dist/tex/latex/ctex/fd/c19sf.fd +++ b/Master/texmf-dist/tex/latex/ctex/fd/c19sf.fd @@ -27,7 +27,7 @@ %% ------------------------------------------------------------------------------ %% \ProvidesFile{c19sf.fd}% - [2015/05/15 v2.0.2 Chinese font definition (CTEX)] + [2015/05/15 v2.1 Chinese font definition (CTEX)] %% %% Chinese characters %% diff --git a/Master/texmf-dist/tex/latex/ctex/fd/c19tt.fd b/Master/texmf-dist/tex/latex/ctex/fd/c19tt.fd index dc38700e6bc..0986f6b8be2 100644 --- a/Master/texmf-dist/tex/latex/ctex/fd/c19tt.fd +++ b/Master/texmf-dist/tex/latex/ctex/fd/c19tt.fd @@ -27,7 +27,7 @@ %% ------------------------------------------------------------------------------ %% \ProvidesFile{c19tt.fd}% - [2015/05/15 v2.0.2 Chinese font definition (CTEX)] + [2015/05/15 v2.1 Chinese font definition (CTEX)] %% %% Chinese characters %% diff --git a/Master/texmf-dist/tex/latex/ctex/fd/c70rm.fd b/Master/texmf-dist/tex/latex/ctex/fd/c70rm.fd index 263726b5cff..914baac86f3 100644 --- a/Master/texmf-dist/tex/latex/ctex/fd/c70rm.fd +++ b/Master/texmf-dist/tex/latex/ctex/fd/c70rm.fd @@ -27,7 +27,7 @@ %% ------------------------------------------------------------------------------ %% \ProvidesFile{c70rm.fd}% - [2015/05/15 v2.0.2 Chinese font definition (CTEX)] + [2015/05/15 v2.1 Chinese font definition (CTEX)] %% %% Chinese characters %% diff --git a/Master/texmf-dist/tex/latex/ctex/fd/c70sf.fd b/Master/texmf-dist/tex/latex/ctex/fd/c70sf.fd index 198ceb4f04f..492cf166309 100644 --- a/Master/texmf-dist/tex/latex/ctex/fd/c70sf.fd +++ b/Master/texmf-dist/tex/latex/ctex/fd/c70sf.fd @@ -27,7 +27,7 @@ %% ------------------------------------------------------------------------------ %% \ProvidesFile{c70sf.fd}% - [2015/05/15 v2.0.2 Chinese font definition (CTEX)] + [2015/05/15 v2.1 Chinese font definition (CTEX)] %% %% Chinese characters %% diff --git a/Master/texmf-dist/tex/latex/ctex/fd/c70tt.fd b/Master/texmf-dist/tex/latex/ctex/fd/c70tt.fd index a1a2a6fb968..305df75675f 100644 --- a/Master/texmf-dist/tex/latex/ctex/fd/c70tt.fd +++ b/Master/texmf-dist/tex/latex/ctex/fd/c70tt.fd @@ -27,7 +27,7 @@ %% ------------------------------------------------------------------------------ %% \ProvidesFile{c70tt.fd}% - [2015/05/15 v2.0.2 Chinese font definition (CTEX)] + [2015/05/15 v2.1 Chinese font definition (CTEX)] %% %% Chinese characters %% diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-adobe.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-adobe.def index 801dacb47f1..5fd609c3abf 100644 --- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-adobe.def +++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-adobe.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {Adobe fonts definition (CTEX)} \ProvidesExplFile{ctex-fontset-adobe.def} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} \pdftex_if_engine:TF { \ctex_if_pdfmode:TF diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-fandol.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-fandol.def index 90d7e04c293..bcdabfb49ff 100644 --- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-fandol.def +++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-fandol.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {Fandol fonts definition (CTEX)} \ProvidesExplFile{ctex-fontset-fandol.def} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} \pdftex_if_engine:TF { \ctex_if_pdfmode:TF diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-founder.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-founder.def index cbf9434afd2..715bd19771b 100644 --- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-founder.def +++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-founder.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {Founder fonts definition (CTEX)} \ProvidesExplFile{ctex-fontset-founder.def} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} \pdftex_if_engine:TF { \ctex_zhmap_case:nnn diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-mac.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-mac.def index a8038e84f00..041926b2c35 100644 --- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-mac.def +++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-mac.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {Mac OS X fonts definition (CTEX)} \ProvidesExplFile{ctex-fontset-mac.def} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} \pdftex_if_engine:TF { \ctex_fontset_error:n { mac } } { diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-ubuntu.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-ubuntu.def index 0c930c754b3..b24ab4be269 100644 --- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-ubuntu.def +++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-ubuntu.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {Ubuntu fonts definition (CTEX)} \ProvidesExplFile{ctex-fontset-ubuntu.def} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} \pdftex_if_engine:TF { \ctex_zhmap_case:nnn @@ -58,7 +58,8 @@ { \ctex_fontset_error:n { ubuntu } } } { - \setCJKmainfont [ ItalicFont = AR~PL~UKai~CN ] { AR~PL~UMing~CN } + \setCJKmainfont + [ BoldFont = WenQuanYi~Zen~Hei , ItalicFont = AR~PL~UKai~CN ] { AR~PL~UMing~CN } \setCJKsansfont { WenQuanYi~Zen~Hei } \setCJKmonofont { AR~PL~UMing~CN } \setCJKfamilyfont { zhsong } { AR~PL~UMing~CN } diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windows.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windows.def index f3b7dfb6b47..296514caca3 100644 --- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windows.def +++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windows.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {Windows fonts definition (CTEX)} \ProvidesExplFile{ctex-fontset-windows.def} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} \file_if_exist:nTF { C:/boot.ini } { \ctex_file_input:n { ctex-fontset-windowsold.def } } { \ctex_file_input:n { ctex-fontset-windowsnew.def } } diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsnew.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsnew.def index 2a00e97336c..bd52407f505 100644 --- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsnew.def +++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsnew.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {Windows fonts definition for Vista or later version (CTEX)} \ProvidesExplFile{ctex-fontset-windowsnew.def} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} \pdftex_if_engine:TF { \ctex_zhmap_case:nnn diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsold.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsold.def index 1a45fc950c4..6156c9e30e8 100644 --- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsold.def +++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsold.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {Windows fonts definition for XP or earlier version (CTEX)} \ProvidesExplFile{ctex-fontset-windowsold.def} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} \pdftex_if_engine:TF { \ctex_zhmap_case:nnn diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-article.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-article.def index 3a0fa752e60..b21208988d8 100644 --- a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-article.def +++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-article.def @@ -26,15 +26,16 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {Chinese scheme for article (CTEX)} \ProvidesExplFile{ctex-scheme-chinese-article.def} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} \keys_set:nn { ctex / part } { + aftertitle = \par , + number = \chinese { part } , nameformat = \Large \bfseries , afterskip = 3ex , - number = \chinese { part } , format = \centering , aftername = \quad , titleformat = \Large \bfseries , @@ -44,6 +45,7 @@ { number = \thesection , aftername = \quad , + aftertitle = \@@par , afterskip = 2.3ex \@plus .2ex , format = \Large \bfseries \centering , beforeskip = 3.5ex \@plus 1ex \@minus .2ex @@ -53,6 +55,7 @@ number = \thesubsection , format = \large \bfseries , aftername = \quad , + aftertitle = \@@par , afterskip = 1.5ex \@plus .2ex , beforeskip = 3.25ex \@plus 1ex \@minus .2ex } @@ -61,6 +64,7 @@ number = \thesubsubsection , format = \normalsize \bfseries , aftername = \quad , + aftertitle = \@@par , afterskip = 1.5ex \@plus .2ex , beforeskip = 3.25ex \@plus 1ex \@minus .2ex } @@ -80,6 +84,7 @@ { \keys_set:nn { ctex / paragraph } { + aftertitle = \@@par , beforeskip = 3.25ex \@plus 1ex \@minus .2ex , afterskip = 1ex \@plus .2ex } @@ -95,6 +100,7 @@ { \keys_set:nn { ctex / subparagraph } { + aftertitle = \@@par , beforeskip = 3.25ex \@plus 1ex \@minus .2ex , afterskip = 1ex \@plus .2ex } diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-book.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-book.def index d44baaf59f3..2d83f7e708f 100644 --- a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-book.def +++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-book.def @@ -26,12 +26,14 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {Chinese scheme for book (CTEX)} \ProvidesExplFile{ctex-scheme-chinese-book.def} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} \keys_set:nn { ctex / part } { + aftertitle = \par , + number = \chinese { part } , format = \centering , nameformat = \huge \bfseries , aftername = \par \vskip 20 \p@ , @@ -42,6 +44,7 @@ { pagestyle = plain , nameformat = \huge \bfseries , + aftertitle = \par , afterskip = 40 \p@ , number = \chinese { chapter } , format = \centering , @@ -53,6 +56,7 @@ { number = \thesection , aftername = \quad , + aftertitle = \@@par , afterskip = 2.3ex \@plus .2ex , format = \Large \bfseries \centering , beforeskip = 3.5ex \@plus 1ex \@minus .2ex @@ -62,6 +66,7 @@ number = \thesubsection , format = \large \bfseries , aftername = \quad , + aftertitle = \@@par , afterskip = 1.5ex \@plus .2ex , beforeskip = 3.25ex \@plus 1ex \@minus .2ex } @@ -70,6 +75,7 @@ number = \thesubsubsection , format = \normalsize \bfseries , aftername = \quad , + aftertitle = \@@par , afterskip = 1.5ex \@plus .2ex , beforeskip = 3.25ex \@plus 1ex \@minus .2ex } @@ -89,6 +95,7 @@ { \keys_set:nn { ctex / paragraph } { + aftertitle = \@@par , beforeskip = 3.25ex \@plus 1ex \@minus .2ex , afterskip = 1ex \@plus .2ex } @@ -104,6 +111,7 @@ { \keys_set:nn { ctex / subparagraph } { + aftertitle = \@@par , beforeskip = 3.25ex \@plus 1ex \@minus .2ex , afterskip = 1ex \@plus .2ex } diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-report.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-report.def index 0b723c70b6d..0bf4aa05931 100644 --- a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-report.def +++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-report.def @@ -26,12 +26,14 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {Chinese scheme for report (CTEX)} \ProvidesExplFile{ctex-scheme-chinese-report.def} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} \keys_set:nn { ctex / part } { + aftertitle = \par , + number = \chinese { part } , format = \centering , nameformat = \huge \bfseries , aftername = \par \vskip 20 \p@ , @@ -42,6 +44,7 @@ { pagestyle = plain , nameformat = \huge \bfseries , + aftertitle = \par , afterskip = 40 \p@ , number = \chinese { chapter } , format = \centering , @@ -53,6 +56,7 @@ { number = \thesection , aftername = \quad , + aftertitle = \@@par , afterskip = 2.3ex \@plus .2ex , format = \Large \bfseries \centering , beforeskip = 3.5ex \@plus 1ex \@minus .2ex @@ -62,6 +66,7 @@ number = \thesubsection , format = \large \bfseries , aftername = \quad , + aftertitle = \@@par , afterskip = 1.5ex \@plus .2ex , beforeskip = 3.25ex \@plus 1ex \@minus .2ex } @@ -70,6 +75,7 @@ number = \thesubsubsection , format = \normalsize \bfseries , aftername = \quad , + aftertitle = \@@par , afterskip = 1.5ex \@plus .2ex , beforeskip = 3.25ex \@plus 1ex \@minus .2ex } @@ -89,6 +95,7 @@ { \keys_set:nn { ctex / paragraph } { + aftertitle = \@@par , beforeskip = 3.25ex \@plus 1ex \@minus .2ex , afterskip = 1ex \@plus .2ex } @@ -104,6 +111,7 @@ { \keys_set:nn { ctex / subparagraph } { + aftertitle = \@@par , beforeskip = 3.25ex \@plus 1ex \@minus .2ex , afterskip = 1ex \@plus .2ex } diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese.def index fbe8be476d4..b3be5572070 100644 --- a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese.def +++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {Chinese scheme for generic (CTEX)} \ProvidesExplFile{ctex-scheme-chinese.def} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} \str_if_eq:onTF { \l__ctex_encoding_tl } { GBK } { \ctex_file_input:n { ctex-name-gbk.cfg } } { \ctex_file_input:n { ctex-name-utf8.cfg } } @@ -40,11 +40,8 @@ { \keys_set:nn { ctex / option } { linespread = 1.3 } } \ctex_if_autoindent_touched:F { \keys_set:nn { ctex } { autoindent = true } } -\clist_map_inline:nn { article , book , report } - { - \@ifclassloaded {#1} - { \RequirePackage{ indentfirst } } { } - } +\tl_if_exist:NT \c__ctex_std_class_tl + { \RequirePackage{ indentfirst } } %% %% %% End of file `ctex-scheme-chinese.def'. diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-article.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-article.def index 0596bf66e9e..752fefd584d 100644 --- a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-article.def +++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-article.def @@ -26,12 +26,13 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {Plain scheme for article (CTEX)} \ProvidesExplFile{ctex-scheme-plain-article.def} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} \keys_set:nn { ctex / part } { + aftertitle = \par , name = \partname \space , number = \thepart , nameformat = \Large \bfseries , @@ -45,6 +46,7 @@ { number = \thesection , aftername = \quad , + aftertitle = \@@par , afterskip = 2.3ex \@plus .2ex , format = \Large \bfseries , beforeskip = -3.5ex \@plus -1ex \@minus -.2ex @@ -54,6 +56,7 @@ number = \thesubsection , format = \large \bfseries , aftername = \quad , + aftertitle = \@@par , afterskip = 1.5ex \@plus .2ex , beforeskip = -3.25ex \@plus -1ex \@minus -.2ex } @@ -62,6 +65,7 @@ number = \thesubsubsection , format = \normalsize \bfseries , aftername = \quad , + aftertitle = \@@par , afterskip = 1.5ex \@plus .2ex , beforeskip = -3.25ex \@plus -1ex \@minus -.2ex } @@ -81,6 +85,7 @@ { \keys_set:nn { ctex / paragraph } { + aftertitle = \@@par , beforeskip = -3.25ex \@plus -1ex \@minus -.2ex , afterskip = 1ex \@plus .2ex } @@ -96,6 +101,7 @@ { \keys_set:nn { ctex / subparagraph } { + aftertitle = \@@par , beforeskip = -3.25ex \@plus -1ex \@minus -.2ex , afterskip = 1ex \@plus .2ex } diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-book.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-book.def index 9f0898b3b42..202db21f8c7 100644 --- a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-book.def +++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-book.def @@ -26,12 +26,13 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {Plain scheme for book (CTEX)} \ProvidesExplFile{ctex-scheme-plain-book.def} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} \keys_set:nn { ctex / part } { + aftertitle = \par , name = \partname \space , number = \thepart , format = \centering , @@ -44,6 +45,7 @@ { pagestyle = plain , nameformat = \huge \bfseries , + aftertitle = \par , afterskip = 40 \p@ , name = \chaptername \space , number = \thechapter , @@ -56,6 +58,7 @@ { number = \thesection , aftername = \quad , + aftertitle = \@@par , afterskip = 2.3ex \@plus .2ex , format = \Large \bfseries , beforeskip = -3.5ex \@plus -1ex \@minus -.2ex @@ -65,6 +68,7 @@ number = \thesubsection , format = \large \bfseries , aftername = \quad , + aftertitle = \@@par , afterskip = 1.5ex \@plus .2ex , beforeskip = -3.25ex \@plus -1ex \@minus -.2ex } @@ -73,6 +77,7 @@ number = \thesubsubsection , format = \normalsize \bfseries , aftername = \quad , + aftertitle = \@@par , afterskip = 1.5ex \@plus .2ex , beforeskip = -3.25ex \@plus -1ex \@minus -.2ex } @@ -92,6 +97,7 @@ { \keys_set:nn { ctex / paragraph } { + aftertitle = \@@par , beforeskip = -3.25ex \@plus -1ex \@minus -.2ex , afterskip = 1ex \@plus .2ex } @@ -107,6 +113,7 @@ { \keys_set:nn { ctex / subparagraph } { + aftertitle = \@@par , beforeskip = -3.25ex \@plus -1ex \@minus -.2ex , afterskip = 1ex \@plus .2ex } diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-report.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-report.def index e7fa5adda1e..fac90d7aea7 100644 --- a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-report.def +++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-report.def @@ -26,12 +26,13 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {Plain scheme for report (CTEX)} \ProvidesExplFile{ctex-scheme-plain-report.def} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} \keys_set:nn { ctex / part } { + aftertitle = \par , name = \partname \space , number = \thepart , format = \centering , @@ -44,6 +45,7 @@ { pagestyle = plain , nameformat = \huge \bfseries , + aftertitle = \par , afterskip = 40 \p@ , name = \chaptername \space , number = \thechapter , @@ -56,6 +58,7 @@ { number = \thesection , aftername = \quad , + aftertitle = \@@par , afterskip = 2.3ex \@plus .2ex , format = \Large \bfseries , beforeskip = -3.5ex \@plus -1ex \@minus -.2ex @@ -65,6 +68,7 @@ number = \thesubsection , format = \large \bfseries , aftername = \quad , + aftertitle = \@@par , afterskip = 1.5ex \@plus .2ex , beforeskip = -3.25ex \@plus -1ex \@minus -.2ex } @@ -73,6 +77,7 @@ number = \thesubsubsection , format = \normalsize \bfseries , aftername = \quad , + aftertitle = \@@par , afterskip = 1.5ex \@plus .2ex , beforeskip = -3.25ex \@plus -1ex \@minus -.2ex } @@ -92,6 +97,7 @@ { \keys_set:nn { ctex / paragraph } { + aftertitle = \@@par , beforeskip = -3.25ex \@plus -1ex \@minus -.2ex , afterskip = 1ex \@plus .2ex } @@ -107,6 +113,7 @@ { \keys_set:nn { ctex / subparagraph } { + aftertitle = \@@par , beforeskip = -3.25ex \@plus -1ex \@minus -.2ex , afterskip = 1ex \@plus .2ex } diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain.def index ef554f86843..7823ef28251 100644 --- a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain.def +++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee $ {Plain scheme for generic (CTEX)} \ProvidesExplFile{ctex-scheme-plain.def} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} %% %% %% End of file `ctex-scheme-plain.def'. -- cgit v1.2.3