| 1 |
%% |
| 2 |
%% This is file `ctexheading.sty', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% ctex.dtx (with options: `style,ctexheading') |
| 8 |
%% |
| 9 |
%% Copyright (C) 2003--2022 |
| 10 |
%% CTEX.ORG and any individual authors listed in the documentation. |
| 11 |
%% --------------------------------------------------------------------- |
| 12 |
%% |
| 13 |
%% This work may be distributed and/or modified under the |
| 14 |
%% conditions of the LaTeX Project Public License, either |
| 15 |
%% version 1.3c of this license or (at your option) any later |
| 16 |
%% version. This version of this license is in |
| 17 |
%% http://www.latex-project.org/lppl/lppl-1-3c.txt |
| 18 |
%% and the latest version of this license is in |
| 19 |
%% http://www.latex-project.org/lppl.txt |
| 20 |
%% and version 1.3 or later is part of all distributions of |
| 21 |
%% LaTeX version 2005/12/01 or later. |
| 22 |
%% |
| 23 |
%% This work has the LPPL maintenance status "maintained". |
| 24 |
%% |
| 25 |
%% --------------------------------------------------------------------- |
| 26 |
%% |
| 27 |
\NeedsTeXFormat{LaTeX2e} |
| 28 |
\RequirePackage{expl3} |
| 29 |
\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee <[email protected]> $ |
| 30 |
{Heading style modification (CTEX)} |
| 31 |
\ProvidesExplPackage{ctexheading} |
| 32 |
{\ExplFileDate}{2.5.10}{\ExplFileDescription} |
| 33 |
\cs_if_exist:NF \NewDocumentCommand |
| 34 |
{ \RequirePackage { xparse } } |
| 35 |
\prop_gput:Nnn \g_msg_module_name_prop { ctex } { ctexheading } |
| 36 |
\RequirePackage { ctexhook , ctexpatch } |
| 37 |
\tl_clear_new:N \l__ctex_tmp_tl |
| 38 |
\int_new:N \l__ctex_tmp_int |
| 39 |
\box_new:N \l__ctex_tmp_box |
| 40 |
\cs_new_protected:Npn \ctex_define_option:n |
| 41 |
{ \keys_define:nn { ctex / option } } |
| 42 |
\cs_new_protected:Npn \ctex_define:n |
| 43 |
{ \keys_define:nn { ctex } } |
| 44 |
\cs_new_protected:Npn \ctex_set:n |
| 45 |
{ \keys_set:nn { ctex } } |
| 46 |
\cs_new_protected:Npn \ctex_set:nn #1 |
| 47 |
{ \keys_set:nn { ctex / #1 } } |
| 48 |
\cs_new_protected:Npn \ctex_scheme_input:n #1 |
| 49 |
{ |
| 50 |
\ctex_push_file: |
| 51 |
\tl_if_exist:NTF \c__ctex_class_tl |
| 52 |
{ |
| 53 |
\file_if_exist_input:nF { ctex-scheme- #1 - \c__ctex_class_tl .def } |
| 54 |
{ \file_input:n { ctex-scheme- #1 .def } } |
| 55 |
} |
| 56 |
{ \file_input:n { ctex-scheme- #1 .def } } |
| 57 |
\ctex_pop_file: |
| 58 |
} |
| 59 |
\cs_generate_variant:Nn \ctex_scheme_input:n { o } |
| 60 |
\int_new:N \g__ctex_section_depth_int |
| 61 |
\int_gset:Nn \g__ctex_section_depth_int { 2 } |
| 62 |
\ctex_define_option:n |
| 63 |
{ |
| 64 |
sub3section .code:n = |
| 65 |
{ \int_gset:Nn \g__ctex_section_depth_int { 3 } } , |
| 66 |
sub4section .code:n = |
| 67 |
{ \int_gset:Nn \g__ctex_section_depth_int { 4 } } , |
| 68 |
sub3section .value_forbidden:n = true , |
| 69 |
sub4section .value_forbidden:n = true , |
| 70 |
scheme .tl_set:N = \l__ctex_scheme_tl , |
| 71 |
scheme .default:n = { plain } , |
| 72 |
scheme .initial:n = { plain } |
| 73 |
} |
| 74 |
\cs_if_exist:NTF \ProcessKeyOptions |
| 75 |
{ \ProcessKeyOptions [ ctex / option ] } |
| 76 |
{ |
| 77 |
\RequirePackage { l3keys2e } |
| 78 |
\ProcessKeysOptions { ctex / option } |
| 79 |
} |
| 80 |
\NewDocumentCommand \ctexset { } { \ctex_set:n } |
| 81 |
\clist_map_inline:nn { article , book , report , beamer } |
| 82 |
{ |
| 83 |
\@ifclassloaded {#1} |
| 84 |
{ \clist_map_break:n { \tl_const:Nn \c__ctex_std_class_tl {#1} } } |
| 85 |
{ } |
| 86 |
} |
| 87 |
\msg_new:nnn { ctex } { not-standard-class } |
| 88 |
{ |
| 89 |
None~of~the~standard~document~classes~was~loaded.\\ |
| 90 |
Heading~`#1'~is~selected.\\ |
| 91 |
ctex~may~not~work~as~expected. |
| 92 |
} |
| 93 |
\use:n |
| 94 |
{ |
| 95 |
\tl_if_exist:NTF \c__ctex_std_class_tl |
| 96 |
{ \cs_new_eq:NN \c__ctex_class_tl \c__ctex_std_class_tl } |
| 97 |
{ |
| 98 |
\cs_if_exist:NTF \chapter |
| 99 |
{ |
| 100 |
\cs_if_exist:NF \if@mainmatter |
| 101 |
{ \cs_new_eq:NN \if@mainmatter \tex_iftrue:D } |
| 102 |
\tl_const:Nn \c__ctex_class_tl { book } |
| 103 |
} |
| 104 |
{ \tl_const:Nn \c__ctex_class_tl { article } } |
| 105 |
\msg_warning:nnx { ctex } { not-standard-class } { \c__ctex_class_tl } |
| 106 |
} |
| 107 |
\ctex_file_input:n { ctex-heading- \c__ctex_class_tl .def } |
| 108 |
} |
| 109 |
%% |
| 110 |
%% This package consists of the files ctex.dtx, |
| 111 |
%% ctxdoc.cls, |
| 112 |
%% ctxdocstrip.tex, |
| 113 |
%% ctex-zhconv.lua, |
| 114 |
%% ctex-zhconv-make.lua, |
| 115 |
%% and the derived files ctex.pdf, |
| 116 |
%% ctex.ins, |
| 117 |
%% ctex.sty, |
| 118 |
%% ctexsize.sty, |
| 119 |
%% ctexheading.sty, |
| 120 |
%% ctexart.cls, |
| 121 |
%% ctexbook.cls, |
| 122 |
%% ctexrep.cls, |
| 123 |
%% ctexbeamer.cls, |
| 124 |
%% ctexcap.sty, |
| 125 |
%% ctexhook.sty, |
| 126 |
%% ctexpatch.sty, |
| 127 |
%% ctex-c5size.clo, |
| 128 |
%% ctex-cs4size.clo, |
| 129 |
%% ctex-heading-article.def, |
| 130 |
%% ctex-heading-book.def, |
| 131 |
%% ctex-heading-report.def, |
| 132 |
%% ctex-heading-beamer.def, |
| 133 |
%% ctex-scheme-plain.def, |
| 134 |
%% ctex-scheme-plain-article.def, |
| 135 |
%% ctex-scheme-plain-book.def, |
| 136 |
%% ctex-scheme-plain-report.def, |
| 137 |
%% ctex-scheme-plain-beamer.def, |
| 138 |
%% ctex-scheme-chinese.def, |
| 139 |
%% ctex-scheme-chinese-article.def, |
| 140 |
%% ctex-scheme-chinese-book.def, |
| 141 |
%% ctex-scheme-chinese-report.def, |
| 142 |
%% ctex-scheme-chinese-beamer.def, |
| 143 |
%% ctex-name-gbk.cfg, |
| 144 |
%% ctex-name-utf8.cfg, |
| 145 |
%% ctex.cfg, |
| 146 |
%% ctexopts.cfg, |
| 147 |
%% ctexbackend.cfg, |
| 148 |
%% ctex-engine-pdftex.def, |
| 149 |
%% ctex-engine-xetex.def, |
| 150 |
%% ctex-engine-luatex.def, |
| 151 |
%% ctex-engine-aptex.def, |
| 152 |
%% ctex-engine-uptex.def, |
| 153 |
%% c19rm.fd, |
| 154 |
%% c19sf.fd, |
| 155 |
%% c19tt.fd, |
| 156 |
%% c70rm.fd, |
| 157 |
%% c70sf.fd, |
| 158 |
%% c70tt.fd, |
| 159 |
%% jy2zhrm.fd, |
| 160 |
%% jy2zhsf.fd, |
| 161 |
%% jy2zhtt.fd, |
| 162 |
%% jt2zhrm.fd, |
| 163 |
%% jt2zhsf.fd, |
| 164 |
%% jt2zhtt.fd, |
| 165 |
%% ctex-fontset-adobe.def, |
| 166 |
%% ctex-fontset-fandol.def, |
| 167 |
%% ctex-fontset-founder.def, |
| 168 |
%% ctex-fontset-mac.def, |
| 169 |
%% ctex-fontset-macnew.def, |
| 170 |
%% ctex-fontset-macold.def, |
| 171 |
%% ctex-fontset-ubuntu.def, |
| 172 |
%% ctex-fontset-windows.def, |
| 173 |
%% ctexspa.def, |
| 174 |
%% ctexpunct.spa, |
| 175 |
%% ctex-spa-make.tex, |
| 176 |
%% ctex-spa-macro.tex, |
| 177 |
%% ctex-zhmap-adobe.tex, |
| 178 |
%% ctex-zhmap-fandol.tex, |
| 179 |
%% ctex-zhmap-founder.tex, |
| 180 |
%% ctex-zhmap-mac.tex, |
| 181 |
%% ctex-zhmap-ubuntu.tex, |
| 182 |
%% ctex-zhmap-windows.tex, |
| 183 |
%% ctex-zhconv-index.lua, |
| 184 |
%% translator-theorem-dictionary-ChineseGBK.dict, |
| 185 |
%% translator-theorem-dictionary-ChineseUTF8.dict, and |
| 186 |
%% README.md. |
| 187 |
%% |
| 188 |
%% End of file `ctexheading.sty'. |