diff options
author | Karl Berry <karl@freefriends.org> | 2015-06-30 21:26:14 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-06-30 21:26:14 +0000 |
commit | aaec8ff3cf7236ae9429a6d9238b1838af2441d6 (patch) | |
tree | 7d00cf0ec8459200ac8e721eed28d09e155012c9 /Master/texmf-dist/tex/latex/ctex/ctex.sty | |
parent | 56e4ae7a5ecbbf9bf7b858d20cb0c3e0d21edc8a (diff) |
ctex (30jun15)
git-svn-id: svn://tug.org/texlive/trunk@37720 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/ctex/ctex.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/ctex/ctex.sty | 159 |
1 files changed, 21 insertions, 138 deletions
diff --git a/Master/texmf-dist/tex/latex/ctex/ctex.sty b/Master/texmf-dist/tex/latex/ctex/ctex.sty index 615e615d807..82a943cb854 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 ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $ {Chinese adapter in LaTeX (CTEX)} \ProvidesExplPackage{\ExplFileName} - {\ExplFileDate}{2.1}{\ExplFileDescription} + {\ExplFileDate}{2.2}{\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,35 +47,12 @@ { \msg_error:nnn { ctex } { subpackage-loaded } { ctexheading } } { \cs_new_eq:cN { ver@ctexheading. \@pkgextension } \c__ctex_version_tl } \RequirePackage { xparse , l3keys2e } -\RequirePackage { etoolbox } +\RequirePackage { ctexhook , ctexpatch } \RequirePackage { fix-cm , everysel } \tl_new:N \l__ctex_tmp_tl \int_new:N \l__ctex_tmp_int \dim_new:N \l__ctex_tmp_dim \box_new:N \l__ctex_tmp_box -\cs_new_protected:Npn \ctex_at_end_package:nn #1#2 - { - \@ifpackageloaded {#1} - {#2} - { \ctex_gadd_hook:cn { g__ctex_at_end_ #1 _hook_tl } {#2} } - } -\cs_new_protected:Npn \ctex_gadd_hook:Nn #1#2 - { - \tl_if_exist:NF #1 { \tl_new:N #1 } - \tl_gput_right:Nn #1 {#2} - } -\cs_generate_variant:Nn \ctex_gadd_hook:Nn { c } -\cs_new_protected_nopar:Npn \ctex_package_end_hook:n #1 - { - \cs_if_exist_use:cT { g__ctex_at_end_ #1 _hook_tl } - { \cs_undefine:c { g__ctex_at_end_ #1 _hook_tl } } - } -\cs_generate_variant:Nn \ctex_package_end_hook:n { o } -\tl_put_left:Nn \@popfilename - { - \cs_if_eq:NNT \@currext \@pkgextension - { \ctex_package_end_hook:o { \@currname } } - } \cs_new_protected:Npn \ctex_file_wrapper:nnn #1#2#3 { \use:x @@ -108,90 +85,6 @@ { } } \cs_generate_variant:Nn \ctex_scheme_input:n { o } -\cs_new_protected:Npn \ctex_parse_name:NN #1#2 - { \ctex_parse_name:NNx #1#2 { \cs_to_str:N #2 } } -\group_begin: -\char_set_lccode:nn { `\< } { `\{ } -\char_set_lccode:nn { `\/ } { `\\ } -\char_set_lccode:nn { `\A } { `\t } -\tl_map_function:nN { \A \E \S \O \P } \char_set_catcode_other:N -\tex_lowercase:D - { - \group_end: - \cs_new_protected:Npn \ctex_parse_name:NNn #1#2#3 - { - \bool_if:nTF { \cs_if_exist_p:c { #3 ~ } || \cs_if_exist_p:c { /#3 } } - { - \group_begin: - \use:x - { - \group_end: - \__ctex_parse_name:nNNNnN { \token_get_replacement_spec:N #2 } - \exp_not:N #2 \exp_not:c { #3 ~ } \exp_not:c { /#3 } - } {#3} #1 - } - { #1#2 } - } - \cs_new_protected:Npn \__ctex_parse_name:nNNNnN #1#2#3#4#5#6 - { - \exp_args:Nc #6 - { - \str_case:nnTF {#1} - { - { \protect #3 } { } - { \x@protect #2 \protect #3 } { } - } - { - \str_if_eq_x:nnTF { \exp_not:n { /@protected@ #3 /#3 } } - { - \exp_last_unbraced:Nf \__ctex_parse_name:w - \token_get_replacement_spec:N #3 AESAOPA ~ < \q_stop - } - { /#5 ~ } { #5 ~ } - } - { - \str_case:onTF { \__ctex_parse_name:w #1 AESAOPA ~ < \q_stop } - { - { /@protected@ #2 #4 } { } - { /@ #4 } { } - } - { /#5 } {#5} - } - } - } - \cs_new:Npn \__ctex_parse_name:w #1 AESAOPA ~ #2 < #3 \q_stop { #1#2 } - } -\cs_generate_variant:Nn \ctex_parse_name:NNn { NNx } -\cs_new_protected_nopar:Npn \ctex_patch_cmd:NnnTF { \ctex_parse_name:NN \patchcmd } -\cs_new_protected_nopar:Npn \ctex_preto_cmd:NnTF { \ctex_parse_name:NN \pretocmd } -\cs_new_protected_nopar:Npn \ctex_appto_cmd:NnTF { \ctex_parse_name:NN \apptocmd } -\cs_new_protected:Npn \ctex_patch_cmd:Nnn - { - \group_begin: - \char_set_catcode_other:N \# - \__ctex_patch_cmd:Nnn - } -\cs_new_protected:Npn \__ctex_patch_cmd:Nnn #1#2#3 - { - \group_end: - \group_begin: - \ExplSyntaxOff - \ctex_patch_cmd:NnnTF #1 {#2} {#3} - { - \cs_gset_eq:NN \__ctex_tmp:w #1 - \group_end: - \cs_set_eq:NN #1 \__ctex_tmp:w - \cs_undefine:N \__ctex_tmp:w - } - { \group_end: \ctex_patch_failure:N #1 } - } -\cs_new_protected:Npn \ctex_patch_failure:N #1 - { \msg_warning:nnx { ctex } { patch-failure } { \token_to_str:N #1 } } -\msg_new:nnn { ctex } { patch-failure } - { - Patching~command~`#1'~failed.\\ - ctex~may~not~work~as~expected. - } \cs_new_eq:NN \g__ctex_section_depth_flag \c_two \msg_new:nnnn { ctex } { package-too-old } { Support~package~`#1'~too~old. } @@ -214,7 +107,7 @@ \cs_new_eq:NN \ctex_if_pdfmode:TF \use_ii:nn } \cs_new_eq:NN \ctex_if_preamble:TF \use_i:nn -\AfterEndPreamble { \cs_set_eq:NN \ctex_if_preamble:TF \use_ii:nn } +\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 { \dim_compare:nNnTF @@ -299,8 +192,8 @@ { \msg_warning:nnn { ctex } { deprecated-option } { - The~ functionality~ has~ been~ removed.~ - It's~ better~ to~ set~ the~ heading~ styles~ via~ beforeskip~ + The~ functionality~ has~ been~ removed.\\ + It's~ better~ to~ set~ the~ heading~ styles~ via~ `afterindent'~ options.~ } } , @@ -309,8 +202,8 @@ { \msg_warning:nnn { ctex } { deprecated-option } { - The~ functionality~ has~ been~ removed.~ - It's~ better~ to~ set~ the~ heading~ styles~ via~ beforeskip~ + The~ functionality~ has~ been~ removed.\\ + It's~ better~ to~ set~ the~ heading~ styles~ via~ `afterindent'~ options. } } , @@ -442,7 +335,7 @@ \cs_if_exist:NF \hypersetup { \cs_new_eq:NN \hypersetup \ctex_hypersetup:n } } - \AtEndPreamble { \RequirePackage { hyperref } } + \ctex_at_end_preamble:n { \RequirePackage { hyperref } } } , } \tl_clear:N \l__ctex_tmp_tl @@ -638,6 +531,14 @@ \cs_new_eq:NN \chinese \zhnum \cs_new_eq:NN \Chinese \chinese \cs_new_eq:NN \CTEXcounter \use_none:n +\ctex_at_end_package:nn { enumitem } + { + \cs_if_free:NF \AddEnumerateCounter + { + \AddEnumerateCounter * { \zhnum } { \zhnum_int:n } { 1 } + \AddEnumerateCounter * { \chinese } { \zhnum_int:n } { 1 } + } + } \NewDocumentCommand \CTEXnumber { m m } { \protected@edef #1 { \zhnumber {#2} } } \NewDocumentCommand \CTEXdigits { m m } @@ -818,7 +719,7 @@ \fi: \fp_compare:nNnF { \l__ctex_line_spread_fp } ? { \c_zero_fp } { - \linespread { \fp_use:N \l__ctex_line_spread_fp } + \exp_args:Nx \linespread { \fp_use:N \l__ctex_line_spread_fp } \group_begin: \footnotesize \exp_args:NNNo \group_end: \dim_set:Nn \footnotesep { \dim_use:N \box_ht:N \strutbox } } @@ -835,26 +736,6 @@ { You~can~load~the~package~`caption'~to~get~its~functionality. } } } -\group_begin: -\char_set_catcode_other:N \# -\use:n - { - \group_end: - \ExplSyntaxOff - \ctex_at_end_package:nn { breqn } - { - \ctex_patch_cmd:NnnTF \end { \csname end#1 \endcsname } - { - \csuse { @end@#1@hook } - \csname end#1 \endcsname - } { } - { - \ctex_preto_cmd:NnTF \end { \csuse { @end@#1@hook } } - { } { \ctex_patch_failure:N \end } - } - } - \ExplSyntaxOn - } \cs_new_protected_nopar:Npn \ctex_fontset_error:n #1 { \msg_critical:nnn { ctex } { fontset-unavailable } {#1} } \msg_new:nnn { ctex } { fontset-unavailable } @@ -928,12 +809,14 @@ %% and the derived files ctex.pdf, %% ctex.ins, %% ctex.sty, -%% ctexcap.sty, %% ctexsize.sty, %% ctexheading.sty, %% ctexart.cls, %% ctexbook.cls, %% ctexrep.cls, +%% ctexcap.sty, +%% ctexhook.sty, +%% ctexpatch.sty, %% ctex-c5size.clo, %% ctex-cs4size.clo, %% ctex-article.def, |