diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/ctex/ctex-article.def')
-rw-r--r-- | Master/texmf-dist/tex/latex/ctex/ctex-article.def | 74 |
1 files changed, 50 insertions, 24 deletions
diff --git a/Master/texmf-dist/tex/latex/ctex/ctex-article.def b/Master/texmf-dist/tex/latex/ctex/ctex-article.def index ba0af7ce82d..be98bfc12e0 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctex-article.def +++ b/Master/texmf-dist/tex/latex/ctex/ctex-article.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $ {Heading modification for article (CTEX)} \ProvidesExplFile{ctex-article.def} - {\ExplFileDate}{2.0.2}{\ExplFileDescription} + {\ExplFileDate}{2.1}{\ExplFileDescription} \seq_new:N \c__ctex_headings_seq \seq_gset_from_clist:Nn \c__ctex_headings_seq { @@ -49,16 +49,18 @@ \tl_const:cx { CTEX@#1name } { \exp_not:c { CTEX@#1@nameformat } - \exp_not:c { CTEX@pre#1 } - \exp_not:N \tl_if_empty:NTF \exp_not:c { CTEX@#1@numberformat } - { \exp_not:c { CTEX@the#1 } } { - \group_begin: - \exp_not:c { CTEX@#1@numberformat } - \exp_not:c { CTEX@the#1 } - \group_end: + \exp_not:c { CTEX@pre#1 } + \exp_not:N \tl_if_empty:NTF \exp_not:c { CTEX@#1@numberformat } + { \exp_not:c { CTEX@the#1 } } + { + \group_begin: + \exp_not:c { CTEX@#1@numberformat } + \exp_not:c { CTEX@the#1 } + \group_end: + } + \exp_not:c { CTEX@post#1 } } - \exp_not:c { CTEX@post#1 } \exp_not:c { CTEX@#1@aftername } } } @@ -75,19 +77,34 @@ #1 / numberformat .tl_set:N = \exp_not:c { CTEX@#1@numberformat } , #1 / aftername .tl_set:N = \exp_not:c { CTEX@#1@aftername } , #1 / titleformat .tl_set:N = \exp_not:c { CTEX@#1@titleformat } , + #1 / aftertitle .tl_set:N = \exp_not:c { CTEX@#1@aftertitle } , #1 / beforeskip .tl_set:N = \exp_not:c { CTEX@#1@beforeskip } , #1 / afterskip .tl_set:N = \exp_not:c { CTEX@#1@afterskip} , #1 / indent .tl_set:N = \exp_not:c { CTEX@#1@indent } , #1 / format+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@format } { ####1 } } , + #1 / format~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@format } { ####1 } } , #1 / nameformat+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@nameformat } { ####1 } } , + #1 / nameformat~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@nameformat } { ####1 } } , #1 / numberformat+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@numberformat } { ####1 } } , + #1 / numberformat~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@numberformat } { ####1 } } , #1 / aftername+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftername } { ####1 } } , + #1 / aftername~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftername } { ####1 } } , #1 / titleformat+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@titleformat } { ####1 } } , + #1 / titleformat~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@titleformat } { ####1 } } , + #1 / aftertitle+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftertitle } { ####1 } } , + #1 / aftertitle~+ .code:n = + { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftertitle } { ####1 } } , #1 / beforeskip .initial:n = \c_zero_skip , #1 / afterskip .initial:n = \c_zero_skip , #1 / indent .initial:n = \c_zero_dim , @@ -106,7 +123,6 @@ { \tl_clear:c { CTEX@post#1 } } { \tl_set:cn { CTEX@post#1 } {#3} } } -\tl_clear:N \l__ctex_tmp_tl \seq_map_inline:Nn \c__ctex_headings_seq { \__ctex_initial_heading:n {#1} @@ -138,14 +154,16 @@ \CTEX@partname \fi \CTEX@part@titleformat{#2}% - \markboth{}{}\par}% + \markboth{}{}% + \CTEX@part@aftertitle}% \nobreak \vskip \CTEX@part@afterskip \@afterheading} \def\@spart#1{% {\interlinepenalty \@M \normalfont \parindent \CTEX@part@indent \CTEX@part@format - \CTEX@part@titleformat{#1}\par}% + \CTEX@part@titleformat{#1}% + \CTEX@part@aftertitle}% \nobreak \vskip \CTEX@part@afterskip \@afterheading} @@ -166,7 +184,8 @@ #6{% \@hangfrom{\hskip #3\relax\@svsec}% \interlinepenalty \@M - \csname CTEX@#1@titleformat\endcsname{#8}\@@par}% + \csname CTEX@#1@titleformat\endcsname{#8}% + \csname CTEX@#1@aftertitle\endcsname}% \endgroup \csname #1mark\endcsname{#7}% \addcontentsline{toc}{#1}{% @@ -179,7 +198,9 @@ \else \def\@svsechd{% #6{\hskip #3\relax - \@svsec \csname CTEX@#1@titleformat\endcsname{#8}}% + \@svsec + \csname CTEX@#1@titleformat\endcsname{#8}% + \csname CTEX@#1@aftertitle\endcsname}% \csname #1mark\endcsname{#7}% \addcontentsline{toc}{#1}{% \ifnum #2>\c@secnumdepth \else @@ -197,15 +218,20 @@ #4{% \@hangfrom{\hskip #1}% \interlinepenalty \@M - \CTEX@titleformat@n{#5}\@@par}% + \CTEX@titleformat@n{#5}% + \CTEX@aftertitle}% \endgroup \else - \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}}}% + \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}\CTEX@aftertitle}}% \fi \@xsect{#3}} \cs_new_protected_nopar:Npn \CTEX@set@titleformat@n #1 - { \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat } } + { + \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat } + \cs_set_eq:Nc \CTEX@aftertitle { CTEX@#1@aftertitle } + } \cs_new_eq:NN \CTEX@titleformat@n \use:n +\cs_new_eq:NN \CTEX@aftertitle \prg_do_nothing: \int_zero:N \l__ctex_tmp_int \clist_map_inline:nn { section , subsection , subsubsection , paragraph , subparagraph } @@ -224,15 +250,15 @@ } } } -\tl_new:N \CTEX@preappendix -\tl_new:N \CTEX@postappendix \keys_define:nn { ctex } - { appendix .meta:nn = { ctex / appendix } {#1} } -\keys_define:nn { ctex / appendix } { - name .code:n = { \ctex_assign_heading_name:nn { appendix } {#1} } , - number .tl_set:N = \CTEX@appendixnumber + appendix .meta:nn = { ctex / appendix } {#1} , + appendix / name .code:n = + { \ctex_assign_heading_name:nn { appendix } {#1} } , + appendix / number .tl_set:N = \CTEX@appendixnumber } +\tl_new:N \CTEX@preappendix +\tl_new:N \CTEX@postappendix \cs_new_eq:NN \CTEX@save@appendix \appendix \cs_gset_protected_nopar:Npn \appendix { |