diff options
author | Karl Berry <karl@freefriends.org> | 2016-02-03 22:59:51 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-02-03 22:59:51 +0000 |
commit | 1290d7454b9754f3c7a7e4a229981e18f58ea6f6 (patch) | |
tree | aa01beb72d34acd81690358b54be7493a5244544 /Master/texmf-dist/tex/latex/ctex | |
parent | e5ef88072190f4f0e310c900fd626db1dd7dc096 (diff) |
ctex (3feb16)
git-svn-id: svn://tug.org/texlive/trunk@39559 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/ctex')
44 files changed, 870 insertions, 741 deletions
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'. |