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 | 46 |
1 files changed, 30 insertions, 16 deletions
diff --git a/Master/texmf-dist/tex/latex/ctex/ctex-article.def b/Master/texmf-dist/tex/latex/ctex/ctex-article.def index 08a0bc1fd6f..69e4f2ae061 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctex-article.def +++ b/Master/texmf-dist/tex/latex/ctex/ctex-article.def @@ -6,7 +6,7 @@ %% %% ctex.dtx (with options: `heading,article') %% -%% Copyright (C) 2003--2018 +%% Copyright (C) 2003--2019 %% CTEX.ORG and any individual authors listed in the documentation. %% ------------------------------------------------------------------------------ %% @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 096f319 2018-05-02 19:51:41 +0800 Liam Huang <liamhuang0205@gmail.com> $ +\GetIdInfo$Id: ctex.dtx cb8bf3c 2019-04-07 23:32:09 +0800 Qing Lee <sobenlee@gmail.com> $ {Heading modification for article (CTEX)} \ProvidesExplFile{ctex-article.def} - {\ExplFileDate}{2.4.14}{\ExplFileDescription} + {\ExplFileDate}{2.4.15}{\ExplFileDescription} \seq_const_from_clist:Nn \c__ctex_section_headings_seq { section , subsection , subsubsection , paragraph , subparagraph } \seq_new:N \c__ctex_headings_seq @@ -112,7 +112,7 @@ { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ####1 } } } \NewDocumentCommand \ctex_assign_heading_name:nn - { m > { \SplitArgument { \c_one } { , } } +m } + { m > { \SplitArgument { 1 } { , } } +m } { \__ctex_assign_heading_name:nnn {#1} #2 } \cs_new_protected:Npn \__ctex_assign_heading_name:nnn #1#2#3 { @@ -180,10 +180,9 @@ \fi \CTEX@addtocline{part}{#1}% {\interlinepenalty \@M - \normalfont \parindent \dimexpr \CTEX@part@indent \relax \CTEX@part@format - \ifnum \c@secnumdepth >\m@ne \ifodd \CTEX@part@numbering - \CTEX@partname \CTEX@part@aftername - \fi \fi + \normalfont \CTEX@part@format + \CTEX@hangindent{part}% + {\CTEXifname{\CTEX@partname\CTEX@part@aftername}{}}% \CTEX@part@titleformat{#2}% \partmark{#1}% \CTEX@part@aftertitle}% @@ -196,8 +195,8 @@ \CTEX@ifnamefalse \CTEX@makeanchor@spart{part*}% {\interlinepenalty \@M - \normalfont \parindent \dimexpr \CTEX@part@indent \relax - \CTEX@part@format + \normalfont \CTEX@part@format + \CTEX@hangindent{part}{}% \CTEX@part@titleformat{#1}% \CTEX@part@aftertitle}% \nobreak @@ -303,6 +302,21 @@ \fi}% \fi \ignorespaces} +\cs_new_protected:Npn \CTEX@hangindent #1#2 + { + \bool_if:cTF { CTEX@#1@hang } + { \@hangfrom } + { \noindent \use:n } + { \__ctex_indent_aux:n {#1} #2 } + } +\cs_new_protected:Npn \__ctex_indent_aux:n #1 + { + \group_begin: + \skip_set:Nn \l__ctex_heading_skip { \use:c { CTEX@#1@indent } } + \dim_compare:nNnF \l__ctex_heading_skip = \c_zero_dim + { \skip_horizontal:N \l__ctex_heading_skip } + \group_end: + } \cs_new_protected_nopar:Npn \CTEX@hangfrom { \bool_if:NTF \CTEX@hang @@ -312,11 +326,11 @@ \cs_new_protected_nopar:Npn \CTEX@update@sectionformat@n #1 { \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat } - \cs_set_eq:Nc \CTEX@aftertitle { CTEX@#1@aftertitle } - \cs_set_eq:Nc \CTEX@afterindent { CTEX@#1@afterindent } - \cs_set_eq:Nc \CTEX@fixskip { CTEX@#1@fixskip } - \cs_set_eq:Nc \CTEX@hang { CTEX@#1@hang } - \cs_set_eq:Nc \CTEX@runin { CTEX@#1@runin } + \cs_set_eq:Nc \CTEX@aftertitle { CTEX@#1@aftertitle } + \cs_set_eq:Nc \CTEX@afterindent { CTEX@#1@afterindent } + \cs_set_eq:Nc \CTEX@fixskip { CTEX@#1@fixskip } + \cs_set_eq:Nc \CTEX@hang { CTEX@#1@hang } + \cs_set_eq:Nc \CTEX@runin { CTEX@#1@runin } } \cs_new_eq:NN \CTEX@titleformat@n \use:n \cs_new_eq:NN \CTEX@aftertitle \prg_do_nothing: @@ -559,7 +573,7 @@ \dim_set:Nn \@tempdima { \dim_max:nn { \@tempdima } - { \box_wd:N \l__ctex_tmp_box + \f@size \p@ / \c_two } + { \box_wd:N \l__ctex_tmp_box + \f@size \p@ / 2 } } } \group_begin: |