summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/ctex/ctexart.cls
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/ctex/ctexart.cls')
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctexart.cls95
1 files changed, 58 insertions, 37 deletions
diff --git a/Master/texmf-dist/tex/latex/ctex/ctexart.cls b/Master/texmf-dist/tex/latex/ctex/ctexart.cls
index 0f7f58d6f54..20707c50646 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctexart.cls
+++ b/Master/texmf-dist/tex/latex/ctex/ctexart.cls
@@ -6,7 +6,7 @@
%%
%% ctex.dtx (with options: `class,article')
%%
-%% Copyright (C) 2003--2018
+%% Copyright (C) 2003--2019
%% CTEX.ORG and any individual authors listed in the documentation.
%% ------------------------------------------------------------------------------
%%
@@ -28,10 +28,10 @@
%%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\GetIdInfo$Id: ctex.dtx 096f319 2018-05-02 19:51:41 +0800 Liam Huang <liamhuang0205@gmail.com> $
+\GetIdInfo$Id: ctex.dtx cb8bf3c 2019-04-07 23:32:09 +0800 Qing Lee <sobenlee@gmail.com> $
{Chinese adapter for class article (CTEX)}
\ProvidesExplClass{ctexart}
- {\ExplFileDate}{2.4.14}{\ExplFileDescription}
+ {\ExplFileDate}{2.4.15}{\ExplFileDescription}
\tl_const:Nx \c__ctex_version_tl
{ \cs_if_exist_use:cF { ver@ \@currname . \@currext } { 9999/99/99 } }
\cs_new_eq:cN { ver@ctex. \@pkgextension } \c__ctex_version_tl
@@ -46,7 +46,7 @@
`l3kernel'~and~`l3packages'\\\\
using~your~TeX~package~manager~or~from~CTAN.
}
-\@ifpackagelater { expl3 } { 2017/12/16 } { }
+\@ifpackagelater { expl3 } { 2019/03/05 } { }
{ \msg_error:nnn { ctex } { l3-too-old } { expl3 } }
\@ifpackagelater { l3keys2e } { 2015/12/20 } { }
{ \msg_error:nnn { ctex } { l3-too-old } { l3keys2e } }
@@ -99,7 +99,8 @@
{ }
}
\cs_generate_variant:Nn \ctex_scheme_input:n { o }
-\cs_new_eq:NN \g__ctex_section_depth_flag \c_two
+\int_new:N \g__ctex_section_depth_int
+\int_gset:Nn \g__ctex_section_depth_int { 2 }
\msg_new:nnnn { ctex } { package-too-old }
{ Support~package~`#1'~too~old. }
{
@@ -121,7 +122,7 @@
\cs_new:Npn \ctex_default_pt:n #1
{
\exp_after:wN \__ctex_default_pt:w
- \dim_use:N \etex_dimexpr:D #1 pt \scan_stop: \q_stop
+ \dim_use:N \tex_dimexpr:D #1 pt \scan_stop: \q_stop
}
\use:x
{
@@ -148,15 +149,15 @@
{ Command~ #1 is~ deprecated.\\ #2 }
\msg_new:nnn { ctex } { deprecated-environment }
{ Environment~ `#1'~ is~ deprecated.\\ #2 }
-\int_new:N \g__ctex_font_size_flag
-\int_set:Nn \g__ctex_font_size_flag { -1 }
+\int_new:N \g__ctex_font_size_int
+\int_set:Nn \g__ctex_font_size_int { -1 }
\keys_define:nn { ctex / option }
{
zihao .choice: ,
zihao .value_required:n = true ,
- zihao / 5 .code:n = { \cs_gset_eq:NN \g__ctex_font_size_flag \c_zero } ,
- zihao / -4 .code:n = { \cs_gset_eq:NN \g__ctex_font_size_flag \c_one } ,
- zihao / false .code:n = { \cs_gset_eq:NN \g__ctex_font_size_flag \c_two } ,
+ zihao / 5 .code:n = { \int_gset:Nn \g__ctex_font_size_int { 0 } } ,
+ zihao / -4 .code:n = { \int_gset:Nn \g__ctex_font_size_int { 1 } } ,
+ zihao / false .code:n = { \int_gset:Nn \g__ctex_font_size_int { 2 } } ,
c5size .code:n =
{
\msg_warning:nnn { ctex } { deprecated-option }
@@ -296,9 +297,9 @@
nospace .value_forbidden:n = true ,
heading .bool_set:N = \l__ctex_heading_bool ,
sub3section .code:n =
- { \cs_gset_eq:NN \g__ctex_section_depth_flag \c_three } ,
+ { \int_gset:Nn \g__ctex_section_depth_int { 3 } } ,
sub4section .code:n =
- { \cs_gset_eq:NN \g__ctex_section_depth_flag \c_four } ,
+ { \int_gset:Nn \g__ctex_section_depth_int { 4 } } ,
sub3section .value_forbidden:n = true ,
sub4section .value_forbidden:n = true ,
scheme .tl_set:N = \l__ctex_scheme_tl ,
@@ -352,7 +353,7 @@
{
#1 .code:n =
{
- \cs_gset_eq:NN \g__ctex_font_size_flag \c_two
+ \int_gset:Nn \g__ctex_font_size_int { 2 }
\clist_gput_right:Nn \g__ctex_std_options_clist {#1}
} ,
#1 .value_forbidden:n = true ,
@@ -367,7 +368,7 @@
}
\ctex_file_input:n { ctexopts.cfg }
\ProcessKeysOptions { ctex / option }
-\if_case:w \g__ctex_font_size_flag
+\if_case:w \g__ctex_font_size_int
\clist_gput_right:Nn \g__ctex_std_options_clist { 10pt }
\or:
\clist_gput_right:Nn \g__ctex_std_options_clist { 12pt }
@@ -453,7 +454,7 @@
{ \ctex_update_ccwd: }
{
\dim_set:Nn \l__ctex_tmp_dim
- { \baselinestretch \etex_glueexpr:D \f@baselineskip \scan_stop: }
+ { \baselinestretch \tex_glueexpr:D \f@baselineskip \scan_stop: }
\skip_set:Nn \l__ctex_ccglue_skip
{ \c_zero_dim plus .08 \l__ctex_tmp_dim }
\ctex_update_ccglue:
@@ -461,9 +462,9 @@
}
{
\int_set:Nn \l__ctex_tmp_int
- { \etex_dimexpr:D \linewidth - \ccwd - \l__ctex_tmp_dim \scan_stop: }
+ { \tex_dimexpr:D \linewidth - \ccwd - \l__ctex_tmp_dim \scan_stop: }
\tex_divide:D \l__ctex_tmp_int \ccwd
- \int_compare:nNnTF \l__ctex_tmp_int > \c_zero
+ \int_compare:nNnTF \l__ctex_tmp_int > \c_zero_int
{
\skip_set:Nn \l__ctex_ccglue_skip
{
@@ -507,15 +508,15 @@
\dim_sub:Nn \l__ctex_tmp_dim { \l__ctex_tmp_int \ccwd }
\dim_compare:nNnF \parindent = \c_zero_dim
{
- \int_compare:nNnF \l__ctex_tmp_int < \c_three
- { \int_sub:Nn \l__ctex_tmp_int { \c_two } }
+ \int_compare:nNnF \l__ctex_tmp_int < 3
+ { \int_sub:Nn \l__ctex_tmp_int { 2 } }
}
\skip_set:Nn \l__ctex_ccglue_skip
{
\l__ctex_ziju_dim
plus \dim_eval:n { \l__ctex_tmp_dim / \l__ctex_tmp_int }
minus \dim_min:nn { \dim_abs:n { \l__ctex_ziju_dim } }
- { ( \ccwd - \l__ctex_tmp_dim ) / ( \l__ctex_tmp_int + \c_one ) }
+ { ( \ccwd - \l__ctex_tmp_dim ) / ( \l__ctex_tmp_int + 1 ) }
}
}
{ \skip_set:Nn \l__ctex_ccglue_skip { \l__ctex_ziju_dim } }
@@ -676,7 +677,7 @@
{ \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ####1 } }
}
\NewDocumentCommand \ctex_assign_heading_name:nn
- { m > { \SplitArgument { \c_one } { , } } +m }
+ { m > { \SplitArgument { 1 } { , } } +m }
{ \__ctex_assign_heading_name:nnn {#1} #2 }
\cs_new_protected:Npn \__ctex_assign_heading_name:nnn #1#2#3
{
@@ -744,10 +745,9 @@
\fi
\CTEX@addtocline{part}{#1}%
{\interlinepenalty \@M
- \normalfont \parindent \dimexpr \CTEX@part@indent \relax \CTEX@part@format
- \ifnum \c@secnumdepth >\m@ne \ifodd \CTEX@part@numbering
- \CTEX@partname \CTEX@part@aftername
- \fi \fi
+ \normalfont \CTEX@part@format
+ \CTEX@hangindent{part}%
+ {\CTEXifname{\CTEX@partname\CTEX@part@aftername}{}}%
\CTEX@part@titleformat{#2}%
\partmark{#1}%
\CTEX@part@aftertitle}%
@@ -760,8 +760,8 @@
\CTEX@ifnamefalse
\CTEX@makeanchor@spart{part*}%
{\interlinepenalty \@M
- \normalfont \parindent \dimexpr \CTEX@part@indent \relax
- \CTEX@part@format
+ \normalfont \CTEX@part@format
+ \CTEX@hangindent{part}{}%
\CTEX@part@titleformat{#1}%
\CTEX@part@aftertitle}%
\nobreak
@@ -867,6 +867,21 @@
\fi}%
\fi
\ignorespaces}
+\cs_new_protected:Npn \CTEX@hangindent #1#2
+ {
+ \bool_if:cTF { CTEX@#1@hang }
+ { \@hangfrom }
+ { \noindent \use:n }
+ { \__ctex_indent_aux:n {#1} #2 }
+ }
+\cs_new_protected:Npn \__ctex_indent_aux:n #1
+ {
+ \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:
+ }
\cs_new_protected_nopar:Npn \CTEX@hangfrom
{
\bool_if:NTF \CTEX@hang
@@ -876,11 +891,11 @@
\cs_new_protected_nopar:Npn \CTEX@update@sectionformat@n #1
{
\cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat }
- \cs_set_eq:Nc \CTEX@aftertitle { CTEX@#1@aftertitle }
- \cs_set_eq:Nc \CTEX@afterindent { CTEX@#1@afterindent }
- \cs_set_eq:Nc \CTEX@fixskip { CTEX@#1@fixskip }
- \cs_set_eq:Nc \CTEX@hang { CTEX@#1@hang }
- \cs_set_eq:Nc \CTEX@runin { CTEX@#1@runin }
+ \cs_set_eq:Nc \CTEX@aftertitle { CTEX@#1@aftertitle }
+ \cs_set_eq:Nc \CTEX@afterindent { CTEX@#1@afterindent }
+ \cs_set_eq:Nc \CTEX@fixskip { CTEX@#1@fixskip }
+ \cs_set_eq:Nc \CTEX@hang { CTEX@#1@hang }
+ \cs_set_eq:Nc \CTEX@runin { CTEX@#1@runin }
}
\cs_new_eq:NN \CTEX@titleformat@n \use:n
\cs_new_eq:NN \CTEX@aftertitle \prg_do_nothing:
@@ -1123,7 +1138,7 @@
\dim_set:Nn \@tempdima
{
\dim_max:nn { \@tempdima }
- { \box_wd:N \l__ctex_tmp_box + \f@size \p@ / \c_two }
+ { \box_wd:N \l__ctex_tmp_box + \f@size \p@ / 2 }
}
}
\group_begin:
@@ -1224,7 +1239,7 @@
\prop_gput:Nnn \exp_not:N \c__ctex_font_size_prop {#1}
{
{ \dim_to_decimal:n {#2} }
- { \dim_to_decimal:n { (#2) * \c_six / \c_five } }
+ { \dim_to_decimal:n { (#2) * 6 / 5 } }
}
}
\seq_gput_right:Nn \c__ctex_font_size_seq {#1}
@@ -1292,7 +1307,7 @@
}
\cs_new_protected:Npn \__ctex_set_font_size:nnNn #1#2#3#4
{ \cs_set_protected_nopar:Npn #3 { \@setfontsize #3 {#1} {#2} #4 } }
-\if_case:w \g__ctex_font_size_flag
+\if_case:w \g__ctex_font_size_int
\ctex_file_input:n { ctex-c5size.clo }
\or:
\ctex_file_input:n { ctex-cs4size.clo }
@@ -1354,7 +1369,7 @@
{
\ctex_if_preamble:TF
{
- \str_if_eq_x:nnTF {#1} { none }
+ \str_if_eq:eeTF {#1} { none }
{ \msg_warning:nnn { ctex } { invalid-value } {#1} }
{
\str_if_eq:onTF { \g__ctex_fontset_tl } { none }
@@ -1430,6 +1445,12 @@
%% c70rm.fd,
%% c70sf.fd,
%% c70tt.fd,
+%% jy2zhrm.fd,
+%% jy2zhsf.fd,
+%% jy2zhtt.fd,
+%% jt2zhrm.fd,
+%% jt2zhsf.fd,
+%% jt2zhtt.fd,
%% ctex-fontset-windows.def,
%% ctex-fontset-windowsnew.def,
%% ctex-fontset-windowsold.def,