summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/ctex/ctex-article.def
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/ctex/ctex-article.def')
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctex-article.def38
1 files changed, 27 insertions, 11 deletions
diff --git a/Master/texmf-dist/tex/latex/ctex/ctex-article.def b/Master/texmf-dist/tex/latex/ctex/ctex-article.def
index 69e4f2ae061..95d29bee36b 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctex-article.def
+++ b/Master/texmf-dist/tex/latex/ctex/ctex-article.def
@@ -26,10 +26,10 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx cb8bf3c 2019-04-07 23:32:09 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx 735dfe2 2019-05-29 21:42:29 +0800 Qing Lee <sobenlee@gmail.com> $
{Heading modification for article (CTEX)}
\ProvidesExplFile{ctex-article.def}
- {\ExplFileDate}{2.4.15}{\ExplFileDescription}
+ {\ExplFileDate}{2.4.16}{\ExplFileDescription}
\seq_const_from_clist:Nn \c__ctex_section_headings_seq
{ section , subsection , subsubsection , paragraph , subparagraph }
\seq_new:N \c__ctex_headings_seq
@@ -152,6 +152,8 @@
{ \cs_set_eq:NN \CTEXifname \use_ii:nn }
\cs_new_protected:Npn \CTEX@addtocline #1#2
{ \addcontentsline { toc } {#1} { \use:c { CTEX@#1@tocline } {#1} {#2} } }
+\cs_new_protected_nopar:Npn \CTEX@disableautoindent
+ { \tl_clear:N \l__ctex_autoindent_tl }
\renewcommand\part{%
\if@noskipsec \leavevmode \fi
\par
@@ -178,8 +180,10 @@
\CTEX@ifnamefalse
\CTEX@makeanchor{part*}%
\fi
+ \CTEX@gettitle{#1}%
\CTEX@addtocline{part}{#1}%
{\interlinepenalty \@M
+ \CTEX@disableautoindent
\normalfont \CTEX@part@format
\CTEX@hangindent{part}%
{\CTEXifname{\CTEX@partname\CTEX@part@aftername}{}}%
@@ -194,7 +198,9 @@
\def\@spart#1{%
\CTEX@ifnamefalse
\CTEX@makeanchor@spart{part*}%
+ \CTEX@gettitle{#1}%
{\interlinepenalty \@M
+ \CTEX@disableautoindent
\normalfont \CTEX@part@format
\CTEX@hangindent{part}{}%
\CTEX@part@titleformat{#1}%
@@ -243,6 +249,7 @@
\let\@svsec\@empty
\fi
\fi
+ \CTEX@gettitle{#7}%
\unless \ifodd \CTEX@runin
\begingroup
#6{%
@@ -265,6 +272,7 @@
\@xsect{#5}}
\def\@ssect#1#2#3#4#5{%
\CTEX@ifnamefalse
+ \CTEX@gettitle{#5}%
\unless \ifodd \CTEX@runin
\begingroup
#4{%
@@ -304,18 +312,15 @@
\ignorespaces}
\cs_new_protected:Npn \CTEX@hangindent #1#2
{
+ \dim_set:Nn \parindent { \use:c { CTEX@#1@indent } }
\bool_if:cTF { CTEX@#1@hang }
- { \@hangfrom }
- { \noindent \use:n }
- { \__ctex_indent_aux:n {#1} #2 }
+ { \@hangfrom { \__ctex_indent_aux: #2 } }
+ {#2}
}
-\cs_new_protected:Npn \__ctex_indent_aux:n #1
+\cs_new_protected_nopar:Npn \__ctex_indent_aux:
{
- \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:
+ \dim_compare:nNnF \parindent = \c_zero_dim
+ { \skip_horizontal:n { \parindent } }
}
\cs_new_protected_nopar:Npn \CTEX@hangfrom
{
@@ -428,6 +433,17 @@
}
\CTEX@hyperheadinghook
}
+\cs_new_protected:Npn \CTEX@gettitle #1
+ { }
+\ctex_at_end_package:nn { nameref }
+ {
+ \cs_gset_protected_nopar:Npn \CTEX@gettitle { \NR@gettitle }
+ \seq_map_inline:Nn \c__ctex_headings_cs_seq
+ {
+ \cs_if_eq:ccT { NR@ #1 } { CTEX@ #1 }
+ { \cs_gset_eq:cc { @ #1 } { CTEX@ #1 } }
+ }
+ }
\cs_new_protected_nopar:Npn \ctex_titlesec_hook:
{
\@ifpackagewith { titlesec } { explicit }