diff options
author | Karl Berry <karl@freefriends.org> | 2016-02-03 22:59:51 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-02-03 22:59:51 +0000 |
commit | 1290d7454b9754f3c7a7e4a229981e18f58ea6f6 (patch) | |
tree | aa01beb72d34acd81690358b54be7493a5244544 /Master/texmf-dist/tex/latex/ctex/ctex-report.def | |
parent | e5ef88072190f4f0e310c900fd626db1dd7dc096 (diff) |
ctex (3feb16)
git-svn-id: svn://tug.org/texlive/trunk@39559 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/ctex/ctex-report.def')
-rw-r--r-- | Master/texmf-dist/tex/latex/ctex/ctex-report.def | 106 |
1 files changed, 63 insertions, 43 deletions
diff --git a/Master/texmf-dist/tex/latex/ctex/ctex-report.def b/Master/texmf-dist/tex/latex/ctex/ctex-report.def index 629360a2279..74d2d488c7d 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctex-report.def +++ b/Master/texmf-dist/tex/latex/ctex/ctex-report.def @@ -26,11 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 6255367 2015-07-01 01:15:24 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 4e02493 2016-02-02 17:10:17 +0800 Qing Lee <sobenlee@gmail.com> $ {Heading modification for report (CTEX)} \ProvidesExplFile{ctex-report.def} - {\ExplFileDate}{2.2}{\ExplFileDescription} - + {\ExplFileDate}{2.3}{\ExplFileDescription} \seq_new:N \c__ctex_section_headings_seq \seq_gset_from_clist:Nn \c__ctex_section_headings_seq { section , subsection , subsubsection , paragraph , subparagraph } @@ -50,20 +49,22 @@ } \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@post#1 } - } - \exp_not:c { CTEX@#1@aftername } + \group_begin: + \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@post#1 } + } + \group_end: } } \cs_new_protected_nopar:Npn \__ctex_def_heading_keys:n #1 @@ -88,35 +89,23 @@ #1 / runin .bool_set:N = \exp_not:c { CTEX@#1@runin } , #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 / numbering .initial:n = true , #1 / beforeskip .initial:n = \c_zero_skip , #1 / afterskip .initial:n = \c_zero_skip , #1 / indent .initial:n = \c_zero_dim , - #1 / beforeskip .value_required: , - #1 / afterskip .value_required: , - #1 / indent .value_required: , + #1 / beforeskip .value_required:n = true , + #1 / afterskip .value_required:n = true , + #1 / indent .value_required:n = true , } } \NewDocumentCommand \ctex_assign_heading_name:nn @@ -175,7 +164,7 @@ {\interlinepenalty \@M \normalfont \CTEX@part@format \ifnum \c@secnumdepth >-2\relax \ifodd \CTEX@part@numbering - \CTEX@partname + \CTEX@partname \CTEX@part@aftername \fi \fi \CTEX@part@titleformat{#2}% \CTEX@part@aftertitle}% @@ -237,7 +226,7 @@ \CTEX@chapter@format \ifnum \c@secnumdepth >\m@ne \ifodd \CTEX@chapter@numbering - \CTEX@chaptername + \CTEX@chaptername \CTEX@chapter@aftername \fi \fi \interlinepenalty\@M @@ -274,9 +263,7 @@ {\@ssect{#3}{#4}{#5}{#6}}% {\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}} \def\@seccntformat#1{% - \@ifundefined{CTEX@#1name}% - {\csname the#1\endcsname\quad}% - {\csname CTEX@#1name\endcsname}} + \csname CTEX@#1name\endcsname \csname CTEX@#1@aftername\endcsname} \def\@sect#1#2#3#4#5#6[#7]#8{% \ifnum #2>\c@secnumdepth \let\@svsec\@empty @@ -301,9 +288,7 @@ \addcontentsline{toc}{#1}{% \ifnum #2>\c@secnumdepth \else \ifodd \csname CTEX@#1@numbering\endcsname - \protect\numberline{\@ifundefined{CTEXthe#1}% - {\csname the#1\endcsname}% - {\csname CTEXthe#1\endcsname}}% + \protect\numberline{\csname CTEXthe#1\endcsname}% \fi \fi #7}% @@ -317,9 +302,7 @@ \addcontentsline{toc}{#1}{% \ifnum #2>\c@secnumdepth \else \ifodd \csname CTEX@#1@numbering\endcsname - \protect\numberline{\@ifundefined{CTEXthe#1}% - {\csname the#1\endcsname}% - {\csname CTEXthe#1\endcsname}}% + \protect\numberline{\csname CTEXthe#1\endcsname}% \fi \fi #7}}% @@ -473,6 +456,43 @@ { \ctex_titlesec_hook: } } } +\group_begin: +\char_set_catcode_other:N \# +\cs_new_protected_nopar:Npn \ctex_titleps_hook: + { + \ctex_patch_cmd:Nnn \ttl@settopmark + { \protect \@namedef { the#1 } { \@nameuse { the#1 } } } + { + \protect \@namedef { the#1 } { \@nameuse { the#1 } } + \CTEX@titlepslabel@set {#1} + } + \ctex_patch_cmd:Nnn \ttl@setsubmark + { \protect \@namedef { the#1 } { } } + { + \protect \@namedef { the#1 } { } + \CTEX@titlepslabel@clear {#1} + } + \ctex_patch_cmd:Nnn \ttl@setsubmark + { \protect \@namedef { the#2 } { \@nameuse { the#2 } } } + { + \protect \@namedef { the#2 } { \@nameuse { the#2 } } + \CTEX@titlepslabel@set {#2} + } + } +\group_end: +\cs_new_nopar:Npn \CTEX@titlepslabel@set #1 + { + \cs_if_free:cF { CTEXthe#1 } + { \protect \@namedef { CTEXthe#1 } { \@nameuse { CTEXthe#1 } } } + } +\cs_new_nopar:Npn \CTEX@titlepslabel@clear #1 + { + \cs_if_free:cF { CTEXthe#1 } + { \protect \@namedef { CTEXthe#1 } { } } + } +\ctex_at_end_package:nn { titlesec } + { \cs_if_free:NF \ttl@settopmark { \ctex_titleps_hook: } } +\ctex_at_end_package:nn { titleps } { \ctex_titleps_hook: } \cs_new_protected:Npn \CTEX@toc@width@n #1 { \hbox_set:Nn \l__ctex_tmp_box {#1} |