summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/ctex/heading/ctex-heading-article.def
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/ctex/heading/ctex-heading-article.def')
-rw-r--r--Master/texmf-dist/tex/latex/ctex/heading/ctex-heading-article.def27
1 files changed, 25 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/latex/ctex/heading/ctex-heading-article.def b/Master/texmf-dist/tex/latex/ctex/heading/ctex-heading-article.def
index ea14835dcfa..a9141a12f83 100644
--- a/Master/texmf-dist/tex/latex/ctex/heading/ctex-heading-article.def
+++ b/Master/texmf-dist/tex/latex/ctex/heading/ctex-heading-article.def
@@ -24,10 +24,10 @@
%%
%% ---------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 320df30 2020-05-02 06:45:05 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 4819efe 2020-05-16 21:20:43 +0800 Qing Lee <sobenlee@gmail.com> $
{Heading modification for article (CTEX)}
\ProvidesExplFile{ctex-article.def}
- {\ExplFileDate}{2.5.1}{\ExplFileDescription}
+ {\ExplFileDate}{2.5.2}{\ExplFileDescription}
\seq_const_from_clist:Nn \c__ctex_section_headings_seq
{ section , subsection , subsubsection , paragraph , subparagraph }
\seq_new:N \c__ctex_headings_seq
@@ -664,6 +664,29 @@
{ \ifnum \c@secnumdepth > \@ne \thesubsection \hskip 1em \relax \fi }
{ \CTEXifname { \CTEXthesubsection \quad } { } }
}
+\ctex_define:n
+ {
+ secnumdepth .code:n = \ctex_heading_depth:ne { secnumdepth } {#1} ,
+ secnumdepth .value_required:n = true ,
+ tocdepth .code:n = \ctex_heading_depth:ne { tocdepth } {#1} ,
+ tocdepth .value_required:n = true
+ }
+\cs_new_protected:Npn \ctex_heading_depth:nn #1#2
+ {
+ \prop_get:NnNTF \c__ctex_heading_level_prop {#2} \l__ctex_tmp_tl
+ { \setcounter {#1} { \l__ctex_tmp_tl } }
+ { \setcounter {#1} { \int_eval:n {#2} } }
+ }
+\cs_generate_variant:Nn \ctex_heading_depth:nn { ne }
+\prop_const_from_keyval:Nn \c__ctex_heading_level_prop
+ {
+ part = 0 ,
+ section = 1 ,
+ subsection = 2 ,
+ subsubsection = 3 ,
+ paragraph = 4 ,
+ subparagraph = 5
+ }
\cs_new_protected:Npn \CTEX@setcurrentlabel@n #1
{
\protected@edef \@currentlabel