diff options
author | Karl Berry <karl@freefriends.org> | 2019-04-07 21:22:23 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-04-07 21:22:23 +0000 |
commit | fc7eee8c175b307abf9396aed71c1d49bd1c0fe4 (patch) | |
tree | 6173e8f922c539a792fcbde24e58cb8db06dd5e2 /Master/texmf-dist/tex/latex/ctex/ctex-book.def | |
parent | bb3a18a8791a2f32a6c8a3e0c9ee15a643aefd89 (diff) |
ctex (7apr19)
git-svn-id: svn://tug.org/texlive/trunk@50843 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/ctex/ctex-book.def')
-rw-r--r-- | Master/texmf-dist/tex/latex/ctex/ctex-book.def | 53 |
1 files changed, 34 insertions, 19 deletions
diff --git a/Master/texmf-dist/tex/latex/ctex/ctex-book.def b/Master/texmf-dist/tex/latex/ctex/ctex-book.def index d8449cacffe..e97cbee7cac 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctex-book.def +++ b/Master/texmf-dist/tex/latex/ctex/ctex-book.def @@ -6,7 +6,7 @@ %% %% ctex.dtx (with options: `heading,book') %% -%% 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 book (CTEX)} \ProvidesExplFile{ctex-book.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} @@ -294,10 +294,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 @@ -309,10 +309,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 @@ -417,6 +417,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 @@ -426,11 +441,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: @@ -681,7 +696,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: |