diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/ctex/ctex-report.def')
-rw-r--r-- | Master/texmf-dist/tex/latex/ctex/ctex-report.def | 53 |
1 files changed, 34 insertions, 19 deletions
diff --git a/Master/texmf-dist/tex/latex/ctex/ctex-report.def b/Master/texmf-dist/tex/latex/ctex/ctex-report.def index 50750dcb0b3..24c7719f4c1 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctex-report.def +++ b/Master/texmf-dist/tex/latex/ctex/ctex-report.def @@ -6,7 +6,7 @@ %% %% ctex.dtx (with options: `heading,report') %% -%% 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 report (CTEX)} \ProvidesExplFile{ctex-report.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 @@ -113,7 +113,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 { @@ -214,9 +214,8 @@ \partmark{#1}% {\interlinepenalty \@M \normalfont \CTEX@part@format - \ifnum \c@secnumdepth >-2\relax \ifodd \CTEX@part@numbering - \CTEX@partname \CTEX@part@aftername - \fi \fi + \CTEX@hangindent{part}% + {\CTEXifname{\CTEX@partname\CTEX@part@aftername}{}}% \CTEX@part@titleformat{#2}% \CTEX@part@aftertitle}% \@endpart} @@ -225,6 +224,7 @@ \CTEX@makeanchor@spart{part*}% {\interlinepenalty \@M \normalfont \CTEX@part@format + \CTEX@hangindent{part}{}% \CTEX@part@titleformat{#1}% \CTEX@part@aftertitle}% \@endpart} @@ -289,10 +289,10 @@ \CTEX@setheadingskip \CTEX@chapter@beforeskip \ifodd \CTEX@chapter@fixskip \CTEX@fixtopskip \fi \vspace*{\CTEX@headingskip}% - {\normalfont \parindent \dimexpr \CTEX@chapter@indent \relax - \CTEX@chapter@format - \CTEXifname{\CTEX@chaptername\CTEX@chapter@aftername}{}% + {\normalfont \CTEX@chapter@format \interlinepenalty\@M + \CTEX@hangindent{chapter}% + {\CTEXifname{\CTEX@chaptername\CTEX@chapter@aftername}{}}% \CTEX@chapter@titleformat{#1}% \CTEX@chapter@aftertitle \nobreak @@ -304,10 +304,10 @@ \CTEX@setheadingskip \CTEX@chapter@beforeskip \ifodd \CTEX@chapter@fixskip \CTEX@fixtopskip \fi \vspace*{\CTEX@headingskip}% - {\normalfont \parindent \dimexpr \CTEX@chapter@indent \relax - \CTEX@chapter@format + {\normalfont \CTEX@chapter@format \interlinepenalty\@M - \CTEX@chapter@titleformat{#1} + \CTEX@hangindent{chapter}{}% + \CTEX@chapter@titleformat{#1}% \CTEX@chapter@aftertitle \nobreak \CTEX@setheadingskip \CTEX@chapter@afterskip @@ -412,6 +412,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 @@ -421,11 +436,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: @@ -676,7 +691,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: |