summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/ctex/heading/ctex-heading-book.def
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/ctex/heading/ctex-heading-book.def')
-rw-r--r--Master/texmf-dist/tex/latex/ctex/heading/ctex-heading-book.def28
1 files changed, 26 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/latex/ctex/heading/ctex-heading-book.def b/Master/texmf-dist/tex/latex/ctex/heading/ctex-heading-book.def
index df344f2c679..39c0e6cb695 100644
--- a/Master/texmf-dist/tex/latex/ctex/heading/ctex-heading-book.def
+++ b/Master/texmf-dist/tex/latex/ctex/heading/ctex-heading-book.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 book (CTEX)}
\ProvidesExplFile{ctex-book.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
@@ -791,6 +791,30 @@
{ \ifnum \c@secnumdepth > \z@ \thesection . ~ \ \fi }
{ \CTEXifname { \CTEXthesection \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 = -1 ,
+ chapter = 0 ,
+ section = 1 ,
+ subsection = 2 ,
+ subsubsection = 3 ,
+ paragraph = 4 ,
+ subparagraph = 5
+ }
\cs_new_protected:Npn \CTEX@setcurrentlabel@n #1
{
\protected@edef \@currentlabel