summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/ctex/ctex-report.def
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-06-19 22:32:36 +0000
committerKarl Berry <karl@freefriends.org>2015-06-19 22:32:36 +0000
commit24a26d6f89a97e7ba548a2c42c0e6a6c80e6fb2a (patch)
treec87c15ce0105a3b7f9dfef8548ea2b0bb368d91c /Master/texmf-dist/tex/latex/ctex/ctex-report.def
parent28cb2b214ad9bcb5ac65fdf512b438f388a68b1e (diff)
ctex (19jun15)
git-svn-id: svn://tug.org/texlive/trunk@37615 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.def92
1 files changed, 61 insertions, 31 deletions
diff --git a/Master/texmf-dist/tex/latex/ctex/ctex-report.def b/Master/texmf-dist/tex/latex/ctex/ctex-report.def
index ed27e9c8adb..42b4b0b15bd 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctex-report.def
+++ b/Master/texmf-dist/tex/latex/ctex/ctex-report.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 report (CTEX)}
\ProvidesExplFile{ctex-report.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,11 @@
{ \tl_clear:c { CTEX@post#1 } }
{ \tl_set:cn { CTEX@post#1 } {#3} }
}
-\tl_clear:N \l__ctex_tmp_tl
+\tl_set:Nn \l__ctex_tmp_tl
+ {
+ part / pagestyle .tl_set:N = \CTEX@part@pagestyle ,
+ chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle ,
+ }
\seq_map_inline:Nn \c__ctex_headings_seq
{
\__ctex_initial_heading:n {#1}
@@ -114,11 +135,6 @@
}
\use:x { \keys_define:nn { ctex } { \exp_not:o { \l__ctex_tmp_tl } } }
\tl_clear:N \l__ctex_tmp_tl
-\keys_define:nn { ctex }
- {
- part / pagestyle .tl_set:N = \CTEX@part@pagestyle ,
- chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle
- }
\def\@part[#1]#2{%
\thispagestyle{\CTEX@part@pagestyle}%
\ifnum \c@secnumdepth >-2\relax
@@ -133,12 +149,14 @@
\ifnum \c@secnumdepth >-2\relax
\CTEX@partname
\fi
- \CTEX@part@titleformat{#2}\par}%
+ \CTEX@part@titleformat{#2}%
+ \CTEX@part@aftertitle}%
\@endpart}
\def\@spart#1{%
{\interlinepenalty \@M
\normalfont \CTEX@part@format
- \CTEX@part@titleformat{#1}\par}%
+ \CTEX@part@titleformat{#1}%
+ \CTEX@part@aftertitle}%
\@endpart}
\def\@chapter[#1]#2{%
\ifnum \c@secnumdepth >\m@ne
@@ -172,7 +190,9 @@
\CTEX@chaptername
\fi
\interlinepenalty\@M
- \CTEX@chapter@titleformat{#1}\par\nobreak
+ \CTEX@chapter@titleformat{#1}%
+ \CTEX@chapter@aftertitle
+ \nobreak
\vskip \CTEX@chapter@afterskip
}}
\def\@makeschapterhead#1{%
@@ -186,7 +206,9 @@
\vspace*{\@tempskipa}%
{\normalfont \parindent \CTEX@chapter@indent \CTEX@chapter@format
\interlinepenalty\@M
- \CTEX@chapter@titleformat{#1}\par\nobreak
+ \CTEX@chapter@titleformat{#1}
+ \CTEX@chapter@aftertitle
+ \nobreak
\vskip \CTEX@chapter@afterskip
}}
\def\@seccntformat#1{%
@@ -206,7 +228,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}{%
@@ -219,7 +242,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
@@ -237,15 +262,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 }
@@ -264,15 +294,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
{