summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-02-03 22:59:51 +0000
committerKarl Berry <karl@freefriends.org>2016-02-03 22:59:51 +0000
commit1290d7454b9754f3c7a7e4a229981e18f58ea6f6 (patch)
treeaa01beb72d34acd81690358b54be7493a5244544 /Master
parente5ef88072190f4f0e310c900fd626db1dd7dc096 (diff)
ctex (3feb16)
git-svn-id: svn://tug.org/texlive/trunk@39559 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/latex/ctex/ctex.pdfbin942922 -> 985726 bytes
-rw-r--r--Master/texmf-dist/source/latex/ctex/ctex.dtx822
-rw-r--r--Master/texmf-dist/source/latex/ctex/ctexpunct.spa2
-rw-r--r--Master/texmf-dist/tex/generic/ctex/ctexspamacro.tex6
-rw-r--r--Master/texmf-dist/tex/generic/ctex/zhadobefonts.tex2
-rw-r--r--Master/texmf-dist/tex/generic/ctex/zhfandolfonts.tex2
-rw-r--r--Master/texmf-dist/tex/generic/ctex/zhfounderfonts.tex2
-rw-r--r--Master/texmf-dist/tex/generic/ctex/zhubuntufonts.tex2
-rw-r--r--Master/texmf-dist/tex/generic/ctex/zhwindowsfonts.tex2
-rw-r--r--Master/texmf-dist/tex/latex/ctex/config/ctex-name-gbk.cfg4
-rw-r--r--Master/texmf-dist/tex/latex/ctex/config/ctex-name-utf8.cfg4
-rw-r--r--Master/texmf-dist/tex/latex/ctex/config/ctex.cfg4
-rw-r--r--Master/texmf-dist/tex/latex/ctex/config/ctexopts.cfg4
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctex-article.def104
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctex-book.def106
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctex-c5size.clo4
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctex-cs4size.clo4
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctex-report.def106
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctex.sty101
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctexart.cls196
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctexbook.cls198
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctexcap.sty4
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctexheading.sty8
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctexhook.sty4
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctexpatch.sty178
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctexrep.cls198
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctexsize.sty6
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctexspa.def4
-rw-r--r--Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-luatex.def236
-rw-r--r--Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-pdftex.def23
-rw-r--r--Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-xetex.def19
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fd/c19rm.fd2
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fd/c19sf.fd2
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fd/c19tt.fd2
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fd/c70rm.fd2
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fd/c70sf.fd2
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fd/c70tt.fd2
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-adobe.def8
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-fandol.def8
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-founder.def8
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-mac.def6
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-ubuntu.def6
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windows.def4
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsnew.def6
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsold.def6
-rw-r--r--Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-article.def4
-rw-r--r--Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-book.def4
-rw-r--r--Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-report.def4
-rw-r--r--Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese.def4
-rw-r--r--Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-article.def4
-rw-r--r--Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-book.def4
-rw-r--r--Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-report.def4
-rw-r--r--Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain.def4
53 files changed, 1373 insertions, 1078 deletions
diff --git a/Master/texmf-dist/doc/latex/ctex/ctex.pdf b/Master/texmf-dist/doc/latex/ctex/ctex.pdf
index e135914f912..e80031823d3 100644
--- a/Master/texmf-dist/doc/latex/ctex/ctex.pdf
+++ b/Master/texmf-dist/doc/latex/ctex/ctex.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/ctex/ctex.dtx b/Master/texmf-dist/source/latex/ctex/ctex.dtx
index 353a630cdd8..8a702ca8d30 100644
--- a/Master/texmf-dist/source/latex/ctex/ctex.dtx
+++ b/Master/texmf-dist/source/latex/ctex/ctex.dtx
@@ -2,7 +2,7 @@
% !TeX program = XeLaTeX
% !TeX encoding = UTF-8
%
-% Copyright (C) 2003--2015
+% Copyright (C) 2003--2016
% CTEX.ORG and any individual authors listed elsewhere in this file.
% --------------------------------------------------------------------------
%
@@ -478,7 +478,7 @@ This package consists of the file ctex.dtx, and the derived files
%<founder>\ProvidesExplFile{ctex-fontset-founder.def}
%<ubuntu> {Ubuntu fonts definition (CTEX)}
%<ubuntu>\ProvidesExplFile{ctex-fontset-ubuntu.def}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.3}{\ExplFileDescription}
%</!(c19|c70|ctexspa)>
%<rm&c19>\ProvidesFile{c19rm.fd}%
%<sf&c19>\ProvidesFile{c19sf.fd}%
@@ -487,8 +487,8 @@ This package consists of the file ctex.dtx, and the derived files
%<sf&c70>\ProvidesFile{c70sf.fd}%
%<tt&c70>\ProvidesFile{c70tt.fd}%
%<ctexspa>\ProvidesFile{ctexspa.def}%
-%<c19|c70> [2015/07/01 v2.2 Chinese font definition (CTEX)]
-%<ctexspa> [2015/07/01 v2.2 Space info for CJKpunct (CTEX)]
+%<c19|c70> [2016/02/02 v2.3 Chinese font definition (CTEX)]
+%<ctexspa> [2016/02/02 v2.3 Space info for CJKpunct (CTEX)]
%</!(readme|install|zhmap|spa)>
%<*driver>
\ExplSyntaxOff
@@ -772,7 +772,7 @@ This package consists of the file ctex.dtx, and the derived files
% \changes{v2.2}{2015/06/24}{不再依赖 \pkg{etoolbox} 宏包。}
%
%
-% \CheckSum{5026}
+% \CheckSum{5056}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -1704,7 +1704,6 @@ This package consists of the file ctex.dtx, and the derived files
%
% 多级选项之间用斜线分开,例如,\opt{part/name} 选项设置 \tn{part} 标题的在数
% 字前后的名称,而 \opt{section/number} 选项设置 \tn{section} 标题的数字类型。
-% 注意斜线前后都不要有空格。
%
% 使用 \tn{ctexset} 设置多级选项时,可以在同一个上级选项下设置多个下级选项。
%
@@ -2624,12 +2623,12 @@ This package consists of the file ctex.dtx, and the derived files
% \begin{ctexexam}
% % 略复杂的 ctex.cfg 内容示例:禁止段末孤字成行。
% % 在使用 XeTeX 编译时,打开 xeCJK 的 CheckSingle 选项。
-% \xetex_if_engine:T
+% \sys_if_engine_xetex:T
% {
% \xeCJKsetup { CheckSingle }
% }
% % 在使用 LuaTeX 编译时,设置 LuaTeX-ja 的 jcharwidowpenalty 参数。
-% \luatex_if_engine:T
+% \sys_if_engine_luatex:T
% {
% \ltjsetparameter { jcharwidowpenalty = 10000 }
% }
@@ -3003,9 +3002,14 @@ This package consists of the file ctex.dtx, and the derived files
%</class|style>
% \end{macrocode}
%
+% \begin{macrocode}
+%<*class|ctex>
+% \end{macrocode}
+%
+% \changes{v2.3}{2015/12/20}{与 \LaTeXiii{} (2015/12/20) 同步。}
+%
% 检查 \pkg{expl3} 和 \pkg{l3keys2e} 的版本。
% \begin{macrocode}
-%<*class>
\msg_new:nnnn { ctex } { l3-too-old }
{ Support~package~`#1'~too~old. }
{
@@ -3013,13 +3017,33 @@ This package consists of the file ctex.dtx, and the derived files
`l3kernel'~and~`l3packages'\\\\
using~your~TeX~package~manager~or~from~CTAN.
}
-\@ifpackagelater { expl3 } { 2014/07/20 } { }
+\@ifpackagelater { expl3 } { 2015/12/20 } { }
{ \msg_error:nnn { ctex } { l3-too-old } { expl3 } }
-\@ifpackagelater { l3keys2e } { 2014/05/05 } { }
+%<*class>
+\@ifpackagelater { l3keys2e } { 2015/12/20 } { }
{ \msg_error:nnn { ctex } { l3-too-old } { l3keys2e } }
%</class>
% \end{macrocode}
%
+% \begin{variable}[int]{\c_@@_engine_file_str}
+% 引擎检查,暂不支持 \pTeX{} 系。
+% \begin{macrocode}
+\msg_new:nnnn { ctex } { engine-not-supported }
+ { Engine~`#1'~is~not~yet~supported,~ctex~will~abort! }
+ { You~can~switch~to~xelatex,~lualatex~or~pdflatex.}
+\file_if_exist:nTF { ctex-engine- \c_sys_engine_str .def }
+ {
+ \str_const:Nx \c_@@_engine_file_str
+ { ctex-engine- \c_sys_engine_str .def }
+ }
+ { \msg_critical:nnx { ctex } { engine-not-supported } { \c_sys_engine_str } }
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macrocode}
+%</class|ctex>
+% \end{macrocode}
+%
% \begin{macrocode}
%<*class|ctex|ctexheading>
% \end{macrocode}
@@ -3114,31 +3138,14 @@ This package consists of the file ctex.dtx, and the derived files
}
% \end{macrocode}
%
-% \begin{macro}[int]{\ctex_lua_now_x:n}
-% 最新的 \pkg{expl3} 去掉了 \pkg{l3luatex} 模块,因而 \cs{lua_now_x:n} 不再有定义。
-% \begin{macrocode}
-\cs_new_eq:NN \ctex_lua_now_x:n \luatex_directlua:D
-% \end{macrocode}
-% \end{macro}
-%
% \changes{v2.1}{2015/05/25}{不依赖 \pkg{ifpdf} 宏包。}
%
-% \begin{macro}[int]{\ctex_if_pdfmode:TF}
-% \pkg{ifpdf} 宏包的简单实现。
+% \begin{macro}[int]{\ifctexpdf}
+% 在 \pkg{zhmetrics} 映射文件中使用。
% \begin{macrocode}
-\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
- }
+\sys_if_output_pdf:TF
+ { \cs_new_eq:NN \ifctexpdf \if_true: }
+ { \cs_new_eq:NN \ifctexpdf \if_false: }
% \end{macrocode}
% \end{macro}
%
@@ -3165,6 +3172,8 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
+% \changes{v2.3}{2015/09/17}{代码实现避免使用 \tn{lowercase} 技巧(Joseph Wright)。}
+%
% \begin{macro}[int]{\ctex_default_pt:n}
% 最新版本的 \pkg{expl3} 已经不允许 \cs{dim_to_decimal:n} 的参数带额外的单位。
% 然而我们需要这个特性实现可展的 \tn{@defaultunits}。
@@ -3174,13 +3183,11 @@ This package consists of the file ctex.dtx, and the derived files
\exp_after:wN \@@_default_pt:w
\dim_use:N \etex_dimexpr:D #1 pt \scan_stop: \q_stop
}
-\group_begin:
- \char_set_catcode_other:N \P
- \char_set_catcode_other:N \T
-\tex_lowercase:D
+\use:x
{
- \group_end:
- \cs_new:Npn \@@_default_pt:w #1 PT #2 \q_stop { #1 PT }
+ \cs_new:Npn \exp_not:N \@@_default_pt:w
+ ##1 \tl_to_str:n { pt } ##2 \exp_not:N \q_stop
+ { ##1 \tl_to_str:n { pt } }
}
% \end{macrocode}
% \end{macro}
@@ -3190,7 +3197,7 @@ This package consists of the file ctex.dtx, and the derived files
% \begin{macrocode}
\tl_new:N \l_@@_encoding_tl
\tl_set:Nx \l_@@_encoding_tl
- { \pdftex_if_engine:TF { GBK } { UTF8 } }
+ { \sys_if_engine_pdftex:TF { GBK } { UTF8 } }
% \end{macrocode}
% \end{variable}
%
@@ -3272,6 +3279,9 @@ This package consists of the file ctex.dtx, and the derived files
%
% \subsection{宏包选项}
%
+% \changes{v2.3}{2015/09/25}
+% {\texttt{.value_required:} 和 \texttt{.value_forbidden:} 已过时。}
+%
% \begin{macrocode}
%<*class|style>
\keys_define:nn { ctex / option }
@@ -3305,8 +3315,8 @@ This package consists of the file ctex.dtx, and the derived files
{ Option~ `zihao=-4'~ is~ set. }
\keys_set:nn { ctex / option } { zihao = -4 }
} ,
- c5size .value_forbidden: ,
- cs4size .value_forbidden: ,
+ c5size .value_forbidden:n = true ,
+ cs4size .value_forbidden:n = true ,
% \end{macrocode}
% \end{macro}
%
@@ -3317,7 +3327,7 @@ This package consists of the file ctex.dtx, and the derived files
% \begin{macrocode}
linespread .fp_set:N = \l_@@_line_spread_fp ,
linespread .initial:n = { \c_nan_fp } ,
- linespread .value_required: ,
+ linespread .value_required:n = true ,
% \end{macrocode}
% \end{macro}
%
@@ -3359,7 +3369,7 @@ This package consists of the file ctex.dtx, and the derived files
options.~
}
} ,
- indent .value_forbidden: ,
+ indent .value_forbidden:n = true ,
noindent .code:n =
{
\msg_warning:nnn { ctex } { deprecated-option }
@@ -3369,7 +3379,7 @@ This package consists of the file ctex.dtx, and the derived files
options.
}
} ,
- noindent .value_forbidden: ,
+ noindent .value_forbidden:n = true ,
% \end{macrocode}
% \end{macro}
%
@@ -3377,8 +3387,8 @@ This package consists of the file ctex.dtx, and the derived files
% \begin{macrocode}
GBK .code:n = { \tl_set:Nn \l_@@_encoding_tl { GBK } } ,
UTF8 .code:n = { \tl_set:Nn \l_@@_encoding_tl { UTF8 } } ,
- GBK .value_forbidden: ,
- UTF8 .value_forbidden: ,
+ GBK .value_forbidden:n = true ,
+ UTF8 .value_forbidden:n = true ,
% \end{macrocode}
% \end{macro}
%
@@ -3418,9 +3428,9 @@ This package consists of the file ctex.dtx, and the derived files
}
\keys_set:nn { ctex / option } { fontset = windows }
} ,
- nofonts .value_forbidden: ,
- winfonts .value_forbidden: ,
- adobefonts .value_forbidden: ,
+ nofonts .value_forbidden:n = true ,
+ winfonts .value_forbidden:n = true ,
+ adobefonts .value_forbidden:n = true ,
% \end{macrocode}
% \end{macro}
%
@@ -3452,7 +3462,7 @@ This package consists of the file ctex.dtx, and the derived files
{ Option~ `zhmap=false'~ is~ set. }
\keys_set:nn { ctex / option } { zhmap = false }
} ,
- nozhmap .value_forbidden: ,
+ nozhmap .value_forbidden:n = true ,
% \end{macrocode}
% \end{macro}
%
@@ -3471,7 +3481,7 @@ This package consists of the file ctex.dtx, and the derived files
{ Option~ `punct=plain'~ is~ set. }
\keys_set:nn { ctex / option } { punct = plain }
} ,
- nopunct .value_forbidden: ,
+ nopunct .value_forbidden:n = true ,
% \end{macrocode}
% \end{macro}
%
@@ -3491,7 +3501,7 @@ This package consists of the file ctex.dtx, and the derived files
{ Option~ `space=false'~ is~ set. }
\keys_set:nn { ctex / option } { space = false }
} ,
- nospace .value_forbidden: ,
+ nospace .value_forbidden:n = true ,
% \end{macrocode}
% \end{macro}
%
@@ -3514,8 +3524,8 @@ This package consists of the file ctex.dtx, and the derived files
{ \cs_gset_eq:NN \g_@@_section_depth_flag \c_three } ,
sub4section .code:n =
{ \cs_gset_eq:NN \g_@@_section_depth_flag \c_four } ,
- sub3section .value_forbidden: ,
- sub4section .value_forbidden: ,
+ sub3section .value_forbidden:n = true ,
+ sub4section .value_forbidden:n = true ,
% \end{macrocode}
% \end{macro}
%
@@ -3553,8 +3563,8 @@ This package consists of the file ctex.dtx, and the derived files
{ Option~ `scheme = plain' ~ is~ set. }
\keys_set:nn { ctex / option } { scheme = plain }
} ,
- cap .value_forbidden: ,
- nocap .value_forbidden: ,
+ cap .value_forbidden:n = true ,
+ nocap .value_forbidden:n = true ,
% \end{macrocode}
% \end{macro}
%
@@ -3622,7 +3632,7 @@ This package consists of the file ctex.dtx, and the derived files
\clist_gput_right:Nn \g_@@_std_options_clist {#1}
} ,
%</class>
- #1 .value_forbidden: ,
+ #1 .value_forbidden:n = true ,
}
}
\use:x { \keys_define:nn { ctex / option } { \exp_not:o { \l_@@_tmp_tl } } }
@@ -3772,7 +3782,7 @@ This package consists of the file ctex.dtx, and the derived files
\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 } }
+ \tl_set:Nx \l_@@_tmp_tl { \str_lower_case:n {#2} \CJK@plane }
\tex_immediate:D \pdfobj stream ~ file { \l_@@_tmp_tl .cmap }
\cs_new_protected_nopar:Npx #1
{
@@ -3788,7 +3798,7 @@ This package consists of the file ctex.dtx, and the derived files
% \begin{macrocode}
\group_begin:
\char_set_catcode_other:N \#
-\ctex_if_pdfmode:TF
+\sys_if_output_pdf:TF
{
\group_end:
\ctex_appto_cmd:NnnTF \DeclareFontFamily { \ExplSyntaxOff }
@@ -4146,6 +4156,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
%
% \changes{v2.0}{2014/03/08}{通过 \pkg{LuaTeX-ja} 宏包支持 \LuaLaTeX。}
+% \changes{v2.3}{2015/09/25}{更新 \pkg{LuaTeX-ja} 支持(20150922.0)。}
%
% \pkg{LuaTeX-ja} 为了兼容 p\LaTeX 的使用习惯,对 \LaTeXe 的 \pkg{NFSS} 作了不少
% 修改和扩充,这对于简体中文用户来说不是必要的。我们在这里禁用它。
@@ -4162,7 +4173,7 @@ This package consists of the file ctex.dtx, and the derived files
%
% \begin{macrocode}
\RequirePackage { luatexja }
-\@ifpackagelater { luatexja-core } { 2015/02/22 } { }
+\@ifpackagelater { luatexja } { 2015/09/21 } { }
{ \msg_error:nnn { ctex } { package-too-old } { luatexja } }
% \end{macrocode}
%
@@ -4196,7 +4207,7 @@ This package consists of the file ctex.dtx, and the derived files
"1100-"11FF, "2F00-"2FFF, "3100-"31EF, "A000-"A4CF, "A830-"A83F,
"AC00-"D7FF}
\ltjdefcharrange{8}{"A7, "A8, "B0, "B1, "B4, "B6, "D7, "F7}
-\ltjsetparameter{jacharrange={-1, +2, +3, -4, -5, +6, +7, +8}}
+\ltjsetparameter{jacharrange={-1, +2, +3, -4, -5, +6, +7, -8}}
\directlua{for x=128,255 do luatexja.math.is_math_letters[x] = true end}
% \end{macrocode}
%
@@ -4224,6 +4235,8 @@ This package consists of the file ctex.dtx, and the derived files
%<@@=ctex_ltj>
% \end{macrocode}
%
+% \changes{v2.3}{2015/09/26}{更新 \pkg{unicode-math} 宏包补丁。}
+%
% 在 \LaTeX{} 下,\pkg{LuaTeX-ja} 对 \pkg{fontspec}、\pkg{xunicode}、\pkg{unicode-math}
% 和 \pkg{listings} 打了补丁。其中前三个是把 \tn{char} 换成 \tn{ltjalchar},确保
% 字符是 ALchar 类。我们这里用 \pkg{xunicode-addon} 来处理 \pkg{xunicode}。
@@ -4232,7 +4245,7 @@ This package consists of the file ctex.dtx, and the derived files
\AtBeginUTFCommand
{
\group_begin:
- \ctex_lua_now_x:n { tex.globaldefs = 0 }
+ \lua_now_x:n { tex.globaldefs = 0 }
\ltj@allalchar
}
\AtEndUTFCommand { \group_end: }
@@ -4244,31 +4257,52 @@ This package consists of the file ctex.dtx, and the derived files
% \pkg{lltjp-unicode-math} 让数学符号命令成为普通的文字宏。为了避免它被展开,应该
% 用 \tn{protected} 来定义。
% \begin{macrocode}
-\group_begin:
-\char_set_catcode_other:n { \c_zero }
-\cs_new_protected:Npn \@@_um_char:Nw #1 = #2 \q_nil
+\cs_new_protected_nopar:Npn \@@_um_define_math_chars:
{
\group_begin:
- \char_set_lccode:nn { \c_zero } {#2}
- \tex_lowercase:D
+ \cs_set_protected:Npn \__um_sym:nnn ##1##2##3
{
- \group_end:
- \cs_gset_protected_nopar:Npn #1
+ \tl_if_in:nnT
{
- \mode_if_math:TF { ^^@ }
- { {
- \ctex_lua_now_x:n { tex.globaldefs = 0 }
- \ltj@allalchar ^^@
- } }
+ \mathord \mathalpha \mathbin \mathrel
+ \mathpunct \mathop \mathfence
}
+ { ##3 }
+ { \@@_um_char:Nn ##2 { ##1 } }
}
+ \__um_input_math_symbol_table:
+ \group_end:
+ }
+\cs_new_protected:Npn \@@_um_char:Nn #1#2
+ {
+ \@@_um_char_aux:Nx #1 { \char_generate:nn {#2} { 12 } }
\ltjsetmathletter {#2}
}
-\group_end:
+\cs_new_protected:Npn \@@_um_char_aux:Nn #1#2
+ {
+ \cs_gset_protected_nopar:Npn #1
+ {
+ \mode_if_math:TF
+ {#2}
+ {
+ {
+ \lua_now_x:n { tex.globaldefs = 0 }
+ \ltj@allalchar #2
+ }
+ }
+ }
+ }
+\cs_generate_variant:Nn \@@_um_char_aux:Nn { Nx }
\ctex_at_end_package:nn { unicode-math }
{
- \cs_if_free:NF \um_cs_set_eq_active_char:Nw
- { \cs_set_eq:NN \um_cs_set_eq_active_char:Nw \@@_um_char:Nw }
+ \cs_set_eq:NN \__um_define_math_chars: \@@_um_define_math_chars:
+ \@ifpackagelater { unicode-math } { 2015/06/28 }
+ {
+ \cs_set_eq:NN \use@mathgroup \ctex_ltj_use_math_group:Nn
+ \cs_set_protected_nopar:Npn \ctex_ltj_math_group_hook:
+ { \__um_switchto_literal: }
+ }
+ { }
}
% \end{macrocode}
% 对 \pkg{listings} 的补丁是让代码环境支持 JAchar 类。\pkg{LuaTeX-ja} 的补丁会将
@@ -4359,17 +4393,19 @@ This package consists of the file ctex.dtx, and the derived files
% \pkg{LuaTeX-ja} 的 \tn{globaljfont} 在 \pkg{luatexja-core} 中定义:
% \begin{verbatim}
% %%%%%%%% \jfont\CS={...:...;jfm=metric;...}, \globaljfont
-% \protected\def\jfont{%
-% \afterassignment\ltj@@jfont\directlua{luatexja.jfont.jfontdefX(false, 'yoko')}}
-% \protected\def\globaljfont{%
-% \afterassignment\ltj@@jfont\directlua{luatexja.jfont.jfontdefX(true, 'yoko')}}
+% \protected\def\jfont#1{%
+% \afterassignment\ltj@@jfont
+% \directlua{luatexja.jfont.jfontdefX(false, 'yoko','\luatexluaescapestring{\noexpand#1}')}}
+% \protected\def\globaljfont#1{%
+% \afterassignment\ltj@@jfont
+% \directlua{luatexja.jfont.jfontdefX(true, 'yoko','\luatexluaescapestring{\noexpand#1}')}}
% \def\ltj@@jfont{\directlua{luatexja.jfont.jfontdefY()}}
% \end{verbatim}
% \texttt{jfontdefX} 函数的作用是把 \tn{CS} 定义为其后的字体,\texttt{jfontdefY}
% 的作用是更新 \texttt{JFM} 和记录相关字体信息。最后的工作是:
% \begin{verbatim}
% tex.sprint(cat_lp, global_flag, '\\protected\\expandafter\\def\\csname ',
-% cstemp , '\\endcsname{\\ltj@cur'..
+% (cstemp==' ') and '\\space' or cstemp, '\\endcsname{\\ltj@cur'..
% (jfm_dir == 'yoko' and 'j' or 't') .. 'fnt', fn, '\\relax}')
% \end{verbatim}
% \tn{CS} 的作用就是把 \tn{ltj@curjfnt} 设置为刚才定义的字体的 \texttt{font.id}。
@@ -4390,7 +4426,7 @@ This package consists of the file ctex.dtx, and the derived files
% 赋值总是全局的,不会受到分组的影响。
% \begin{macrocode}
\font@name
- \ctex_lua_now_x:n { font.current(tex.getattribute('ltj@curjfnt')) }
+ \lua_now_x:n { font.current(tex.getattribute('ltj@curjfnt')) }
\use:c { \f@encoding + \f@family }
\use:c { \curr@fontshape }
}
@@ -4442,7 +4478,7 @@ This package consists of the file ctex.dtx, and the derived files
% \begin{macrocode}
\prg_new_conditional:Npnn \ctex_ltj_if_alternate_shape_exist:n #1 { T , F , TF }
{
- \ctex_lua_now_x:n { luatexja.jfont.does_alt_set ('\luatexluaescapestring {#1}') }
+ \lua_now_x:n { luatexja.jfont.does_alt_set ('\lua_escape_x:n {#1}') }
\prg_return_true: \else: \prg_return_false: \fi:
}
% \end{macrocode}
@@ -4461,7 +4497,7 @@ This package consists of the file ctex.dtx, and the derived files
% \texttt{font.id} 唯一。
% \begin{macrocode}
\cs_new_nopar:Npn \@@_patch_external_font:w #1 ~ at
- { #1 \ctex_lua_now_x:n { luatexja.jfont.print_aftl_address() } ~ at }
+ { #1 \lua_now_x:n { luatexja.jfont.print_aftl_address() } ~ at }
% \end{macrocode}
% \end{macro}
%
@@ -4472,12 +4508,12 @@ This package consists of the file ctex.dtx, and the derived files
{
\ctex_ltj_if_alternate_shape_exist:nT { \l_@@_current_shape_tl }
{
- \ctex_lua_now_x:n
+ \lua_now_x:n
{
luatexja.jfont.output_alt_font_cmd
- ('y', '\luatexluaescapestring { \l_@@_current_shape_tl }')
+ ('y', '\lua_escape_x:n { \l_@@_current_shape_tl }')
}
- \ctex_lua_now_x:n { luatexja.jfont.pickup_alt_font_a ('\f@size') }
+ \lua_now_x:n { luatexja.jfont.pickup_alt_font_a ('\f@size') }
}
}
\tl_new:N \l_@@_current_shape_tl
@@ -4515,65 +4551,115 @@ This package consists of the file ctex.dtx, and the derived files
\cs_new_protected_nopar:Npn \ltj@pickup@altfont@copy #1#2
{
\ltj@@getjfontnumber #1
- \ctex_lua_now_x:n
+ \lua_now_x:n
{
luatexja.jfont.pickup_alt_font_b
- ( \the\ltj@tempcntc, '\luatexluaescapestring {#2}' )
+ ( \int_use:N \ltj@tempcntc, '\lua_escape_x:n {#2}' )
}
}
% \end{macrocode}
% \end{macro}
%
+% \paragraph{数学字体族}
+%
% \begin{macrocode}
-\ExplSyntaxOff
+%<@@=ctex_ltj>
% \end{macrocode}
%
-% 以下内容抄录自 \file{lltjfont.sty},目的是让汉字可以在数学环境中直接使用。
-% \begin{macrocode}
-\def\ltj@@IsFontJapanese#1{%
- \directlua{luatexja.jfont.is_kenc(string.match(
- '\luatexluaescapestring{#1}', '[^/]+'))}}
-{\catcode`M=12%
-\gdef\ltj@@mathJapaneseFonts#1M#2#3\relax{\ltj@@IsFontJapanese{#3}}}
-\let\ltj@@al@getanddefine@fonts=\getanddefine@fonts
-\def\ltj@@ja@getanddefine@fonts#1#2{%
- \xdef\font@name{\csname \string#2/\tf@size\endcsname}%
- \pickup@jfont\let\textfont@name\font@name
- \xdef\font@name{\csname \string#2/\sf@size\endcsname}%
- \pickup@jfont\let\scriptfont@name\font@name
- \xdef\font@name{\csname \string#2/\ssf@size\endcsname}%
- \pickup@jfont
- \edef\math@fonts{\math@fonts\ltj@setpar@global%
- \ltj@@set@stackfont#1,\textfont@name:{MJT}%
- \ltj@@set@stackfont#1,\scriptfont@name:{MJS}%
- \ltj@@set@stackfont#1,\font@name:{MJSS}%
- }%
-}
-\def\getanddefine@fonts#1#2{%
- \ltj@tempcnta=#1\ltj@@IsFontJapanese{\string#2}%
- \ifin@\let\ltj@temp=\ltj@@ja@getanddefine@fonts%
- \else \let\ltj@temp=\ltj@@al@getanddefine@fonts\fi
- \ltj@temp{#1}{#2}%
-}
-\def\use@mathgroup#1#2{\relax\ifmmode
- \math@bgroup
- \expandafter\ifx\csname M@\f@encoding\endcsname#1\else
- #1\fi\ltj@tempcnta=#2 \expandafter\ltj@@mathJapaneseFonts\string#1\relax%
- \ifin@\jfam#2\relax\else\mathgroup#2\relax\fi
- \expandafter\math@egroup\fi}%
+% 以下内容来自 \file{lltjfont.sty},目的是让汉字可以在数学环境中直接使用。
+%
+% \begin{macro}[int]{\ctex_ltj_if_jfont:nTF}
+% 参数 |#1| 是一个 \LaTeXe{} 编码名称或者字体命令。\LaTeXe{} 字体命令的一般形式是:
+% \begin{quote}\ttfamily\small
+% \textbackslash\meta{encoding}/\meta{family}/\meta{series}/\meta{shape}
+% \end{quote}
+% 通过截取名字中的 \meta{encoding} 来判断是否是 jfont。
+% 最后会设置 \tn{ifin@} 为对应的 \tn{iftrue} 或者 \tn{iffalse}。
+% \begin{macrocode}
+\cs_new:Npn \ctex_ltj_if_jfont:nTF #1
+ {
+ \lua_now_x:n
+ { luatexja.jfont.is_kenc( string.match('\lua_escape_x:n {#1}', '[^/]+') ) }
+ \ifin@ \exp_after:wN \use_i:nn \else: \exp_after:wN \use_ii:nn \fi:
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[int]{\ctex_ltj_if_jfont_math:NTF}
+% |#1| 是一个形式为 |\M@|\meta{encoding} 的命令,它由 \tn{DeclareFontEncoding} 的
+% 第三个参数来定义。
+% \begin{macrocode}
+\cs_new:Npn \ctex_ltj_if_jfont_math:NTF #1
+ { \exp_after:wN \@@_if_jfont_math:w \token_to_str:N #1 \q_stop }
+\group_begin:
+ \char_set_catcode_other:N M
+ \cs_new:Npn \@@_if_jfont_math:w #1 M #2#3 \q_stop
+ { \ctex_ltj_if_jfont:nTF {#3} }
+\group_end:
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%<@@=>
% \end{macrocode}
%
+% \begin{macro}[int]{\getanddefine@fonts,\ctex_ltj_get_and_define_fonts:nN}
+% 在使用的场合,\tn{escapechar} 已经被设置成 $-1$,使用 \cs{token_to_str:N} 就
+% 可以得到名字,不必使用 \cs{cs_to_str:N}。
% \begin{macrocode}
-\let\@@italiccorr=\/
+\cs_new_protected_nopar:Npn \ctex_ltj_get_and_define_fonts:nN #1#2
+ {
+ \ctex_ltj_if_jfont:nTF { \token_to_str:N #2 }
+ { \ctex_ltj_get_and_define_fonts_ja:nN }
+ { \ctex_ltj_get_and_define_fonts_al:nN }
+ {#1} #2
+ }
+\cs_new_eq:NN \ctex_ltj_get_and_define_fonts_al:nN \getanddefine@fonts
+\cs_set_eq:NN \getanddefine@fonts \ctex_ltj_get_and_define_fonts:nN
+\cs_new_protected_nopar:Npn \ctex_ltj_get_and_define_fonts_ja:nN #1#2
+ {
+ \tl_gset:Nx \font@name { \use:c { \token_to_str:N #2 / \tf@size } }
+ \ctex_ltj_pickup_font: \tl_set_eq:NN \textfont@name \font@name
+ \tl_gset:Nx \font@name { \use:c { \token_to_str:N #2 / \sf@size } }
+ \ctex_ltj_pickup_font: \tl_set_eq:NN \scriptfont@name \font@name
+ \tl_gset:Nx \font@name { \use:c { \token_to_str:N #2 / \ssf@size } }
+ \ctex_ltj_pickup_font:
+ \tl_put_right:Nx \math@fonts
+ {
+ \ltj@setpar@global
+ \ltj@@set@stackfont #1 , \textfont@name \c_colon_str { MJT }
+ \ltj@@set@stackfont #1 , \scriptfont@name \c_colon_str { MJS }
+ \ltj@@set@stackfont #1 , \font@name \c_colon_str { MJSS }
+ }
+ }
% \end{macrocode}
+% \end{macro}
%
% \begin{macrocode}
%<@@=ctex_ltj>
% \end{macrocode}
%
+% \begin{macro}[int]{\use@mathgroup,\ctex_ltj_use_math_group:Nn}
+% 在使用 \pkg{unicode-math} 宏包时,\cs{ctex_ltj_math_group_hook:} 将被重定义。
% \begin{macrocode}
-\ExplSyntaxOn
+\cs_new_protected_nopar:Npn \ctex_ltj_use_math_group:Nn #1#2
+ {
+ \mode_if_math:T
+ {
+ \math@bgroup
+ \cs_if_eq:cNF { M@ \f@encoding } #1 {#1}
+ \ctex_ltj_math_group_hook:
+ \ctex_ltj_if_jfont_math:NTF #1
+ { \jfam } { \mathgroup } #2 \scan_stop:
+ \math@egroup
+ }
+ }
+\cs_new_eq:NN \ctex_ltj_math_group_hook: \prg_do_nothing:
+\cs_set_eq:NN \use@mathgroup \ctex_ltj_use_math_group:Nn
% \end{macrocode}
+% \end{macro}
+%
+% \paragraph{字体族的定义与使用}
%
% \begin{macro}[int]{\ctex_mono_jfm:n,\l_@@_jfm_tl}
% \pkg{LuaTeX-ja} 中与标点格式 \opt{plain} 对应的 \texttt{JFM} 是 \opt{mono}。
@@ -4592,14 +4678,18 @@ This package consists of the file ctex.dtx, and the derived files
%
% \begin{macro}[int]{\CJK@encoding,\@@_change_encoding:}
% 在 \LaTeX 下,\pkg{LuaTeX-ja} 依赖字体编码来实现特殊设置。例如上述的
-% \tn{ltj@@IsFontJapanese} 就是通过判断编码来实现的,它在设置数学字体时会用到。所以
+% \cs{ctex_ltj_if_jfont:nTF} 就是通过判断编码来实现的,它在设置数学字体时会用到。所以
% 不应该与西文共用 \texttt{EU2}。定义字体族 song 为 \tn{CJK@encoding} 的默认替换
% 字体。下划线 |_| 不在 \tn{nfss@catcodes} 里,可以放心使用。
% \begin{macrocode}
\tl_const:Nn \CJK@encoding { LTJY3 }
\DeclareFontEncoding { \CJK@encoding } { } { }
-\DeclareFontSubstitution { LTJY3 } { song } { \mddefault } { \updefault }
-\ctex_lua_now_x:n { luatexja.jfont.add_kyenc_list('\CJK@encoding') }
+\use:x
+ {
+ \exp_not:N \DeclareFontSubstitution
+ { \CJK@encoding } { song } { \mddefault } { \updefault }
+ }
+\lua_now_x:n { luatexja.jfont.add_kyenc_list('\CJK@encoding') }
\cs_new_protected_nopar:Npn \@@_change_encoding:
{ \tl_set_eq:NN \g_fontspec_encoding_tl \CJK@encoding }
\DeclareFontFamily { \CJK@encoding } { song } { }
@@ -4617,8 +4707,6 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \paragraph{字体族的定义与使用}
-%
% 这是 \pkg{luatexja-fontspec} 中新增的一些字体选项。
% \begin{macrocode}
\newfontfeature { CID } { cid = #1 }
@@ -5049,9 +5137,9 @@ This package consists of the file ctex.dtx, and the derived files
\keys_define:nn { ctex_ltj / fontspec }
{
AlternateFont .code:n = \ctex_ltj_set_alternate_seq:n {#1} ,
- AlternateFont .value_required: ,
+ AlternateFont .value_required:n = true ,
CharRange .clist_set:N = \l_@@_char_range_clist ,
- CharRange .value_required:
+ CharRange .value_required:n = true
}
% \end{macrocode}
% \end{macro}
@@ -5061,25 +5149,26 @@ This package consists of the file ctex.dtx, and the derived files
% 需要先“消毒”,同时过滤掉空元素。
% \begin{macrocode}
\group_begin:
-\char_set_catcode_active:N \/
-\char_set_lccode:nn { `\/ } { `\| }
-\tex_lowercase:D
- {
- \group_end:
- \cs_new_protected:Npn \ctex_ltj_set_alternate_seq:n #1
- {
- \clist_if_empty:NT \l_@@_char_range_clist
- {
- \tl_set:Nn \l_@@_tmp_tl {#1}
- \tl_replace_all:Nnn \l_@@_tmp_tl { // } { || }
- \seq_set_split:NnV \l_@@_tmp_seq { || } \l_@@_tmp_tl
- \seq_set_filter:NNn \l_@@_tmp_seq \l_@@_tmp_seq
- { ! \tl_if_blank_p:n { ##1 } }
- \seq_concat:NNN \l_@@_alternate_seq
- \l_@@_alternate_seq \l_@@_tmp_seq
- }
- }
- }
+ \char_set_catcode_other:N \|
+ \cs_set:Npn \@@_tmp:w #1
+ {
+ \cs_new_protected:Npn \ctex_ltj_set_alternate_seq:n ##1
+ {
+ \clist_if_empty:NT \l_@@_char_range_clist
+ {
+ \tl_set:Nn \l_@@_tmp_tl { ##1 }
+ \tl_replace_all:Nnn \l_@@_tmp_tl {#1} { || }
+ \seq_set_split:NnV \l_@@_tmp_seq { || } \l_@@_tmp_tl
+ \seq_set_filter:NNn \l_@@_tmp_seq \l_@@_tmp_seq
+ { ! \tl_if_blank_p:n { ####1 } }
+ \seq_concat:NNN \l_@@_alternate_seq
+ \l_@@_alternate_seq \l_@@_tmp_seq
+ }
+ }
+ }
+ \char_set_catcode_active:N \|
+ \@@_tmp:w { || }
+\group_end:
\seq_new:N \l_@@_tmp_seq
\seq_new:N \l_@@_alternate_seq
% \end{macrocode}
@@ -5250,7 +5339,7 @@ This package consists of the file ctex.dtx, and the derived files
\@@_save_alternate_shape:cnn
{ \@@_alternate_cs:n { clear / \l_@@_base_CJKfamily_tl } }
{ luatexja.jfont.clear_alt_font_latex }
- { '\luatexluaescapestring { \CJK@encoding/#2/#3/#4 }' }
+ { '\lua_escape_x:n { \CJK@encoding/#2/#3/#4 }' }
}
% \end{macrocode}
% \end{macro}
@@ -5274,13 +5363,13 @@ This package consists of the file ctex.dtx, and the derived files
\int_eval:n { \tl_if_blank:nTF {#3} { "80 } {#3} } ,
\int_eval:n { \tl_if_blank:nTF {#4} { "10FFFF } {#4} } ,
}
- '\luatexluaescapestring { \CJK@encoding/#2 }' ,
- '\luatexluaescapestring { \CJK@encoding/#1 }'
+ '\lua_escape_x:n { \CJK@encoding/#2 }' ,
+ '\lua_escape_x:n { \CJK@encoding/#1 }'
}
}
\cs_new_protected_nopar:Npn \ctex_ltj_set_alternate_shape:n #1
{
- \ctex_lua_now_x:n { luatexja.jfont.set_alt_font_latex ( #1 ) }
+ \lua_now_x:n { luatexja.jfont.set_alt_font_latex ( #1 ) }
\@@_save_alternate_shape:cnn
{ \@@_alternate_cs:n { reset / \l_@@_base_CJKfamily_tl } }
{ luatexja.jfont.set_alt_font_latex } {#1}
@@ -5298,8 +5387,8 @@ This package consists of the file ctex.dtx, and the derived files
\ctex_ltj_set_alternate_shape:n
{
##1 ,
- '\luatexluaescapestring { \CJK@encoding/#2 }' ,
- '\luatexluaescapestring { \CJK@encoding/#1 }'
+ '\lua_escape_x:n { \CJK@encoding/#2 }' ,
+ '\lua_escape_x:n { \CJK@encoding/#1 }'
}
}
}
@@ -5316,9 +5405,9 @@ This package consists of the file ctex.dtx, and the derived files
\group_begin:
\cs_if_exist:NF #1 { \cs_set_eq:NN #1 \prg_do_nothing: }
\cs_set_eq:NN \l_@@_base_family_tl \scan_stop:
- \cs_set_eq:NN \luatexluaescapestring \scan_stop:
+ \cs_set_eq:NN \lua_escape_x:n \scan_stop:
\cs_gset_protected_nopar:Npx #1
- { \exp_not:o {#1} \exp_not:N \ctex_lua_now_x:n { #2 ( #3 ) } }
+ { \exp_not:o {#1} \exp_not:N \lua_now_x:n { #2 ( #3 ) } }
\group_end:
}
\cs_generate_variant:Nn \@@_save_alternate_shape:Nnn { c }
@@ -5375,7 +5464,7 @@ This package consists of the file ctex.dtx, and the derived files
\keys_define:nn { ctex }
{
declarecharrange .code:n = \ctex_ltj_declare_char_range:x {#1} ,
- declarecharrange .value_required:
+ declarecharrange .value_required:n = true
}
\cs_new_protected_nopar:Npn \ctex_ltj_declare_char_range:n #1
{ \clist_map_inline:nn {#1} { \@@_declare_char_range:nn ##1 } }
@@ -5533,6 +5622,17 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
%
% \begin{macrocode}
+%<@@=>
+% \end{macrocode}
+%
+% \begin{macro}[int]{\@@italiccorr}
+% \LaTeX{} 的倾斜校正也要重新定义。
+% \begin{macrocode}
+\cs_set_eq:NN \@@italiccorr \/
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
%<@@=ctex>
% \end{macrocode}
%
@@ -5604,7 +5704,7 @@ This package consists of the file ctex.dtx, and the derived files
{
\tl_gset:Nx \g_@@_fontset_tl
{
- \ctex_lua_now_x:n
+ \lua_now_x:n
{
if ~ os.name == 'windows' then ~
tex.sprint ( 'windows' )
@@ -5629,7 +5729,7 @@ This package consists of the file ctex.dtx, and the derived files
{
\file_if_exist:nTF { nul: }
{
- \file_if_exist:nTF { \c_@@_engine_file_tl }
+ \file_if_exist:nTF { \c_@@_upper_case_file_str }
{ \ctex_if_macosx:TF { mac } { windows } }
{ \ctex_if_macosx:TF { mac } { fandol } }
}
@@ -5637,11 +5737,8 @@ This package consists of the file ctex.dtx, and the derived files
}
{ \tl_gset:Nn \g_@@_fontset_tl { windows } }
}
-\tex_uppercase:D \exp_after:wN
- {
- \exp_after:wN \tl_const:Nn \exp_after:wN \c_@@_engine_file_tl
- \exp_after:wN { \g_file_current_name_tl }
- }
+\str_const:Nx \c_@@_upper_case_file_str
+ { \exp_args:No \str_upper_case:n { \g_file_current_name_tl } }
% \end{macrocode}
% \end{macro}
%
@@ -5651,11 +5748,11 @@ This package consists of the file ctex.dtx, and the derived files
% \begin{macrocode}
\cs_new_protected_nopar:Npn \ctex_if_macosx:TF #1#2
{
- \file_if_exist:nTF { \c_@@_macosx_file_tl }
+ \file_if_exist:nTF { \c_@@_macosx_file_str }
{ \tl_gset:Nn \g_@@_fontset_tl {#1} }
{ \tl_gset:Nn \g_@@_fontset_tl {#2} }
}
-\tl_const:Nn \c_@@_macosx_file_tl { /Library/Fonts/Songti.ttc }
+\str_const:Nn \c_@@_macosx_file_str { /Library/Fonts/Songti.ttc }
%</xetex|pdftex>
% \end{macrocode}
% \end{macro}
@@ -5698,7 +5795,7 @@ This package consists of the file ctex.dtx, and the derived files
\str_if_eq:onTF { \l_@@_encoding_tl } { GBK }
{
\ctex_hypersetup:n { CJKbookmarks = true }
- \ctex_if_pdfmode:TF
+ \sys_if_output_pdf:TF
{ \ctex_at_end_package:nn { hyperref } { \RequirePackage { xCJK2uni } } }
{
\ctex_at_end_package:nn { hyperref }
@@ -5791,7 +5888,6 @@ This package consists of the file ctex.dtx, and the derived files
\RequirePackage { xeCJKfntef }
\@ifpackagelater { xeCJKfntef } { 2014/11/04 }
{
-
\cs_new_protected_nopar:Npn \@@_clear_fntef_color:n #1
{ \xeCJKsetup { #1 / format = { } } }
}
@@ -6021,6 +6117,13 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
+% \XeLaTeX{} 和 \LuaLaTeX{} 总是使用 \texttt{UTF8} 编码。
+% \begin{macrocode}
+%<*xetex|luatex>
+\tl_set:Nn \l_@@_encoding_tl { UTF8 }
+%</xetex|luatex>
+% \end{macrocode}
+%
% \begin{macrocode}
%</pdftex|xetex|luatex>
%<*class|ctex>
@@ -6030,17 +6133,7 @@ This package consists of the file ctex.dtx, and the derived files
%
% 最后载入各个编译引擎的定义文件。
% \begin{macrocode}
-\pdftex_if_engine:TF
- {
- \tl_set:Nx \l_@@_encoding_tl { \l_@@_encoding_tl }
- \ctex_file_input:n { ctex-engine-pdftex.def }
- }
- {
- \tl_set:Nn \l_@@_encoding_tl { UTF8 }
- \xetex_if_engine:TF
- { \ctex_file_input:n { ctex-engine-xetex.def } }
- { \ctex_file_input:n { ctex-engine-luatex.def } }
- }
+\ctex_file_input:n { \c_@@_engine_file_str }
% \end{macrocode}
%
% \subsection{字距与缩进}
@@ -6115,7 +6208,7 @@ This package consists of the file ctex.dtx, and the derived files
\ctex_set_default_ccwd:Nn \l_@@_line_stretch_tl {#1}
\ctex_select_size:
} ,
- linestretch .value_required:
+ linestretch .value_required:n = true
}
\tl_new:N \l_@@_line_stretch_tl
\tl_set:Nn \l_@@_line_stretch_tl { \ccwd }
@@ -6384,7 +6477,6 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
%
% \subsubsection{定义标题格式选项}
-
%
% \begin{variable}[int]{\c_@@_section_headings_seq}
% 保存 \tn{section} 级以下标题名字。
@@ -6405,6 +6497,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{variable}
%
% \changes{v2.1}{2015/06/19}{\opt{nameformat} 可以接受章节名字为参数。}
+% \changes{v2.3}{2016/01/05}{修复 \opt{nameformat} 作用域问题。}
%
% \begin{macro}[int]{\@@_initial_heading:n}
% \begin{macrocode}
@@ -6420,20 +6513,22 @@ 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@post#1 }
- }
- \exp_not:c { CTEX@#1@aftername }
+ \group_begin:
+ \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@post#1 }
+ }
+ \group_end:
}
}
% \end{macrocode}
@@ -6472,35 +6567,23 @@ This package consists of the file ctex.dtx, and the derived files
#1 / runin .bool_set:N = \exp_not:c { CTEX@#1@runin } ,
#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 / numbering .initial:n = true ,
#1 / beforeskip .initial:n = \c_zero_skip ,
#1 / afterskip .initial:n = \c_zero_skip ,
#1 / indent .initial:n = \c_zero_dim ,
- #1 / beforeskip .value_required: ,
- #1 / afterskip .value_required: ,
- #1 / indent .value_required: ,
+ #1 / beforeskip .value_required:n = true ,
+ #1 / afterskip .value_required:n = true ,
+ #1 / indent .value_required:n = true ,
}
}
% \end{macrocode}
@@ -6634,7 +6717,7 @@ This package consists of the file ctex.dtx, and the derived files
\normalfont \parindent \dimexpr \CTEX@part@indent \relax \CTEX@part@format
\ifnum \c@secnumdepth >\m@ne \ifodd \CTEX@part@numbering
% \Large\bfseries\partname\nobreakspace\thepart\par\nobreak
- \CTEX@partname
+ \CTEX@partname \CTEX@part@aftername
\fi \fi
% \huge\bfseries #2%
\CTEX@part@titleformat{#2}%
@@ -6665,7 +6748,7 @@ This package consists of the file ctex.dtx, and the derived files
\normalfont \CTEX@part@format
\ifnum \c@secnumdepth >-2\relax \ifodd \CTEX@part@numbering
% \huge\bfseries\partname\nobreakspace\thepart\par\vskip 20\p@
- \CTEX@partname
+ \CTEX@partname \CTEX@part@aftername
\fi \fi
% \Huge\bfseries #2\par}%
\CTEX@part@titleformat{#2}%
@@ -6793,7 +6876,7 @@ This package consists of the file ctex.dtx, and the derived files
%<book> \if@mainmatter
\ifodd \CTEX@chapter@numbering
% \huge\bfseries\@chapapp\space\thechapter\par\nobreak\vskip 20\p@
- \CTEX@chaptername
+ \CTEX@chaptername \CTEX@chapter@aftername
\fi
%<book> \fi
\fi
@@ -6864,9 +6947,8 @@ This package consists of the file ctex.dtx, and the derived files
% \begin{macro}[int]{\@seccntformat}
% \begin{macrocode}
\def\@seccntformat#1{%
- \@ifundefined{CTEX@#1name}%
- {\csname the#1\endcsname\quad}%
- {\csname CTEX@#1name\endcsname}}
+% \csname the#1\endcsname\quad}%
+ \csname CTEX@#1name\endcsname \csname CTEX@#1@aftername\endcsname}
% \end{macrocode}
% \end{macro}
%
@@ -6900,9 +6982,7 @@ This package consists of the file ctex.dtx, and the derived files
\ifnum #2>\c@secnumdepth \else
\ifodd \csname CTEX@#1@numbering\endcsname
% \protect\numberline{\csname the#1\endcsname}%
- \protect\numberline{\@ifundefined{CTEXthe#1}%
- {\csname the#1\endcsname}%
- {\csname CTEXthe#1\endcsname}}%
+ \protect\numberline{\csname CTEXthe#1\endcsname}%
\fi
\fi
#7}%
@@ -6918,9 +6998,7 @@ This package consists of the file ctex.dtx, and the derived files
\ifnum #2>\c@secnumdepth \else
\ifodd \csname CTEX@#1@numbering\endcsname
% \protect\numberline{\csname the#1\endcsname}%
- \protect\numberline{\@ifundefined{CTEXthe#1}%
- {\csname the#1\endcsname}%
- {\csname CTEXthe#1\endcsname}}%
+ \protect\numberline{\csname CTEXthe#1\endcsname}%
\fi
\fi
#7}}%
@@ -7073,14 +7151,14 @@ This package consists of the file ctex.dtx, and the derived files
%
% \begin{macro}[int]{\ctex_titlesec_hook:}
% \tn{titleformat} 的设置保存在名为 |\ttlf@|\meta{section} 的宏中备用,它的内容是
-% \begin{center}\small
+% \begin{quote}\small
% |\ttlh@|\meta{shape}\Arg{format}\Arg{label}\Arg{sep}\Arg{before}\Arg{after}
-% \end{center}
+% \end{quote}
% 我们这里的 \meta{shape} 为 |hang| 或者 |runin|。\tn{titlespacing} 的设置保存在
% |\ttls@|\meta{section} 之中,它的内容是
-% \begin{center}\small
+% \begin{quote}\small
% \Arg{left}\Arg{right}\Arg{before}\Arg{after}\Arg{afterindent}
-% \end{center}
+% \end{quote}
% 其中 \meta{afterindent} 为 |1| 或 |0|,分别对应是否保留段首缩进。
% 我们需要根据 \CTeX{} 的 \opt{runin} 和 \opt{afterindent} 选项调整
% |\ttlh@|\meta{shape} 和 \meta{afterindent}。注意,由 \tn{ttl@extract} 得的
@@ -7162,6 +7240,75 @@ This package consists of the file ctex.dtx, and the derived files
}
% \end{macrocode}
%
+% \paragraph{兼容 \pkg{titleps} 宏包}
+%
+% \changes{v2.3}{2015/12/25}{兼容 \pkg{titleps} 宏包。}
+%
+% 按照 \pkg{titleps} 宏包的实现机制,|\CTEXtheXXX| 等宏直到页眉排版时才会被展开,
+% 这可能会造成问题\footnote{\url{https://github.com/CTeX-org/ctex-kit/issues/217}}。
+%
+% \begin{macro}[int]{\ctex_titleps_hook:}
+% 我们修改 \pkg{titleps} 包的内部命令 \tn{ttl@settopmark} 和 \tn{ttl@setsubmark},
+% 将 |\CTEXtheXXX| 等加入更新队列中。
+% \begin{macrocode}
+\group_begin:
+\char_set_catcode_other:N \#
+\cs_new_protected_nopar:Npn \ctex_titleps_hook:
+ {
+ \ctex_patch_cmd:Nnn \ttl@settopmark
+ { \protect \@namedef { the#1 } { \@nameuse { the#1 } } }
+ {
+ \protect \@namedef { the#1 } { \@nameuse { the#1 } }
+ \CTEX@titlepslabel@set {#1}
+ }
+ \ctex_patch_cmd:Nnn \ttl@setsubmark
+ { \protect \@namedef { the#1 } { } }
+ {
+ \protect \@namedef { the#1 } { }
+ \CTEX@titlepslabel@clear {#1}
+ }
+ \ctex_patch_cmd:Nnn \ttl@setsubmark
+ { \protect \@namedef { the#2 } { \@nameuse { the#2 } } }
+ {
+ \protect \@namedef { the#2 } { \@nameuse { the#2 } }
+ \CTEX@titlepslabel@set {#2}
+ }
+ }
+\group_end:
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[aux]{\CTEX@titlepslabel@set,\CTEX@titlepslabel@clear}
+% 这两个函数要在随后被 \tn{xdef} 展开来获得 |\CTEXtheXXX| 的内容,不应该用
+% \tn{protected} 来定义。
+% \begin{macrocode}
+\cs_new_nopar:Npn \CTEX@titlepslabel@set #1
+ {
+ \cs_if_free:cF { CTEXthe#1 }
+ { \protect \@namedef { CTEXthe#1 } { \@nameuse { CTEXthe#1 } } }
+ }
+\cs_new_nopar:Npn \CTEX@titlepslabel@clear #1
+ {
+ \cs_if_free:cF { CTEXthe#1 }
+ { \protect \@namedef { CTEXthe#1 } { } }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \pkg{titleps} 宏包的功能可以由 \pkg{titlesec} 的选项 \opt{pagestyles} 引入。
+% \begin{macrocode}
+\ctex_at_end_package:nn { titlesec }
+ { \cs_if_free:NF \ttl@settopmark { \ctex_titleps_hook: } }
+\ctex_at_end_package:nn { titleps } { \ctex_titleps_hook: }
+% \end{macrocode}
+%
+% 除此之外,也可以使用 \pkg{titleps} 提供的命令 \tn{newtitlemark} 来完成:
+% \begin{verbatim}
+% \newtitlemark { \CTEXthechapter }
+% \newtitlemark { \CTEXthesection }
+% \end{verbatim}
+% 但 \tn{newtitlemark} 不包含章节间的层次信息,功能上不及修改内部命令完整。
+%
%
% \subsubsection{目录标签的宽度}
%
@@ -8289,7 +8436,7 @@ This package consists of the file ctex.dtx, and the derived files
% Windows 字体设置使用微软雅黑作为无衬线体,楷体和仿宋是大字库。
% \begin{macrocode}
%<*windowsnew|windowsold>
-\pdftex_if_engine:TF
+\sys_if_engine_pdftex:TF
{
\ctex_zhmap_case:nnn
{
@@ -8383,9 +8530,9 @@ This package consists of the file ctex.dtx, and the derived files
% \tn{pdfmapline} 不支持 OpenType 字体,因而 \opt{adobe} 字体集在 pdf 模式下
% 就没有定义。\opt{fandol} 的情况类似。
% \begin{macrocode}
-\pdftex_if_engine:TF
+\sys_if_engine_pdftex:TF
{
- \ctex_if_pdfmode:TF
+ \sys_if_output_pdf:TF
{ \ctex_fontset_error:n { adobe } }
{
\ctex_zhmap_case:nnn
@@ -8446,9 +8593,9 @@ This package consists of the file ctex.dtx, and the derived files
% \subsubsection{\pkg{ctex-fontset-fandol.def}}
%
% \begin{macrocode}
-\pdftex_if_engine:TF
+\sys_if_engine_pdftex:TF
{
- \ctex_if_pdfmode:TF
+ \sys_if_output_pdf:TF
{ \ctex_fontset_error:n { fandol } }
{
\ctex_zhmap_case:nnn
@@ -8584,7 +8731,7 @@ This package consists of the file ctex.dtx, and the derived files
% \footnote{\url{http://www.newsmth.net/bbscon.php?bid=460&id=312640}}。
% 华文细黑和华文仿宋的情况类似。
% \begin{macrocode}
-\pdftex_if_engine:TF
+\sys_if_engine_pdftex:TF
{ \ctex_fontset_error:n { mac } }
{
\setCJKmainfont [ BoldFont = STHeiti , ItalicFont = STKaiti ] { STSong }
@@ -8605,7 +8752,7 @@ This package consists of the file ctex.dtx, and the derived files
% \subsubsection{\pkg{ctex-fontset-founder.def}}
%
% \begin{macrocode}
-\pdftex_if_engine:TF
+\sys_if_engine_pdftex:TF
{
\ctex_zhmap_case:nnn
{
@@ -8651,7 +8798,7 @@ This package consists of the file ctex.dtx, and the derived files
% 速度不受影响。
% \begin{macrocode}
\setCJKsansfont [ BoldFont = FZHei-B01 ]
- { \xetex_if_engine:TF { 方正细黑一_GBK } { FZXH1K--GBK1-0 } }
+ { \sys_if_engine_xetex:TF { 方正细黑一_GBK } { FZXH1K--GBK1-0 } }
\setCJKmonofont { FZFangSong-Z02 }
\setCJKfamilyfont { zhsong } [ BoldFont = FZXiaoBiaoSong-B05 ] { FZShuSong-Z01 }
\setCJKfamilyfont { zhhei } { FZHei-B01 }
@@ -8678,7 +8825,7 @@ This package consists of the file ctex.dtx, and the derived files
% 其实只有“令”和“骨”这区区两个字有新字形,其余都取旧字形^^A
% \footnote{\url{http://www.freedesktop.org/wiki/Software/CJKUnifonts/Download/}}。
% \begin{macrocode}
-\pdftex_if_engine:TF
+\sys_if_engine_pdftex:TF
{
\ctex_zhmap_case:nnn
{
@@ -8811,7 +8958,7 @@ This package consists of the file ctex.dtx, and the derived files
% \begin{macrocode}
%<*windows>
\ProvidesFile{zhwindowsfonts.tex}%
- [2015/07/01 v2.2 Windows font map loader for pdfTeX and DVIPDFMx (CTEX)]
+ [2016/02/02 v2.3 Windows font map loader for pdfTeX and DVIPDFMx (CTEX)]
\ifzhmappdf
\pdfmapline{=gbk@UGBK@ <simsun.ttc}
@@ -8883,7 +9030,7 @@ This package consists of the file ctex.dtx, and the derived files
% \begin{macrocode}
%<*adobe>
\ProvidesFile{zhadobefonts.tex}%
- [2015/07/01 v2.2 Adobe font map loader for DVIPDFMx (CTEX)]
+ [2016/02/02 v2.3 Adobe font map loader for DVIPDFMx (CTEX)]
\ifzhmappdf
%% pdfTeX does not support OTF fonts
@@ -8919,7 +9066,7 @@ This package consists of the file ctex.dtx, and the derived files
% \begin{macrocode}
%<*fandol>
\ProvidesFile{zhfandolfonts.tex}%
- [2015/07/01 v2.2 Fandol font map loader for DVIPDFMx (CTEX)]
+ [2016/02/02 v2.3 Fandol font map loader for DVIPDFMx (CTEX)]
\ifzhmappdf
%% pdfTeX does not support OTF fonts
@@ -8955,7 +9102,7 @@ This package consists of the file ctex.dtx, and the derived files
% \begin{macrocode}
%<*founder>
\ProvidesFile{zhfounderfonts.tex}%
- [2015/07/01 v2.2 Founder font map loader for pdfTeX and DVIPDFMx (CTEX)]
+ [2016/02/02 v2.3 Founder font map loader for pdfTeX and DVIPDFMx (CTEX)]
\ifzhmappdf
\pdfmapline{=gbk@UGBK@ <FZSSK.TTF}
@@ -9027,7 +9174,7 @@ This package consists of the file ctex.dtx, and the derived files
% \begin{macrocode}
%<*ubuntu>
\ProvidesFile{zhubuntufonts.tex}%
- [2015/07/01 v2.2 Ubuntu font map loader for pdfTeX and DVIPDFMx (CTEX)]
+ [2016/02/02 v2.3 Ubuntu font map loader for pdfTeX and DVIPDFMx (CTEX)]
\ifzhmappdf
\pdfmapline{=gbk@UGBK@ <uming.ttc}
@@ -9099,7 +9246,7 @@ This package consists of the file ctex.dtx, and the derived files
%<*macro>
\input expl3-generic %
\ExplSyntaxOn
-\xetex_if_engine:F
+\sys_if_engine_xetex:F
{
\msg_new:nn { ctex } { xetex }
{ XeTeX~is~required~to~compile~this~document! }
@@ -9148,7 +9295,7 @@ This package consists of the file ctex.dtx, and the derived files
\l_@@_punct_font
\clist_clear:N \l_@@_punct_bounds_clist
\seq_map_inline:Nn \c_@@_punct_seq
- { \exp_args:No \@@_save_bounds:n { \int_use:N \XeTeXcharglyph ##1 } }
+ { \exp_args:No \@@_save_bounds:n { \int_use:N \xetex_charglyph:D ##1 } }
\iow_now:Nx \g_@@_spa_iow
{
\token_to_str:N \ctexspadef {#1}
@@ -9179,7 +9326,7 @@ This package consists of the file ctex.dtx, and the derived files
round
(
\dim_to_decimal_in_unit:nn
- { 100 \XeTeXglyphbounds #1 ~ #2 }
+ { 100 \xetex_glyphbounds:D #1 ~ #2 }
{ 1 em }
)
}
@@ -9354,6 +9501,10 @@ This package consists of the file ctex.dtx, and the derived files
%<*ctexpatch>
% \end{macrocode}
%
+% \begin{macrocode}
+\cs_if_exist:NF \str_new:N { \RequirePackage { l3str } }
+% \end{macrocode}
+%
% \begin{macro}[int]{\ctex_patch_cmd_once:NnnnTF}
% 只进行第一次匹配进行替换。参数 |#2| 是宏重建时的 \tn{catcode} 设置。
% \begin{macrocode}
@@ -9459,66 +9610,77 @@ This package consists of the file ctex.dtx, and the derived files
\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
+\cs_set_protected:Npn \@@_tmp:w #1#2#3
{
- \group_end:
- \cs_new_protected:Npn \ctex_parse_name:NNn #1#2#3
+ \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 } }
+ \bool_if:nTF
+ {
+ \cs_if_exist_p:c { ##3 ~ } ||
+ \cs_if_exist_p:c { #1##3 }
+ }
{
\group_begin:
\use:x
{
\group_end:
- \@@_parse_name:nNNNnN { \token_get_replacement_spec:N #2 }
- \exp_not:N #2 \exp_not:c { #3 ~ } \exp_not:c { /#3 }
- } {#3} #1
+ \@@_parse_name:nNNNnN
+ { \token_get_replacement_spec:N ##2 }
+ \exp_not:N ##2
+ \exp_not:c { ##3 ~ }
+ \exp_not:c { #1##3 }
+ } {##3} ##1
}
- { #1#2 }
+ { ##1##2 }
}
- \cs_new_protected:Npn \@@_parse_name:nNNNnN #1#2#3#4#5#6
+ \cs_new_protected:Npn \@@_parse_name:nNNNnN ##1##2##3##4##5##6
{
- \exp_args:Nc #6
+ \exp_args:Nc ##6
{
- \str_case:nnTF {#1}
+ \str_case:nnTF {##1}
{
- { \protect #3 } { }
- { \x@protect #2 \protect #3 } { }
+ { \protect ##3 } { }
+ { \x@protect ##2 \protect ##3 } { }
}
{
- \str_if_eq_x:nnTF { \exp_not:n { /@protected@ #3 /#3 } }
+ \str_if_eq_x:nnTF
+ { \exp_not:n { #1@protected@ ##3 #1##3 } }
{
\exp_last_unbraced:Nf \@@_parse_name:w
- \token_get_replacement_spec:N #3 AESAOPA ~ < \q_stop
+ \token_get_replacement_spec:N ##3 #2 ~ #1 \q_stop
}
- { /#5 ~ } { #5 ~ }
+ { #1##5 ~ } { ##5 ~ }
}
{
- \str_case:onTF { \@@_parse_name:w #1 AESAOPA ~ < \q_stop }
+ \str_case:onTF { \@@_parse_name:w ##1 #2 ~ #1 \q_stop }
{
- { /@protected@ #2 #4 } { }
- { /@ #4 } { }
+ { #1@protected@ ##2 ##4 } { }
+ { #1@ ##4 } { }
}
- { /#5 } {#5}
+ { #1##5 } {##5}
}
}
}
- \cs_new:Npn \@@_parse_name:w #1 AESAOPA ~ #2 < #3 \q_stop { #1#2 }
+ \cs_new:Npn \@@_parse_name:w ##1 #2 ~ ##2 #1 ##3 \q_stop { ##1##2 }
}
+\use:x
+ {
+ \@@_tmp:w
+ { \c_backslash_str }
+ { \c_left_brace_str }
+ { \tl_to_str:n { testopt } }
+ }
+\group_end:
\cs_generate_variant:Nn \ctex_parse_name:NNn { NNx }
% \end{macrocode}
% \end{macro}
%
-% \begin{variable}[int]{\l_@@_prefix_tl,\l_@@_parameter_tl,\l_@@_replacement_tl}
+% \begin{variable}[int]{\l_@@_prefix_str,\l_@@_parameter_str,\l_@@_replacement_str}
% 分别保存宏的 \tn{meaning} 中的前缀、参数文本和替换文本。
% \begin{macrocode}
-\tl_new:N \l_@@_prefix_tl
-\tl_new:N \l_@@_parameter_tl
-\tl_new:N \l_@@_replacement_tl
+\str_new:N \l_@@_prefix_str
+\str_new:N \l_@@_parameter_str
+\str_new:N \l_@@_replacement_str
% \end{macrocode}
% \end{variable}
%
@@ -9527,28 +9689,30 @@ This package consists of the file ctex.dtx, and the derived files
% 解构待补丁宏的 \tn{meaning}。若命令不是宏,则走向 |false| 分支。
% \begin{macrocode}
\group_begin:
- \char_set_lccode:nn { `\; } { `\: }
- \tl_map_function:nN { \M \A \C \R \O \; } \char_set_catcode_other:N
-\tex_lowercase:D
- {
- \group_end:
- \cs_new_protected:Npn \ctex_get_macro_meaning:NTF #1
- {
- \exp_after:wN \@@_get_macro_meaning:w
- \token_to_meaning:N #1 \q_stop MACRO ; -> \q_no_value \q_stop
- }
- \cs_new_protected:Npn \@@_get_macro_meaning:w #1 MACRO ; #2 -> #3 \q_stop
- {
- \tl_set:Nn \l_@@_replacement_tl {#3}
- \quark_if_no_value:NTF \l_@@_replacement_tl
- { \use_ii:nn }
- {
- \tl_set:Nn \l_@@_prefix_tl {#1}
- \tl_set:Nn \l_@@_parameter_tl {#2}
- \use_i_delimit_by_q_stop:nw { \use_i:nn }
- }
- }
- }
+ \cs_set_protected:Npn \@@_tmp:w #1
+ {
+ \prg_new_protected_conditional:Npnn
+ \ctex_get_macro_meaning:N ##1 { TF }
+ {
+ \exp_after:wN \@@_get_macro_meaning:w
+ \token_to_meaning:N ##1 \q_mark #1 -> \q_no_value \q_mark \q_stop
+ }
+ \cs_new_protected:Npn \@@_get_macro_meaning:w
+ ##1 #1 ##2 -> ##3 \q_mark ##4 \q_stop
+ {
+ \tl_set:Nn \l_@@_replacement_tl {##3}
+ \quark_if_no_value:NTF \l_@@_replacement_tl
+ { \prg_return_false: }
+ {
+ \str_set:Nn \l_@@_prefix_str {##1}
+ \str_set:Nn \l_@@_parameter_str {##2}
+ \str_set:Nn \l_@@_replacement_str {##3}
+ \prg_return_true:
+ }
+ }
+ }
+ \exp_args:No \@@_tmp:w { \tl_to_str:n { macro: } }
+\group_end:
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -9560,12 +9724,12 @@ This package consists of the file ctex.dtx, and the derived files
{
\ctex_get_macro_meaning:NTF #1
{
- \@@_patch_rebuild:Nn \CTEXPATCHRESCANCMD {#2}
- \cs_if_eq:NNTF #1 \CTEXPATCHRESCANCMD {#3} {#4}
+ \@@_patch_rebuild:Nn \@@_rebuild_cmd:w {#2}
+ \cs_if_eq:NNTF #1 \@@_rebuild_cmd:w {#3} {#4}
}
{#4}
}
-\cs_new_eq:NN \CTEXPATCHRESCANCMD \prg_do_nothing:
+\cs_new_eq:NN \@@_rebuild_cmd:w \prg_do_nothing:
% \end{macrocode}
% \end{macro}
%
@@ -9574,22 +9738,25 @@ This package consists of the file ctex.dtx, and the derived files
% \begin{macrocode}
\cs_new_protected:Npn \@@_patch_rebuild:Nn #1#2
{
- \tl_if_empty:nTF {#2}
- { \tl_rescan:nx {#2} }
- {
- \tl_rescan:nx
- {
- #2 \scan_stop:
- \int_set_eq:NN \tex_endlinechar:D \c_minus_one
- \int_set_eq:NN \tex_newlinechar:D \c_minus_one
- }
- }
+ \@@_patch_rescan:NNn \l_@@_prefix_tl \l_@@_prefix_str {#2}
+ \@@_patch_rescan:NNn \l_@@_parameter_tl \l_@@_parameter_str {#2}
+ \@@_patch_rescan:NNn \l_@@_replacement_tl \l_@@_replacement_str {#2}
+ \use:x
{
- \l_@@_prefix_tl \exp_not:N \def \exp_not:N #1 \l_@@_parameter_tl
- { \l_@@_replacement_tl }
+ \exp_not:o { \l_@@_prefix_tl } \tex_def:D \exp_not:N #1
+ \exp_not:o { \l_@@_parameter_tl }
+ { \exp_not:o { \l_@@_replacement_tl } }
}
}
-\cs_generate_variant:Nn \tl_rescan:nn { nx }
+\cs_new_protected:Npn \@@_patch_rescan:NNn #1#2#3
+ {
+ \str_if_empty:NTF #2
+ { \tl_clear:N #1 }
+ { \tl_set_rescan:Nnx #1 {#3} {#2} }
+ }
+\tl_new:N \l_@@_prefix_tl
+\tl_new:N \l_@@_parameter_tl
+\tl_new:N \l_@@_replacement_tl
% \end{macrocode}
% \end{macro}
%
@@ -9608,8 +9775,7 @@ This package consists of the file ctex.dtx, and the derived files
{ \tl_to_str:n {#5} }
}
{
- \@@_patch_rebuild:Nn \CTEXPATCHRESCANCMD {#3}
- \cs_set_eq:NN #1 \CTEXPATCHRESCANCMD
+ \@@_patch_rebuild:Nn #1 {#3}
\@@_patch_true:w
}
{ \@@_patch_false:w }
@@ -9624,8 +9790,8 @@ This package consists of the file ctex.dtx, and the derived files
% \begin{macrocode}
\cs_new_protected:Npn \@@_patch_replace:nnnTF #1#2#3#4
{
- \tl_if_in:NnTF \l_@@_replacement_tl {#2}
- { \use:c { tl_replace_ #1 :Nnn } \l_@@_replacement_tl {#2} {#3} #4 }
+ \tl_if_in:NnTF \l_@@_replacement_str {#2}
+ { \use:c { tl_replace_ #1 :Nnn } \l_@@_replacement_str {#2} {#3} #4 }
}
% \end{macrocode}
% \end{macro}
@@ -9638,7 +9804,7 @@ This package consists of the file ctex.dtx, and the derived files
\group_end:
\ctex_get_macro_meaning:NTF #1
{
- \tl_if_empty:NTF \l_@@_parameter_tl
+ \str_if_empty:NTF \l_@@_parameter_str
{ \@@_hookto_cmd_parameterless:Nnnw #1 {#2} {#4} }
{ \@@_hookto_cmd_parameter:Nnnnw #1 {#2} {#3} {#4} }
}
@@ -9652,9 +9818,9 @@ This package consists of the file ctex.dtx, and the derived files
% \begin{macrocode}
\cs_new_protected:Npn \@@_hookto_cmd_parameterless:Nnnw #1#2#3
{
- \tl_if_empty:NF \l_@@_prefix_tl
- { \tl_rescan:nx { } { \l_@@_prefix_tl } }
- \edef #1
+ \str_if_empty:NF \l_@@_prefix_str
+ { \tl_rescan:nx { } { \l_@@_prefix_str } }
+ \tex_edef:D #1
{
\use:c { @@_ #2 _hook_aux:nn }
{ \exp_not:o {#1} }
@@ -9662,6 +9828,7 @@ This package consists of the file ctex.dtx, and the derived files
}
\@@_patch_true:w
}
+\cs_generate_variant:Nn \tl_rescan:nn { nx }
\cs_new:Npn \@@_left_hook_aux:nn #1#2 { #2#1 }
\cs_new_eq:NN \@@_right_hook_aux:nn \use:nn
% \end{macrocode}
@@ -9672,12 +9839,11 @@ This package consists of the file ctex.dtx, and the derived files
% \begin{macrocode}
\cs_new_protected:Npn \@@_hookto_cmd_parameter:Nnnnw #1#2#3#4
{
- \@@_patch_rebuild:Nn \CTEXPATCHRESCANCMD {#3}
- \cs_if_eq:NNTF #1 \CTEXPATCHRESCANCMD
+ \@@_patch_rebuild:Nn \@@_rebuild_cmd:w {#3}
+ \cs_if_eq:NNTF #1 \@@_rebuild_cmd:w
{
- \use:c { tl_put_ #2 :Nx } \l_@@_replacement_tl { \tl_to_str:n {#4} }
- \@@_patch_rebuild:Nn \CTEXPATCHRESCANCMD {#3}
- \cs_set_eq:NN #1 \CTEXPATCHRESCANCMD
+ \use:c { str_put_ #2 :Nn } \l_@@_replacement_str {#4}
+ \@@_patch_rebuild:Nn #1 {#3}
\@@_patch_true:w
}
{ \@@_patch_false:w }
diff --git a/Master/texmf-dist/source/latex/ctex/ctexpunct.spa b/Master/texmf-dist/source/latex/ctex/ctexpunct.spa
index d357f18a679..2c6e37c4970 100644
--- a/Master/texmf-dist/source/latex/ctex/ctexpunct.spa
+++ b/Master/texmf-dist/source/latex/ctex/ctexpunct.spa
@@ -2,7 +2,7 @@
\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,,,}
\ctexspadef{adobezhfs}{76,10,56,8,63,4,61,4,71,4,65,4,71,4,74,4,54,4,54,4,62,4,62,4,0,0,11,11,4,72,5,71,8,79,8,79,18,68,19,68,18,68,2,46,14,13,4,71,4,65,4,71,4,74,4,54,4,54,4,62,4,62,10,76,8,56,4,63,4,61,,,}
-\ctexspadef{fandolzhsong}{69,19,58,8,59,9,60,10,60,11,63,13,67,17,57,7,61,11,54,5,57,7,58,7,0,0,17,17,15,65,14,64,19,69,8,81,20,70,19,69,20,70,7,57,14,14,11,61,13,63,17,67,7,57,11,61,4,55,7,57,7,58,19,69,8,58,9,59,10,60,,,}
+\ctexspadef{fandolzhsong}{69,19,58,8,59,9,60,10,60,11,63,13,67,17,57,7,61,11,54,5,57,7,58,7,0,0,17,17,15,65,14,64,19,69,8,81,20,70,19,69,20,70,7,57,14,14,11,61,13,63,17,67,7,57,11,61,5,55,7,57,7,58,19,69,8,58,9,59,10,60,,,}
\ctexspadef{fandolzhsongb}{66,16,54,4,59,9,60,10,60,11,63,13,66,16,57,7,61,11,54,5,57,7,58,7,0,0,14,14,15,65,14,64,17,67,6,78,17,67,17,67,17,67,32,32,14,14,11,61,13,63,16,66,7,57,11,61,4,55,7,57,7,58,16,66,4,54,9,59,10,60,,,}
\ctexspadef{fandolzhhei}{71,21,60,10,59,9,60,10,60,11,62,12,67,17,55,5,61,11,54,5,57,7,58,7,0,0,18,18,15,65,14,64,21,71,10,82,21,71,21,71,21,71,32,32,14,14,11,61,12,62,17,67,5,55,11,61,5,55,7,57,7,58,21,71,10,60,9,59,10,60,,,}
\ctexspadef{fandolzhheib}{70,20,60,10,59,9,60,10,60,11,63,13,65,15,56,6,61,11,54,5,57,7,58,7,3,3,18,18,15,65,14,64,20,70,8,82,20,70,20,70,20,69,33,33,11,11,11,61,13,63,15,65,6,56,11,61,5,55,7,57,7,58,20,70,10,60,9,59,10,60,,,}
diff --git a/Master/texmf-dist/tex/generic/ctex/ctexspamacro.tex b/Master/texmf-dist/tex/generic/ctex/ctexspamacro.tex
index 4f4e629c38f..c4755f49393 100644
--- a/Master/texmf-dist/tex/generic/ctex/ctexspamacro.tex
+++ b/Master/texmf-dist/tex/generic/ctex/ctexspamacro.tex
@@ -28,7 +28,7 @@
%%
\input expl3-generic %
\ExplSyntaxOn
-\xetex_if_engine:F
+\sys_if_engine_xetex:F
{
\msg_new:nn { ctex } { xetex }
{ XeTeX~is~required~to~compile~this~document! }
@@ -59,7 +59,7 @@
\l__ctex_punct_font
\clist_clear:N \l__ctex_punct_bounds_clist
\seq_map_inline:Nn \c__ctex_punct_seq
- { \exp_args:No \__ctex_save_bounds:n { \int_use:N \XeTeXcharglyph ##1 } }
+ { \exp_args:No \__ctex_save_bounds:n { \int_use:N \xetex_charglyph:D ##1 } }
\iow_now:Nx \g__ctex_spa_iow
{
\token_to_str:N \ctexspadef {#1}
@@ -83,7 +83,7 @@
round
(
\dim_to_decimal_in_unit:nn
- { 100 \XeTeXglyphbounds #1 ~ #2 }
+ { 100 \xetex_glyphbounds:D #1 ~ #2 }
{ 1 em }
)
}
diff --git a/Master/texmf-dist/tex/generic/ctex/zhadobefonts.tex b/Master/texmf-dist/tex/generic/ctex/zhadobefonts.tex
index 2fb29caa89f..cf3fbf1e638 100644
--- a/Master/texmf-dist/tex/generic/ctex/zhadobefonts.tex
+++ b/Master/texmf-dist/tex/generic/ctex/zhadobefonts.tex
@@ -76,7 +76,7 @@
\fi
\endgroup
\ProvidesFile{zhadobefonts.tex}%
- [2015/07/01 v2.2 Adobe font map loader for DVIPDFMx (CTEX)]
+ [2016/02/02 v2.3 Adobe font map loader for DVIPDFMx (CTEX)]
\ifzhmappdf
%% pdfTeX does not support OTF fonts
diff --git a/Master/texmf-dist/tex/generic/ctex/zhfandolfonts.tex b/Master/texmf-dist/tex/generic/ctex/zhfandolfonts.tex
index ddc33ab7737..eccb9dc1ddd 100644
--- a/Master/texmf-dist/tex/generic/ctex/zhfandolfonts.tex
+++ b/Master/texmf-dist/tex/generic/ctex/zhfandolfonts.tex
@@ -76,7 +76,7 @@
\fi
\endgroup
\ProvidesFile{zhfandolfonts.tex}%
- [2015/07/01 v2.2 Fandol font map loader for DVIPDFMx (CTEX)]
+ [2016/02/02 v2.3 Fandol font map loader for DVIPDFMx (CTEX)]
\ifzhmappdf
%% pdfTeX does not support OTF fonts
diff --git a/Master/texmf-dist/tex/generic/ctex/zhfounderfonts.tex b/Master/texmf-dist/tex/generic/ctex/zhfounderfonts.tex
index 9df31d39992..7efb4acec14 100644
--- a/Master/texmf-dist/tex/generic/ctex/zhfounderfonts.tex
+++ b/Master/texmf-dist/tex/generic/ctex/zhfounderfonts.tex
@@ -76,7 +76,7 @@
\fi
\endgroup
\ProvidesFile{zhfounderfonts.tex}%
- [2015/07/01 v2.2 Founder font map loader for pdfTeX and DVIPDFMx (CTEX)]
+ [2016/02/02 v2.3 Founder font map loader for pdfTeX and DVIPDFMx (CTEX)]
\ifzhmappdf
\pdfmapline{=gbk@UGBK@ <FZSSK.TTF}
diff --git a/Master/texmf-dist/tex/generic/ctex/zhubuntufonts.tex b/Master/texmf-dist/tex/generic/ctex/zhubuntufonts.tex
index e26a0d0545c..b24820ba5b5 100644
--- a/Master/texmf-dist/tex/generic/ctex/zhubuntufonts.tex
+++ b/Master/texmf-dist/tex/generic/ctex/zhubuntufonts.tex
@@ -76,7 +76,7 @@
\fi
\endgroup
\ProvidesFile{zhubuntufonts.tex}%
- [2015/07/01 v2.2 Ubuntu font map loader for pdfTeX and DVIPDFMx (CTEX)]
+ [2016/02/02 v2.3 Ubuntu font map loader for pdfTeX and DVIPDFMx (CTEX)]
\ifzhmappdf
\pdfmapline{=gbk@UGBK@ <uming.ttc}
diff --git a/Master/texmf-dist/tex/generic/ctex/zhwindowsfonts.tex b/Master/texmf-dist/tex/generic/ctex/zhwindowsfonts.tex
index 0775bf882d0..367d4b8ede1 100644
--- a/Master/texmf-dist/tex/generic/ctex/zhwindowsfonts.tex
+++ b/Master/texmf-dist/tex/generic/ctex/zhwindowsfonts.tex
@@ -76,7 +76,7 @@
\fi
\endgroup
\ProvidesFile{zhwindowsfonts.tex}%
- [2015/07/01 v2.2 Windows font map loader for pdfTeX and DVIPDFMx (CTEX)]
+ [2016/02/02 v2.3 Windows font map loader for pdfTeX and DVIPDFMx (CTEX)]
\ifzhmappdf
\pdfmapline{=gbk@UGBK@ <simsun.ttc}
diff --git a/Master/texmf-dist/tex/latex/ctex/config/ctex-name-gbk.cfg b/Master/texmf-dist/tex/latex/ctex/config/ctex-name-gbk.cfg
index e7b67910cf2..2a0669607fe 100644
--- a/Master/texmf-dist/tex/latex/ctex/config/ctex-name-gbk.cfg
+++ b/Master/texmf-dist/tex/latex/ctex/config/ctex-name-gbk.cfg
@@ -26,10 +26,10 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{Caption with encoding GBK (CTEX)}
\ProvidesExplFile{ctex-name-gbk.cfg}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.3}{\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 7b7304d527c..7499917f405 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 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{Caption with encoding UTF8 (CTEX)}
\ProvidesExplFile{ctex-name-utf8.cfg}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.3}{\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 b27c064532a..8e6fb24890f 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 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{Configuration file (CTEX)}
\ProvidesExplFile{\ExplFileName.cfg}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.3}{\ExplFileDescription}
%%
%%
%%
diff --git a/Master/texmf-dist/tex/latex/ctex/config/ctexopts.cfg b/Master/texmf-dist/tex/latex/ctex/config/ctexopts.cfg
index 82074e82836..5fb5a197174 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 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{Option configuration file (CTEX)}
\ProvidesExplFile{ctexopts.cfg}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.3}{\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 c1dfb48076e..41f9a6cbf32 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctex-article.def
+++ b/Master/texmf-dist/tex/latex/ctex/ctex-article.def
@@ -26,11 +26,10 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{Heading modification for article (CTEX)}
\ProvidesExplFile{ctex-article.def}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
-
+ {\ExplFileDate}{2.3}{\ExplFileDescription}
\seq_new:N \c__ctex_section_headings_seq
\seq_gset_from_clist:Nn \c__ctex_section_headings_seq
{ section , subsection , subsubsection , paragraph , subparagraph }
@@ -49,20 +48,22 @@
}
\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@post#1 }
- }
- \exp_not:c { CTEX@#1@aftername }
+ \group_begin:
+ \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@post#1 }
+ }
+ \group_end:
}
}
\cs_new_protected_nopar:Npn \__ctex_def_heading_keys:n #1
@@ -87,35 +88,23 @@
#1 / runin .bool_set:N = \exp_not:c { CTEX@#1@runin } ,
#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 / numbering .initial:n = true ,
#1 / beforeskip .initial:n = \c_zero_skip ,
#1 / afterskip .initial:n = \c_zero_skip ,
#1 / indent .initial:n = \c_zero_dim ,
- #1 / beforeskip .value_required: ,
- #1 / afterskip .value_required: ,
- #1 / indent .value_required: ,
+ #1 / beforeskip .value_required:n = true ,
+ #1 / afterskip .value_required:n = true ,
+ #1 / indent .value_required:n = true ,
}
}
\NewDocumentCommand \ctex_assign_heading_name:nn
@@ -163,7 +152,7 @@
{\interlinepenalty \@M
\normalfont \parindent \dimexpr \CTEX@part@indent \relax \CTEX@part@format
\ifnum \c@secnumdepth >\m@ne \ifodd \CTEX@part@numbering
- \CTEX@partname
+ \CTEX@partname \CTEX@part@aftername
\fi \fi
\CTEX@part@titleformat{#2}%
\markboth{}{}%
@@ -198,9 +187,7 @@
{\@ssect{#3}{#4}{#5}{#6}}%
{\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}}
\def\@seccntformat#1{%
- \@ifundefined{CTEX@#1name}%
- {\csname the#1\endcsname\quad}%
- {\csname CTEX@#1name\endcsname}}
+ \csname CTEX@#1name\endcsname \csname CTEX@#1@aftername\endcsname}
\def\@sect#1#2#3#4#5#6[#7]#8{%
\ifnum #2>\c@secnumdepth
\let\@svsec\@empty
@@ -225,9 +212,7 @@
\addcontentsline{toc}{#1}{%
\ifnum #2>\c@secnumdepth \else
\ifodd \csname CTEX@#1@numbering\endcsname
- \protect\numberline{\@ifundefined{CTEXthe#1}%
- {\csname the#1\endcsname}%
- {\csname CTEXthe#1\endcsname}}%
+ \protect\numberline{\csname CTEXthe#1\endcsname}%
\fi
\fi
#7}%
@@ -241,9 +226,7 @@
\addcontentsline{toc}{#1}{%
\ifnum #2>\c@secnumdepth \else
\ifodd \csname CTEX@#1@numbering\endcsname
- \protect\numberline{\@ifundefined{CTEXthe#1}%
- {\csname the#1\endcsname}%
- {\csname CTEXthe#1\endcsname}}%
+ \protect\numberline{\csname CTEXthe#1\endcsname}%
\fi
\fi
#7}}%
@@ -397,6 +380,43 @@
{ \ctex_titlesec_hook: }
}
}
+\group_begin:
+\char_set_catcode_other:N \#
+\cs_new_protected_nopar:Npn \ctex_titleps_hook:
+ {
+ \ctex_patch_cmd:Nnn \ttl@settopmark
+ { \protect \@namedef { the#1 } { \@nameuse { the#1 } } }
+ {
+ \protect \@namedef { the#1 } { \@nameuse { the#1 } }
+ \CTEX@titlepslabel@set {#1}
+ }
+ \ctex_patch_cmd:Nnn \ttl@setsubmark
+ { \protect \@namedef { the#1 } { } }
+ {
+ \protect \@namedef { the#1 } { }
+ \CTEX@titlepslabel@clear {#1}
+ }
+ \ctex_patch_cmd:Nnn \ttl@setsubmark
+ { \protect \@namedef { the#2 } { \@nameuse { the#2 } } }
+ {
+ \protect \@namedef { the#2 } { \@nameuse { the#2 } }
+ \CTEX@titlepslabel@set {#2}
+ }
+ }
+\group_end:
+\cs_new_nopar:Npn \CTEX@titlepslabel@set #1
+ {
+ \cs_if_free:cF { CTEXthe#1 }
+ { \protect \@namedef { CTEXthe#1 } { \@nameuse { CTEXthe#1 } } }
+ }
+\cs_new_nopar:Npn \CTEX@titlepslabel@clear #1
+ {
+ \cs_if_free:cF { CTEXthe#1 }
+ { \protect \@namedef { CTEXthe#1 } { } }
+ }
+\ctex_at_end_package:nn { titlesec }
+ { \cs_if_free:NF \ttl@settopmark { \ctex_titleps_hook: } }
+\ctex_at_end_package:nn { titleps } { \ctex_titleps_hook: }
\cs_new_protected:Npn \CTEX@toc@width@n #1
{
\hbox_set:Nn \l__ctex_tmp_box {#1}
diff --git a/Master/texmf-dist/tex/latex/ctex/ctex-book.def b/Master/texmf-dist/tex/latex/ctex/ctex-book.def
index 5978f8e9c95..a52e2dff675 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctex-book.def
+++ b/Master/texmf-dist/tex/latex/ctex/ctex-book.def
@@ -26,11 +26,10 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{Heading modification for book (CTEX)}
\ProvidesExplFile{ctex-book.def}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
-
+ {\ExplFileDate}{2.3}{\ExplFileDescription}
\seq_new:N \c__ctex_section_headings_seq
\seq_gset_from_clist:Nn \c__ctex_section_headings_seq
{ section , subsection , subsubsection , paragraph , subparagraph }
@@ -50,20 +49,22 @@
}
\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@post#1 }
- }
- \exp_not:c { CTEX@#1@aftername }
+ \group_begin:
+ \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@post#1 }
+ }
+ \group_end:
}
}
\cs_new_protected_nopar:Npn \__ctex_def_heading_keys:n #1
@@ -88,35 +89,23 @@
#1 / runin .bool_set:N = \exp_not:c { CTEX@#1@runin } ,
#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 / numbering .initial:n = true ,
#1 / beforeskip .initial:n = \c_zero_skip ,
#1 / afterskip .initial:n = \c_zero_skip ,
#1 / indent .initial:n = \c_zero_dim ,
- #1 / beforeskip .value_required: ,
- #1 / afterskip .value_required: ,
- #1 / indent .value_required: ,
+ #1 / beforeskip .value_required:n = true ,
+ #1 / afterskip .value_required:n = true ,
+ #1 / indent .value_required:n = true ,
}
}
\NewDocumentCommand \ctex_assign_heading_name:nn
@@ -175,7 +164,7 @@
{\interlinepenalty \@M
\normalfont \CTEX@part@format
\ifnum \c@secnumdepth >-2\relax \ifodd \CTEX@part@numbering
- \CTEX@partname
+ \CTEX@partname \CTEX@part@aftername
\fi \fi
\CTEX@part@titleformat{#2}%
\CTEX@part@aftertitle}%
@@ -242,7 +231,7 @@
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\ifodd \CTEX@chapter@numbering
- \CTEX@chaptername
+ \CTEX@chaptername \CTEX@chapter@aftername
\fi
\fi
\fi
@@ -280,9 +269,7 @@
{\@ssect{#3}{#4}{#5}{#6}}%
{\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}}
\def\@seccntformat#1{%
- \@ifundefined{CTEX@#1name}%
- {\csname the#1\endcsname\quad}%
- {\csname CTEX@#1name\endcsname}}
+ \csname CTEX@#1name\endcsname \csname CTEX@#1@aftername\endcsname}
\def\@sect#1#2#3#4#5#6[#7]#8{%
\ifnum #2>\c@secnumdepth
\let\@svsec\@empty
@@ -307,9 +294,7 @@
\addcontentsline{toc}{#1}{%
\ifnum #2>\c@secnumdepth \else
\ifodd \csname CTEX@#1@numbering\endcsname
- \protect\numberline{\@ifundefined{CTEXthe#1}%
- {\csname the#1\endcsname}%
- {\csname CTEXthe#1\endcsname}}%
+ \protect\numberline{\csname CTEXthe#1\endcsname}%
\fi
\fi
#7}%
@@ -323,9 +308,7 @@
\addcontentsline{toc}{#1}{%
\ifnum #2>\c@secnumdepth \else
\ifodd \csname CTEX@#1@numbering\endcsname
- \protect\numberline{\@ifundefined{CTEXthe#1}%
- {\csname the#1\endcsname}%
- {\csname CTEXthe#1\endcsname}}%
+ \protect\numberline{\csname CTEXthe#1\endcsname}%
\fi
\fi
#7}}%
@@ -479,6 +462,43 @@
{ \ctex_titlesec_hook: }
}
}
+\group_begin:
+\char_set_catcode_other:N \#
+\cs_new_protected_nopar:Npn \ctex_titleps_hook:
+ {
+ \ctex_patch_cmd:Nnn \ttl@settopmark
+ { \protect \@namedef { the#1 } { \@nameuse { the#1 } } }
+ {
+ \protect \@namedef { the#1 } { \@nameuse { the#1 } }
+ \CTEX@titlepslabel@set {#1}
+ }
+ \ctex_patch_cmd:Nnn \ttl@setsubmark
+ { \protect \@namedef { the#1 } { } }
+ {
+ \protect \@namedef { the#1 } { }
+ \CTEX@titlepslabel@clear {#1}
+ }
+ \ctex_patch_cmd:Nnn \ttl@setsubmark
+ { \protect \@namedef { the#2 } { \@nameuse { the#2 } } }
+ {
+ \protect \@namedef { the#2 } { \@nameuse { the#2 } }
+ \CTEX@titlepslabel@set {#2}
+ }
+ }
+\group_end:
+\cs_new_nopar:Npn \CTEX@titlepslabel@set #1
+ {
+ \cs_if_free:cF { CTEXthe#1 }
+ { \protect \@namedef { CTEXthe#1 } { \@nameuse { CTEXthe#1 } } }
+ }
+\cs_new_nopar:Npn \CTEX@titlepslabel@clear #1
+ {
+ \cs_if_free:cF { CTEXthe#1 }
+ { \protect \@namedef { CTEXthe#1 } { } }
+ }
+\ctex_at_end_package:nn { titlesec }
+ { \cs_if_free:NF \ttl@settopmark { \ctex_titleps_hook: } }
+\ctex_at_end_package:nn { titleps } { \ctex_titleps_hook: }
\cs_new_protected:Npn \CTEX@toc@width@n #1
{
\hbox_set:Nn \l__ctex_tmp_box {#1}
diff --git a/Master/texmf-dist/tex/latex/ctex/ctex-c5size.clo b/Master/texmf-dist/tex/latex/ctex/ctex-c5size.clo
index 26993a98cf9..cc39c258635 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 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{c5size option (CTEX)}
\ProvidesExplFile{ctex-c5size.clo}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.3}{\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 0aa0c4088b8..f3cfc2fd419 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 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{cs4size option (CTEX)}
\ProvidesExplFile{ctex-cs4size.clo}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.3}{\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 629360a2279..74d2d488c7d 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctex-report.def
+++ b/Master/texmf-dist/tex/latex/ctex/ctex-report.def
@@ -26,11 +26,10 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{Heading modification for report (CTEX)}
\ProvidesExplFile{ctex-report.def}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
-
+ {\ExplFileDate}{2.3}{\ExplFileDescription}
\seq_new:N \c__ctex_section_headings_seq
\seq_gset_from_clist:Nn \c__ctex_section_headings_seq
{ section , subsection , subsubsection , paragraph , subparagraph }
@@ -50,20 +49,22 @@
}
\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@post#1 }
- }
- \exp_not:c { CTEX@#1@aftername }
+ \group_begin:
+ \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@post#1 }
+ }
+ \group_end:
}
}
\cs_new_protected_nopar:Npn \__ctex_def_heading_keys:n #1
@@ -88,35 +89,23 @@
#1 / runin .bool_set:N = \exp_not:c { CTEX@#1@runin } ,
#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 / numbering .initial:n = true ,
#1 / beforeskip .initial:n = \c_zero_skip ,
#1 / afterskip .initial:n = \c_zero_skip ,
#1 / indent .initial:n = \c_zero_dim ,
- #1 / beforeskip .value_required: ,
- #1 / afterskip .value_required: ,
- #1 / indent .value_required: ,
+ #1 / beforeskip .value_required:n = true ,
+ #1 / afterskip .value_required:n = true ,
+ #1 / indent .value_required:n = true ,
}
}
\NewDocumentCommand \ctex_assign_heading_name:nn
@@ -175,7 +164,7 @@
{\interlinepenalty \@M
\normalfont \CTEX@part@format
\ifnum \c@secnumdepth >-2\relax \ifodd \CTEX@part@numbering
- \CTEX@partname
+ \CTEX@partname \CTEX@part@aftername
\fi \fi
\CTEX@part@titleformat{#2}%
\CTEX@part@aftertitle}%
@@ -237,7 +226,7 @@
\CTEX@chapter@format
\ifnum \c@secnumdepth >\m@ne
\ifodd \CTEX@chapter@numbering
- \CTEX@chaptername
+ \CTEX@chaptername \CTEX@chapter@aftername
\fi
\fi
\interlinepenalty\@M
@@ -274,9 +263,7 @@
{\@ssect{#3}{#4}{#5}{#6}}%
{\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}}
\def\@seccntformat#1{%
- \@ifundefined{CTEX@#1name}%
- {\csname the#1\endcsname\quad}%
- {\csname CTEX@#1name\endcsname}}
+ \csname CTEX@#1name\endcsname \csname CTEX@#1@aftername\endcsname}
\def\@sect#1#2#3#4#5#6[#7]#8{%
\ifnum #2>\c@secnumdepth
\let\@svsec\@empty
@@ -301,9 +288,7 @@
\addcontentsline{toc}{#1}{%
\ifnum #2>\c@secnumdepth \else
\ifodd \csname CTEX@#1@numbering\endcsname
- \protect\numberline{\@ifundefined{CTEXthe#1}%
- {\csname the#1\endcsname}%
- {\csname CTEXthe#1\endcsname}}%
+ \protect\numberline{\csname CTEXthe#1\endcsname}%
\fi
\fi
#7}%
@@ -317,9 +302,7 @@
\addcontentsline{toc}{#1}{%
\ifnum #2>\c@secnumdepth \else
\ifodd \csname CTEX@#1@numbering\endcsname
- \protect\numberline{\@ifundefined{CTEXthe#1}%
- {\csname the#1\endcsname}%
- {\csname CTEXthe#1\endcsname}}%
+ \protect\numberline{\csname CTEXthe#1\endcsname}%
\fi
\fi
#7}}%
@@ -473,6 +456,43 @@
{ \ctex_titlesec_hook: }
}
}
+\group_begin:
+\char_set_catcode_other:N \#
+\cs_new_protected_nopar:Npn \ctex_titleps_hook:
+ {
+ \ctex_patch_cmd:Nnn \ttl@settopmark
+ { \protect \@namedef { the#1 } { \@nameuse { the#1 } } }
+ {
+ \protect \@namedef { the#1 } { \@nameuse { the#1 } }
+ \CTEX@titlepslabel@set {#1}
+ }
+ \ctex_patch_cmd:Nnn \ttl@setsubmark
+ { \protect \@namedef { the#1 } { } }
+ {
+ \protect \@namedef { the#1 } { }
+ \CTEX@titlepslabel@clear {#1}
+ }
+ \ctex_patch_cmd:Nnn \ttl@setsubmark
+ { \protect \@namedef { the#2 } { \@nameuse { the#2 } } }
+ {
+ \protect \@namedef { the#2 } { \@nameuse { the#2 } }
+ \CTEX@titlepslabel@set {#2}
+ }
+ }
+\group_end:
+\cs_new_nopar:Npn \CTEX@titlepslabel@set #1
+ {
+ \cs_if_free:cF { CTEXthe#1 }
+ { \protect \@namedef { CTEXthe#1 } { \@nameuse { CTEXthe#1 } } }
+ }
+\cs_new_nopar:Npn \CTEX@titlepslabel@clear #1
+ {
+ \cs_if_free:cF { CTEXthe#1 }
+ { \protect \@namedef { CTEXthe#1 } { } }
+ }
+\ctex_at_end_package:nn { titlesec }
+ { \cs_if_free:NF \ttl@settopmark { \ctex_titleps_hook: } }
+\ctex_at_end_package:nn { titleps } { \ctex_titleps_hook: }
\cs_new_protected:Npn \CTEX@toc@width@n #1
{
\hbox_set:Nn \l__ctex_tmp_box {#1}
diff --git a/Master/texmf-dist/tex/latex/ctex/ctex.sty b/Master/texmf-dist/tex/latex/ctex/ctex.sty
index 82a943cb854..af5e62b22d2 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctex.sty
+++ b/Master/texmf-dist/tex/latex/ctex/ctex.sty
@@ -28,10 +28,10 @@
%%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\GetIdInfo$Id: ctex.dtx 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{Chinese adapter in LaTeX (CTEX)}
\ProvidesExplPackage{\ExplFileName}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.3}{\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 }
@@ -47,6 +47,24 @@
{ \msg_error:nnn { ctex } { subpackage-loaded } { ctexheading } }
{ \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. }
+ {
+ Please~update~an~up~to~date~version~of~the~bundles\\\\
+ `l3kernel'~and~`l3packages'\\\\
+ using~your~TeX~package~manager~or~from~CTAN.
+ }
+\@ifpackagelater { expl3 } { 2015/12/20 } { }
+ { \msg_error:nnn { ctex } { l3-too-old } { expl3 } }
+\msg_new:nnnn { ctex } { engine-not-supported }
+ { Engine~`#1'~is~not~yet~supported,~ctex~will~abort! }
+ { You~can~switch~to~xelatex,~lualatex~or~pdflatex.}
+\file_if_exist:nTF { ctex-engine- \c_sys_engine_str .def }
+ {
+ \str_const:Nx \c__ctex_engine_file_str
+ { ctex-engine- \c_sys_engine_str .def }
+ }
+ { \msg_critical:nnx { ctex } { engine-not-supported } { \c_sys_engine_str } }
\RequirePackage { ctexhook , ctexpatch }
\RequirePackage { fix-cm , everysel }
\tl_new:N \l__ctex_tmp_tl
@@ -92,20 +110,9 @@
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
- }
+\sys_if_output_pdf:TF
+ { \cs_new_eq:NN \ifctexpdf \if_true: }
+ { \cs_new_eq:NN \ifctexpdf \if_false: }
\cs_new_eq:NN \ctex_if_preamble:TF \use_i:nn
\ctex_after_end_preamble:n { \cs_set_eq:NN \ctex_if_preamble:TF \use_ii:nn }
\cs_new:Npn \ctex_set_default_ccwd:Nn #1#2
@@ -120,17 +127,15 @@
\exp_after:wN \__ctex_default_pt:w
\dim_use:N \etex_dimexpr:D #1 pt \scan_stop: \q_stop
}
-\group_begin:
- \char_set_catcode_other:N \P
- \char_set_catcode_other:N \T
-\tex_lowercase:D
+\use:x
{
- \group_end:
- \cs_new:Npn \__ctex_default_pt:w #1 PT #2 \q_stop { #1 PT }
+ \cs_new:Npn \exp_not:N \__ctex_default_pt:w
+ ##1 \tl_to_str:n { pt } ##2 \exp_not:N \q_stop
+ { ##1 \tl_to_str:n { pt } }
}
\tl_new:N \l__ctex_encoding_tl
\tl_set:Nx \l__ctex_encoding_tl
- { \pdftex_if_engine:TF { GBK } { UTF8 } }
+ { \sys_if_engine_pdftex:TF { GBK } { UTF8 } }
\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
@@ -166,11 +171,11 @@
{ Option~ `zihao=-4'~ is~ set. }
\keys_set:nn { ctex / option } { zihao = -4 }
} ,
- c5size .value_forbidden: ,
- cs4size .value_forbidden: ,
+ c5size .value_forbidden:n = true ,
+ cs4size .value_forbidden:n = true ,
linespread .fp_set:N = \l__ctex_line_spread_fp ,
linespread .initial:n = { \c_nan_fp } ,
- linespread .value_required: ,
+ linespread .value_required:n = true ,
autoindent .choice: ,
autoindent .default:n = { true } ,
autoindent / true .code:n =
@@ -197,7 +202,7 @@
options.~
}
} ,
- indent .value_forbidden: ,
+ indent .value_forbidden:n = true ,
noindent .code:n =
{
\msg_warning:nnn { ctex } { deprecated-option }
@@ -207,11 +212,11 @@
options.
}
} ,
- noindent .value_forbidden: ,
+ noindent .value_forbidden:n = true ,
GBK .code:n = { \tl_set:Nn \l__ctex_encoding_tl { GBK } } ,
UTF8 .code:n = { \tl_set:Nn \l__ctex_encoding_tl { UTF8 } } ,
- GBK .value_forbidden: ,
- UTF8 .value_forbidden: ,
+ GBK .value_forbidden:n = true ,
+ UTF8 .value_forbidden:n = true ,
fontset .tl_gset:N = \g__ctex_fontset_tl ,
nofonts .code:n =
{
@@ -240,9 +245,9 @@
}
\keys_set:nn { ctex / option } { fontset = windows }
} ,
- nofonts .value_forbidden: ,
- winfonts .value_forbidden: ,
- adobefonts .value_forbidden: ,
+ nofonts .value_forbidden:n = true ,
+ winfonts .value_forbidden:n = true ,
+ adobefonts .value_forbidden:n = true ,
zhmap .choice: ,
zhmap .default:n = { true } ,
zhmap / zhmCJK .code:n =
@@ -266,7 +271,7 @@
{ Option~ `zhmap=false'~ is~ set. }
\keys_set:nn { ctex / option } { zhmap = false }
} ,
- nozhmap .value_forbidden: ,
+ nozhmap .value_forbidden:n = true ,
punct .tl_set:N = \l__ctex_punct_tl ,
punct .default:n = { quanjiao } ,
punct .initial:n = { quanjiao } ,
@@ -276,7 +281,7 @@
{ Option~ `punct=plain'~ is~ set. }
\keys_set:nn { ctex / option } { punct = plain }
} ,
- nopunct .value_forbidden: ,
+ nopunct .value_forbidden:n = true ,
space .choices:nn =
{ true , auto , false }
{
@@ -290,14 +295,14 @@
{ Option~ `space=false'~ is~ set. }
\keys_set:nn { ctex / option } { space = false }
} ,
- nospace .value_forbidden: ,
+ nospace .value_forbidden:n = true ,
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: ,
+ sub3section .value_forbidden:n = true ,
+ sub4section .value_forbidden:n = true ,
scheme .tl_set:N = \l__ctex_scheme_tl ,
scheme .default:n = { chinese } ,
scheme .initial:n = { chinese } ,
@@ -313,8 +318,8 @@
{ Option~ `scheme = plain' ~ is~ set. }
\keys_set:nn { ctex / option } { scheme = plain }
} ,
- cap .value_forbidden: ,
- nocap .value_forbidden: ,
+ cap .value_forbidden:n = true ,
+ nocap .value_forbidden:n = true ,
fntef .code:n =
{
\msg_warning:nnn { ctex } { deprecated-option }
@@ -349,7 +354,7 @@
{
#1 .code:n =
{ \cs_gset_eq:NN \g__ctex_font_size_flag \c_two } ,
- #1 .value_forbidden: ,
+ #1 .value_forbidden:n = true ,
}
}
\use:x { \keys_define:nn { ctex / option } { \exp_not:o { \l__ctex_tmp_tl } } }
@@ -378,17 +383,7 @@
\cs_new_protected_nopar:Npn \ctex_hypersetup:n #1
{ \PassOptionsToPackage {#1} { hyperref } }
}
-\pdftex_if_engine:TF
- {
- \tl_set:Nx \l__ctex_encoding_tl { \l__ctex_encoding_tl }
- \ctex_file_input:n { ctex-engine-pdftex.def }
- }
- {
- \tl_set:Nn \l__ctex_encoding_tl { UTF8 }
- \xetex_if_engine:TF
- { \ctex_file_input:n { ctex-engine-xetex.def } }
- { \ctex_file_input:n { ctex-engine-luatex.def } }
- }
+\ctex_file_input:n { \c__ctex_engine_file_str }
\keys_define:nn { ctex }
{
autoindent .choice: ,
@@ -430,7 +425,7 @@
\ctex_set_default_ccwd:Nn \l__ctex_line_stretch_tl {#1}
\ctex_select_size:
} ,
- linestretch .value_required:
+ linestretch .value_required:n = true
}
\tl_new:N \l__ctex_line_stretch_tl
\tl_set:Nn \l__ctex_line_stretch_tl { \ccwd }
diff --git a/Master/texmf-dist/tex/latex/ctex/ctexart.cls b/Master/texmf-dist/tex/latex/ctex/ctexart.cls
index 85cd0e3f0ab..ae5eb13faee 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctexart.cls
+++ b/Master/texmf-dist/tex/latex/ctex/ctexart.cls
@@ -28,10 +28,10 @@
%%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\GetIdInfo$Id: ctex.dtx 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{Chinese adapter for class article (CTEX)}
\ProvidesExplClass{ctexart}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.3}{\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
@@ -46,10 +46,19 @@
`l3kernel'~and~`l3packages'\\\\
using~your~TeX~package~manager~or~from~CTAN.
}
-\@ifpackagelater { expl3 } { 2014/07/20 } { }
+\@ifpackagelater { expl3 } { 2015/12/20 } { }
{ \msg_error:nnn { ctex } { l3-too-old } { expl3 } }
-\@ifpackagelater { l3keys2e } { 2014/05/05 } { }
+\@ifpackagelater { l3keys2e } { 2015/12/20 } { }
{ \msg_error:nnn { ctex } { l3-too-old } { l3keys2e } }
+\msg_new:nnnn { ctex } { engine-not-supported }
+ { Engine~`#1'~is~not~yet~supported,~ctex~will~abort! }
+ { You~can~switch~to~xelatex,~lualatex~or~pdflatex.}
+\file_if_exist:nTF { ctex-engine- \c_sys_engine_str .def }
+ {
+ \str_const:Nx \c__ctex_engine_file_str
+ { ctex-engine- \c_sys_engine_str .def }
+ }
+ { \msg_critical:nnx { ctex } { engine-not-supported } { \c_sys_engine_str } }
\RequirePackage { ctexhook , ctexpatch }
\RequirePackage { fix-cm , everysel }
\tl_new:N \l__ctex_tmp_tl
@@ -95,20 +104,9 @@
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
- }
+\sys_if_output_pdf:TF
+ { \cs_new_eq:NN \ifctexpdf \if_true: }
+ { \cs_new_eq:NN \ifctexpdf \if_false: }
\cs_new_eq:NN \ctex_if_preamble:TF \use_i:nn
\ctex_after_end_preamble:n { \cs_set_eq:NN \ctex_if_preamble:TF \use_ii:nn }
\cs_new:Npn \ctex_set_default_ccwd:Nn #1#2
@@ -123,17 +121,15 @@
\exp_after:wN \__ctex_default_pt:w
\dim_use:N \etex_dimexpr:D #1 pt \scan_stop: \q_stop
}
-\group_begin:
- \char_set_catcode_other:N \P
- \char_set_catcode_other:N \T
-\tex_lowercase:D
+\use:x
{
- \group_end:
- \cs_new:Npn \__ctex_default_pt:w #1 PT #2 \q_stop { #1 PT }
+ \cs_new:Npn \exp_not:N \__ctex_default_pt:w
+ ##1 \tl_to_str:n { pt } ##2 \exp_not:N \q_stop
+ { ##1 \tl_to_str:n { pt } }
}
\tl_new:N \l__ctex_encoding_tl
\tl_set:Nx \l__ctex_encoding_tl
- { \pdftex_if_engine:TF { GBK } { UTF8 } }
+ { \sys_if_engine_pdftex:TF { GBK } { UTF8 } }
\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
@@ -170,11 +166,11 @@
{ Option~ `zihao=-4'~ is~ set. }
\keys_set:nn { ctex / option } { zihao = -4 }
} ,
- c5size .value_forbidden: ,
- cs4size .value_forbidden: ,
+ c5size .value_forbidden:n = true ,
+ cs4size .value_forbidden:n = true ,
linespread .fp_set:N = \l__ctex_line_spread_fp ,
linespread .initial:n = { \c_nan_fp } ,
- linespread .value_required: ,
+ linespread .value_required:n = true ,
autoindent .choice: ,
autoindent .default:n = { true } ,
autoindent / true .code:n =
@@ -201,7 +197,7 @@
options.~
}
} ,
- indent .value_forbidden: ,
+ indent .value_forbidden:n = true ,
noindent .code:n =
{
\msg_warning:nnn { ctex } { deprecated-option }
@@ -211,11 +207,11 @@
options.
}
} ,
- noindent .value_forbidden: ,
+ noindent .value_forbidden:n = true ,
GBK .code:n = { \tl_set:Nn \l__ctex_encoding_tl { GBK } } ,
UTF8 .code:n = { \tl_set:Nn \l__ctex_encoding_tl { UTF8 } } ,
- GBK .value_forbidden: ,
- UTF8 .value_forbidden: ,
+ GBK .value_forbidden:n = true ,
+ UTF8 .value_forbidden:n = true ,
fontset .tl_gset:N = \g__ctex_fontset_tl ,
nofonts .code:n =
{
@@ -244,9 +240,9 @@
}
\keys_set:nn { ctex / option } { fontset = windows }
} ,
- nofonts .value_forbidden: ,
- winfonts .value_forbidden: ,
- adobefonts .value_forbidden: ,
+ nofonts .value_forbidden:n = true ,
+ winfonts .value_forbidden:n = true ,
+ adobefonts .value_forbidden:n = true ,
zhmap .choice: ,
zhmap .default:n = { true } ,
zhmap / zhmCJK .code:n =
@@ -270,7 +266,7 @@
{ Option~ `zhmap=false'~ is~ set. }
\keys_set:nn { ctex / option } { zhmap = false }
} ,
- nozhmap .value_forbidden: ,
+ nozhmap .value_forbidden:n = true ,
punct .tl_set:N = \l__ctex_punct_tl ,
punct .default:n = { quanjiao } ,
punct .initial:n = { quanjiao } ,
@@ -280,7 +276,7 @@
{ Option~ `punct=plain'~ is~ set. }
\keys_set:nn { ctex / option } { punct = plain }
} ,
- nopunct .value_forbidden: ,
+ nopunct .value_forbidden:n = true ,
space .choices:nn =
{ true , auto , false }
{
@@ -294,14 +290,14 @@
{ Option~ `space=false'~ is~ set. }
\keys_set:nn { ctex / option } { space = false }
} ,
- nospace .value_forbidden: ,
+ nospace .value_forbidden:n = true ,
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: ,
+ sub3section .value_forbidden:n = true ,
+ sub4section .value_forbidden:n = true ,
scheme .tl_set:N = \l__ctex_scheme_tl ,
scheme .default:n = { chinese } ,
scheme .initial:n = { chinese } ,
@@ -317,8 +313,8 @@
{ Option~ `scheme = plain' ~ is~ set. }
\keys_set:nn { ctex / option } { scheme = plain }
} ,
- cap .value_forbidden: ,
- nocap .value_forbidden: ,
+ cap .value_forbidden:n = true ,
+ nocap .value_forbidden:n = true ,
fntef .code:n =
{
\msg_warning:nnn { ctex } { deprecated-option }
@@ -356,7 +352,7 @@
\cs_gset_eq:NN \g__ctex_font_size_flag \c_two
\clist_gput_right:Nn \g__ctex_std_options_clist {#1}
} ,
- #1 .value_forbidden: ,
+ #1 .value_forbidden:n = true ,
}
}
\use:x { \keys_define:nn { ctex / option } { \exp_not:o { \l__ctex_tmp_tl } } }
@@ -398,17 +394,7 @@
\cs_new_protected_nopar:Npn \ctex_hypersetup:n #1
{ \PassOptionsToPackage {#1} { hyperref } }
}
-\pdftex_if_engine:TF
- {
- \tl_set:Nx \l__ctex_encoding_tl { \l__ctex_encoding_tl }
- \ctex_file_input:n { ctex-engine-pdftex.def }
- }
- {
- \tl_set:Nn \l__ctex_encoding_tl { UTF8 }
- \xetex_if_engine:TF
- { \ctex_file_input:n { ctex-engine-xetex.def } }
- { \ctex_file_input:n { ctex-engine-luatex.def } }
- }
+\ctex_file_input:n { \c__ctex_engine_file_str }
\keys_define:nn { ctex }
{
autoindent .choice: ,
@@ -450,7 +436,7 @@
\ctex_set_default_ccwd:Nn \l__ctex_line_stretch_tl {#1}
\ctex_select_size:
} ,
- linestretch .value_required:
+ linestretch .value_required:n = true
}
\tl_new:N \l__ctex_line_stretch_tl
\tl_set:Nn \l__ctex_line_stretch_tl { \ccwd }
@@ -597,7 +583,6 @@
appendixname .tl_set:N = \appendixname ,
bibname .tl_set:N = \refname
}
-
\seq_new:N \c__ctex_section_headings_seq
\seq_gset_from_clist:Nn \c__ctex_section_headings_seq
{ section , subsection , subsubsection , paragraph , subparagraph }
@@ -616,20 +601,22 @@
}
\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@post#1 }
- }
- \exp_not:c { CTEX@#1@aftername }
+ \group_begin:
+ \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@post#1 }
+ }
+ \group_end:
}
}
\cs_new_protected_nopar:Npn \__ctex_def_heading_keys:n #1
@@ -654,35 +641,23 @@
#1 / runin .bool_set:N = \exp_not:c { CTEX@#1@runin } ,
#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 / numbering .initial:n = true ,
#1 / beforeskip .initial:n = \c_zero_skip ,
#1 / afterskip .initial:n = \c_zero_skip ,
#1 / indent .initial:n = \c_zero_dim ,
- #1 / beforeskip .value_required: ,
- #1 / afterskip .value_required: ,
- #1 / indent .value_required: ,
+ #1 / beforeskip .value_required:n = true ,
+ #1 / afterskip .value_required:n = true ,
+ #1 / indent .value_required:n = true ,
}
}
\NewDocumentCommand \ctex_assign_heading_name:nn
@@ -730,7 +705,7 @@
{\interlinepenalty \@M
\normalfont \parindent \dimexpr \CTEX@part@indent \relax \CTEX@part@format
\ifnum \c@secnumdepth >\m@ne \ifodd \CTEX@part@numbering
- \CTEX@partname
+ \CTEX@partname \CTEX@part@aftername
\fi \fi
\CTEX@part@titleformat{#2}%
\markboth{}{}%
@@ -765,9 +740,7 @@
{\@ssect{#3}{#4}{#5}{#6}}%
{\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}}
\def\@seccntformat#1{%
- \@ifundefined{CTEX@#1name}%
- {\csname the#1\endcsname\quad}%
- {\csname CTEX@#1name\endcsname}}
+ \csname CTEX@#1name\endcsname \csname CTEX@#1@aftername\endcsname}
\def\@sect#1#2#3#4#5#6[#7]#8{%
\ifnum #2>\c@secnumdepth
\let\@svsec\@empty
@@ -792,9 +765,7 @@
\addcontentsline{toc}{#1}{%
\ifnum #2>\c@secnumdepth \else
\ifodd \csname CTEX@#1@numbering\endcsname
- \protect\numberline{\@ifundefined{CTEXthe#1}%
- {\csname the#1\endcsname}%
- {\csname CTEXthe#1\endcsname}}%
+ \protect\numberline{\csname CTEXthe#1\endcsname}%
\fi
\fi
#7}%
@@ -808,9 +779,7 @@
\addcontentsline{toc}{#1}{%
\ifnum #2>\c@secnumdepth \else
\ifodd \csname CTEX@#1@numbering\endcsname
- \protect\numberline{\@ifundefined{CTEXthe#1}%
- {\csname the#1\endcsname}%
- {\csname CTEXthe#1\endcsname}}%
+ \protect\numberline{\csname CTEXthe#1\endcsname}%
\fi
\fi
#7}}%
@@ -964,6 +933,43 @@
{ \ctex_titlesec_hook: }
}
}
+\group_begin:
+\char_set_catcode_other:N \#
+\cs_new_protected_nopar:Npn \ctex_titleps_hook:
+ {
+ \ctex_patch_cmd:Nnn \ttl@settopmark
+ { \protect \@namedef { the#1 } { \@nameuse { the#1 } } }
+ {
+ \protect \@namedef { the#1 } { \@nameuse { the#1 } }
+ \CTEX@titlepslabel@set {#1}
+ }
+ \ctex_patch_cmd:Nnn \ttl@setsubmark
+ { \protect \@namedef { the#1 } { } }
+ {
+ \protect \@namedef { the#1 } { }
+ \CTEX@titlepslabel@clear {#1}
+ }
+ \ctex_patch_cmd:Nnn \ttl@setsubmark
+ { \protect \@namedef { the#2 } { \@nameuse { the#2 } } }
+ {
+ \protect \@namedef { the#2 } { \@nameuse { the#2 } }
+ \CTEX@titlepslabel@set {#2}
+ }
+ }
+\group_end:
+\cs_new_nopar:Npn \CTEX@titlepslabel@set #1
+ {
+ \cs_if_free:cF { CTEXthe#1 }
+ { \protect \@namedef { CTEXthe#1 } { \@nameuse { CTEXthe#1 } } }
+ }
+\cs_new_nopar:Npn \CTEX@titlepslabel@clear #1
+ {
+ \cs_if_free:cF { CTEXthe#1 }
+ { \protect \@namedef { CTEXthe#1 } { } }
+ }
+\ctex_at_end_package:nn { titlesec }
+ { \cs_if_free:NF \ttl@settopmark { \ctex_titleps_hook: } }
+\ctex_at_end_package:nn { titleps } { \ctex_titleps_hook: }
\cs_new_protected:Npn \CTEX@toc@width@n #1
{
\hbox_set:Nn \l__ctex_tmp_box {#1}
diff --git a/Master/texmf-dist/tex/latex/ctex/ctexbook.cls b/Master/texmf-dist/tex/latex/ctex/ctexbook.cls
index 41e4f5b9690..e83470e2eed 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctexbook.cls
+++ b/Master/texmf-dist/tex/latex/ctex/ctexbook.cls
@@ -28,10 +28,10 @@
%%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\GetIdInfo$Id: ctex.dtx 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{Chinese adapter for class book (CTEX)}
\ProvidesExplClass{ctexbook}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.3}{\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
@@ -46,10 +46,19 @@
`l3kernel'~and~`l3packages'\\\\
using~your~TeX~package~manager~or~from~CTAN.
}
-\@ifpackagelater { expl3 } { 2014/07/20 } { }
+\@ifpackagelater { expl3 } { 2015/12/20 } { }
{ \msg_error:nnn { ctex } { l3-too-old } { expl3 } }
-\@ifpackagelater { l3keys2e } { 2014/05/05 } { }
+\@ifpackagelater { l3keys2e } { 2015/12/20 } { }
{ \msg_error:nnn { ctex } { l3-too-old } { l3keys2e } }
+\msg_new:nnnn { ctex } { engine-not-supported }
+ { Engine~`#1'~is~not~yet~supported,~ctex~will~abort! }
+ { You~can~switch~to~xelatex,~lualatex~or~pdflatex.}
+\file_if_exist:nTF { ctex-engine- \c_sys_engine_str .def }
+ {
+ \str_const:Nx \c__ctex_engine_file_str
+ { ctex-engine- \c_sys_engine_str .def }
+ }
+ { \msg_critical:nnx { ctex } { engine-not-supported } { \c_sys_engine_str } }
\RequirePackage { ctexhook , ctexpatch }
\RequirePackage { fix-cm , everysel }
\tl_new:N \l__ctex_tmp_tl
@@ -95,20 +104,9 @@
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
- }
+\sys_if_output_pdf:TF
+ { \cs_new_eq:NN \ifctexpdf \if_true: }
+ { \cs_new_eq:NN \ifctexpdf \if_false: }
\cs_new_eq:NN \ctex_if_preamble:TF \use_i:nn
\ctex_after_end_preamble:n { \cs_set_eq:NN \ctex_if_preamble:TF \use_ii:nn }
\cs_new:Npn \ctex_set_default_ccwd:Nn #1#2
@@ -123,17 +121,15 @@
\exp_after:wN \__ctex_default_pt:w
\dim_use:N \etex_dimexpr:D #1 pt \scan_stop: \q_stop
}
-\group_begin:
- \char_set_catcode_other:N \P
- \char_set_catcode_other:N \T
-\tex_lowercase:D
+\use:x
{
- \group_end:
- \cs_new:Npn \__ctex_default_pt:w #1 PT #2 \q_stop { #1 PT }
+ \cs_new:Npn \exp_not:N \__ctex_default_pt:w
+ ##1 \tl_to_str:n { pt } ##2 \exp_not:N \q_stop
+ { ##1 \tl_to_str:n { pt } }
}
\tl_new:N \l__ctex_encoding_tl
\tl_set:Nx \l__ctex_encoding_tl
- { \pdftex_if_engine:TF { GBK } { UTF8 } }
+ { \sys_if_engine_pdftex:TF { GBK } { UTF8 } }
\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
@@ -170,11 +166,11 @@
{ Option~ `zihao=-4'~ is~ set. }
\keys_set:nn { ctex / option } { zihao = -4 }
} ,
- c5size .value_forbidden: ,
- cs4size .value_forbidden: ,
+ c5size .value_forbidden:n = true ,
+ cs4size .value_forbidden:n = true ,
linespread .fp_set:N = \l__ctex_line_spread_fp ,
linespread .initial:n = { \c_nan_fp } ,
- linespread .value_required: ,
+ linespread .value_required:n = true ,
autoindent .choice: ,
autoindent .default:n = { true } ,
autoindent / true .code:n =
@@ -201,7 +197,7 @@
options.~
}
} ,
- indent .value_forbidden: ,
+ indent .value_forbidden:n = true ,
noindent .code:n =
{
\msg_warning:nnn { ctex } { deprecated-option }
@@ -211,11 +207,11 @@
options.
}
} ,
- noindent .value_forbidden: ,
+ noindent .value_forbidden:n = true ,
GBK .code:n = { \tl_set:Nn \l__ctex_encoding_tl { GBK } } ,
UTF8 .code:n = { \tl_set:Nn \l__ctex_encoding_tl { UTF8 } } ,
- GBK .value_forbidden: ,
- UTF8 .value_forbidden: ,
+ GBK .value_forbidden:n = true ,
+ UTF8 .value_forbidden:n = true ,
fontset .tl_gset:N = \g__ctex_fontset_tl ,
nofonts .code:n =
{
@@ -244,9 +240,9 @@
}
\keys_set:nn { ctex / option } { fontset = windows }
} ,
- nofonts .value_forbidden: ,
- winfonts .value_forbidden: ,
- adobefonts .value_forbidden: ,
+ nofonts .value_forbidden:n = true ,
+ winfonts .value_forbidden:n = true ,
+ adobefonts .value_forbidden:n = true ,
zhmap .choice: ,
zhmap .default:n = { true } ,
zhmap / zhmCJK .code:n =
@@ -270,7 +266,7 @@
{ Option~ `zhmap=false'~ is~ set. }
\keys_set:nn { ctex / option } { zhmap = false }
} ,
- nozhmap .value_forbidden: ,
+ nozhmap .value_forbidden:n = true ,
punct .tl_set:N = \l__ctex_punct_tl ,
punct .default:n = { quanjiao } ,
punct .initial:n = { quanjiao } ,
@@ -280,7 +276,7 @@
{ Option~ `punct=plain'~ is~ set. }
\keys_set:nn { ctex / option } { punct = plain }
} ,
- nopunct .value_forbidden: ,
+ nopunct .value_forbidden:n = true ,
space .choices:nn =
{ true , auto , false }
{
@@ -294,14 +290,14 @@
{ Option~ `space=false'~ is~ set. }
\keys_set:nn { ctex / option } { space = false }
} ,
- nospace .value_forbidden: ,
+ nospace .value_forbidden:n = true ,
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: ,
+ sub3section .value_forbidden:n = true ,
+ sub4section .value_forbidden:n = true ,
scheme .tl_set:N = \l__ctex_scheme_tl ,
scheme .default:n = { chinese } ,
scheme .initial:n = { chinese } ,
@@ -317,8 +313,8 @@
{ Option~ `scheme = plain' ~ is~ set. }
\keys_set:nn { ctex / option } { scheme = plain }
} ,
- cap .value_forbidden: ,
- nocap .value_forbidden: ,
+ cap .value_forbidden:n = true ,
+ nocap .value_forbidden:n = true ,
fntef .code:n =
{
\msg_warning:nnn { ctex } { deprecated-option }
@@ -356,7 +352,7 @@
\cs_gset_eq:NN \g__ctex_font_size_flag \c_two
\clist_gput_right:Nn \g__ctex_std_options_clist {#1}
} ,
- #1 .value_forbidden: ,
+ #1 .value_forbidden:n = true ,
}
}
\use:x { \keys_define:nn { ctex / option } { \exp_not:o { \l__ctex_tmp_tl } } }
@@ -398,17 +394,7 @@
\cs_new_protected_nopar:Npn \ctex_hypersetup:n #1
{ \PassOptionsToPackage {#1} { hyperref } }
}
-\pdftex_if_engine:TF
- {
- \tl_set:Nx \l__ctex_encoding_tl { \l__ctex_encoding_tl }
- \ctex_file_input:n { ctex-engine-pdftex.def }
- }
- {
- \tl_set:Nn \l__ctex_encoding_tl { UTF8 }
- \xetex_if_engine:TF
- { \ctex_file_input:n { ctex-engine-xetex.def } }
- { \ctex_file_input:n { ctex-engine-luatex.def } }
- }
+\ctex_file_input:n { \c__ctex_engine_file_str }
\keys_define:nn { ctex }
{
autoindent .choice: ,
@@ -450,7 +436,7 @@
\ctex_set_default_ccwd:Nn \l__ctex_line_stretch_tl {#1}
\ctex_select_size:
} ,
- linestretch .value_required:
+ linestretch .value_required:n = true
}
\tl_new:N \l__ctex_line_stretch_tl
\tl_set:Nn \l__ctex_line_stretch_tl { \ccwd }
@@ -597,7 +583,6 @@
appendixname .tl_set:N = \appendixname ,
bibname .tl_set:N = \bibname
}
-
\seq_new:N \c__ctex_section_headings_seq
\seq_gset_from_clist:Nn \c__ctex_section_headings_seq
{ section , subsection , subsubsection , paragraph , subparagraph }
@@ -617,20 +602,22 @@
}
\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@post#1 }
- }
- \exp_not:c { CTEX@#1@aftername }
+ \group_begin:
+ \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@post#1 }
+ }
+ \group_end:
}
}
\cs_new_protected_nopar:Npn \__ctex_def_heading_keys:n #1
@@ -655,35 +642,23 @@
#1 / runin .bool_set:N = \exp_not:c { CTEX@#1@runin } ,
#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 / numbering .initial:n = true ,
#1 / beforeskip .initial:n = \c_zero_skip ,
#1 / afterskip .initial:n = \c_zero_skip ,
#1 / indent .initial:n = \c_zero_dim ,
- #1 / beforeskip .value_required: ,
- #1 / afterskip .value_required: ,
- #1 / indent .value_required: ,
+ #1 / beforeskip .value_required:n = true ,
+ #1 / afterskip .value_required:n = true ,
+ #1 / indent .value_required:n = true ,
}
}
\NewDocumentCommand \ctex_assign_heading_name:nn
@@ -742,7 +717,7 @@
{\interlinepenalty \@M
\normalfont \CTEX@part@format
\ifnum \c@secnumdepth >-2\relax \ifodd \CTEX@part@numbering
- \CTEX@partname
+ \CTEX@partname \CTEX@part@aftername
\fi \fi
\CTEX@part@titleformat{#2}%
\CTEX@part@aftertitle}%
@@ -809,7 +784,7 @@
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\ifodd \CTEX@chapter@numbering
- \CTEX@chaptername
+ \CTEX@chaptername \CTEX@chapter@aftername
\fi
\fi
\fi
@@ -847,9 +822,7 @@
{\@ssect{#3}{#4}{#5}{#6}}%
{\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}}
\def\@seccntformat#1{%
- \@ifundefined{CTEX@#1name}%
- {\csname the#1\endcsname\quad}%
- {\csname CTEX@#1name\endcsname}}
+ \csname CTEX@#1name\endcsname \csname CTEX@#1@aftername\endcsname}
\def\@sect#1#2#3#4#5#6[#7]#8{%
\ifnum #2>\c@secnumdepth
\let\@svsec\@empty
@@ -874,9 +847,7 @@
\addcontentsline{toc}{#1}{%
\ifnum #2>\c@secnumdepth \else
\ifodd \csname CTEX@#1@numbering\endcsname
- \protect\numberline{\@ifundefined{CTEXthe#1}%
- {\csname the#1\endcsname}%
- {\csname CTEXthe#1\endcsname}}%
+ \protect\numberline{\csname CTEXthe#1\endcsname}%
\fi
\fi
#7}%
@@ -890,9 +861,7 @@
\addcontentsline{toc}{#1}{%
\ifnum #2>\c@secnumdepth \else
\ifodd \csname CTEX@#1@numbering\endcsname
- \protect\numberline{\@ifundefined{CTEXthe#1}%
- {\csname the#1\endcsname}%
- {\csname CTEXthe#1\endcsname}}%
+ \protect\numberline{\csname CTEXthe#1\endcsname}%
\fi
\fi
#7}}%
@@ -1046,6 +1015,43 @@
{ \ctex_titlesec_hook: }
}
}
+\group_begin:
+\char_set_catcode_other:N \#
+\cs_new_protected_nopar:Npn \ctex_titleps_hook:
+ {
+ \ctex_patch_cmd:Nnn \ttl@settopmark
+ { \protect \@namedef { the#1 } { \@nameuse { the#1 } } }
+ {
+ \protect \@namedef { the#1 } { \@nameuse { the#1 } }
+ \CTEX@titlepslabel@set {#1}
+ }
+ \ctex_patch_cmd:Nnn \ttl@setsubmark
+ { \protect \@namedef { the#1 } { } }
+ {
+ \protect \@namedef { the#1 } { }
+ \CTEX@titlepslabel@clear {#1}
+ }
+ \ctex_patch_cmd:Nnn \ttl@setsubmark
+ { \protect \@namedef { the#2 } { \@nameuse { the#2 } } }
+ {
+ \protect \@namedef { the#2 } { \@nameuse { the#2 } }
+ \CTEX@titlepslabel@set {#2}
+ }
+ }
+\group_end:
+\cs_new_nopar:Npn \CTEX@titlepslabel@set #1
+ {
+ \cs_if_free:cF { CTEXthe#1 }
+ { \protect \@namedef { CTEXthe#1 } { \@nameuse { CTEXthe#1 } } }
+ }
+\cs_new_nopar:Npn \CTEX@titlepslabel@clear #1
+ {
+ \cs_if_free:cF { CTEXthe#1 }
+ { \protect \@namedef { CTEXthe#1 } { } }
+ }
+\ctex_at_end_package:nn { titlesec }
+ { \cs_if_free:NF \ttl@settopmark { \ctex_titleps_hook: } }
+\ctex_at_end_package:nn { titleps } { \ctex_titleps_hook: }
\cs_new_protected:Npn \CTEX@toc@width@n #1
{
\hbox_set:Nn \l__ctex_tmp_box {#1}
diff --git a/Master/texmf-dist/tex/latex/ctex/ctexcap.sty b/Master/texmf-dist/tex/latex/ctex/ctexcap.sty
index e537e094f39..ff09859c840 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctexcap.sty
+++ b/Master/texmf-dist/tex/latex/ctex/ctexcap.sty
@@ -28,10 +28,10 @@
%%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\GetIdInfo$Id: ctex.dtx 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{Chinese adapter in LaTeX (CTEX)}
\ProvidesExplPackage{ctexcap}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.3}{\ExplFileDescription}
\clist_new:N \l__ctex_ctexcap_options_clist
\clist_set:Nx \l__ctex_ctexcap_options_clist
{ \exp_not:v { opt@ \@currname . \@currext } , heading }
diff --git a/Master/texmf-dist/tex/latex/ctex/ctexheading.sty b/Master/texmf-dist/tex/latex/ctex/ctexheading.sty
index 92d61d817d6..60c3b3d03aa 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctexheading.sty
+++ b/Master/texmf-dist/tex/latex/ctex/ctexheading.sty
@@ -28,10 +28,10 @@
%%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\GetIdInfo$Id: ctex.dtx 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{Heading style modification (CTEX)}
\ProvidesExplPackage{ctexheading}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.3}{\ExplFileDescription}
\RequirePackage { xparse , l3keys2e }
\RequirePackage { ctexhook , ctexpatch }
\tl_new:N \l__ctex_tmp_tl
@@ -76,8 +76,8 @@
{ \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: ,
+ sub3section .value_forbidden:n = true ,
+ sub4section .value_forbidden:n = true ,
scheme .tl_set:N = \l__ctex_scheme_tl ,
scheme .default:n = { plain } ,
scheme .initial:n = { plain }
diff --git a/Master/texmf-dist/tex/latex/ctex/ctexhook.sty b/Master/texmf-dist/tex/latex/ctex/ctexhook.sty
index f492b7444dd..101dee640de 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctexhook.sty
+++ b/Master/texmf-dist/tex/latex/ctex/ctexhook.sty
@@ -28,10 +28,10 @@
%%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\GetIdInfo$Id: ctex.dtx 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{Document and package hooks (CTEX)}
\ProvidesExplPackage{ctexhook}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.3}{\ExplFileDescription}
\cs_new_protected:Npn \ctex_at_end_preamble:n #1
{ \tl_gput_right:Nn \g__ctex_end_preamble_hook_tl {#1} }
\cs_new_protected:Npn \ctex_after_end_preamble:n #1
diff --git a/Master/texmf-dist/tex/latex/ctex/ctexpatch.sty b/Master/texmf-dist/tex/latex/ctex/ctexpatch.sty
index c0e571bfd26..fdb205421df 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctexpatch.sty
+++ b/Master/texmf-dist/tex/latex/ctex/ctexpatch.sty
@@ -28,10 +28,11 @@
%%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\GetIdInfo$Id: ctex.dtx 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{Patching commands (CTEX)}
\ProvidesExplPackage{ctexpatch}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.3}{\ExplFileDescription}
+\cs_if_exist:NF \str_new:N { \RequirePackage { l3str } }
\cs_new_protected:Npn \ctex_patch_cmd_once:NnnnTF #1#2
{
\ctex_patch_boot:NNnnTF \__ctex_patch_cmd:Nnnnnw #1
@@ -80,111 +81,127 @@
\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
+\cs_set_protected:Npn \__ctex_tmp:w #1#2#3
{
- \group_end:
- \cs_new_protected:Npn \ctex_parse_name:NNn #1#2#3
+ \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 } }
+ \bool_if:nTF
+ {
+ \cs_if_exist_p:c { ##3 ~ } ||
+ \cs_if_exist_p:c { #1##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
+ \__ctex_parse_name:nNNNnN
+ { \token_get_replacement_spec:N ##2 }
+ \exp_not:N ##2
+ \exp_not:c { ##3 ~ }
+ \exp_not:c { #1##3 }
+ } {##3} ##1
}
- { #1#2 }
+ { ##1##2 }
}
- \cs_new_protected:Npn \__ctex_parse_name:nNNNnN #1#2#3#4#5#6
+ \cs_new_protected:Npn \__ctex_parse_name:nNNNnN ##1##2##3##4##5##6
{
- \exp_args:Nc #6
+ \exp_args:Nc ##6
{
- \str_case:nnTF {#1}
+ \str_case:nnTF {##1}
{
- { \protect #3 } { }
- { \x@protect #2 \protect #3 } { }
+ { \protect ##3 } { }
+ { \x@protect ##2 \protect ##3 } { }
}
{
- \str_if_eq_x:nnTF { \exp_not:n { /@protected@ #3 /#3 } }
+ \str_if_eq_x:nnTF
+ { \exp_not:n { #1@protected@ ##3 #1##3 } }
{
\exp_last_unbraced:Nf \__ctex_parse_name:w
- \token_get_replacement_spec:N #3 AESAOPA ~ < \q_stop
+ \token_get_replacement_spec:N ##3 #2 ~ #1 \q_stop
}
- { /#5 ~ } { #5 ~ }
+ { #1##5 ~ } { ##5 ~ }
}
{
- \str_case:onTF { \__ctex_parse_name:w #1 AESAOPA ~ < \q_stop }
+ \str_case:onTF { \__ctex_parse_name:w ##1 #2 ~ #1 \q_stop }
{
- { /@protected@ #2 #4 } { }
- { /@ #4 } { }
+ { #1@protected@ ##2 ##4 } { }
+ { #1@ ##4 } { }
}
- { /#5 } {#5}
+ { #1##5 } {##5}
}
}
}
- \cs_new:Npn \__ctex_parse_name:w #1 AESAOPA ~ #2 < #3 \q_stop { #1#2 }
+ \cs_new:Npn \__ctex_parse_name:w ##1 #2 ~ ##2 #1 ##3 \q_stop { ##1##2 }
}
-\cs_generate_variant:Nn \ctex_parse_name:NNn { NNx }
-\tl_new:N \l__ctex_prefix_tl
-\tl_new:N \l__ctex_parameter_tl
-\tl_new:N \l__ctex_replacement_tl
-\group_begin:
- \char_set_lccode:nn { `\; } { `\: }
- \tl_map_function:nN { \M \A \C \R \O \; } \char_set_catcode_other:N
-\tex_lowercase:D
+\use:x
{
- \group_end:
- \cs_new_protected:Npn \ctex_get_macro_meaning:NTF #1
- {
- \exp_after:wN \__ctex_get_macro_meaning:w
- \token_to_meaning:N #1 \q_stop MACRO ; -> \q_no_value \q_stop
- }
- \cs_new_protected:Npn \__ctex_get_macro_meaning:w #1 MACRO ; #2 -> #3 \q_stop
- {
- \tl_set:Nn \l__ctex_replacement_tl {#3}
- \quark_if_no_value:NTF \l__ctex_replacement_tl
- { \use_ii:nn }
- {
- \tl_set:Nn \l__ctex_prefix_tl {#1}
- \tl_set:Nn \l__ctex_parameter_tl {#2}
- \use_i_delimit_by_q_stop:nw { \use_i:nn }
- }
- }
+ \__ctex_tmp:w
+ { \c_backslash_str }
+ { \c_left_brace_str }
+ { \tl_to_str:n { testopt } }
}
+\group_end:
+\cs_generate_variant:Nn \ctex_parse_name:NNn { NNx }
+\str_new:N \l__ctex_prefix_str
+\str_new:N \l__ctex_parameter_str
+\str_new:N \l__ctex_replacement_str
+\group_begin:
+ \cs_set_protected:Npn \__ctex_tmp:w #1
+ {
+ \prg_new_protected_conditional:Npnn
+ \ctex_get_macro_meaning:N ##1 { TF }
+ {
+ \exp_after:wN \__ctex_get_macro_meaning:w
+ \token_to_meaning:N ##1 \q_mark #1 -> \q_no_value \q_mark \q_stop
+ }
+ \cs_new_protected:Npn \__ctex_get_macro_meaning:w
+ ##1 #1 ##2 -> ##3 \q_mark ##4 \q_stop
+ {
+ \tl_set:Nn \l__ctex_replacement_tl {##3}
+ \quark_if_no_value:NTF \l__ctex_replacement_tl
+ { \prg_return_false: }
+ {
+ \str_set:Nn \l__ctex_prefix_str {##1}
+ \str_set:Nn \l__ctex_parameter_str {##2}
+ \str_set:Nn \l__ctex_replacement_str {##3}
+ \prg_return_true:
+ }
+ }
+ }
+ \exp_args:No \__ctex_tmp:w { \tl_to_str:n { macro: } }
+\group_end:
\cs_new_protected:Npn \ctex_if_rescanable:NnTF #1#2#3#4
{
\ctex_get_macro_meaning:NTF #1
{
- \__ctex_patch_rebuild:Nn \CTEXPATCHRESCANCMD {#2}
- \cs_if_eq:NNTF #1 \CTEXPATCHRESCANCMD {#3} {#4}
+ \__ctex_patch_rebuild:Nn \__ctex_rebuild_cmd:w {#2}
+ \cs_if_eq:NNTF #1 \__ctex_rebuild_cmd:w {#3} {#4}
}
{#4}
}
-\cs_new_eq:NN \CTEXPATCHRESCANCMD \prg_do_nothing:
+\cs_new_eq:NN \__ctex_rebuild_cmd:w \prg_do_nothing:
\cs_new_protected:Npn \__ctex_patch_rebuild:Nn #1#2
{
- \tl_if_empty:nTF {#2}
- { \tl_rescan:nx {#2} }
- {
- \tl_rescan:nx
- {
- #2 \scan_stop:
- \int_set_eq:NN \tex_endlinechar:D \c_minus_one
- \int_set_eq:NN \tex_newlinechar:D \c_minus_one
- }
- }
+ \__ctex_patch_rescan:NNn \l__ctex_prefix_tl \l__ctex_prefix_str {#2}
+ \__ctex_patch_rescan:NNn \l__ctex_parameter_tl \l__ctex_parameter_str {#2}
+ \__ctex_patch_rescan:NNn \l__ctex_replacement_tl \l__ctex_replacement_str {#2}
+ \use:x
{
- \l__ctex_prefix_tl \exp_not:N \def \exp_not:N #1 \l__ctex_parameter_tl
- { \l__ctex_replacement_tl }
+ \exp_not:o { \l__ctex_prefix_tl } \tex_def:D \exp_not:N #1
+ \exp_not:o { \l__ctex_parameter_tl }
+ { \exp_not:o { \l__ctex_replacement_tl } }
}
}
-\cs_generate_variant:Nn \tl_rescan:nn { nx }
+\cs_new_protected:Npn \__ctex_patch_rescan:NNn #1#2#3
+ {
+ \str_if_empty:NTF #2
+ { \tl_clear:N #1 }
+ { \tl_set_rescan:Nnx #1 {#3} {#2} }
+ }
+\tl_new:N \l__ctex_prefix_tl
+\tl_new:N \l__ctex_parameter_tl
+\tl_new:N \l__ctex_replacement_tl
\cs_new_protected:Npn \__ctex_patch_cmd:Nnnnnw #1#2#3#4#5
{
\group_end:
@@ -197,8 +214,7 @@
{ \tl_to_str:n {#5} }
}
{
- \__ctex_patch_rebuild:Nn \CTEXPATCHRESCANCMD {#3}
- \cs_set_eq:NN #1 \CTEXPATCHRESCANCMD
+ \__ctex_patch_rebuild:Nn #1 {#3}
\__ctex_patch_true:w
}
{ \__ctex_patch_false:w }
@@ -207,15 +223,15 @@
}
\cs_new_protected:Npn \__ctex_patch_replace:nnnTF #1#2#3#4
{
- \tl_if_in:NnTF \l__ctex_replacement_tl {#2}
- { \use:c { tl_replace_ #1 :Nnn } \l__ctex_replacement_tl {#2} {#3} #4 }
+ \tl_if_in:NnTF \l__ctex_replacement_str {#2}
+ { \use:c { tl_replace_ #1 :Nnn } \l__ctex_replacement_str {#2} {#3} #4 }
}
\cs_new_protected:Npn \__ctex_hookto_cmd:Nnnnw #1#2#3#4
{
\group_end:
\ctex_get_macro_meaning:NTF #1
{
- \tl_if_empty:NTF \l__ctex_parameter_tl
+ \str_if_empty:NTF \l__ctex_parameter_str
{ \__ctex_hookto_cmd_parameterless:Nnnw #1 {#2} {#4} }
{ \__ctex_hookto_cmd_parameter:Nnnnw #1 {#2} {#3} {#4} }
}
@@ -223,9 +239,9 @@
}
\cs_new_protected:Npn \__ctex_hookto_cmd_parameterless:Nnnw #1#2#3
{
- \tl_if_empty:NF \l__ctex_prefix_tl
- { \tl_rescan:nx { } { \l__ctex_prefix_tl } }
- \edef #1
+ \str_if_empty:NF \l__ctex_prefix_str
+ { \tl_rescan:nx { } { \l__ctex_prefix_str } }
+ \tex_edef:D #1
{
\use:c { __ctex_ #2 _hook_aux:nn }
{ \exp_not:o {#1} }
@@ -233,16 +249,16 @@
}
\__ctex_patch_true:w
}
+\cs_generate_variant:Nn \tl_rescan:nn { nx }
\cs_new:Npn \__ctex_left_hook_aux:nn #1#2 { #2#1 }
\cs_new_eq:NN \__ctex_right_hook_aux:nn \use:nn
\cs_new_protected:Npn \__ctex_hookto_cmd_parameter:Nnnnw #1#2#3#4
{
- \__ctex_patch_rebuild:Nn \CTEXPATCHRESCANCMD {#3}
- \cs_if_eq:NNTF #1 \CTEXPATCHRESCANCMD
+ \__ctex_patch_rebuild:Nn \__ctex_rebuild_cmd:w {#3}
+ \cs_if_eq:NNTF #1 \__ctex_rebuild_cmd:w
{
- \use:c { tl_put_ #2 :Nx } \l__ctex_replacement_tl { \tl_to_str:n {#4} }
- \__ctex_patch_rebuild:Nn \CTEXPATCHRESCANCMD {#3}
- \cs_set_eq:NN #1 \CTEXPATCHRESCANCMD
+ \use:c { str_put_ #2 :Nn } \l__ctex_replacement_str {#4}
+ \__ctex_patch_rebuild:Nn #1 {#3}
\__ctex_patch_true:w
}
{ \__ctex_patch_false:w }
diff --git a/Master/texmf-dist/tex/latex/ctex/ctexrep.cls b/Master/texmf-dist/tex/latex/ctex/ctexrep.cls
index c9f8798891e..a8d1d0d5155 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctexrep.cls
+++ b/Master/texmf-dist/tex/latex/ctex/ctexrep.cls
@@ -28,10 +28,10 @@
%%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\GetIdInfo$Id: ctex.dtx 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{Chinese adapter for class report (CTEX)}
\ProvidesExplClass{ctexrep}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.3}{\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
@@ -46,10 +46,19 @@
`l3kernel'~and~`l3packages'\\\\
using~your~TeX~package~manager~or~from~CTAN.
}
-\@ifpackagelater { expl3 } { 2014/07/20 } { }
+\@ifpackagelater { expl3 } { 2015/12/20 } { }
{ \msg_error:nnn { ctex } { l3-too-old } { expl3 } }
-\@ifpackagelater { l3keys2e } { 2014/05/05 } { }
+\@ifpackagelater { l3keys2e } { 2015/12/20 } { }
{ \msg_error:nnn { ctex } { l3-too-old } { l3keys2e } }
+\msg_new:nnnn { ctex } { engine-not-supported }
+ { Engine~`#1'~is~not~yet~supported,~ctex~will~abort! }
+ { You~can~switch~to~xelatex,~lualatex~or~pdflatex.}
+\file_if_exist:nTF { ctex-engine- \c_sys_engine_str .def }
+ {
+ \str_const:Nx \c__ctex_engine_file_str
+ { ctex-engine- \c_sys_engine_str .def }
+ }
+ { \msg_critical:nnx { ctex } { engine-not-supported } { \c_sys_engine_str } }
\RequirePackage { ctexhook , ctexpatch }
\RequirePackage { fix-cm , everysel }
\tl_new:N \l__ctex_tmp_tl
@@ -95,20 +104,9 @@
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
- }
+\sys_if_output_pdf:TF
+ { \cs_new_eq:NN \ifctexpdf \if_true: }
+ { \cs_new_eq:NN \ifctexpdf \if_false: }
\cs_new_eq:NN \ctex_if_preamble:TF \use_i:nn
\ctex_after_end_preamble:n { \cs_set_eq:NN \ctex_if_preamble:TF \use_ii:nn }
\cs_new:Npn \ctex_set_default_ccwd:Nn #1#2
@@ -123,17 +121,15 @@
\exp_after:wN \__ctex_default_pt:w
\dim_use:N \etex_dimexpr:D #1 pt \scan_stop: \q_stop
}
-\group_begin:
- \char_set_catcode_other:N \P
- \char_set_catcode_other:N \T
-\tex_lowercase:D
+\use:x
{
- \group_end:
- \cs_new:Npn \__ctex_default_pt:w #1 PT #2 \q_stop { #1 PT }
+ \cs_new:Npn \exp_not:N \__ctex_default_pt:w
+ ##1 \tl_to_str:n { pt } ##2 \exp_not:N \q_stop
+ { ##1 \tl_to_str:n { pt } }
}
\tl_new:N \l__ctex_encoding_tl
\tl_set:Nx \l__ctex_encoding_tl
- { \pdftex_if_engine:TF { GBK } { UTF8 } }
+ { \sys_if_engine_pdftex:TF { GBK } { UTF8 } }
\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
@@ -170,11 +166,11 @@
{ Option~ `zihao=-4'~ is~ set. }
\keys_set:nn { ctex / option } { zihao = -4 }
} ,
- c5size .value_forbidden: ,
- cs4size .value_forbidden: ,
+ c5size .value_forbidden:n = true ,
+ cs4size .value_forbidden:n = true ,
linespread .fp_set:N = \l__ctex_line_spread_fp ,
linespread .initial:n = { \c_nan_fp } ,
- linespread .value_required: ,
+ linespread .value_required:n = true ,
autoindent .choice: ,
autoindent .default:n = { true } ,
autoindent / true .code:n =
@@ -201,7 +197,7 @@
options.~
}
} ,
- indent .value_forbidden: ,
+ indent .value_forbidden:n = true ,
noindent .code:n =
{
\msg_warning:nnn { ctex } { deprecated-option }
@@ -211,11 +207,11 @@
options.
}
} ,
- noindent .value_forbidden: ,
+ noindent .value_forbidden:n = true ,
GBK .code:n = { \tl_set:Nn \l__ctex_encoding_tl { GBK } } ,
UTF8 .code:n = { \tl_set:Nn \l__ctex_encoding_tl { UTF8 } } ,
- GBK .value_forbidden: ,
- UTF8 .value_forbidden: ,
+ GBK .value_forbidden:n = true ,
+ UTF8 .value_forbidden:n = true ,
fontset .tl_gset:N = \g__ctex_fontset_tl ,
nofonts .code:n =
{
@@ -244,9 +240,9 @@
}
\keys_set:nn { ctex / option } { fontset = windows }
} ,
- nofonts .value_forbidden: ,
- winfonts .value_forbidden: ,
- adobefonts .value_forbidden: ,
+ nofonts .value_forbidden:n = true ,
+ winfonts .value_forbidden:n = true ,
+ adobefonts .value_forbidden:n = true ,
zhmap .choice: ,
zhmap .default:n = { true } ,
zhmap / zhmCJK .code:n =
@@ -270,7 +266,7 @@
{ Option~ `zhmap=false'~ is~ set. }
\keys_set:nn { ctex / option } { zhmap = false }
} ,
- nozhmap .value_forbidden: ,
+ nozhmap .value_forbidden:n = true ,
punct .tl_set:N = \l__ctex_punct_tl ,
punct .default:n = { quanjiao } ,
punct .initial:n = { quanjiao } ,
@@ -280,7 +276,7 @@
{ Option~ `punct=plain'~ is~ set. }
\keys_set:nn { ctex / option } { punct = plain }
} ,
- nopunct .value_forbidden: ,
+ nopunct .value_forbidden:n = true ,
space .choices:nn =
{ true , auto , false }
{
@@ -294,14 +290,14 @@
{ Option~ `space=false'~ is~ set. }
\keys_set:nn { ctex / option } { space = false }
} ,
- nospace .value_forbidden: ,
+ nospace .value_forbidden:n = true ,
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: ,
+ sub3section .value_forbidden:n = true ,
+ sub4section .value_forbidden:n = true ,
scheme .tl_set:N = \l__ctex_scheme_tl ,
scheme .default:n = { chinese } ,
scheme .initial:n = { chinese } ,
@@ -317,8 +313,8 @@
{ Option~ `scheme = plain' ~ is~ set. }
\keys_set:nn { ctex / option } { scheme = plain }
} ,
- cap .value_forbidden: ,
- nocap .value_forbidden: ,
+ cap .value_forbidden:n = true ,
+ nocap .value_forbidden:n = true ,
fntef .code:n =
{
\msg_warning:nnn { ctex } { deprecated-option }
@@ -356,7 +352,7 @@
\cs_gset_eq:NN \g__ctex_font_size_flag \c_two
\clist_gput_right:Nn \g__ctex_std_options_clist {#1}
} ,
- #1 .value_forbidden: ,
+ #1 .value_forbidden:n = true ,
}
}
\use:x { \keys_define:nn { ctex / option } { \exp_not:o { \l__ctex_tmp_tl } } }
@@ -398,17 +394,7 @@
\cs_new_protected_nopar:Npn \ctex_hypersetup:n #1
{ \PassOptionsToPackage {#1} { hyperref } }
}
-\pdftex_if_engine:TF
- {
- \tl_set:Nx \l__ctex_encoding_tl { \l__ctex_encoding_tl }
- \ctex_file_input:n { ctex-engine-pdftex.def }
- }
- {
- \tl_set:Nn \l__ctex_encoding_tl { UTF8 }
- \xetex_if_engine:TF
- { \ctex_file_input:n { ctex-engine-xetex.def } }
- { \ctex_file_input:n { ctex-engine-luatex.def } }
- }
+\ctex_file_input:n { \c__ctex_engine_file_str }
\keys_define:nn { ctex }
{
autoindent .choice: ,
@@ -450,7 +436,7 @@
\ctex_set_default_ccwd:Nn \l__ctex_line_stretch_tl {#1}
\ctex_select_size:
} ,
- linestretch .value_required:
+ linestretch .value_required:n = true
}
\tl_new:N \l__ctex_line_stretch_tl
\tl_set:Nn \l__ctex_line_stretch_tl { \ccwd }
@@ -597,7 +583,6 @@
appendixname .tl_set:N = \appendixname ,
bibname .tl_set:N = \bibname
}
-
\seq_new:N \c__ctex_section_headings_seq
\seq_gset_from_clist:Nn \c__ctex_section_headings_seq
{ section , subsection , subsubsection , paragraph , subparagraph }
@@ -617,20 +602,22 @@
}
\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@post#1 }
- }
- \exp_not:c { CTEX@#1@aftername }
+ \group_begin:
+ \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@post#1 }
+ }
+ \group_end:
}
}
\cs_new_protected_nopar:Npn \__ctex_def_heading_keys:n #1
@@ -655,35 +642,23 @@
#1 / runin .bool_set:N = \exp_not:c { CTEX@#1@runin } ,
#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 / numbering .initial:n = true ,
#1 / beforeskip .initial:n = \c_zero_skip ,
#1 / afterskip .initial:n = \c_zero_skip ,
#1 / indent .initial:n = \c_zero_dim ,
- #1 / beforeskip .value_required: ,
- #1 / afterskip .value_required: ,
- #1 / indent .value_required: ,
+ #1 / beforeskip .value_required:n = true ,
+ #1 / afterskip .value_required:n = true ,
+ #1 / indent .value_required:n = true ,
}
}
\NewDocumentCommand \ctex_assign_heading_name:nn
@@ -742,7 +717,7 @@
{\interlinepenalty \@M
\normalfont \CTEX@part@format
\ifnum \c@secnumdepth >-2\relax \ifodd \CTEX@part@numbering
- \CTEX@partname
+ \CTEX@partname \CTEX@part@aftername
\fi \fi
\CTEX@part@titleformat{#2}%
\CTEX@part@aftertitle}%
@@ -804,7 +779,7 @@
\CTEX@chapter@format
\ifnum \c@secnumdepth >\m@ne
\ifodd \CTEX@chapter@numbering
- \CTEX@chaptername
+ \CTEX@chaptername \CTEX@chapter@aftername
\fi
\fi
\interlinepenalty\@M
@@ -841,9 +816,7 @@
{\@ssect{#3}{#4}{#5}{#6}}%
{\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}}
\def\@seccntformat#1{%
- \@ifundefined{CTEX@#1name}%
- {\csname the#1\endcsname\quad}%
- {\csname CTEX@#1name\endcsname}}
+ \csname CTEX@#1name\endcsname \csname CTEX@#1@aftername\endcsname}
\def\@sect#1#2#3#4#5#6[#7]#8{%
\ifnum #2>\c@secnumdepth
\let\@svsec\@empty
@@ -868,9 +841,7 @@
\addcontentsline{toc}{#1}{%
\ifnum #2>\c@secnumdepth \else
\ifodd \csname CTEX@#1@numbering\endcsname
- \protect\numberline{\@ifundefined{CTEXthe#1}%
- {\csname the#1\endcsname}%
- {\csname CTEXthe#1\endcsname}}%
+ \protect\numberline{\csname CTEXthe#1\endcsname}%
\fi
\fi
#7}%
@@ -884,9 +855,7 @@
\addcontentsline{toc}{#1}{%
\ifnum #2>\c@secnumdepth \else
\ifodd \csname CTEX@#1@numbering\endcsname
- \protect\numberline{\@ifundefined{CTEXthe#1}%
- {\csname the#1\endcsname}%
- {\csname CTEXthe#1\endcsname}}%
+ \protect\numberline{\csname CTEXthe#1\endcsname}%
\fi
\fi
#7}}%
@@ -1040,6 +1009,43 @@
{ \ctex_titlesec_hook: }
}
}
+\group_begin:
+\char_set_catcode_other:N \#
+\cs_new_protected_nopar:Npn \ctex_titleps_hook:
+ {
+ \ctex_patch_cmd:Nnn \ttl@settopmark
+ { \protect \@namedef { the#1 } { \@nameuse { the#1 } } }
+ {
+ \protect \@namedef { the#1 } { \@nameuse { the#1 } }
+ \CTEX@titlepslabel@set {#1}
+ }
+ \ctex_patch_cmd:Nnn \ttl@setsubmark
+ { \protect \@namedef { the#1 } { } }
+ {
+ \protect \@namedef { the#1 } { }
+ \CTEX@titlepslabel@clear {#1}
+ }
+ \ctex_patch_cmd:Nnn \ttl@setsubmark
+ { \protect \@namedef { the#2 } { \@nameuse { the#2 } } }
+ {
+ \protect \@namedef { the#2 } { \@nameuse { the#2 } }
+ \CTEX@titlepslabel@set {#2}
+ }
+ }
+\group_end:
+\cs_new_nopar:Npn \CTEX@titlepslabel@set #1
+ {
+ \cs_if_free:cF { CTEXthe#1 }
+ { \protect \@namedef { CTEXthe#1 } { \@nameuse { CTEXthe#1 } } }
+ }
+\cs_new_nopar:Npn \CTEX@titlepslabel@clear #1
+ {
+ \cs_if_free:cF { CTEXthe#1 }
+ { \protect \@namedef { CTEXthe#1 } { } }
+ }
+\ctex_at_end_package:nn { titlesec }
+ { \cs_if_free:NF \ttl@settopmark { \ctex_titleps_hook: } }
+\ctex_at_end_package:nn { titleps } { \ctex_titleps_hook: }
\cs_new_protected:Npn \CTEX@toc@width@n #1
{
\hbox_set:Nn \l__ctex_tmp_box {#1}
diff --git a/Master/texmf-dist/tex/latex/ctex/ctexsize.sty b/Master/texmf-dist/tex/latex/ctex/ctexsize.sty
index 9dcee563f86..47e89f9aef0 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctexsize.sty
+++ b/Master/texmf-dist/tex/latex/ctex/ctexsize.sty
@@ -28,10 +28,10 @@
%%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\GetIdInfo$Id: ctex.dtx 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{Chinese font size definition (CTEX)}
\ProvidesExplPackage{ctexsize}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.3}{\ExplFileDescription}
\RequirePackage { xparse , l3keys2e }
\cs_new_eq:NN \g__ctex_font_size_flag \c_minus_one
\keys_define:nn { ctex / option }
@@ -53,7 +53,7 @@
{
#1 .code:n =
{ \cs_gset_eq:NN \g__ctex_font_size_flag \c_two } ,
- #1 .value_forbidden: ,
+ #1 .value_forbidden:n = true ,
}
}
\use:x { \keys_define:nn { ctex / option } { \exp_not:o { \l__ctex_tmp_tl } } }
diff --git a/Master/texmf-dist/tex/latex/ctex/ctexspa.def b/Master/texmf-dist/tex/latex/ctex/ctexspa.def
index 9e61e7c8870..d7be21f1073 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctexspa.def
+++ b/Master/texmf-dist/tex/latex/ctex/ctexspa.def
@@ -28,12 +28,12 @@
%% ------------------------------------------------------------------------------
%%
\ProvidesFile{ctexspa.def}%
- [2015/07/01 v2.2 Space info for CJKpunct (CTEX)]
+ [2016/02/02 v2.3 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,,,}
\ctexspadef{adobezhfs}{76,10,56,8,63,4,61,4,71,4,65,4,71,4,74,4,54,4,54,4,62,4,62,4,0,0,11,11,4,72,5,71,8,79,8,79,18,68,19,68,18,68,2,46,14,13,4,71,4,65,4,71,4,74,4,54,4,54,4,62,4,62,10,76,8,56,4,63,4,61,,,}
-\ctexspadef{fandolzhsong}{69,19,58,8,59,9,60,10,60,11,63,13,67,17,57,7,61,11,54,5,57,7,58,7,0,0,17,17,15,65,14,64,19,69,8,81,20,70,19,69,20,70,7,57,14,14,11,61,13,63,17,67,7,57,11,61,4,55,7,57,7,58,19,69,8,58,9,59,10,60,,,}
+\ctexspadef{fandolzhsong}{69,19,58,8,59,9,60,10,60,11,63,13,67,17,57,7,61,11,54,5,57,7,58,7,0,0,17,17,15,65,14,64,19,69,8,81,20,70,19,69,20,70,7,57,14,14,11,61,13,63,17,67,7,57,11,61,5,55,7,57,7,58,19,69,8,58,9,59,10,60,,,}
\ctexspadef{fandolzhsongb}{66,16,54,4,59,9,60,10,60,11,63,13,66,16,57,7,61,11,54,5,57,7,58,7,0,0,14,14,15,65,14,64,17,67,6,78,17,67,17,67,17,67,32,32,14,14,11,61,13,63,16,66,7,57,11,61,4,55,7,57,7,58,16,66,4,54,9,59,10,60,,,}
\ctexspadef{fandolzhhei}{71,21,60,10,59,9,60,10,60,11,62,12,67,17,55,5,61,11,54,5,57,7,58,7,0,0,18,18,15,65,14,64,21,71,10,82,21,71,21,71,21,71,32,32,14,14,11,61,12,62,17,67,5,55,11,61,5,55,7,57,7,58,21,71,10,60,9,59,10,60,,,}
\ctexspadef{fandolzhheib}{70,20,60,10,59,9,60,10,60,11,63,13,65,15,56,6,61,11,54,5,57,7,58,7,3,3,18,18,15,65,14,64,20,70,8,82,20,70,20,70,20,69,33,33,11,11,11,61,13,63,15,65,6,56,11,61,5,55,7,57,7,58,20,70,10,60,9,59,10,60,,,}
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 902e0e3e832..584a58a0105 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 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{LuaLaTeX adapter (CTEX)}
\ProvidesExplFile{ctex-engine-luatex.def}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.3}{\ExplFileDescription}
\msg_new:nnn { ctex } { luatexja-loaded }
{
Package~`luatexja'~can~not~be~loaded~before~`ctex'.\\
@@ -39,7 +39,7 @@
{ \msg_critical:nnx { ctex } { luatexja-loaded } { \g_file_current_name_tl } }
{ \tl_const:cn { ver@ltj-latex.\@pkgextension } { 9999/99/99 } }
\RequirePackage { luatexja }
-\@ifpackagelater { luatexja-core } { 2015/02/22 } { }
+\@ifpackagelater { luatexja } { 2015/09/21 } { }
{ \msg_error:nnn { ctex } { package-too-old } { luatexja } }
\RequirePackage { fontspec }
\@ifpackagelater { fontspec } { 2014/05/25 } { }
@@ -61,7 +61,7 @@
"1100-"11FF, "2F00-"2FFF, "3100-"31EF, "A000-"A4CF, "A830-"A83F,
"AC00-"D7FF}
\ltjdefcharrange{8}{"A7, "A8, "B0, "B1, "B4, "B6, "D7, "F7}
-\ltjsetparameter{jacharrange={-1, +2, +3, -4, -5, +6, +7, +8}}
+\ltjsetparameter{jacharrange={-1, +2, +3, -4, -5, +6, +7, -8}}
\directlua{for x=128,255 do luatexja.math.is_math_letters[x] = true end}
\directlua{
local s = kpse.find_file('ltj-kinsoku.lua', 'tex')
@@ -78,36 +78,57 @@
\AtBeginUTFCommand
{
\group_begin:
- \ctex_lua_now_x:n { tex.globaldefs = 0 }
+ \lua_now_x:n { tex.globaldefs = 0 }
\ltj@allalchar
}
\AtEndUTFCommand { \group_end: }
\RequirePackage { lltjp-fontspec }
-\group_begin:
-\char_set_catcode_other:n { \c_zero }
-\cs_new_protected:Npn \__ctex_ltj_um_char:Nw #1 = #2 \q_nil
+\cs_new_protected_nopar:Npn \__ctex_ltj_um_define_math_chars:
{
\group_begin:
- \char_set_lccode:nn { \c_zero } {#2}
- \tex_lowercase:D
+ \cs_set_protected:Npn \__um_sym:nnn ##1##2##3
{
- \group_end:
- \cs_gset_protected_nopar:Npn #1
+ \tl_if_in:nnT
{
- \mode_if_math:TF { ^^@ }
- { {
- \ctex_lua_now_x:n { tex.globaldefs = 0 }
- \ltj@allalchar ^^@
- } }
+ \mathord \mathalpha \mathbin \mathrel
+ \mathpunct \mathop \mathfence
}
+ { ##3 }
+ { \__ctex_ltj_um_char:Nn ##2 { ##1 } }
}
+ \__um_input_math_symbol_table:
+ \group_end:
+ }
+\cs_new_protected:Npn \__ctex_ltj_um_char:Nn #1#2
+ {
+ \__ctex_ltj_um_char_aux:Nx #1 { \char_generate:nn {#2} { 12 } }
\ltjsetmathletter {#2}
}
-\group_end:
+\cs_new_protected:Npn \__ctex_ltj_um_char_aux:Nn #1#2
+ {
+ \cs_gset_protected_nopar:Npn #1
+ {
+ \mode_if_math:TF
+ {#2}
+ {
+ {
+ \lua_now_x:n { tex.globaldefs = 0 }
+ \ltj@allalchar #2
+ }
+ }
+ }
+ }
+\cs_generate_variant:Nn \__ctex_ltj_um_char_aux:Nn { Nx }
\ctex_at_end_package:nn { unicode-math }
{
- \cs_if_free:NF \um_cs_set_eq_active_char:Nw
- { \cs_set_eq:NN \um_cs_set_eq_active_char:Nw \__ctex_ltj_um_char:Nw }
+ \cs_set_eq:NN \__um_define_math_chars: \__ctex_ltj_um_define_math_chars:
+ \@ifpackagelater { unicode-math } { 2015/06/28 }
+ {
+ \cs_set_eq:NN \use@mathgroup \ctex_ltj_use_math_group:Nn
+ \cs_set_protected_nopar:Npn \ctex_ltj_math_group_hook:
+ { \__um_switchto_literal: }
+ }
+ { }
}
\ctex_at_end_package:nn { listings }
{
@@ -171,7 +192,7 @@
}
\exp_after:wN \globaljfont \font@name \external@font \scan_stop:
\font@name
- \ctex_lua_now_x:n { font.current(tex.getattribute('ltj@curjfnt')) }
+ \lua_now_x:n { font.current(tex.getattribute('ltj@curjfnt')) }
\use:c { \f@encoding + \f@family }
\use:c { \curr@fontshape }
}
@@ -197,21 +218,21 @@
}
\prg_new_conditional:Npnn \ctex_ltj_if_alternate_shape_exist:n #1 { T , F , TF }
{
- \ctex_lua_now_x:n { luatexja.jfont.does_alt_set ('\luatexluaescapestring {#1}') }
+ \lua_now_x:n { luatexja.jfont.does_alt_set ('\lua_escape_x:n {#1}') }
\prg_return_true: \else: \prg_return_false: \fi:
}
\cs_new_nopar:Npn \__ctex_ltj_patch_external_font:w #1 ~ at
- { #1 \ctex_lua_now_x:n { luatexja.jfont.print_aftl_address() } ~ at }
+ { #1 \lua_now_x:n { luatexja.jfont.print_aftl_address() } ~ at }
\cs_new_protected_nopar:Npn \ctex_ltj_select_alternate_font:
{
\ctex_ltj_if_alternate_shape_exist:nT { \l__ctex_ltj_current_shape_tl }
{
- \ctex_lua_now_x:n
+ \lua_now_x:n
{
luatexja.jfont.output_alt_font_cmd
- ('y', '\luatexluaescapestring { \l__ctex_ltj_current_shape_tl }')
+ ('y', '\lua_escape_x:n { \l__ctex_ltj_current_shape_tl }')
}
- \ctex_lua_now_x:n { luatexja.jfont.pickup_alt_font_a ('\f@size') }
+ \lua_now_x:n { luatexja.jfont.pickup_alt_font_a ('\f@size') }
}
}
\tl_new:N \l__ctex_ltj_current_shape_tl
@@ -232,46 +253,64 @@
\cs_new_protected_nopar:Npn \ltj@pickup@altfont@copy #1#2
{
\ltj@@getjfontnumber #1
- \ctex_lua_now_x:n
+ \lua_now_x:n
{
luatexja.jfont.pickup_alt_font_b
- ( \the\ltj@tempcntc, '\luatexluaescapestring {#2}' )
+ ( \int_use:N \ltj@tempcntc, '\lua_escape_x:n {#2}' )
}
}
-\ExplSyntaxOff
-\def\ltj@@IsFontJapanese#1{%
- \directlua{luatexja.jfont.is_kenc(string.match(
- '\luatexluaescapestring{#1}', '[^/]+'))}}
-{\catcode`M=12%
-\gdef\ltj@@mathJapaneseFonts#1M#2#3\relax{\ltj@@IsFontJapanese{#3}}}
-\let\ltj@@al@getanddefine@fonts=\getanddefine@fonts
-\def\ltj@@ja@getanddefine@fonts#1#2{%
- \xdef\font@name{\csname \string#2/\tf@size\endcsname}%
- \pickup@jfont\let\textfont@name\font@name
- \xdef\font@name{\csname \string#2/\sf@size\endcsname}%
- \pickup@jfont\let\scriptfont@name\font@name
- \xdef\font@name{\csname \string#2/\ssf@size\endcsname}%
- \pickup@jfont
- \edef\math@fonts{\math@fonts\ltj@setpar@global%
- \ltj@@set@stackfont#1,\textfont@name:{MJT}%
- \ltj@@set@stackfont#1,\scriptfont@name:{MJS}%
- \ltj@@set@stackfont#1,\font@name:{MJSS}%
- }%
-}
-\def\getanddefine@fonts#1#2{%
- \ltj@tempcnta=#1\ltj@@IsFontJapanese{\string#2}%
- \ifin@\let\ltj@temp=\ltj@@ja@getanddefine@fonts%
- \else \let\ltj@temp=\ltj@@al@getanddefine@fonts\fi
- \ltj@temp{#1}{#2}%
-}
-\def\use@mathgroup#1#2{\relax\ifmmode
- \math@bgroup
- \expandafter\ifx\csname M@\f@encoding\endcsname#1\else
- #1\fi\ltj@tempcnta=#2 \expandafter\ltj@@mathJapaneseFonts\string#1\relax%
- \ifin@\jfam#2\relax\else\mathgroup#2\relax\fi
- \expandafter\math@egroup\fi}%
-\let\@@italiccorr=\/
-\ExplSyntaxOn
+\cs_new:Npn \ctex_ltj_if_jfont:nTF #1
+ {
+ \lua_now_x:n
+ { luatexja.jfont.is_kenc( string.match('\lua_escape_x:n {#1}', '[^/]+') ) }
+ \ifin@ \exp_after:wN \use_i:nn \else: \exp_after:wN \use_ii:nn \fi:
+ }
+\cs_new:Npn \ctex_ltj_if_jfont_math:NTF #1
+ { \exp_after:wN \__ctex_ltj_if_jfont_math:w \token_to_str:N #1 \q_stop }
+\group_begin:
+ \char_set_catcode_other:N M
+ \cs_new:Npn \__ctex_ltj_if_jfont_math:w #1 M #2#3 \q_stop
+ { \ctex_ltj_if_jfont:nTF {#3} }
+\group_end:
+\cs_new_protected_nopar:Npn \ctex_ltj_get_and_define_fonts:nN #1#2
+ {
+ \ctex_ltj_if_jfont:nTF { \token_to_str:N #2 }
+ { \ctex_ltj_get_and_define_fonts_ja:nN }
+ { \ctex_ltj_get_and_define_fonts_al:nN }
+ {#1} #2
+ }
+\cs_new_eq:NN \ctex_ltj_get_and_define_fonts_al:nN \getanddefine@fonts
+\cs_set_eq:NN \getanddefine@fonts \ctex_ltj_get_and_define_fonts:nN
+\cs_new_protected_nopar:Npn \ctex_ltj_get_and_define_fonts_ja:nN #1#2
+ {
+ \tl_gset:Nx \font@name { \use:c { \token_to_str:N #2 / \tf@size } }
+ \ctex_ltj_pickup_font: \tl_set_eq:NN \textfont@name \font@name
+ \tl_gset:Nx \font@name { \use:c { \token_to_str:N #2 / \sf@size } }
+ \ctex_ltj_pickup_font: \tl_set_eq:NN \scriptfont@name \font@name
+ \tl_gset:Nx \font@name { \use:c { \token_to_str:N #2 / \ssf@size } }
+ \ctex_ltj_pickup_font:
+ \tl_put_right:Nx \math@fonts
+ {
+ \ltj@setpar@global
+ \ltj@@set@stackfont #1 , \textfont@name \c_colon_str { MJT }
+ \ltj@@set@stackfont #1 , \scriptfont@name \c_colon_str { MJS }
+ \ltj@@set@stackfont #1 , \font@name \c_colon_str { MJSS }
+ }
+ }
+\cs_new_protected_nopar:Npn \ctex_ltj_use_math_group:Nn #1#2
+ {
+ \mode_if_math:T
+ {
+ \math@bgroup
+ \cs_if_eq:cNF { M@ \f@encoding } #1 {#1}
+ \ctex_ltj_math_group_hook:
+ \ctex_ltj_if_jfont_math:NTF #1
+ { \jfam } { \mathgroup } #2 \scan_stop:
+ \math@egroup
+ }
+ }
+\cs_new_eq:NN \ctex_ltj_math_group_hook: \prg_do_nothing:
+\cs_set_eq:NN \use@mathgroup \ctex_ltj_use_math_group:Nn
\cs_new_protected_nopar:Npn \ctex_mono_jfm:n #1
{
\str_if_eq:nnTF {#1} { plain }
@@ -283,8 +322,12 @@
\ctex_mono_jfm:o { \l__ctex_punct_tl }
\tl_const:Nn \CJK@encoding { LTJY3 }
\DeclareFontEncoding { \CJK@encoding } { } { }
-\DeclareFontSubstitution { LTJY3 } { song } { \mddefault } { \updefault }
-\ctex_lua_now_x:n { luatexja.jfont.add_kyenc_list('\CJK@encoding') }
+\use:x
+ {
+ \exp_not:N \DeclareFontSubstitution
+ { \CJK@encoding } { song } { \mddefault } { \updefault }
+ }
+\lua_now_x:n { luatexja.jfont.add_kyenc_list('\CJK@encoding') }
\cs_new_protected_nopar:Npn \__ctex_ltj_change_encoding:
{ \tl_set_eq:NN \g_fontspec_encoding_tl \CJK@encoding }
\DeclareFontFamily { \CJK@encoding } { song } { }
@@ -634,30 +677,31 @@
\keys_define:nn { ctex_ltj / fontspec }
{
AlternateFont .code:n = \ctex_ltj_set_alternate_seq:n {#1} ,
- AlternateFont .value_required: ,
+ AlternateFont .value_required:n = true ,
CharRange .clist_set:N = \l__ctex_ltj_char_range_clist ,
- CharRange .value_required:
+ CharRange .value_required:n = true
}
\group_begin:
-\char_set_catcode_active:N \/
-\char_set_lccode:nn { `\/ } { `\| }
-\tex_lowercase:D
- {
- \group_end:
- \cs_new_protected:Npn \ctex_ltj_set_alternate_seq:n #1
- {
- \clist_if_empty:NT \l__ctex_ltj_char_range_clist
- {
- \tl_set:Nn \l__ctex_ltj_tmp_tl {#1}
- \tl_replace_all:Nnn \l__ctex_ltj_tmp_tl { // } { || }
- \seq_set_split:NnV \l__ctex_ltj_tmp_seq { || } \l__ctex_ltj_tmp_tl
- \seq_set_filter:NNn \l__ctex_ltj_tmp_seq \l__ctex_ltj_tmp_seq
- { ! \tl_if_blank_p:n { ##1 } }
- \seq_concat:NNN \l__ctex_ltj_alternate_seq
- \l__ctex_ltj_alternate_seq \l__ctex_ltj_tmp_seq
- }
- }
- }
+ \char_set_catcode_other:N \|
+ \cs_set:Npn \__ctex_ltj_tmp:w #1
+ {
+ \cs_new_protected:Npn \ctex_ltj_set_alternate_seq:n ##1
+ {
+ \clist_if_empty:NT \l__ctex_ltj_char_range_clist
+ {
+ \tl_set:Nn \l__ctex_ltj_tmp_tl { ##1 }
+ \tl_replace_all:Nnn \l__ctex_ltj_tmp_tl {#1} { || }
+ \seq_set_split:NnV \l__ctex_ltj_tmp_seq { || } \l__ctex_ltj_tmp_tl
+ \seq_set_filter:NNn \l__ctex_ltj_tmp_seq \l__ctex_ltj_tmp_seq
+ { ! \tl_if_blank_p:n { ####1 } }
+ \seq_concat:NNN \l__ctex_ltj_alternate_seq
+ \l__ctex_ltj_alternate_seq \l__ctex_ltj_tmp_seq
+ }
+ }
+ }
+ \char_set_catcode_active:N \|
+ \__ctex_ltj_tmp:w { || }
+\group_end:
\seq_new:N \l__ctex_ltj_tmp_seq
\seq_new:N \l__ctex_ltj_alternate_seq
\cs_new_protected_nopar:Npn \ctex_ltj_set_alternate_family:nnF #1#2#3
@@ -767,7 +811,7 @@
\__ctex_ltj_save_alternate_shape:cnn
{ \__ctex_ltj_alternate_cs:n { clear / \l__ctex_ltj_base_CJKfamily_tl } }
{ luatexja.jfont.clear_alt_font_latex }
- { '\luatexluaescapestring { \CJK@encoding/#2/#3/#4 }' }
+ { '\lua_escape_x:n { \CJK@encoding/#2/#3/#4 }' }
}
\NewDocumentCommand \ctex_ltj_set_alternate_shape:nnn
{ m m > { \SplitArgument { \c_one } { -> } } m }
@@ -782,13 +826,13 @@
\int_eval:n { \tl_if_blank:nTF {#3} { "80 } {#3} } ,
\int_eval:n { \tl_if_blank:nTF {#4} { "10FFFF } {#4} } ,
}
- '\luatexluaescapestring { \CJK@encoding/#2 }' ,
- '\luatexluaescapestring { \CJK@encoding/#1 }'
+ '\lua_escape_x:n { \CJK@encoding/#2 }' ,
+ '\lua_escape_x:n { \CJK@encoding/#1 }'
}
}
\cs_new_protected_nopar:Npn \ctex_ltj_set_alternate_shape:n #1
{
- \ctex_lua_now_x:n { luatexja.jfont.set_alt_font_latex ( #1 ) }
+ \lua_now_x:n { luatexja.jfont.set_alt_font_latex ( #1 ) }
\__ctex_ltj_save_alternate_shape:cnn
{ \__ctex_ltj_alternate_cs:n { reset / \l__ctex_ltj_base_CJKfamily_tl } }
{ luatexja.jfont.set_alt_font_latex } {#1}
@@ -800,8 +844,8 @@
\ctex_ltj_set_alternate_shape:n
{
##1 ,
- '\luatexluaescapestring { \CJK@encoding/#2 }' ,
- '\luatexluaescapestring { \CJK@encoding/#1 }'
+ '\lua_escape_x:n { \CJK@encoding/#2 }' ,
+ '\lua_escape_x:n { \CJK@encoding/#1 }'
}
}
}
@@ -810,9 +854,9 @@
\group_begin:
\cs_if_exist:NF #1 { \cs_set_eq:NN #1 \prg_do_nothing: }
\cs_set_eq:NN \l__ctex_ltj_base_family_tl \scan_stop:
- \cs_set_eq:NN \luatexluaescapestring \scan_stop:
+ \cs_set_eq:NN \lua_escape_x:n \scan_stop:
\cs_gset_protected_nopar:Npx #1
- { \exp_not:o {#1} \exp_not:N \ctex_lua_now_x:n { #2 ( #3 ) } }
+ { \exp_not:o {#1} \exp_not:N \lua_now_x:n { #2 ( #3 ) } }
\group_end:
}
\cs_generate_variant:Nn \__ctex_ltj_save_alternate_shape:Nnn { c }
@@ -857,7 +901,7 @@
\keys_define:nn { ctex }
{
declarecharrange .code:n = \ctex_ltj_declare_char_range:x {#1} ,
- declarecharrange .value_required:
+ declarecharrange .value_required:n = true
}
\cs_new_protected_nopar:Npn \ctex_ltj_declare_char_range:n #1
{ \clist_map_inline:nn {#1} { \__ctex_ltj_declare_char_range:nn ##1 } }
@@ -944,6 +988,7 @@
}
\cs_new_protected_nopar:Npn \CTEX@verbatim@font@hook
{ \ltjsetparameter { autospacing = false , autoxspacing = false } }
+\cs_set_eq:NN \@@italiccorr \/
\cs_new_protected_nopar:Npn \ctex_update_default_family:
{
\tl_if_eq:NNT \CJKfamilydefault \l__ctex_family_default_init_tl
@@ -977,7 +1022,7 @@
{
\tl_gset:Nx \g__ctex_fontset_tl
{
- \ctex_lua_now_x:n
+ \lua_now_x:n
{
if ~ os.name == 'windows' then ~
tex.sprint ( 'windows' )
@@ -1048,6 +1093,7 @@
} ,
punct .default:n = { quanjiao } ,
}
+\tl_set:Nn \l__ctex_encoding_tl { UTF8 }
%%
%%
%% End of file `ctex-engine-luatex.def'.
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 49dc80aca67..f4d9c367d76 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,10 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{(pdf)LaTeX adapter (CTEX)}
\ProvidesExplFile{ctex-engine-pdftex.def}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.3}{\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 }
@@ -56,7 +56,7 @@
\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 } }
+ \tl_set:Nx \l__ctex_tmp_tl { \str_lower_case:n {#2} \CJK@plane }
\tex_immediate:D \pdfobj stream ~ file { \l__ctex_tmp_tl .cmap }
\cs_new_protected_nopar:Npx #1
{
@@ -66,7 +66,7 @@
}
\group_begin:
\char_set_catcode_other:N \#
-\ctex_if_pdfmode:TF
+\sys_if_output_pdf:TF
{
\group_end:
\ctex_appto_cmd:NnnTF \DeclareFontFamily { \ExplSyntaxOff }
@@ -269,7 +269,7 @@
{
\file_if_exist:nTF { nul: }
{
- \file_if_exist:nTF { \c__ctex_engine_file_tl }
+ \file_if_exist:nTF { \c__ctex_upper_case_file_str }
{ \ctex_if_macosx:TF { mac } { windows } }
{ \ctex_if_macosx:TF { mac } { fandol } }
}
@@ -277,23 +277,20 @@
}
{ \tl_gset:Nn \g__ctex_fontset_tl { windows } }
}
-\tex_uppercase:D \exp_after:wN
- {
- \exp_after:wN \tl_const:Nn \exp_after:wN \c__ctex_engine_file_tl
- \exp_after:wN { \g_file_current_name_tl }
- }
+\str_const:Nx \c__ctex_upper_case_file_str
+ { \exp_args:No \str_upper_case:n { \g_file_current_name_tl } }
\cs_new_protected_nopar:Npn \ctex_if_macosx:TF #1#2
{
- \file_if_exist:nTF { \c__ctex_macosx_file_tl }
+ \file_if_exist:nTF { \c__ctex_macosx_file_str }
{ \tl_gset:Nn \g__ctex_fontset_tl {#1} }
{ \tl_gset:Nn \g__ctex_fontset_tl {#2} }
}
-\tl_const:Nn \c__ctex_macosx_file_tl { /Library/Fonts/Songti.ttc }
+\str_const:Nn \c__ctex_macosx_file_str { /Library/Fonts/Songti.ttc }
\ctex_hypersetup:n { driverfallback = dvipdfmx }
\str_if_eq:onTF { \l__ctex_encoding_tl } { GBK }
{
\ctex_hypersetup:n { CJKbookmarks = true }
- \ctex_if_pdfmode:TF
+ \sys_if_output_pdf:TF
{ \ctex_at_end_package:nn { hyperref } { \RequirePackage { xCJK2uni } } }
{
\ctex_at_end_package:nn { hyperref }
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 6a6e2a0cbf4..d45315f24d2 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 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{XeLaTeX adapter (CTEX)}
\ProvidesExplFile{ctex-engine-xetex.def}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.3}{\ExplFileDescription}
\RequirePackage { xeCJK }
\exp_args:Nx \xeCJKsetup
{
@@ -45,7 +45,7 @@
{
\file_if_exist:nTF { nul: }
{
- \file_if_exist:nTF { \c__ctex_engine_file_tl }
+ \file_if_exist:nTF { \c__ctex_upper_case_file_str }
{ \ctex_if_macosx:TF { mac } { windows } }
{ \ctex_if_macosx:TF { mac } { fandol } }
}
@@ -53,23 +53,19 @@
}
{ \tl_gset:Nn \g__ctex_fontset_tl { windows } }
}
-\tex_uppercase:D \exp_after:wN
- {
- \exp_after:wN \tl_const:Nn \exp_after:wN \c__ctex_engine_file_tl
- \exp_after:wN { \g_file_current_name_tl }
- }
+\str_const:Nx \c__ctex_upper_case_file_str
+ { \exp_args:No \str_upper_case:n { \g_file_current_name_tl } }
\cs_new_protected_nopar:Npn \ctex_if_macosx:TF #1#2
{
- \file_if_exist:nTF { \c__ctex_macosx_file_tl }
+ \file_if_exist:nTF { \c__ctex_macosx_file_str }
{ \tl_gset:Nn \g__ctex_fontset_tl {#1} }
{ \tl_gset:Nn \g__ctex_fontset_tl {#2} }
}
-\tl_const:Nn \c__ctex_macosx_file_tl { /Library/Fonts/Songti.ttc }
+\str_const:Nn \c__ctex_macosx_file_str { /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 = { } } }
}
@@ -148,6 +144,7 @@
} ,
punct .default:n = { quanjiao } ,
}
+\tl_set:Nn \l__ctex_encoding_tl { UTF8 }
%%
%%
%% End of file `ctex-engine-xetex.def'.
diff --git a/Master/texmf-dist/tex/latex/ctex/fd/c19rm.fd b/Master/texmf-dist/tex/latex/ctex/fd/c19rm.fd
index b748cdf5f57..515d96783ca 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/07/01 v2.2 Chinese font definition (CTEX)]
+ [2016/02/02 v2.3 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 f473966f375..91a3e0b12f6 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/07/01 v2.2 Chinese font definition (CTEX)]
+ [2016/02/02 v2.3 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 443363529e0..d35485a2621 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/07/01 v2.2 Chinese font definition (CTEX)]
+ [2016/02/02 v2.3 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 99eb8e23466..0e96bf9e32b 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/07/01 v2.2 Chinese font definition (CTEX)]
+ [2016/02/02 v2.3 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 aaca4cec351..02708a6b676 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/07/01 v2.2 Chinese font definition (CTEX)]
+ [2016/02/02 v2.3 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 115bb4df8fb..fcb5bc5137a 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/07/01 v2.2 Chinese font definition (CTEX)]
+ [2016/02/02 v2.3 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 24e30e0f28d..60bd1c0c957 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,13 +26,13 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{Adobe fonts definition (CTEX)}
\ProvidesExplFile{ctex-fontset-adobe.def}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
-\pdftex_if_engine:TF
+ {\ExplFileDate}{2.3}{\ExplFileDescription}
+\sys_if_engine_pdftex:TF
{
- \ctex_if_pdfmode:TF
+ \sys_if_output_pdf:TF
{ \ctex_fontset_error:n { adobe } }
{
\ctex_zhmap_case:nnn
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 8d29591debf..955f3686992 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,13 +26,13 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{Fandol fonts definition (CTEX)}
\ProvidesExplFile{ctex-fontset-fandol.def}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
-\pdftex_if_engine:TF
+ {\ExplFileDate}{2.3}{\ExplFileDescription}
+\sys_if_engine_pdftex:TF
{
- \ctex_if_pdfmode:TF
+ \sys_if_output_pdf:TF
{ \ctex_fontset_error:n { fandol } }
{
\ctex_zhmap_case:nnn
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 8a8cd79d2dc..498d48c475c 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,11 +26,11 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{Founder fonts definition (CTEX)}
\ProvidesExplFile{ctex-fontset-founder.def}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
-\pdftex_if_engine:TF
+ {\ExplFileDate}{2.3}{\ExplFileDescription}
+\sys_if_engine_pdftex:TF
{
\ctex_zhmap_case:nnn
{
@@ -66,7 +66,7 @@
\setCJKmainfont
[ BoldFont = FZXiaoBiaoSong-B05 , ItalicFont = FZKai-Z03 ] { FZShuSong-Z01 }
\setCJKsansfont [ BoldFont = FZHei-B01 ]
- { \xetex_if_engine:TF { 方正细黑一_GBK } { FZXH1K--GBK1-0 } }
+ { \sys_if_engine_xetex:TF { 方正细黑一_GBK } { FZXH1K--GBK1-0 } }
\setCJKmonofont { FZFangSong-Z02 }
\setCJKfamilyfont { zhsong } [ BoldFont = FZXiaoBiaoSong-B05 ] { FZShuSong-Z01 }
\setCJKfamilyfont { zhhei } { FZHei-B01 }
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 74fd11e0a80..d35c93356c2 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,11 +26,11 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{Mac OS X fonts definition (CTEX)}
\ProvidesExplFile{ctex-fontset-mac.def}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
-\pdftex_if_engine:TF
+ {\ExplFileDate}{2.3}{\ExplFileDescription}
+\sys_if_engine_pdftex:TF
{ \ctex_fontset_error:n { mac } }
{
\setCJKmainfont [ BoldFont = STHeiti , ItalicFont = STKaiti ] { STSong }
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 6b4c840a77d..2a66dea15ac 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,11 +26,11 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{Ubuntu fonts definition (CTEX)}
\ProvidesExplFile{ctex-fontset-ubuntu.def}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
-\pdftex_if_engine:TF
+ {\ExplFileDate}{2.3}{\ExplFileDescription}
+\sys_if_engine_pdftex:TF
{
\ctex_zhmap_case:nnn
{
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 46d2f765513..8bd30d60680 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 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{Windows fonts definition (CTEX)}
\ProvidesExplFile{ctex-fontset-windows.def}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.3}{\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 19c4b348e7a..c880cbddba4 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,11 +26,11 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{Windows fonts definition for Vista or later version (CTEX)}
\ProvidesExplFile{ctex-fontset-windowsnew.def}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
-\pdftex_if_engine:TF
+ {\ExplFileDate}{2.3}{\ExplFileDescription}
+\sys_if_engine_pdftex: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 8bb2f56860e..3060142d09b 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,11 +26,11 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{Windows fonts definition for XP or earlier version (CTEX)}
\ProvidesExplFile{ctex-fontset-windowsold.def}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
-\pdftex_if_engine:TF
+ {\ExplFileDate}{2.3}{\ExplFileDescription}
+\sys_if_engine_pdftex: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 744ddadda77..6db47b31cc8 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,10 +26,10 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{Chinese scheme for article (CTEX)}
\ProvidesExplFile{ctex-scheme-chinese-article.def}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.3}{\ExplFileDescription}
\keys_set:nn { ctex / part }
{
aftertitle = \par ,
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 055ca1c859d..ae26395987c 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,10 +26,10 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{Chinese scheme for book (CTEX)}
\ProvidesExplFile{ctex-scheme-chinese-book.def}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.3}{\ExplFileDescription}
\keys_set:nn { ctex / part }
{
aftertitle = \par ,
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 017ee477859..37d2bddca38 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,10 +26,10 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{Chinese scheme for report (CTEX)}
\ProvidesExplFile{ctex-scheme-chinese-report.def}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.3}{\ExplFileDescription}
\keys_set:nn { ctex / part }
{
aftertitle = \par ,
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 e5b315b71c9..08db97bfde2 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 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{Chinese scheme for generic (CTEX)}
\ProvidesExplFile{ctex-scheme-chinese.def}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.3}{\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 } }
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 771341156b2..c1845cd0437 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,10 +26,10 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{Plain scheme for article (CTEX)}
\ProvidesExplFile{ctex-scheme-plain-article.def}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.3}{\ExplFileDescription}
\keys_set:nn { ctex / part }
{
aftertitle = \par ,
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 e3ab04495eb..34898a62706 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,10 +26,10 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{Plain scheme for book (CTEX)}
\ProvidesExplFile{ctex-scheme-plain-book.def}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.3}{\ExplFileDescription}
\keys_set:nn { ctex / part }
{
aftertitle = \par ,
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 61d509648d8..946ed89e789 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,10 +26,10 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{Plain scheme for report (CTEX)}
\ProvidesExplFile{ctex-scheme-plain-report.def}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.3}{\ExplFileDescription}
\keys_set:nn { ctex / part }
{
aftertitle = \par ,
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 c3cee4ceabb..feddaa061c5 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 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $
{Plain scheme for generic (CTEX)}
\ProvidesExplFile{ctex-scheme-plain.def}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.3}{\ExplFileDescription}
%%
%%
%% End of file `ctex-scheme-plain.def'.