summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-05-14 21:23:11 +0000
committerKarl Berry <karl@freefriends.org>2015-05-14 21:23:11 +0000
commit9591c0c57b007ba49f15f0970009bc27efa23db4 (patch)
tree4ef2076432f70e69f1d944b127898e217b269ae6 /Master/texmf-dist/tex
parent99d7ad5df8ac48132b622ee369d7493853592a61 (diff)
ctex (14may15)
git-svn-id: svn://tug.org/texlive/trunk@37393 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/generic/ctex/ctexmakespa.tex68
-rw-r--r--Master/texmf-dist/tex/generic/ctex/ctexspamacro.tex94
-rw-r--r--Master/texmf-dist/tex/generic/ctex/zhadobefonts.tex106
-rw-r--r--Master/texmf-dist/tex/generic/ctex/zhfandolfonts.tex106
-rw-r--r--Master/texmf-dist/tex/generic/ctex/zhfounderfonts.tex142
-rw-r--r--Master/texmf-dist/tex/generic/ctex/zhubuntufonts.tex130
-rw-r--r--Master/texmf-dist/tex/generic/ctex/zhwindowsfonts.tex142
-rw-r--r--Master/texmf-dist/tex/latex/ctex/back/ctexartutf8.cls13
-rw-r--r--Master/texmf-dist/tex/latex/ctex/back/ctexbookutf8.cls13
-rw-r--r--Master/texmf-dist/tex/latex/ctex/back/ctexcaputf8.sty13
-rw-r--r--Master/texmf-dist/tex/latex/ctex/back/ctexreputf8.cls13
-rw-r--r--Master/texmf-dist/tex/latex/ctex/back/ctexutf8.sty13
-rw-r--r--Master/texmf-dist/tex/latex/ctex/cfg/ctex.cfg4
-rw-r--r--Master/texmf-dist/tex/latex/ctex/cfg/ctexcap-gbk.cfg46
-rw-r--r--Master/texmf-dist/tex/latex/ctex/cfg/ctexcap-utf8.cfg46
-rw-r--r--Master/texmf-dist/tex/latex/ctex/cfg/ctexcap.cfg111
-rw-r--r--Master/texmf-dist/tex/latex/ctex/cfg/ctexopts.cfg.template6
-rw-r--r--Master/texmf-dist/tex/latex/ctex/config/ctex-name-gbk.cfg53
-rw-r--r--Master/texmf-dist/tex/latex/ctex/config/ctex-name-utf8.cfg53
-rw-r--r--Master/texmf-dist/tex/latex/ctex/config/ctex.cfg36
-rw-r--r--Master/texmf-dist/tex/latex/ctex/config/ctexopts.cfg37
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctex-article.def316
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctex-book.def363
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctex-c5size.clo72
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctex-cs4size.clo72
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctex-report.def357
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctex.sty996
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctexart.cls1265
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctexbook.cls1312
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctexcap.sty122
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctexrep.cls1306
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctexsize.sty215
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctexspa.def64
-rw-r--r--Master/texmf-dist/tex/latex/ctex/def/ctex-article.def220
-rw-r--r--Master/texmf-dist/tex/latex/ctex/def/ctex-book.def252
-rw-r--r--Master/texmf-dist/tex/latex/ctex/def/ctex-caption.def165
-rw-r--r--Master/texmf-dist/tex/latex/ctex/def/ctex-class.def96
-rw-r--r--Master/texmf-dist/tex/latex/ctex/def/ctex-common.def423
-rw-r--r--Master/texmf-dist/tex/latex/ctex/def/ctex-gbk.def31
-rw-r--r--Master/texmf-dist/tex/latex/ctex/def/ctex-loadclass.def16
-rw-r--r--Master/texmf-dist/tex/latex/ctex/def/ctex-report.def242
-rw-r--r--Master/texmf-dist/tex/latex/ctex/def/ctex-utf8.def31
-rw-r--r--Master/texmf-dist/tex/latex/ctex/engine/ctex-cct-engine.def82
-rw-r--r--Master/texmf-dist/tex/latex/ctex/engine/ctex-cjk-common.def57
-rw-r--r--Master/texmf-dist/tex/latex/ctex/engine/ctex-cjk-engine.def66
-rw-r--r--Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-luatex.def1047
-rw-r--r--Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-pdftex.def349
-rw-r--r--Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-xetex.def147
-rw-r--r--Master/texmf-dist/tex/latex/ctex/engine/ctex-xecjk-engine.def37
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fd/c19gbsn.fd17
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fd/c19gbsn.fdx62
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fd/c19gkai.fd17
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fd/c19gkai.fdx62
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fd/c19rm.fd64
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fd/c19sf.fd56
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fd/c19tt.fd56
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fd/c70rm.fd62
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fd/c70sf.fd54
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fd/c70tt.fd54
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fontset/ctex-cjk-adobefonts.def7
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fontset/ctex-cjk-winfonts.def82
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-adobe.def92
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-fandol.def103
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-founder.def86
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-mac.def50
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-ubuntu.def73
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windows.def38
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsnew.def102
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsold.def87
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fontset/ctex-xecjk-adobefonts.def21
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fontset/ctex-xecjk-winfonts.def23
-rw-r--r--Master/texmf-dist/tex/latex/ctex/opt/ctex-caption-opts.def11
-rw-r--r--Master/texmf-dist/tex/latex/ctex/opt/ctex-class-opts.def26
-rw-r--r--Master/texmf-dist/tex/latex/ctex/opt/ctex-common-opts.def58
-rw-r--r--Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-article.def130
-rw-r--r--Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-book.def142
-rw-r--r--Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-report.def142
-rw-r--r--Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese.def45
-rw-r--r--Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-article.def117
-rw-r--r--Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-book.def131
-rw-r--r--Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-report.def131
-rw-r--r--Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain.def35
82 files changed, 10508 insertions, 2694 deletions
diff --git a/Master/texmf-dist/tex/generic/ctex/ctexmakespa.tex b/Master/texmf-dist/tex/generic/ctex/ctexmakespa.tex
new file mode 100644
index 00000000000..b118c20873c
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/ctex/ctexmakespa.tex
@@ -0,0 +1,68 @@
+%%
+%% This is file `ctexmakespa.tex',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `spa,make')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\input ctexspamacro %
+
+\MAKESPA {ctexpunct.spa}
+ {
+ {adobezhsong} {AdobeSongStd-Light} ,
+ {adobezhhei} {AdobeHeitiStd-Regular} ,
+ {adobezhkai} {AdobeKaitiStd-Regular} ,
+ {adobezhfs} {AdobeFangsongStd-Regular} ,
+ {fandolzhsong} {FandolSong} ,
+ {fandolzhsongb} {FandolSong-Bold} ,
+ {fandolzhhei} {FandolHei} ,
+ {fandolzhheib} {FandolHei-Bold} ,
+ {fandolzhkai} {FandolKai} ,
+ {fandolzhfs} {FandolFang} ,
+ {founderzhsong} {FZShuSong-Z01} ,
+ {founderzhsongb} {FZXiaoBiaoSong-B05} ,
+ {founderzhhei} {FZHei-B01} ,
+ {founderzhheil} {FZXiHeiI-Z08} ,
+ {founderzhkai} {FZKai-Z03} ,
+ {founderzhfs} {FZFangSong-Z02} ,
+ {founderzhli} {FZLiShu-S01} ,
+ {founderzhyou} {FZXiYuan-M01} ,
+ {founderzhyoub} {FZZhunYuan-M02} ,
+ {ubuntuzhsong} {AR PL UMing CN} ,
+ {ubuntuzhhei} {WenQuanYi Zen Hei} ,
+ {ubuntuzhkai} {AR PL UKai CN} ,
+ {windowszhsong} {SimSun} ,
+ {windowszhhei} {SimHei} ,
+ {windowszhkai} {KaiTi} ,
+ {windowszhfs} {FangSong} ,
+ {windowszhli} {LiSu} ,
+ {windowszhyou} {YouYuan} ,
+ {windowszhyahei} {Microsoft YaHei} ,
+ {windowszhyaheib} {Microsoft YaHei Bold}
+ }
+
+\primitive\end
+%%
+%%
+%% End of file `ctexmakespa.tex'.
diff --git a/Master/texmf-dist/tex/generic/ctex/ctexspamacro.tex b/Master/texmf-dist/tex/generic/ctex/ctexspamacro.tex
new file mode 100644
index 00000000000..4f4e629c38f
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/ctex/ctexspamacro.tex
@@ -0,0 +1,94 @@
+%%
+%% This is file `ctexspamacro.tex',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `spa,macro')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\input expl3-generic %
+\ExplSyntaxOn
+\xetex_if_engine:F
+ {
+ \msg_new:nn { ctex } { xetex }
+ { XeTeX~is~required~to~compile~this~document! }
+ \msg_fatal:nn { ctex } { xetex }
+ }
+\seq_new:N \c__ctex_punct_seq
+\seq_gset_from_clist:Nn \c__ctex_punct_seq
+ {
+ "2018 , "201C , "300C , "300E , "3014 , "FF08 , "FF3B , "FF5B ,
+ "3008 , "300A , "3016 , "3010 ,
+ "2014 , "2026 , "3001 , "3002 , "FF0C , "FF0E , "FF1A , "FF1B ,
+ "FF01 , "FF1F , "FF05 , "3015 , "FF09 , "FF3D , "FF5D , "3009 ,
+ "300B , "3017 , "3011 , "2019 , "201D , "300D , "300F
+ }
+\cs_new_protected_nopar:Npn \ctex_make_spa:nn #1#2
+ {
+ \iow_open:Nn \g__ctex_spa_iow {#1}
+ \clist_map_inline:nn {#2}
+ { \__ctex_write_family:nn ##1 }
+ \iow_close:N \g__ctex_spa_iow
+ }
+\iow_new:N \g__ctex_spa_iow
+\cs_new_eq:NN \MAKESPA \ctex_make_spa:nn
+\cs_new_protected:Npn \__ctex_write_family:nn #1#2
+ {
+ \group_begin:
+ \tex_font:D \l__ctex_punct_font = "#2" ~ at ~ 100 pt \scan_stop:
+ \l__ctex_punct_font
+ \clist_clear:N \l__ctex_punct_bounds_clist
+ \seq_map_inline:Nn \c__ctex_punct_seq
+ { \exp_args:No \__ctex_save_bounds:n { \int_use:N \XeTeXcharglyph ##1 } }
+ \iow_now:Nx \g__ctex_spa_iow
+ {
+ \token_to_str:N \ctexspadef {#1}
+ { \l__ctex_punct_bounds_clist , , , }
+ }
+ \group_end:
+ }
+\cs_new_protected_nopar:Npn \__ctex_save_bounds:n #1
+ {
+ \clist_put_right:Nx \l__ctex_punct_bounds_clist
+ {
+ \__ctex_calc_bounds:nn { \c_one } {#1} ,
+ \__ctex_calc_bounds:nn { \c_three } {#1}
+ }
+ }
+\clist_new:N \l__ctex_punct_bounds_clist
+\cs_new_nopar:Npn \__ctex_calc_bounds:nn #1#2
+ {
+ \fp_eval:n
+ {
+ round
+ (
+ \dim_to_decimal_in_unit:nn
+ { 100 \XeTeXglyphbounds #1 ~ #2 }
+ { 1 em }
+ )
+ }
+ }
+\ExplSyntaxOff
+%%
+%%
+%% End of file `ctexspamacro.tex'.
diff --git a/Master/texmf-dist/tex/generic/ctex/zhadobefonts.tex b/Master/texmf-dist/tex/generic/ctex/zhadobefonts.tex
new file mode 100644
index 00000000000..bd63bc0c8af
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/ctex/zhadobefonts.tex
@@ -0,0 +1,106 @@
+%%
+%% This is file `zhadobefonts.tex',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `zhmap,adobe')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\begingroup\catcode61\catcode48\catcode32=10\relax%
+ \catcode 35=6 % #
+ \catcode123=1 % {
+ \catcode125=2 % }
+ \toks0{\endlinechar=\the\endlinechar\relax}%
+ \toks2{\endlinechar=13 }%
+ \def\x#1 #2 {%
+ \toks0\expandafter{\the\toks0 \catcode#1=\the\catcode#1\relax}%
+ \toks2\expandafter{\the\toks2 \catcode#1=#2 }}%
+ \x 13 5 % carriage return
+ \x 32 10 % space
+ \x 35 6 % #
+ \x 40 12 % (
+ \x 41 12 % )
+ \x 45 12 % -
+ \x 46 12 % .
+ \x 47 12 % /
+ \x 58 12 % :
+ \x 60 12 % <
+ \x 61 12 % =
+ \x 64 11 % @
+ \x 91 12 % [
+ \x 93 12 % ]
+ \x 123 1 % {
+ \x 125 2 % }
+ \edef\x#1{\endgroup%
+ \edef\noexpand#1{%
+ \the\toks0 %
+ \let\noexpand\noexpand\noexpand#1%
+ \noexpand\noexpand\noexpand\undefined%
+ \noexpand\noexpand\noexpand\endinput}%
+ \the\toks2}%
+\expandafter\x\csname ctex@zhmap@endinput\endcsname
+\input ifpdf.sty\relax
+\begingroup
+\expandafter\ifx\csname ProvidesFile\endcsname\relax
+ \long\def\x#1\ProvidesFile#2[#3]{%
+ #1%
+ \immediate\write-1{File: #2 #3}%
+ \expandafter\xdef\csname ver@#2\endcsname{#3}}
+ \expandafter\x%
+\fi
+\endgroup
+\ProvidesFile{zhadobefonts.tex}%
+ [2014/06/03 v2.0 Adobe font map loader for DVIPDFMx (CTEX)]
+
+\ifpdf
+%% pdfTeX does not support OTF fonts
+
+\else
+ \special{pdf:mapline gbk@UGBK@ UniGB-UTF16-H AdobeSongStd-Light.otf}
+ \special{pdf:mapline gbksong@UGBK@ UniGB-UTF16-H AdobeSongStd-Light.otf}
+ \special{pdf:mapline gbkkai@UGBK@ UniGB-UTF16-H AdobeKaitiStd-Regular.otf}
+ \special{pdf:mapline gbkhei@UGBK@ UniGB-UTF16-H AdobeHeitiStd-Regular.otf}
+ \special{pdf:mapline gbkfs@UGBK@ UniGB-UTF16-H AdobeFangsongStd-Regular.otf}
+
+ \special{pdf:mapline cyberb@Unicode@ UniGB-UTF16-H AdobeSongStd-Light.otf}
+ \special{pdf:mapline unisong@Unicode@ UniGB-UTF16-H AdobeSongStd-Light.otf}
+ \special{pdf:mapline unikai@Unicode@ UniGB-UTF16-H AdobeKaitiStd-Regular.otf}
+ \special{pdf:mapline unihei@Unicode@ UniGB-UTF16-H AdobeHeitiStd-Regular.otf}
+ \special{pdf:mapline unifs@Unicode@ UniGB-UTF16-H AdobeFangsongStd-Regular.otf}
+
+ \special{pdf:mapline gbksongsl@UGBK@ UniGB-UTF16-H AdobeSongStd-Light.otf -s .167}
+ \special{pdf:mapline gbkkaisl@UGBK@ UniGB-UTF16-H AdobeKaitiStd-Regular.otf -s .167}
+ \special{pdf:mapline gbkheisl@UGBK@ UniGB-UTF16-H AdobeHeitiStd-Regular.otf -s .167}
+ \special{pdf:mapline gbkfssl@UGBK@ UniGB-UTF16-H AdobeFangsongStd-Regular.otf -s .167}
+
+ \special{pdf:mapline unisongsl@Unicode@ UniGB-UTF16-H AdobeSongStd-Light.otf -s .167}
+ \special{pdf:mapline unikaisl@Unicode@ UniGB-UTF16-H AdobeKaitiStd-Regular.otf -s .167}
+ \special{pdf:mapline uniheisl@Unicode@ UniGB-UTF16-H AdobeHeitiStd-Regular.otf -s .167}
+ \special{pdf:mapline unifssl@Unicode@ UniGB-UTF16-H AdobeFangsongStd-Regular.otf -s .167}
+
+\fi
+
+\ctex@zhmap@endinput
+%%
+%%
+%% End of file `zhadobefonts.tex'.
diff --git a/Master/texmf-dist/tex/generic/ctex/zhfandolfonts.tex b/Master/texmf-dist/tex/generic/ctex/zhfandolfonts.tex
new file mode 100644
index 00000000000..3d2806f552d
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/ctex/zhfandolfonts.tex
@@ -0,0 +1,106 @@
+%%
+%% This is file `zhfandolfonts.tex',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `zhmap,fandol')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\begingroup\catcode61\catcode48\catcode32=10\relax%
+ \catcode 35=6 % #
+ \catcode123=1 % {
+ \catcode125=2 % }
+ \toks0{\endlinechar=\the\endlinechar\relax}%
+ \toks2{\endlinechar=13 }%
+ \def\x#1 #2 {%
+ \toks0\expandafter{\the\toks0 \catcode#1=\the\catcode#1\relax}%
+ \toks2\expandafter{\the\toks2 \catcode#1=#2 }}%
+ \x 13 5 % carriage return
+ \x 32 10 % space
+ \x 35 6 % #
+ \x 40 12 % (
+ \x 41 12 % )
+ \x 45 12 % -
+ \x 46 12 % .
+ \x 47 12 % /
+ \x 58 12 % :
+ \x 60 12 % <
+ \x 61 12 % =
+ \x 64 11 % @
+ \x 91 12 % [
+ \x 93 12 % ]
+ \x 123 1 % {
+ \x 125 2 % }
+ \edef\x#1{\endgroup%
+ \edef\noexpand#1{%
+ \the\toks0 %
+ \let\noexpand\noexpand\noexpand#1%
+ \noexpand\noexpand\noexpand\undefined%
+ \noexpand\noexpand\noexpand\endinput}%
+ \the\toks2}%
+\expandafter\x\csname ctex@zhmap@endinput\endcsname
+\input ifpdf.sty\relax
+\begingroup
+\expandafter\ifx\csname ProvidesFile\endcsname\relax
+ \long\def\x#1\ProvidesFile#2[#3]{%
+ #1%
+ \immediate\write-1{File: #2 #3}%
+ \expandafter\xdef\csname ver@#2\endcsname{#3}}
+ \expandafter\x%
+\fi
+\endgroup
+\ProvidesFile{zhfandolfonts.tex}%
+ [2014/06/03 v2.0 Fandol font map loader for DVIPDFMx (CTEX)]
+
+\ifpdf
+%% pdfTeX does not support OTF fonts
+
+\else
+ \special{pdf:mapline gbk@UGBK@ UniGB-UTF16-H FandolSong-Regular.otf}
+ \special{pdf:mapline gbksong@UGBK@ UniGB-UTF16-H FandolSong-Regular.otf}
+ \special{pdf:mapline gbkkai@UGBK@ UniGB-UTF16-H FandolKai-Regular.otf}
+ \special{pdf:mapline gbkhei@UGBK@ UniGB-UTF16-H FandolHei-Regular.otf}
+ \special{pdf:mapline gbkfs@UGBK@ UniGB-UTF16-H FandolFang-Regular.otf}
+
+ \special{pdf:mapline cyberb@Unicode@ UniGB-UTF16-H FandolSong-Regular.otf}
+ \special{pdf:mapline unisong@Unicode@ UniGB-UTF16-H FandolSong-Regular.otf}
+ \special{pdf:mapline unikai@Unicode@ UniGB-UTF16-H FandolKai-Regular.otf}
+ \special{pdf:mapline unihei@Unicode@ UniGB-UTF16-H FandolHei-Regular.otf}
+ \special{pdf:mapline unifs@Unicode@ UniGB-UTF16-H FandolFang-Regular.otf}
+
+ \special{pdf:mapline gbksongsl@UGBK@ UniGB-UTF16-H FandolSong-Regular.otf -s .167}
+ \special{pdf:mapline gbkkaisl@UGBK@ UniGB-UTF16-H FandolKai-Regular.otf -s .167}
+ \special{pdf:mapline gbkheisl@UGBK@ UniGB-UTF16-H FandolHei-Regular.otf -s .167}
+ \special{pdf:mapline gbkfssl@UGBK@ UniGB-UTF16-H FandolFang-Regular.otf -s .167}
+
+ \special{pdf:mapline unisongsl@Unicode@ UniGB-UTF16-H FandolSong-Regular.otf -s .167}
+ \special{pdf:mapline unikaisl@Unicode@ UniGB-UTF16-H FandolKai-Regular.otf -s .167}
+ \special{pdf:mapline uniheisl@Unicode@ UniGB-UTF16-H FandolHei-Regular.otf -s .167}
+ \special{pdf:mapline unifssl@Unicode@ UniGB-UTF16-H FandolFang-Regular.otf -s .167}
+
+\fi
+
+\ctex@zhmap@endinput
+%%
+%%
+%% End of file `zhfandolfonts.tex'.
diff --git a/Master/texmf-dist/tex/generic/ctex/zhfounderfonts.tex b/Master/texmf-dist/tex/generic/ctex/zhfounderfonts.tex
new file mode 100644
index 00000000000..763eb012fce
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/ctex/zhfounderfonts.tex
@@ -0,0 +1,142 @@
+%%
+%% This is file `zhfounderfonts.tex',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `zhmap,founder')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\begingroup\catcode61\catcode48\catcode32=10\relax%
+ \catcode 35=6 % #
+ \catcode123=1 % {
+ \catcode125=2 % }
+ \toks0{\endlinechar=\the\endlinechar\relax}%
+ \toks2{\endlinechar=13 }%
+ \def\x#1 #2 {%
+ \toks0\expandafter{\the\toks0 \catcode#1=\the\catcode#1\relax}%
+ \toks2\expandafter{\the\toks2 \catcode#1=#2 }}%
+ \x 13 5 % carriage return
+ \x 32 10 % space
+ \x 35 6 % #
+ \x 40 12 % (
+ \x 41 12 % )
+ \x 45 12 % -
+ \x 46 12 % .
+ \x 47 12 % /
+ \x 58 12 % :
+ \x 60 12 % <
+ \x 61 12 % =
+ \x 64 11 % @
+ \x 91 12 % [
+ \x 93 12 % ]
+ \x 123 1 % {
+ \x 125 2 % }
+ \edef\x#1{\endgroup%
+ \edef\noexpand#1{%
+ \the\toks0 %
+ \let\noexpand\noexpand\noexpand#1%
+ \noexpand\noexpand\noexpand\undefined%
+ \noexpand\noexpand\noexpand\endinput}%
+ \the\toks2}%
+\expandafter\x\csname ctex@zhmap@endinput\endcsname
+\input ifpdf.sty\relax
+\begingroup
+\expandafter\ifx\csname ProvidesFile\endcsname\relax
+ \long\def\x#1\ProvidesFile#2[#3]{%
+ #1%
+ \immediate\write-1{File: #2 #3}%
+ \expandafter\xdef\csname ver@#2\endcsname{#3}}
+ \expandafter\x%
+\fi
+\endgroup
+\ProvidesFile{zhfounderfonts.tex}%
+ [2014/06/03 v2.0 Founder font map loader for pdfTeX and DVIPDFMx (CTEX)]
+
+\ifpdf
+ \pdfmapline{=gbk@UGBK@ <FZSSK.TTF}
+ \pdfmapline{=gbksong@UGBK@ <FZSSK.TTF}
+ \pdfmapline{=gbkkai@UGBK@ <FZKTK.TTF}
+ \pdfmapline{=gbkhei@UGBK@ <FZHTK.TTF}
+ \pdfmapline{=gbkfs@UGBK@ <FZFSK.TTF}
+ \pdfmapline{=gbkli@UGBK@ <FZLSK.TTF}
+ \pdfmapline{=gbkyou@UGBK@ <FZY1K.TTF}
+
+ \pdfmapline{=cyberb@Unicode@ <FZSSK.TTF}
+ \pdfmapline{=unisong@Unicode@ <FZSSK.TTF}
+ \pdfmapline{=unikai@Unicode@ <FZKTK.TTF}
+ \pdfmapline{=unihei@Unicode@ <FZHTK.TTF}
+ \pdfmapline{=unifs@Unicode@ <FZFSK.TTF}
+ \pdfmapline{=unili@Unicode@ <FZLSK.TTF}
+ \pdfmapline{=uniyou@Unicode@ <FZY1K.TTF}
+
+ \pdfmapline{=gbksongsl@UGBK@ <FZSSK.TTF}
+ \pdfmapline{=gbkkaisl@UGBK@ <FZKTK.TTF}
+ \pdfmapline{=gbkheisl@UGBK@ <FZHTK.TTF}
+ \pdfmapline{=gbkfssl@UGBK@ <FZFSK.TTF}
+ \pdfmapline{=gbklisl@UGBK@ <FZLSK.TTF}
+ \pdfmapline{=gbkyousl@UGBK@ <FZY1K.TTF}
+
+ \pdfmapline{=unisongsl@Unicode@ <FZSSK.TTF}
+ \pdfmapline{=unikaisl@Unicode@ <FZKTK.TTF}
+ \pdfmapline{=uniheisl@Unicode@ <FZHTK.TTF}
+ \pdfmapline{=unifssl@Unicode@ <FZFSK.TTF}
+ \pdfmapline{=unilisl@Unicode@ <FZLSK.TTF}
+ \pdfmapline{=uniyousl@Unicode@ <FZY1K.TTF}
+
+\else
+ \special{pdf:mapline gbk@UGBK@ unicode FZSSK.TTF}
+ \special{pdf:mapline gbksong@UGBK@ unicode FZSSK.TTF}
+ \special{pdf:mapline gbkkai@UGBK@ unicode FZKTK.TTF}
+ \special{pdf:mapline gbkhei@UGBK@ unicode FZHTK.TTF}
+ \special{pdf:mapline gbkfs@UGBK@ unicode FZFSK.TTF}
+ \special{pdf:mapline gbkli@UGBK@ unicode FZLSK.TTF}
+ \special{pdf:mapline gbkyou@UGBK@ unicode FZY1K.TTF}
+
+ \special{pdf:mapline cyberb@Unicode@ unicode FZSSK.TTF}
+ \special{pdf:mapline unisong@Unicode@ unicode FZSSK.TTF}
+ \special{pdf:mapline unikai@Unicode@ unicode FZKTK.TTF}
+ \special{pdf:mapline unihei@Unicode@ unicode FZHTK.TTF}
+ \special{pdf:mapline unifs@Unicode@ unicode FZFSK.TTF}
+ \special{pdf:mapline unili@Unicode@ unicode FZLSK.TTF}
+ \special{pdf:mapline uniyou@Unicode@ unicode FZY1K.TTF}
+
+ \special{pdf:mapline gbksongsl@UGBK@ unicode FZSSK.TTF -s .167}
+ \special{pdf:mapline gbkkaisl@UGBK@ unicode FZKTK.TTF -s .167}
+ \special{pdf:mapline gbkheisl@UGBK@ unicode FZHTK.TTF -s .167}
+ \special{pdf:mapline gbkfssl@UGBK@ unicode FZFSK.TTF -s .167}
+ \special{pdf:mapline gbklisl@UGBK@ unicode FZLSK.TTF -s .167}
+ \special{pdf:mapline gbkyousl@UGBK@ unicode FZY1K.TTF -s .167}
+
+ \special{pdf:mapline unisongsl@Unicode@ unicode FZSSK.TTF -s .167}
+ \special{pdf:mapline unikaisl@Unicode@ unicode FZKTK.TTF -s .167}
+ \special{pdf:mapline uniheisl@Unicode@ unicode FZHTK.TTF -s .167}
+ \special{pdf:mapline unifssl@Unicode@ unicode FZFSK.TTF -s .167}
+ \special{pdf:mapline unilisl@Unicode@ unicode FZLSK.TTF -s .167}
+ \special{pdf:mapline uniyousl@Unicode@ unicode FZY1K.TTF -s .167}
+
+\fi
+
+\ctex@zhmap@endinput
+%%
+%%
+%% End of file `zhfounderfonts.tex'.
diff --git a/Master/texmf-dist/tex/generic/ctex/zhubuntufonts.tex b/Master/texmf-dist/tex/generic/ctex/zhubuntufonts.tex
new file mode 100644
index 00000000000..bd427a1464c
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/ctex/zhubuntufonts.tex
@@ -0,0 +1,130 @@
+%%
+%% This is file `zhubuntufonts.tex',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `zhmap,ubuntu')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\begingroup\catcode61\catcode48\catcode32=10\relax%
+ \catcode 35=6 % #
+ \catcode123=1 % {
+ \catcode125=2 % }
+ \toks0{\endlinechar=\the\endlinechar\relax}%
+ \toks2{\endlinechar=13 }%
+ \def\x#1 #2 {%
+ \toks0\expandafter{\the\toks0 \catcode#1=\the\catcode#1\relax}%
+ \toks2\expandafter{\the\toks2 \catcode#1=#2 }}%
+ \x 13 5 % carriage return
+ \x 32 10 % space
+ \x 35 6 % #
+ \x 40 12 % (
+ \x 41 12 % )
+ \x 45 12 % -
+ \x 46 12 % .
+ \x 47 12 % /
+ \x 58 12 % :
+ \x 60 12 % <
+ \x 61 12 % =
+ \x 64 11 % @
+ \x 91 12 % [
+ \x 93 12 % ]
+ \x 123 1 % {
+ \x 125 2 % }
+ \edef\x#1{\endgroup%
+ \edef\noexpand#1{%
+ \the\toks0 %
+ \let\noexpand\noexpand\noexpand#1%
+ \noexpand\noexpand\noexpand\undefined%
+ \noexpand\noexpand\noexpand\endinput}%
+ \the\toks2}%
+\expandafter\x\csname ctex@zhmap@endinput\endcsname
+\input ifpdf.sty\relax
+\begingroup
+\expandafter\ifx\csname ProvidesFile\endcsname\relax
+ \long\def\x#1\ProvidesFile#2[#3]{%
+ #1%
+ \immediate\write-1{File: #2 #3}%
+ \expandafter\xdef\csname ver@#2\endcsname{#3}}
+ \expandafter\x%
+\fi
+\endgroup
+\ProvidesFile{zhubuntufonts.tex}%
+ [2014/06/03 v2.0 Ubuntu font map loader for pdfTeX and DVIPDFMx (CTEX)]
+
+\ifpdf
+ \pdfmapline{=gbk@UGBK@ <uming.ttc}
+ \pdfmapline{=gbksong@UGBK@ <uming.ttc}
+ \pdfmapline{=gbkkai@UGBK@ <ukai.ttc}
+ \pdfmapline{=gbkhei@UGBK@ <wqy-zenhei.ttc}
+ \pdfmapline{=gbkfs@UGBK@ <uming.ttc}
+ \pdfmapline{=gbkyou@UGBK@ <wqy-zenhei.ttc}
+
+ \pdfmapline{=cyberb@Unicode@ <uming.ttc}
+ \pdfmapline{=unisong@Unicode@ <uming.ttc}
+ \pdfmapline{=unikai@Unicode@ <ukai.ttc}
+ \pdfmapline{=unihei@Unicode@ <wqy-zenhei.ttc}
+ \pdfmapline{=unifs@Unicode@ <uming.ttc}
+ \pdfmapline{=uniyou@Unicode@ <wqy-zenhei.ttc}
+
+ \pdfmapline{=gbksongsl@UGBK@ <uming.ttc}
+ \pdfmapline{=gbkkaisl@UGBK@ <ukai.ttc}
+ \pdfmapline{=gbkheisl@UGBK@ <wqy-zenhei.ttc}
+ \pdfmapline{=gbkfssl@UGBK@ <uming.ttc}
+ \pdfmapline{=gbkyousl@UGBK@ <wqy-zenhei.ttc}
+
+ \pdfmapline{=unisongsl@Unicode@ <uming.ttc}
+ \pdfmapline{=unikaisl@Unicode@ <ukai.ttc}
+ \pdfmapline{=uniheisl@Unicode@ <wqy-zenhei.ttc}
+ \pdfmapline{=unifssl@Unicode@ <uming.ttc}
+ \pdfmapline{=uniyousl@Unicode@ <wqy-zenhei.ttc}
+
+\else
+ \special{pdf:mapline gbk@UGBK@ unicode :0:uming.ttc}
+ \special{pdf:mapline gbksong@UGBK@ unicode :0:uming.ttc}
+ \special{pdf:mapline gbkkai@UGBK@ unicode :0:ukai.ttc}
+ \special{pdf:mapline gbkhei@UGBK@ unicode :0:wqy-zenhei.ttc}
+ \special{pdf:mapline gbkfs@UGBK@ unicode :0:uming.ttc}
+
+ \special{pdf:mapline cyberb@Unicode@ unicode :0:uming.ttc}
+ \special{pdf:mapline unisong@Unicode@ unicode :0:uming.ttc}
+ \special{pdf:mapline unikai@Unicode@ unicode :0:ukai.ttc}
+ \special{pdf:mapline unihei@Unicode@ unicode :0:wqy-zenhei.ttc}
+ \special{pdf:mapline unifs@Unicode@ unicode :0:uming.ttc}
+
+ \special{pdf:mapline gbksongsl@UGBK@ unicode :0:uming.ttc -s .167}
+ \special{pdf:mapline gbkkaisl@UGBK@ unicode :0:ukai.ttc -s .167}
+ \special{pdf:mapline gbkheisl@UGBK@ unicode :0:wqy-zenhei.ttc -s .167}
+ \special{pdf:mapline gbkfssl@UGBK@ unicode :0:uming.ttc -s .167}
+
+ \special{pdf:mapline unisongsl@Unicode@ unicode :0:uming.ttc -s .167}
+ \special{pdf:mapline unikaisl@Unicode@ unicode :0:ukai.ttc -s .167}
+ \special{pdf:mapline uniheisl@Unicode@ unicode :0:wqy-zenhei.ttc -s .167}
+ \special{pdf:mapline unifssl@Unicode@ unicode :0:uming.ttc -s .167}
+
+\fi
+
+\ctex@zhmap@endinput
+%%
+%%
+%% End of file `zhubuntufonts.tex'.
diff --git a/Master/texmf-dist/tex/generic/ctex/zhwindowsfonts.tex b/Master/texmf-dist/tex/generic/ctex/zhwindowsfonts.tex
new file mode 100644
index 00000000000..d7878965922
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/ctex/zhwindowsfonts.tex
@@ -0,0 +1,142 @@
+%%
+%% This is file `zhwindowsfonts.tex',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `zhmap,windows')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\begingroup\catcode61\catcode48\catcode32=10\relax%
+ \catcode 35=6 % #
+ \catcode123=1 % {
+ \catcode125=2 % }
+ \toks0{\endlinechar=\the\endlinechar\relax}%
+ \toks2{\endlinechar=13 }%
+ \def\x#1 #2 {%
+ \toks0\expandafter{\the\toks0 \catcode#1=\the\catcode#1\relax}%
+ \toks2\expandafter{\the\toks2 \catcode#1=#2 }}%
+ \x 13 5 % carriage return
+ \x 32 10 % space
+ \x 35 6 % #
+ \x 40 12 % (
+ \x 41 12 % )
+ \x 45 12 % -
+ \x 46 12 % .
+ \x 47 12 % /
+ \x 58 12 % :
+ \x 60 12 % <
+ \x 61 12 % =
+ \x 64 11 % @
+ \x 91 12 % [
+ \x 93 12 % ]
+ \x 123 1 % {
+ \x 125 2 % }
+ \edef\x#1{\endgroup%
+ \edef\noexpand#1{%
+ \the\toks0 %
+ \let\noexpand\noexpand\noexpand#1%
+ \noexpand\noexpand\noexpand\undefined%
+ \noexpand\noexpand\noexpand\endinput}%
+ \the\toks2}%
+\expandafter\x\csname ctex@zhmap@endinput\endcsname
+\input ifpdf.sty\relax
+\begingroup
+\expandafter\ifx\csname ProvidesFile\endcsname\relax
+ \long\def\x#1\ProvidesFile#2[#3]{%
+ #1%
+ \immediate\write-1{File: #2 #3}%
+ \expandafter\xdef\csname ver@#2\endcsname{#3}}
+ \expandafter\x%
+\fi
+\endgroup
+\ProvidesFile{zhwindowsfonts.tex}%
+ [2014/06/03 v2.0 Windows font map loader for pdfTeX and DVIPDFMx (CTEX)]
+
+\ifpdf
+ \pdfmapline{=gbk@UGBK@ <simsun.ttc}
+ \pdfmapline{=gbksong@UGBK@ <simsun.ttc}
+ \pdfmapline{=gbkkai@UGBK@ <simkai.ttf}
+ \pdfmapline{=gbkhei@UGBK@ <simhei.ttf}
+ \pdfmapline{=gbkfs@UGBK@ <simfang.ttf}
+ \pdfmapline{=gbkli@UGBK@ <simli.ttf}
+ \pdfmapline{=gbkyou@UGBK@ <simyou.ttf}
+
+ \pdfmapline{=cyberb@Unicode@ <simsun.ttc}
+ \pdfmapline{=unisong@Unicode@ <simsun.ttc}
+ \pdfmapline{=unikai@Unicode@ <simkai.ttf}
+ \pdfmapline{=unihei@Unicode@ <simhei.ttf}
+ \pdfmapline{=unifs@Unicode@ <simfang.ttf}
+ \pdfmapline{=unili@Unicode@ <simli.ttf}
+ \pdfmapline{=uniyou@Unicode@ <simyou.ttf}
+
+ \pdfmapline{=gbksongsl@UGBK@ <simsun.ttc}
+ \pdfmapline{=gbkkaisl@UGBK@ <simkai.ttf}
+ \pdfmapline{=gbkheisl@UGBK@ <simhei.ttf}
+ \pdfmapline{=gbkfssl@UGBK@ <simfang.ttf}
+ \pdfmapline{=gbklisl@UGBK@ <simli.ttf}
+ \pdfmapline{=gbkyousl@UGBK@ <simyou.ttf}
+
+ \pdfmapline{=unisongsl@Unicode@ <simsun.ttc}
+ \pdfmapline{=unikaisl@Unicode@ <simkai.ttf}
+ \pdfmapline{=uniheisl@Unicode@ <simhei.ttf}
+ \pdfmapline{=unifssl@Unicode@ <simfang.ttf}
+ \pdfmapline{=unilisl@Unicode@ <simli.ttf}
+ \pdfmapline{=uniyousl@Unicode@ <simyou.ttf}
+
+\else
+ \special{pdf:mapline gbk@UGBK@ unicode :0:simsun.ttc -v 50}
+ \special{pdf:mapline gbksong@UGBK@ unicode :0:simsun.ttc -v 50}
+ \special{pdf:mapline gbkkai@UGBK@ unicode simkai.ttf -v 70}
+ \special{pdf:mapline gbkhei@UGBK@ unicode simhei.ttf -v 150}
+ \special{pdf:mapline gbkfs@UGBK@ unicode simfang.ttf -v 50}
+ \special{pdf:mapline gbkli@UGBK@ unicode simli.ttf -v 150}
+ \special{pdf:mapline gbkyou@UGBK@ unicode simyou.ttf -v 60}
+
+ \special{pdf:mapline cyberb@Unicode@ unicode :0:simsun.ttc -v 50}
+ \special{pdf:mapline unisong@Unicode@ unicode :0:simsun.ttc -v 50}
+ \special{pdf:mapline unikai@Unicode@ unicode simkai.ttf -v 70}
+ \special{pdf:mapline unihei@Unicode@ unicode simhei.ttf -v 150}
+ \special{pdf:mapline unifs@Unicode@ unicode simfang.ttf -v 50}
+ \special{pdf:mapline unili@Unicode@ unicode simli.ttf -v 150}
+ \special{pdf:mapline uniyou@Unicode@ unicode simyou.ttf -v 60}
+
+ \special{pdf:mapline gbksongsl@UGBK@ unicode :0:simsun.ttc -s .167 -v 50}
+ \special{pdf:mapline gbkkaisl@UGBK@ unicode simkai.ttf -s .167 -v 70}
+ \special{pdf:mapline gbkheisl@UGBK@ unicode simhei.ttf -s .167 -v 150}
+ \special{pdf:mapline gbkfssl@UGBK@ unicode simfang.ttf -s .167 -v 50}
+ \special{pdf:mapline gbklisl@UGBK@ unicode simli.ttf -s .167 -v 150}
+ \special{pdf:mapline gbkyousl@UGBK@ unicode simyou.ttf -s .167 -v 60}
+
+ \special{pdf:mapline unisongsl@Unicode@ unicode :0:simsun.ttc -s .167 -v 50}
+ \special{pdf:mapline unikaisl@Unicode@ unicode simkai.ttf -s .167 -v 70}
+ \special{pdf:mapline uniheisl@Unicode@ unicode simhei.ttf -s .167 -v 150}
+ \special{pdf:mapline unifssl@Unicode@ unicode simfang.ttf -s .167 -v 50}
+ \special{pdf:mapline unilisl@Unicode@ unicode simli.ttf -s .167 -v 150}
+ \special{pdf:mapline uniyousl@Unicode@ unicode simyou.ttf -s .167 -v 60}
+
+\fi
+
+\ctex@zhmap@endinput
+%%
+%%
+%% End of file `zhwindowsfonts.tex'.
diff --git a/Master/texmf-dist/tex/latex/ctex/back/ctexartutf8.cls b/Master/texmf-dist/tex/latex/ctex/back/ctexartutf8.cls
deleted file mode 100644
index e58903a0877..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/back/ctexartutf8.cls
+++ /dev/null
@@ -1,13 +0,0 @@
-% ctexartutf8.cls
-
-\NeedsTeXFormat{LaTeX2e}[1995/12/01]
-\ProvidesClass{ctexartutf8}
- [2014/06/09 v1.02d ctexartutf8
- document class]
-
-\DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexart}}
-\PassOptionsToClass{UTF8}{ctexart}
-\ProcessOptions
-\LoadClass{ctexart}
-
-\endinput
diff --git a/Master/texmf-dist/tex/latex/ctex/back/ctexbookutf8.cls b/Master/texmf-dist/tex/latex/ctex/back/ctexbookutf8.cls
deleted file mode 100644
index 26f5ae47229..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/back/ctexbookutf8.cls
+++ /dev/null
@@ -1,13 +0,0 @@
-% ctexbookutf8.cls
-
-\NeedsTeXFormat{LaTeX2e}[1995/12/01]
-\ProvidesClass{ctexbookutf8}
- [2014/06/09 v1.02d ctexbookutf8
- document class]
-
-\DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexbook}}
-\PassOptionsToClass{UTF8}{ctexbook}
-\ProcessOptions
-\LoadClass{ctexbook}
-
-\endinput
diff --git a/Master/texmf-dist/tex/latex/ctex/back/ctexcaputf8.sty b/Master/texmf-dist/tex/latex/ctex/back/ctexcaputf8.sty
deleted file mode 100644
index d2ecca3932e..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/back/ctexcaputf8.sty
+++ /dev/null
@@ -1,13 +0,0 @@
-% ctexcaputf8.sty
-
-\NeedsTeXFormat{LaTeX2e}[1995/12/01]
-\ProvidesPackage{ctexcaputf8}
- [2014/06/09 v1.02d ctexcaputf8
- macros package]
-
-\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{ctexcap}}
-\PassOptionsToPackage{UTF8}{ctexcap}
-\ProcessOptions
-\RequirePackage{ctexcap}
-
-\endinput
diff --git a/Master/texmf-dist/tex/latex/ctex/back/ctexreputf8.cls b/Master/texmf-dist/tex/latex/ctex/back/ctexreputf8.cls
deleted file mode 100644
index 6d6baa2a575..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/back/ctexreputf8.cls
+++ /dev/null
@@ -1,13 +0,0 @@
-% ctexreputf8.cls
-
-\NeedsTeXFormat{LaTeX2e}[1995/12/01]
-\ProvidesClass{ctexreputf8}
- [2014/06/09 v1.02d ctexreputf8
- document class]
-
-\DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexrep}}
-\PassOptionsToClass{UTF8}{ctexrep}
-\ProcessOptions
-\LoadClass{ctexrep}
-
-\endinput
diff --git a/Master/texmf-dist/tex/latex/ctex/back/ctexutf8.sty b/Master/texmf-dist/tex/latex/ctex/back/ctexutf8.sty
deleted file mode 100644
index 3df2a91fb9b..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/back/ctexutf8.sty
+++ /dev/null
@@ -1,13 +0,0 @@
-% ctexutf8.sty
-
-\NeedsTeXFormat{LaTeX2e}[1995/12/01]
-\ProvidesPackage{ctexutf8}
- [2014/06/09 v1.02d ctexutf8
- macros package]
-
-\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{ctex}}
-\PassOptionsToPackage{UTF8}{ctex}
-\ProcessOptions
-\RequirePackage{ctex}
-
-\endinput
diff --git a/Master/texmf-dist/tex/latex/ctex/cfg/ctex.cfg b/Master/texmf-dist/tex/latex/ctex/cfg/ctex.cfg
deleted file mode 100644
index 0feb9f95ec1..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/cfg/ctex.cfg
+++ /dev/null
@@ -1,4 +0,0 @@
-% ctex.cfg: for user's customized definitions
-% vim:ft=tex
-
-\endinput
diff --git a/Master/texmf-dist/tex/latex/ctex/cfg/ctexcap-gbk.cfg b/Master/texmf-dist/tex/latex/ctex/cfg/ctexcap-gbk.cfg
deleted file mode 100644
index 900864986eb..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/cfg/ctexcap-gbk.cfg
+++ /dev/null
@@ -1,46 +0,0 @@
-% ctexcap-gbk.cfg: default Chinese caption settings
-% vim:ft=tex
-
-%% Chinese captions
-%%
-%% character set: GBK
-%% encoding: EUC
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% caption name
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-\def\CTEX@contentsname{Ŀ¼}
-\def\CTEX@listfigurename{ͼ}
-\def\CTEX@listtablename{}
-
-\def\CTEX@figurename{ͼ}
-\def\CTEX@tablename{}
-
-\def\CTEX@abstractname{ժҪ}
-\def\CTEX@indexname{}
-\def\CTEX@bibname{ο}
-
-\def\CTEX@prepart{}
-\def\CTEX@postpart{}
-\def\CTEX@prechapter{}
-\def\CTEX@postchapter{}
-\def\CTEX@presection{}
-\def\CTEX@postsection{}
-\def\CTEX@presubsection{}
-\def\CTEX@postsubsection{}
-\def\CTEX@presubsubsection{}
-\def\CTEX@postsubsubsection{}
-\def\CTEX@preparagraph{}
-\def\CTEX@postparagraph{}
-\def\CTEX@presubparagraph{}
-\def\CTEX@postsubparagraph{}
-
-\ifCTEX@cls{article}{
- \def\CTEX@appendixname{}
-}{
- \def\CTEX@appendixname{¼~}
-}
-
-\endinput
-
diff --git a/Master/texmf-dist/tex/latex/ctex/cfg/ctexcap-utf8.cfg b/Master/texmf-dist/tex/latex/ctex/cfg/ctexcap-utf8.cfg
deleted file mode 100644
index f9d39747048..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/cfg/ctexcap-utf8.cfg
+++ /dev/null
@@ -1,46 +0,0 @@
-% ctexcap-utf8.cfg: default Chinese caption settings
-% vim:ft=tex
-
-%% Chinese captions
-%%
-%% character set: UTF-8
-%% encoding: EUC
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% caption name
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-\def\CTEX@contentsname{目录}
-\def\CTEX@listfigurename{插图}
-\def\CTEX@listtablename{表格}
-
-\def\CTEX@figurename{图}
-\def\CTEX@tablename{表}
-
-\def\CTEX@abstractname{摘要}
-\def\CTEX@indexname{索引}
-\def\CTEX@bibname{参考文献}
-
-\def\CTEX@prepart{第}
-\def\CTEX@postpart{部分}
-\def\CTEX@prechapter{第}
-\def\CTEX@postchapter{章}
-\def\CTEX@presection{}
-\def\CTEX@postsection{}
-\def\CTEX@presubsection{}
-\def\CTEX@postsubsection{}
-\def\CTEX@presubsubsection{}
-\def\CTEX@postsubsubsection{}
-\def\CTEX@preparagraph{}
-\def\CTEX@postparagraph{}
-\def\CTEX@presubparagraph{}
-\def\CTEX@postsubparagraph{}
-
-\ifCTEX@cls{article}{
- \def\CTEX@appendixname{}
-}{
- \def\CTEX@appendixname{附录~}
-}
-
-\endinput
-
diff --git a/Master/texmf-dist/tex/latex/ctex/cfg/ctexcap.cfg b/Master/texmf-dist/tex/latex/ctex/cfg/ctexcap.cfg
deleted file mode 100644
index a9c1b41f9f3..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/cfg/ctexcap.cfg
+++ /dev/null
@@ -1,111 +0,0 @@
-% ctexcap.cfg: default Chinese caption settings
-% vim:ft=tex
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% caption by encoding
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-\ifCTEX@GBK
- \input{ctexcap-gbk.cfg}
-\else
- \input{ctexcap-utf8.cfg}
-\fi
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% caption number
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-\def\CTEX@thepart{\chinese{part}}
-\def\CTEX@thechapter{\chinese{chapter}}
-
-\def\CTEX@thesection{\thesection}
-\def\CTEX@thesubsection{\thesubsection}
-\def\CTEX@thesubsubsection{\thesubsubsection}
-\def\CTEX@theparagraph{\theparagraph}
-\def\CTEX@thesubparagraph{\thesubparagraph}
-
-\ifCTEX@cls{article}{
- \def\CTEX@appendixnumber{\@Alph\c@section}
-}{
- \def\CTEX@appendixnumber{\@Alph\c@chapter}
-}
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% caption format
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-\ifCTEX@cls{article}{
- \def\CTEX@part@format{\centering}
- \def\CTEX@part@nameformat{\Large\bfseries}
- \def\CTEX@part@aftername{\quad}
- \def\CTEX@part@titleformat{\Large\bfseries}
- \def\CTEX@part@beforeskip{4ex}
- \def\CTEX@part@afterskip{3ex}
- \def\CTEX@part@indent{\z@}
-}{
- \def\CTEX@part@format{\centering}
- \def\CTEX@part@nameformat{\huge\bfseries}
- \def\CTEX@part@aftername{\par\vskip 20\p@}
- \def\CTEX@part@titleformat{\huge\bfseries}
-}
-
-\def\CTEX@chapter@format{\centering}
-\def\CTEX@chapter@nameformat{\huge\bfseries}
-\def\CTEX@chapter@aftername{\quad}
-\def\CTEX@chapter@titleformat{\huge\bfseries}
-\def\CTEX@chapter@beforeskip{50\p@}
-\def\CTEX@chapter@afterskip{40\p@}
-\def\CTEX@chapter@indent{\z@}
-
-\def\CTEX@section@format{\Large\bfseries\centering}
-\def\CTEX@section@aftername{\quad}
-\def\CTEX@section@beforeskip{-3.5ex \@plus -1ex \@minus -.2ex}
-\def\CTEX@section@afterskip{2.3ex \@plus .2ex}
-\def\CTEX@section@indent{\z@}
-
-\def\CTEX@subsection@format{\large\bfseries}
-\def\CTEX@subsection@aftername{\quad}
-\def\CTEX@subsection@beforeskip{-3.25ex \@plus -1ex \@minus -.2ex}
-\def\CTEX@subsection@afterskip{1.5ex \@plus .2ex}
-\def\CTEX@subsection@indent{\z@}
-
-\def\CTEX@subsubsection@format{\normalsize\bfseries}
-\def\CTEX@subsubsection@aftername{\quad}
-\def\CTEX@subsubsection@beforeskip{-3.25ex \@plus -1ex \@minus -.2ex}
-\def\CTEX@subsubsection@afterskip{1.5ex \@plus .2ex}
-\def\CTEX@subsubsection@indent{\z@}
-
-\def\CTEX@paragraph@format{\normalsize\bfseries}
-\def\CTEX@paragraph@aftername{\quad}
-\ifnum\c@CTEX@sectiondepth>2
- \def\CTEX@paragraph@beforeskip{-3.25ex \@plus -1ex \@minus -.2ex}
- \def\CTEX@paragraph@afterskip{1ex \@plus .2ex}
-\else
- \def\CTEX@paragraph@beforeskip{3.25ex \@plus1ex \@minus .2ex}
- \def\CTEX@paragraph@afterskip{-1em}
-\fi
-\def\CTEX@paragraph@indent{\z@}
-
-\def\CTEX@subparagraph@format{\normalsize\bfseries}
-\def\CTEX@subparagraph@aftername{\quad}
-\ifnum\c@CTEX@sectiondepth>3
- \def\CTEX@subparagraph@beforeskip{-3.25ex \@plus -1ex \@minus -.2ex}
- \def\CTEX@subparagraph@afterskip{1ex \@plus .2ex}
-\else
- \def\CTEX@subparagraph@beforeskip{3.25ex \@plus1ex \@minus .2ex}
- \def\CTEX@subparagraph@afterskip{-1em}
-\fi
-\ifnum\c@CTEX@sectiondepth>2
- \def\CTEX@subparagraph@indent{\z@}
-\else
- \def\CTEX@subparagraph@indent{\parindent}
-\fi
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% other configurations
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-\def\CTEX@caption@delimiter{: }
-
-\endinput
-
diff --git a/Master/texmf-dist/tex/latex/ctex/cfg/ctexopts.cfg.template b/Master/texmf-dist/tex/latex/ctex/cfg/ctexopts.cfg.template
deleted file mode 100644
index bbd8d3afba8..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/cfg/ctexopts.cfg.template
+++ /dev/null
@@ -1,6 +0,0 @@
-% ctexopts.cfg.template: set default options
-% vim:ft=tex
-
-\ExecuteOptions{winfonts}
-
-\endinput
diff --git a/Master/texmf-dist/tex/latex/ctex/config/ctex-name-gbk.cfg b/Master/texmf-dist/tex/latex/ctex/config/ctex-name-gbk.cfg
new file mode 100644
index 00000000000..ae8adb5d66a
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ctex/config/ctex-name-gbk.cfg
@@ -0,0 +1,53 @@
+%%
+%% This is file `ctex-name-gbk.cfg',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `GBK')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {Caption with encoding GBK (CTEX)}
+\ProvidesExplFile{ctex-name-gbk.cfg}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+\keys_set:nn { ctex }
+ {
+ contentsname = Ŀ¼ ,
+ listfigurename = ͼ ,
+ listtablename = ,
+ figurename = ͼ ,
+ tablename = ,
+ abstractname = ժҪ ,
+ indexname = ,
+ bibname = ο ,
+ appendixname = ¼
+ }
+\keys_if_exist:nnT { ctex / part } { name }
+ {
+ \keys_set:nn { ctex / part } { name = { , } }
+ \keys_if_exist:nnT { ctex / chapter } { name }
+ { \keys_set:nn { ctex / chapter } { name = { , } } }
+ }
+%%
+%%
+%% End of file `ctex-name-gbk.cfg'.
diff --git a/Master/texmf-dist/tex/latex/ctex/config/ctex-name-utf8.cfg b/Master/texmf-dist/tex/latex/ctex/config/ctex-name-utf8.cfg
new file mode 100644
index 00000000000..e43631aca8e
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ctex/config/ctex-name-utf8.cfg
@@ -0,0 +1,53 @@
+%%
+%% This is file `ctex-name-utf8.cfg',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `UTF8')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {Caption with encoding UTF8 (CTEX)}
+\ProvidesExplFile{ctex-name-utf8.cfg}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+\keys_set:nn { ctex }
+ {
+ contentsname = 目录 ,
+ listfigurename = 插图 ,
+ listtablename = 表格 ,
+ figurename = 图 ,
+ tablename = 表 ,
+ abstractname = 摘要 ,
+ indexname = 索引 ,
+ bibname = 参考文献 ,
+ appendixname = 附录
+ }
+\keys_if_exist:nnT { ctex / part } { name }
+ {
+ \keys_set:nn { ctex / part } { name = { 第 , 部分 } }
+ \keys_if_exist:nnT { ctex / chapter } { name }
+ { \keys_set:nn { ctex / chapter } { name = { 第 , 章 } } }
+ }
+%%
+%%
+%% End of file `ctex-name-utf8.cfg'.
diff --git a/Master/texmf-dist/tex/latex/ctex/config/ctex.cfg b/Master/texmf-dist/tex/latex/ctex/config/ctex.cfg
new file mode 100644
index 00000000000..10ca31cc48f
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ctex/config/ctex.cfg
@@ -0,0 +1,36 @@
+%%
+%% This is file `ctex.cfg',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `config')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {Configuration file (CTEX)}
+\ProvidesExplFile{\ExplFileName.cfg}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+%%
+%%
+%%
+%% End of file `ctex.cfg'.
diff --git a/Master/texmf-dist/tex/latex/ctex/config/ctexopts.cfg b/Master/texmf-dist/tex/latex/ctex/config/ctexopts.cfg
new file mode 100644
index 00000000000..20348f201ae
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ctex/config/ctexopts.cfg
@@ -0,0 +1,37 @@
+%%
+%% This is file `ctexopts.cfg',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `ctexopts')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {Option configuration file (CTEX)}
+\ProvidesExplFile{ctexopts.cfg}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+%%
+%% \keys_set:nn { ctex / option } { fontset = windowsnew }
+%%
+%%
+%% End of file `ctexopts.cfg'.
diff --git a/Master/texmf-dist/tex/latex/ctex/ctex-article.def b/Master/texmf-dist/tex/latex/ctex/ctex-article.def
new file mode 100644
index 00000000000..df49c0d502e
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ctex/ctex-article.def
@@ -0,0 +1,316 @@
+%%
+%% This is file `ctex-article.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `heading,article')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {Heading modification for article (CTEX)}
+\ProvidesExplFile{ctex-article.def}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+\seq_new:N \c__ctex_headings_seq
+\seq_gset_from_clist:Nn \c__ctex_headings_seq
+ {
+ part , section , subsection , subsubsection ,
+ paragraph , subparagraph
+ }
+\cs_new_protected_nopar:Npn \__ctex_initial_heading:n #1
+ {
+ \tl_new:c { CTEX@pre#1 }
+ \tl_new:c { CTEX@post#1 }
+ \tl_const:cx { CTEXthe#1 }
+ {
+ \exp_not:c { CTEX@pre#1 }
+ \exp_not:c { CTEX@the#1 }
+ \exp_not:c { CTEX@post#1 }
+ }
+ \tl_const:cx { CTEX@#1name }
+ {
+ \exp_not:c { CTEX@#1@nameformat }
+ \exp_not:c { CTEX@pre#1 }
+ \exp_not:N \tl_if_empty:NTF \exp_not:c { CTEX@#1@numberformat }
+ { \exp_not:c { CTEX@the#1 } }
+ {
+ \group_begin:
+ \exp_not:c { CTEX@#1@numberformat }
+ \exp_not:c { CTEX@the#1 }
+ \group_end:
+ }
+ \exp_not:c { CTEX@post#1 }
+ \exp_not:c { CTEX@#1@aftername }
+ }
+ }
+\cs_new_protected_nopar:Npn \__ctex_def_heading_keys:n #1
+ {
+ \tl_put_right:Nx \l__ctex_tmp_tl
+ {
+ #1 .meta:nn = { ctex / #1 } { ####1 } ,
+ #1 / name .code:n =
+ { \ctex_assign_heading_name:nn {#1} { ####1 } } ,
+ #1 / number .tl_set:N = \exp_not:c { CTEX@the#1 } ,
+ #1 / format .tl_set:N = \exp_not:c { CTEX@#1@format } ,
+ #1 / nameformat .tl_set:N = \exp_not:c { CTEX@#1@nameformat } ,
+ #1 / numberformat .tl_set:N = \exp_not:c { CTEX@#1@numberformat } ,
+ #1 / aftername .tl_set:N = \exp_not:c { CTEX@#1@aftername } ,
+ #1 / titleformat .tl_set:N = \exp_not:c { CTEX@#1@titleformat } ,
+ #1 / beforeskip .tl_set:N = \exp_not:c { CTEX@#1@beforeskip } ,
+ #1 / afterskip .tl_set:N = \exp_not:c { CTEX@#1@afterskip} ,
+ #1 / indent .tl_set:N = \exp_not:c { CTEX@#1@indent } ,
+ #1 / format+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@format } { ####1 } } ,
+ #1 / nameformat+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@nameformat } { ####1 } } ,
+ #1 / numberformat+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@numberformat } { ####1 } } ,
+ #1 / aftername+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftername } { ####1 } } ,
+ #1 / titleformat+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@titleformat } { ####1 } } ,
+ #1 / beforeskip .initial:n = \c_zero_skip ,
+ #1 / afterskip .initial:n = \c_zero_skip ,
+ #1 / indent .initial:n = \c_zero_dim ,
+ #1 / beforeskip .value_required: ,
+ #1 / afterskip .value_required: ,
+ #1 / indent .value_required: ,
+ }
+ }
+\NewDocumentCommand \ctex_assign_heading_name:nn
+ { m > { \SplitArgument { \c_one } { , } } +m }
+ { \__ctex_assign_heading_name:nnn {#1} #2 }
+\cs_new_protected:Npn \__ctex_assign_heading_name:nnn #1#2#3
+ {
+ \tl_set:cn { CTEX@pre#1 } {#2}
+ \IfNoValueTF {#3}
+ { \tl_clear:c { CTEX@post#1 } }
+ { \tl_set:cn { CTEX@post#1 } {#3} }
+ }
+\tl_clear:N \l__ctex_tmp_tl
+\seq_map_inline:Nn \c__ctex_headings_seq
+ {
+ \__ctex_initial_heading:n {#1}
+ \__ctex_def_heading_keys:n {#1}
+ }
+\use:x { \keys_define:nn { ctex } { \exp_not:o { \l__ctex_tmp_tl } } }
+\tl_clear:N \l__ctex_tmp_tl
+\renewcommand\part{%
+ \if@noskipsec \leavevmode \fi
+ \par
+ \@tempskipa \CTEX@part@beforeskip \relax
+ \ifdim \@tempskipa <\z@
+ \@tempskipa -\@tempskipa \@afterindentfalse
+ \else
+ \@afterindenttrue
+ \fi
+ \addvspace{\@tempskipa}%
+ \secdef\@part\@spart}
+\def\@part[#1]#2{%
+ \ifnum \c@secnumdepth >\m@ne
+ \refstepcounter{part}%
+ \addcontentsline{toc}{part}{\CTEXthepart\hspace{1em}#1}%
+ \else
+ \addcontentsline{toc}{part}{#1}%
+ \fi
+ {\interlinepenalty \@M
+ \normalfont \parindent \CTEX@part@indent \CTEX@part@format
+ \ifnum \c@secnumdepth >\m@ne
+ \CTEX@partname
+ \fi
+ \CTEX@part@titleformat{#2}%
+ \markboth{}{}\par}%
+ \nobreak
+ \vskip \CTEX@part@afterskip
+ \@afterheading}
+\def\@spart#1{%
+ {\interlinepenalty \@M
+ \normalfont \parindent \CTEX@part@indent \CTEX@part@format
+ \CTEX@part@titleformat{#1}\par}%
+ \nobreak
+ \vskip \CTEX@part@afterskip
+ \@afterheading}
+\def\@seccntformat#1{%
+ \@ifundefined{CTEX@#1name}%
+ {\csname the#1\endcsname\quad}%
+ {\csname CTEX@#1name\endcsname}}
+\def\@sect#1#2#3#4#5#6[#7]#8{%
+ \ifnum #2>\c@secnumdepth
+ \let\@svsec\@empty
+ \else
+ \refstepcounter{#1}%
+ \protected@edef\@svsec{\@seccntformat{#1}\relax}%
+ \fi
+ \@tempskipa #5\relax
+ \ifdim \@tempskipa>\z@
+ \begingroup
+ #6{%
+ \@hangfrom{\hskip #3\relax\@svsec}%
+ \interlinepenalty \@M
+ \csname CTEX@#1@titleformat\endcsname{#8}\@@par}%
+ \endgroup
+ \csname #1mark\endcsname{#7}%
+ \addcontentsline{toc}{#1}{%
+ \ifnum #2>\c@secnumdepth \else
+ \protect\numberline{\@ifundefined{CTEXthe#1}%
+ {\csname the#1\endcsname}%
+ {\csname CTEXthe#1\endcsname}}%
+ \fi
+ #7}%
+ \else
+ \def\@svsechd{%
+ #6{\hskip #3\relax
+ \@svsec \csname CTEX@#1@titleformat\endcsname{#8}}%
+ \csname #1mark\endcsname{#7}%
+ \addcontentsline{toc}{#1}{%
+ \ifnum #2>\c@secnumdepth \else
+ \protect\numberline{\@ifundefined{CTEXthe#1}%
+ {\csname the#1\endcsname}%
+ {\csname CTEXthe#1\endcsname}}%
+ \fi
+ #7}}%
+ \fi
+ \@xsect{#5}}
+\def\@ssect#1#2#3#4#5{%
+ \@tempskipa #3\relax
+ \ifdim \@tempskipa>\z@
+ \begingroup
+ #4{%
+ \@hangfrom{\hskip #1}%
+ \interlinepenalty \@M
+ \CTEX@titleformat@n{#5}\@@par}%
+ \endgroup
+ \else
+ \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}}}%
+ \fi
+ \@xsect{#3}}
+\cs_new_protected_nopar:Npn \CTEX@set@titleformat@n #1
+ { \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat } }
+\cs_new_eq:NN \CTEX@titleformat@n \use:n
+\int_zero:N \l__ctex_tmp_int
+\clist_map_inline:nn
+ { section , subsection , subsubsection , paragraph , subparagraph }
+ {
+ \int_incr:N \l__ctex_tmp_int
+ \cs_gset_protected_nopar:cpx {#1}
+ {
+ \exp_not:N \@startsection {#1}
+ { \int_use:N \l__ctex_tmp_int }
+ { \exp_not:c { CTEX@#1@indent } }
+ { \exp_not:c { CTEX@#1@beforeskip } }
+ { \exp_not:c { CTEX@#1@afterskip } }
+ {
+ \CTEX@set@titleformat@n {#1}
+ \exp_not:N \normalfont \exp_not:c { CTEX@#1@format }
+ }
+ }
+ }
+\tl_new:N \CTEX@preappendix
+\tl_new:N \CTEX@postappendix
+\keys_define:nn { ctex }
+ { appendix .meta:nn = { ctex / appendix } {#1} }
+\keys_define:nn { ctex / appendix }
+ {
+ name .code:n = { \ctex_assign_heading_name:nn { appendix } {#1} } ,
+ number .tl_set:N = \CTEX@appendixnumber
+ }
+\cs_new_eq:NN \CTEX@save@appendix \appendix
+\cs_gset_protected_nopar:Npn \appendix
+ {
+ \CTEX@save@appendix
+ \gdef \CTEX@presection { \CTEX@preappendix }
+ \gdef \CTEX@thesection { \CTEX@appendixnumber }
+ \gdef \CTEX@postsection { \CTEX@postappendix }
+ }
+\cs_new_protected:Npn \CTEX@toc@width@n #1
+ {
+ \hbox_set:Nn \l__ctex_tmp_box {#1}
+ \dim_set:Nn \@tempdima
+ {
+ \dim_max:nn { \@tempdima }
+ { \box_wd:N \l__ctex_tmp_box + \f@size \p@ / \c_two }
+ }
+ }
+\group_begin:
+\char_set_catcode_other:N \#
+\use:n
+ {
+ \group_end:
+ \ExplSyntaxOff
+ \ctex_preto_cmd:NnTF \numberline { \CTEX@toc@width@n {#1} } { }
+ { \ctex_patch_failure:N \numberline }
+ \@ifpackageloaded { tocloft }
+ { }
+ {
+ \ctex_at_end_package:nn { tocloft }
+ {
+ \ctex_preto_cmd:NnTF \numberline { \CTEX@toc@width@n {#1} } { }
+ { \ctex_patch_failure:N \numberline }
+ }
+ }
+ \ExplSyntaxOn
+ }
+\ctex_patch_cmd:Nnn \ps@headings { \thesection } { \CTEXthesection }
+\if@twoside
+ \ctex_patch_cmd:Nnn \ps@headings { \thesubsection } { \CTEXthesubsection }
+\fi:
+\ctex_at_end_package:nn { fancyhdr }
+ {
+ \ctex_patch_cmd:Nnn \ps@fancy
+ { \thesection \hskip 1em \relax } { \CTEXthesection \quad }
+ \ctex_patch_cmd:Nnn \ps@fancy
+ { \thesubsection \hskip 1em \relax } { \CTEXthesubsection \quad }
+ }
+\cs_new_protected_nopar:Npn \CTEX@setcurrentlabel@n #1
+ {
+ \protected@edef \@currentlabel
+ {
+ \cs_if_exist:cTF { CTEX@the#1 }
+ { \exp_args:cc { p@#1 } { CTEX@the#1 } }
+ { \exp_not:o { \@currentlabel } }
+ }
+ }
+\cs_new_protected_nopar:Npn \ctex_varioref_hook:
+ {
+ \seq_map_inline:Nn \c__ctex_headings_seq
+ { \ctex_fix_varioref_label:n { ##1 } }
+ }
+\cs_new_protected_nopar:Npn \ctex_fix_varioref_label:n #1
+ {
+ \tl_if_empty:cT { p@#1 }
+ { \exp_args:Nno \labelformat {#1} { \cs:w CTEX@the#1 \cs_end: } }
+ }
+\@ifpackageloaded { varioref }
+ { \ctex_varioref_hook: }
+ {
+ \cs_new_eq:NN \CTEX@save@refstepcounter \refstepcounter
+ \RenewDocumentCommand \refstepcounter { m }
+ {
+ \CTEX@save@refstepcounter {#1}
+ \CTEX@setcurrentlabel@n {#1}
+ }
+ \ctex_at_end_package:nn { varioref } { \ctex_varioref_hook: }
+ }
+\ctex_scheme_input:o { \l__ctex_scheme_tl }
+%%
+%%
+%% End of file `ctex-article.def'.
diff --git a/Master/texmf-dist/tex/latex/ctex/ctex-book.def b/Master/texmf-dist/tex/latex/ctex/ctex-book.def
new file mode 100644
index 00000000000..d848f503a12
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ctex/ctex-book.def
@@ -0,0 +1,363 @@
+%%
+%% This is file `ctex-book.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `heading,book')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {Heading modification for book (CTEX)}
+\ProvidesExplFile{ctex-book.def}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+\seq_new:N \c__ctex_headings_seq
+\seq_gset_from_clist:Nn \c__ctex_headings_seq
+ {
+ part , chapter , section , subsection , subsubsection ,
+ paragraph , subparagraph
+ }
+\cs_new_protected_nopar:Npn \__ctex_initial_heading:n #1
+ {
+ \tl_new:c { CTEX@pre#1 }
+ \tl_new:c { CTEX@post#1 }
+ \tl_const:cx { CTEXthe#1 }
+ {
+ \exp_not:c { CTEX@pre#1 }
+ \exp_not:c { CTEX@the#1 }
+ \exp_not:c { CTEX@post#1 }
+ }
+ \tl_const:cx { CTEX@#1name }
+ {
+ \exp_not:c { CTEX@#1@nameformat }
+ \exp_not:c { CTEX@pre#1 }
+ \exp_not:N \tl_if_empty:NTF \exp_not:c { CTEX@#1@numberformat }
+ { \exp_not:c { CTEX@the#1 } }
+ {
+ \group_begin:
+ \exp_not:c { CTEX@#1@numberformat }
+ \exp_not:c { CTEX@the#1 }
+ \group_end:
+ }
+ \exp_not:c { CTEX@post#1 }
+ \exp_not:c { CTEX@#1@aftername }
+ }
+ }
+\cs_new_protected_nopar:Npn \__ctex_def_heading_keys:n #1
+ {
+ \tl_put_right:Nx \l__ctex_tmp_tl
+ {
+ #1 .meta:nn = { ctex / #1 } { ####1 } ,
+ #1 / name .code:n =
+ { \ctex_assign_heading_name:nn {#1} { ####1 } } ,
+ #1 / number .tl_set:N = \exp_not:c { CTEX@the#1 } ,
+ #1 / format .tl_set:N = \exp_not:c { CTEX@#1@format } ,
+ #1 / nameformat .tl_set:N = \exp_not:c { CTEX@#1@nameformat } ,
+ #1 / numberformat .tl_set:N = \exp_not:c { CTEX@#1@numberformat } ,
+ #1 / aftername .tl_set:N = \exp_not:c { CTEX@#1@aftername } ,
+ #1 / titleformat .tl_set:N = \exp_not:c { CTEX@#1@titleformat } ,
+ #1 / beforeskip .tl_set:N = \exp_not:c { CTEX@#1@beforeskip } ,
+ #1 / afterskip .tl_set:N = \exp_not:c { CTEX@#1@afterskip} ,
+ #1 / indent .tl_set:N = \exp_not:c { CTEX@#1@indent } ,
+ #1 / format+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@format } { ####1 } } ,
+ #1 / nameformat+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@nameformat } { ####1 } } ,
+ #1 / numberformat+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@numberformat } { ####1 } } ,
+ #1 / aftername+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftername } { ####1 } } ,
+ #1 / titleformat+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@titleformat } { ####1 } } ,
+ #1 / beforeskip .initial:n = \c_zero_skip ,
+ #1 / afterskip .initial:n = \c_zero_skip ,
+ #1 / indent .initial:n = \c_zero_dim ,
+ #1 / beforeskip .value_required: ,
+ #1 / afterskip .value_required: ,
+ #1 / indent .value_required: ,
+ }
+ }
+\NewDocumentCommand \ctex_assign_heading_name:nn
+ { m > { \SplitArgument { \c_one } { , } } +m }
+ { \__ctex_assign_heading_name:nnn {#1} #2 }
+\cs_new_protected:Npn \__ctex_assign_heading_name:nnn #1#2#3
+ {
+ \tl_set:cn { CTEX@pre#1 } {#2}
+ \IfNoValueTF {#3}
+ { \tl_clear:c { CTEX@post#1 } }
+ { \tl_set:cn { CTEX@post#1 } {#3} }
+ }
+\tl_clear:N \l__ctex_tmp_tl
+\seq_map_inline:Nn \c__ctex_headings_seq
+ {
+ \__ctex_initial_heading:n {#1}
+ \__ctex_def_heading_keys:n {#1}
+ }
+\use:x { \keys_define:nn { ctex } { \exp_not:o { \l__ctex_tmp_tl } } }
+\tl_clear:N \l__ctex_tmp_tl
+\keys_define:nn { ctex }
+ {
+ part / pagestyle .tl_set:N = \CTEX@part@pagestyle ,
+ chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle
+ }
+\def\@part[#1]#2{%
+ \thispagestyle{\CTEX@part@pagestyle}%
+ \ifnum \c@secnumdepth >-2\relax
+ \refstepcounter{part}%
+ \addcontentsline{toc}{part}{\CTEXthepart\hspace{1em}#1}%
+ \else
+ \addcontentsline{toc}{part}{#1}%
+ \fi
+ \markboth{}{}%
+ {\interlinepenalty \@M
+ \normalfont \CTEX@part@format
+ \ifnum \c@secnumdepth >-2\relax
+ \CTEX@partname
+ \fi
+ \CTEX@part@titleformat{#2}\par}%
+ \@endpart}
+\def\@spart#1{%
+ {\interlinepenalty \@M
+ \normalfont \CTEX@part@format
+ \CTEX@part@titleformat{#1}\par}%
+ \@endpart}
+\def\@chapter[#1]#2{%
+ \ifnum \c@secnumdepth >\m@ne
+ \if@mainmatter
+ \refstepcounter{chapter}%
+ \typeout{\CTEXthechapter}%
+ \addcontentsline{toc}{chapter}
+ {\protect\numberline{\CTEXthechapter\hspace{0.3em}}#1}%
+ \else
+ \addcontentsline{toc}{chapter}{#1}%
+ \fi
+ \else
+ \addcontentsline{toc}{chapter}{#1}%
+ \fi
+ \chaptermark{#1}%
+ \addtocontents{lof}{\protect\addvspace{10\p@}}%
+ \addtocontents{lot}{\protect\addvspace{10\p@}}%
+ \if@twocolumn
+ \@topnewpage[\@makechapterhead{#2}]%
+ \else
+ \@makechapterhead{#2}%
+ \@afterheading
+ \fi}
+\def\@makechapterhead#1{%
+ \thispagestyle{\CTEX@chapter@pagestyle}%
+ \@tempskipa \CTEX@chapter@beforeskip \relax
+ \ifdim \@tempskipa <\z@
+ \@tempskipa -\@tempskipa \@afterindentfalse
+ \else
+ \@afterindenttrue
+ \fi
+ \vspace*{\@tempskipa}%
+ {\normalfont \parindent \CTEX@chapter@indent \CTEX@chapter@format
+ \ifnum \c@secnumdepth >\m@ne
+ \if@mainmatter
+ \CTEX@chaptername
+ \fi
+ \fi
+ \interlinepenalty\@M
+ \CTEX@chapter@titleformat{#1}\par\nobreak
+ \vskip \CTEX@chapter@afterskip
+ }}
+\def\@makeschapterhead#1{%
+ \thispagestyle{\CTEX@chapter@pagestyle}%
+ \@tempskipa \CTEX@chapter@beforeskip \relax
+ \ifdim \@tempskipa <\z@
+ \@tempskipa -\@tempskipa \@afterindentfalse
+ \else
+ \@afterindenttrue
+ \fi
+ \vspace*{\@tempskipa}%
+ {\normalfont \parindent \CTEX@chapter@indent \CTEX@chapter@format
+ \interlinepenalty\@M
+ \CTEX@chapter@titleformat{#1}\par\nobreak
+ \vskip \CTEX@chapter@afterskip
+ }}
+\def\@seccntformat#1{%
+ \@ifundefined{CTEX@#1name}%
+ {\csname the#1\endcsname\quad}%
+ {\csname CTEX@#1name\endcsname}}
+\def\@sect#1#2#3#4#5#6[#7]#8{%
+ \ifnum #2>\c@secnumdepth
+ \let\@svsec\@empty
+ \else
+ \refstepcounter{#1}%
+ \protected@edef\@svsec{\@seccntformat{#1}\relax}%
+ \fi
+ \@tempskipa #5\relax
+ \ifdim \@tempskipa>\z@
+ \begingroup
+ #6{%
+ \@hangfrom{\hskip #3\relax\@svsec}%
+ \interlinepenalty \@M
+ \csname CTEX@#1@titleformat\endcsname{#8}\@@par}%
+ \endgroup
+ \csname #1mark\endcsname{#7}%
+ \addcontentsline{toc}{#1}{%
+ \ifnum #2>\c@secnumdepth \else
+ \protect\numberline{\@ifundefined{CTEXthe#1}%
+ {\csname the#1\endcsname}%
+ {\csname CTEXthe#1\endcsname}}%
+ \fi
+ #7}%
+ \else
+ \def\@svsechd{%
+ #6{\hskip #3\relax
+ \@svsec \csname CTEX@#1@titleformat\endcsname{#8}}%
+ \csname #1mark\endcsname{#7}%
+ \addcontentsline{toc}{#1}{%
+ \ifnum #2>\c@secnumdepth \else
+ \protect\numberline{\@ifundefined{CTEXthe#1}%
+ {\csname the#1\endcsname}%
+ {\csname CTEXthe#1\endcsname}}%
+ \fi
+ #7}}%
+ \fi
+ \@xsect{#5}}
+\def\@ssect#1#2#3#4#5{%
+ \@tempskipa #3\relax
+ \ifdim \@tempskipa>\z@
+ \begingroup
+ #4{%
+ \@hangfrom{\hskip #1}%
+ \interlinepenalty \@M
+ \CTEX@titleformat@n{#5}\@@par}%
+ \endgroup
+ \else
+ \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}}}%
+ \fi
+ \@xsect{#3}}
+\cs_new_protected_nopar:Npn \CTEX@set@titleformat@n #1
+ { \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat } }
+\cs_new_eq:NN \CTEX@titleformat@n \use:n
+\int_zero:N \l__ctex_tmp_int
+\clist_map_inline:nn
+ { section , subsection , subsubsection , paragraph , subparagraph }
+ {
+ \int_incr:N \l__ctex_tmp_int
+ \cs_gset_protected_nopar:cpx {#1}
+ {
+ \exp_not:N \@startsection {#1}
+ { \int_use:N \l__ctex_tmp_int }
+ { \exp_not:c { CTEX@#1@indent } }
+ { \exp_not:c { CTEX@#1@beforeskip } }
+ { \exp_not:c { CTEX@#1@afterskip } }
+ {
+ \CTEX@set@titleformat@n {#1}
+ \exp_not:N \normalfont \exp_not:c { CTEX@#1@format }
+ }
+ }
+ }
+\tl_new:N \CTEX@preappendix
+\tl_new:N \CTEX@postappendix
+\keys_define:nn { ctex }
+ { appendix .meta:nn = { ctex / appendix } {#1} }
+\keys_define:nn { ctex / appendix }
+ {
+ name .code:n = { \ctex_assign_heading_name:nn { appendix } {#1} } ,
+ number .tl_set:N = \CTEX@appendixnumber
+ }
+\cs_new_eq:NN \CTEX@save@appendix \appendix
+\cs_gset_protected_nopar:Npn \appendix
+ {
+ \CTEX@save@appendix
+ \gdef \CTEX@prechapter { \CTEX@preappendix }
+ \gdef \CTEX@thechapter { \CTEX@appendixnumber }
+ \gdef \CTEX@postchapter { \CTEX@postappendix }
+ }
+\cs_new_protected:Npn \CTEX@toc@width@n #1
+ {
+ \hbox_set:Nn \l__ctex_tmp_box {#1}
+ \dim_set:Nn \@tempdima
+ {
+ \dim_max:nn { \@tempdima }
+ { \box_wd:N \l__ctex_tmp_box + \f@size \p@ / \c_two }
+ }
+ }
+\group_begin:
+\char_set_catcode_other:N \#
+\use:n
+ {
+ \group_end:
+ \ExplSyntaxOff
+ \ctex_preto_cmd:NnTF \numberline { \CTEX@toc@width@n {#1} } { }
+ { \ctex_patch_failure:N \numberline }
+ \@ifpackageloaded { tocloft }
+ { }
+ {
+ \ctex_at_end_package:nn { tocloft }
+ {
+ \ctex_preto_cmd:NnTF \numberline { \CTEX@toc@width@n {#1} } { }
+ { \ctex_patch_failure:N \numberline }
+ }
+ }
+ \ExplSyntaxOn
+ }
+\ctex_patch_cmd:Nnn \ps@headings
+ { \@chapapp\ \thechapter.~\ } { \CTEXthechapter \quad }
+\if@twoside
+ \ctex_patch_cmd:Nnn \ps@headings { \thesection.~\ } { \CTEXthesection \quad }
+\fi:
+\ctex_at_end_package:nn { fancyhdr }
+ {
+ \ctex_patch_cmd:Nnn \ps@fancy
+ { \@chapapp\ \thechapter.~\ } { \if@mainmatter \CTEXthechapter \quad \fi }
+ \ctex_patch_cmd:Nnn \ps@fancy
+ { \thesection.~\ } { \CTEXthesection \quad }
+ }
+\cs_new_protected_nopar:Npn \CTEX@setcurrentlabel@n #1
+ {
+ \protected@edef \@currentlabel
+ {
+ \cs_if_exist:cTF { CTEX@the#1 }
+ { \exp_args:cc { p@#1 } { CTEX@the#1 } }
+ { \exp_not:o { \@currentlabel } }
+ }
+ }
+\cs_new_protected_nopar:Npn \ctex_varioref_hook:
+ {
+ \seq_map_inline:Nn \c__ctex_headings_seq
+ { \ctex_fix_varioref_label:n { ##1 } }
+ }
+\cs_new_protected_nopar:Npn \ctex_fix_varioref_label:n #1
+ {
+ \tl_if_empty:cT { p@#1 }
+ { \exp_args:Nno \labelformat {#1} { \cs:w CTEX@the#1 \cs_end: } }
+ }
+\@ifpackageloaded { varioref }
+ { \ctex_varioref_hook: }
+ {
+ \cs_new_eq:NN \CTEX@save@refstepcounter \refstepcounter
+ \RenewDocumentCommand \refstepcounter { m }
+ {
+ \CTEX@save@refstepcounter {#1}
+ \CTEX@setcurrentlabel@n {#1}
+ }
+ \ctex_at_end_package:nn { varioref } { \ctex_varioref_hook: }
+ }
+\ctex_scheme_input:o { \l__ctex_scheme_tl }
+%%
+%%
+%% End of file `ctex-book.def'.
diff --git a/Master/texmf-dist/tex/latex/ctex/ctex-c5size.clo b/Master/texmf-dist/tex/latex/ctex/ctex-c5size.clo
new file mode 100644
index 00000000000..3eabd9dd5a2
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ctex/ctex-c5size.clo
@@ -0,0 +1,72 @@
+%%
+%% This is file `ctex-c5size.clo',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `c5size')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {c5size option (CTEX)}
+\ProvidesExplFile{ctex-c5size.clo}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+\ctex_set_font_size:Nnn \normalsize { 5 }
+ {
+ \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
+ \abovedisplayshortskip \z@ \@plus3\p@
+ \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
+ \belowdisplayskip \abovedisplayskip
+ \let\@listi\@listI
+ }
+\ctex_set_font_size:Nnn \small { -5 }
+ {
+ \abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@
+ \abovedisplayshortskip \z@ \@plus2\p@
+ \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@
+ \def\@listi{\leftmargin\leftmargini
+ \topsep 4\p@ \@plus2\p@ \@minus2\p@
+ \parsep 2\p@ \@plus\p@ \@minus\p@
+ \itemsep \parsep}
+ \belowdisplayskip \abovedisplayskip
+ }
+\ctex_set_font_size:Nnn \footnotesize { 6 }
+ {
+ \abovedisplayskip 6\p@ \@plus2\p@ \@minus4\p@
+ \abovedisplayshortskip \z@ \@plus\p@
+ \belowdisplayshortskip 3\p@ \@plus\p@ \@minus2\p@
+ \def\@listi{\leftmargin\leftmargini
+ \topsep 3\p@ \@plus\p@ \@minus\p@
+ \parsep 2\p@ \@plus\p@ \@minus\p@
+ \itemsep \parsep}
+ \belowdisplayskip \abovedisplayskip
+ }
+\ctex_set_font_size:Nnn \scriptsize { -6 } { }
+\ctex_set_font_size:Nnn \tiny { 7 } { }
+\ctex_set_font_size:Nnn \large { -4 } { }
+\ctex_set_font_size:Nnn \Large { -3 } { }
+\ctex_set_font_size:Nnn \LARGE { -2 } { }
+\ctex_set_font_size:Nnn \huge { 2 } { }
+\ctex_set_font_size:Nnn \Huge { 1 } { }
+%%
+%%
+%% End of file `ctex-c5size.clo'.
diff --git a/Master/texmf-dist/tex/latex/ctex/ctex-cs4size.clo b/Master/texmf-dist/tex/latex/ctex/ctex-cs4size.clo
new file mode 100644
index 00000000000..99d8a275ad5
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ctex/ctex-cs4size.clo
@@ -0,0 +1,72 @@
+%%
+%% This is file `ctex-cs4size.clo',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `cs4size')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {cs4size option (CTEX)}
+\ProvidesExplFile{ctex-cs4size.clo}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+\ctex_set_font_size:Nnn \normalsize { -4 }
+ {
+ \abovedisplayskip 12\p@ \@plus3\p@ \@minus7\p@
+ \abovedisplayshortskip \z@ \@plus3\p@
+ \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
+ \belowdisplayskip \abovedisplayskip
+ \let\@listi\@listI
+ }
+\ctex_set_font_size:Nnn \small { 5 }
+ {
+ \abovedisplayskip 11\p@ \@plus3\p@ \@minus6\p@
+ \abovedisplayshortskip \z@ \@plus3\p@
+ \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
+ \def\@listi{\leftmargin\leftmargini
+ \topsep 9\p@ \@plus3\p@ \@minus5\p@
+ \parsep 4.5\p@ \@plus2\p@ \@minus\p@
+ \itemsep \parsep}
+ \belowdisplayskip \abovedisplayskip
+ }
+\ctex_set_font_size:Nnn \footnotesize { -5 }
+ {
+ \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
+ \abovedisplayshortskip \z@ \@plus3\p@
+ \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
+ \def\@listi{\leftmargin\leftmargini
+ \topsep 6\p@ \@plus2\p@ \@minus2\p@
+ \parsep 3\p@ \@plus2\p@ \@minus\p@
+ \itemsep \parsep}
+ \belowdisplayskip \abovedisplayskip
+ }
+\ctex_set_font_size:Nnn \scriptsize { 6 } { }
+\ctex_set_font_size:Nnn \tiny { -6 } { }
+\ctex_set_font_size:Nnn \large { -3 } { }
+\ctex_set_font_size:Nnn \Large { -2 } { }
+\ctex_set_font_size:Nnn \LARGE { 2 } { }
+\ctex_set_font_size:Nnn \huge { -1 } { }
+\ctex_set_font_size:Nnn \Huge { 1 } { }
+%%
+%%
+%% End of file `ctex-cs4size.clo'.
diff --git a/Master/texmf-dist/tex/latex/ctex/ctex-report.def b/Master/texmf-dist/tex/latex/ctex/ctex-report.def
new file mode 100644
index 00000000000..fcc9a1ebdae
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ctex/ctex-report.def
@@ -0,0 +1,357 @@
+%%
+%% This is file `ctex-report.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `heading,report')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {Heading modification for report (CTEX)}
+\ProvidesExplFile{ctex-report.def}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+\seq_new:N \c__ctex_headings_seq
+\seq_gset_from_clist:Nn \c__ctex_headings_seq
+ {
+ part , chapter , section , subsection , subsubsection ,
+ paragraph , subparagraph
+ }
+\cs_new_protected_nopar:Npn \__ctex_initial_heading:n #1
+ {
+ \tl_new:c { CTEX@pre#1 }
+ \tl_new:c { CTEX@post#1 }
+ \tl_const:cx { CTEXthe#1 }
+ {
+ \exp_not:c { CTEX@pre#1 }
+ \exp_not:c { CTEX@the#1 }
+ \exp_not:c { CTEX@post#1 }
+ }
+ \tl_const:cx { CTEX@#1name }
+ {
+ \exp_not:c { CTEX@#1@nameformat }
+ \exp_not:c { CTEX@pre#1 }
+ \exp_not:N \tl_if_empty:NTF \exp_not:c { CTEX@#1@numberformat }
+ { \exp_not:c { CTEX@the#1 } }
+ {
+ \group_begin:
+ \exp_not:c { CTEX@#1@numberformat }
+ \exp_not:c { CTEX@the#1 }
+ \group_end:
+ }
+ \exp_not:c { CTEX@post#1 }
+ \exp_not:c { CTEX@#1@aftername }
+ }
+ }
+\cs_new_protected_nopar:Npn \__ctex_def_heading_keys:n #1
+ {
+ \tl_put_right:Nx \l__ctex_tmp_tl
+ {
+ #1 .meta:nn = { ctex / #1 } { ####1 } ,
+ #1 / name .code:n =
+ { \ctex_assign_heading_name:nn {#1} { ####1 } } ,
+ #1 / number .tl_set:N = \exp_not:c { CTEX@the#1 } ,
+ #1 / format .tl_set:N = \exp_not:c { CTEX@#1@format } ,
+ #1 / nameformat .tl_set:N = \exp_not:c { CTEX@#1@nameformat } ,
+ #1 / numberformat .tl_set:N = \exp_not:c { CTEX@#1@numberformat } ,
+ #1 / aftername .tl_set:N = \exp_not:c { CTEX@#1@aftername } ,
+ #1 / titleformat .tl_set:N = \exp_not:c { CTEX@#1@titleformat } ,
+ #1 / beforeskip .tl_set:N = \exp_not:c { CTEX@#1@beforeskip } ,
+ #1 / afterskip .tl_set:N = \exp_not:c { CTEX@#1@afterskip} ,
+ #1 / indent .tl_set:N = \exp_not:c { CTEX@#1@indent } ,
+ #1 / format+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@format } { ####1 } } ,
+ #1 / nameformat+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@nameformat } { ####1 } } ,
+ #1 / numberformat+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@numberformat } { ####1 } } ,
+ #1 / aftername+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftername } { ####1 } } ,
+ #1 / titleformat+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@titleformat } { ####1 } } ,
+ #1 / beforeskip .initial:n = \c_zero_skip ,
+ #1 / afterskip .initial:n = \c_zero_skip ,
+ #1 / indent .initial:n = \c_zero_dim ,
+ #1 / beforeskip .value_required: ,
+ #1 / afterskip .value_required: ,
+ #1 / indent .value_required: ,
+ }
+ }
+\NewDocumentCommand \ctex_assign_heading_name:nn
+ { m > { \SplitArgument { \c_one } { , } } +m }
+ { \__ctex_assign_heading_name:nnn {#1} #2 }
+\cs_new_protected:Npn \__ctex_assign_heading_name:nnn #1#2#3
+ {
+ \tl_set:cn { CTEX@pre#1 } {#2}
+ \IfNoValueTF {#3}
+ { \tl_clear:c { CTEX@post#1 } }
+ { \tl_set:cn { CTEX@post#1 } {#3} }
+ }
+\tl_clear:N \l__ctex_tmp_tl
+\seq_map_inline:Nn \c__ctex_headings_seq
+ {
+ \__ctex_initial_heading:n {#1}
+ \__ctex_def_heading_keys:n {#1}
+ }
+\use:x { \keys_define:nn { ctex } { \exp_not:o { \l__ctex_tmp_tl } } }
+\tl_clear:N \l__ctex_tmp_tl
+\keys_define:nn { ctex }
+ {
+ part / pagestyle .tl_set:N = \CTEX@part@pagestyle ,
+ chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle
+ }
+\def\@part[#1]#2{%
+ \thispagestyle{\CTEX@part@pagestyle}%
+ \ifnum \c@secnumdepth >-2\relax
+ \refstepcounter{part}%
+ \addcontentsline{toc}{part}{\CTEXthepart\hspace{1em}#1}%
+ \else
+ \addcontentsline{toc}{part}{#1}%
+ \fi
+ \markboth{}{}%
+ {\interlinepenalty \@M
+ \normalfont \CTEX@part@format
+ \ifnum \c@secnumdepth >-2\relax
+ \CTEX@partname
+ \fi
+ \CTEX@part@titleformat{#2}\par}%
+ \@endpart}
+\def\@spart#1{%
+ {\interlinepenalty \@M
+ \normalfont \CTEX@part@format
+ \CTEX@part@titleformat{#1}\par}%
+ \@endpart}
+\def\@chapter[#1]#2{%
+ \ifnum \c@secnumdepth >\m@ne
+ \refstepcounter{chapter}%
+ \typeout{\CTEXthechapter}%
+ \addcontentsline{toc}{chapter}
+ {\protect\numberline{\CTEXthechapter\hspace{0.3em}}#1}%
+ \else
+ \addcontentsline{toc}{chapter}{#1}%
+ \fi
+ \chaptermark{#1}%
+ \addtocontents{lof}{\protect\addvspace{10\p@}}%
+ \addtocontents{lot}{\protect\addvspace{10\p@}}%
+ \if@twocolumn
+ \@topnewpage[\@makechapterhead{#2}]%
+ \else
+ \@makechapterhead{#2}%
+ \@afterheading
+ \fi}
+\def\@makechapterhead#1{%
+ \thispagestyle{\CTEX@chapter@pagestyle}%
+ \@tempskipa \CTEX@chapter@beforeskip \relax
+ \ifdim \@tempskipa <\z@
+ \@tempskipa -\@tempskipa \@afterindentfalse
+ \else
+ \@afterindenttrue
+ \fi
+ \vspace*{\@tempskipa}%
+ {\normalfont \parindent \CTEX@chapter@indent \CTEX@chapter@format
+ \ifnum \c@secnumdepth >\m@ne
+ \CTEX@chaptername
+ \fi
+ \interlinepenalty\@M
+ \CTEX@chapter@titleformat{#1}\par\nobreak
+ \vskip \CTEX@chapter@afterskip
+ }}
+\def\@makeschapterhead#1{%
+ \thispagestyle{\CTEX@chapter@pagestyle}%
+ \@tempskipa \CTEX@chapter@beforeskip \relax
+ \ifdim \@tempskipa <\z@
+ \@tempskipa -\@tempskipa \@afterindentfalse
+ \else
+ \@afterindenttrue
+ \fi
+ \vspace*{\@tempskipa}%
+ {\normalfont \parindent \CTEX@chapter@indent \CTEX@chapter@format
+ \interlinepenalty\@M
+ \CTEX@chapter@titleformat{#1}\par\nobreak
+ \vskip \CTEX@chapter@afterskip
+ }}
+\def\@seccntformat#1{%
+ \@ifundefined{CTEX@#1name}%
+ {\csname the#1\endcsname\quad}%
+ {\csname CTEX@#1name\endcsname}}
+\def\@sect#1#2#3#4#5#6[#7]#8{%
+ \ifnum #2>\c@secnumdepth
+ \let\@svsec\@empty
+ \else
+ \refstepcounter{#1}%
+ \protected@edef\@svsec{\@seccntformat{#1}\relax}%
+ \fi
+ \@tempskipa #5\relax
+ \ifdim \@tempskipa>\z@
+ \begingroup
+ #6{%
+ \@hangfrom{\hskip #3\relax\@svsec}%
+ \interlinepenalty \@M
+ \csname CTEX@#1@titleformat\endcsname{#8}\@@par}%
+ \endgroup
+ \csname #1mark\endcsname{#7}%
+ \addcontentsline{toc}{#1}{%
+ \ifnum #2>\c@secnumdepth \else
+ \protect\numberline{\@ifundefined{CTEXthe#1}%
+ {\csname the#1\endcsname}%
+ {\csname CTEXthe#1\endcsname}}%
+ \fi
+ #7}%
+ \else
+ \def\@svsechd{%
+ #6{\hskip #3\relax
+ \@svsec \csname CTEX@#1@titleformat\endcsname{#8}}%
+ \csname #1mark\endcsname{#7}%
+ \addcontentsline{toc}{#1}{%
+ \ifnum #2>\c@secnumdepth \else
+ \protect\numberline{\@ifundefined{CTEXthe#1}%
+ {\csname the#1\endcsname}%
+ {\csname CTEXthe#1\endcsname}}%
+ \fi
+ #7}}%
+ \fi
+ \@xsect{#5}}
+\def\@ssect#1#2#3#4#5{%
+ \@tempskipa #3\relax
+ \ifdim \@tempskipa>\z@
+ \begingroup
+ #4{%
+ \@hangfrom{\hskip #1}%
+ \interlinepenalty \@M
+ \CTEX@titleformat@n{#5}\@@par}%
+ \endgroup
+ \else
+ \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}}}%
+ \fi
+ \@xsect{#3}}
+\cs_new_protected_nopar:Npn \CTEX@set@titleformat@n #1
+ { \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat } }
+\cs_new_eq:NN \CTEX@titleformat@n \use:n
+\int_zero:N \l__ctex_tmp_int
+\clist_map_inline:nn
+ { section , subsection , subsubsection , paragraph , subparagraph }
+ {
+ \int_incr:N \l__ctex_tmp_int
+ \cs_gset_protected_nopar:cpx {#1}
+ {
+ \exp_not:N \@startsection {#1}
+ { \int_use:N \l__ctex_tmp_int }
+ { \exp_not:c { CTEX@#1@indent } }
+ { \exp_not:c { CTEX@#1@beforeskip } }
+ { \exp_not:c { CTEX@#1@afterskip } }
+ {
+ \CTEX@set@titleformat@n {#1}
+ \exp_not:N \normalfont \exp_not:c { CTEX@#1@format }
+ }
+ }
+ }
+\tl_new:N \CTEX@preappendix
+\tl_new:N \CTEX@postappendix
+\keys_define:nn { ctex }
+ { appendix .meta:nn = { ctex / appendix } {#1} }
+\keys_define:nn { ctex / appendix }
+ {
+ name .code:n = { \ctex_assign_heading_name:nn { appendix } {#1} } ,
+ number .tl_set:N = \CTEX@appendixnumber
+ }
+\cs_new_eq:NN \CTEX@save@appendix \appendix
+\cs_gset_protected_nopar:Npn \appendix
+ {
+ \CTEX@save@appendix
+ \gdef \CTEX@prechapter { \CTEX@preappendix }
+ \gdef \CTEX@thechapter { \CTEX@appendixnumber }
+ \gdef \CTEX@postchapter { \CTEX@postappendix }
+ }
+\cs_new_protected:Npn \CTEX@toc@width@n #1
+ {
+ \hbox_set:Nn \l__ctex_tmp_box {#1}
+ \dim_set:Nn \@tempdima
+ {
+ \dim_max:nn { \@tempdima }
+ { \box_wd:N \l__ctex_tmp_box + \f@size \p@ / \c_two }
+ }
+ }
+\group_begin:
+\char_set_catcode_other:N \#
+\use:n
+ {
+ \group_end:
+ \ExplSyntaxOff
+ \ctex_preto_cmd:NnTF \numberline { \CTEX@toc@width@n {#1} } { }
+ { \ctex_patch_failure:N \numberline }
+ \@ifpackageloaded { tocloft }
+ { }
+ {
+ \ctex_at_end_package:nn { tocloft }
+ {
+ \ctex_preto_cmd:NnTF \numberline { \CTEX@toc@width@n {#1} } { }
+ { \ctex_patch_failure:N \numberline }
+ }
+ }
+ \ExplSyntaxOn
+ }
+\ctex_patch_cmd:Nnn \ps@headings
+ { \@chapapp\ \thechapter.~\ } { \CTEXthechapter \quad }
+\if@twoside
+ \ctex_patch_cmd:Nnn \ps@headings { \thesection.~\ } { \CTEXthesection \quad }
+\fi:
+\ctex_at_end_package:nn { fancyhdr }
+ {
+ \ctex_patch_cmd:Nnn \ps@fancy
+ { \@chapapp\ \thechapter.~\ } { \CTEXthechapter \quad }
+ \ctex_patch_cmd:Nnn \ps@fancy
+ { \thesection.~\ } { \CTEXthesection \quad }
+ }
+\cs_new_protected_nopar:Npn \CTEX@setcurrentlabel@n #1
+ {
+ \protected@edef \@currentlabel
+ {
+ \cs_if_exist:cTF { CTEX@the#1 }
+ { \exp_args:cc { p@#1 } { CTEX@the#1 } }
+ { \exp_not:o { \@currentlabel } }
+ }
+ }
+\cs_new_protected_nopar:Npn \ctex_varioref_hook:
+ {
+ \seq_map_inline:Nn \c__ctex_headings_seq
+ { \ctex_fix_varioref_label:n { ##1 } }
+ }
+\cs_new_protected_nopar:Npn \ctex_fix_varioref_label:n #1
+ {
+ \tl_if_empty:cT { p@#1 }
+ { \exp_args:Nno \labelformat {#1} { \cs:w CTEX@the#1 \cs_end: } }
+ }
+\@ifpackageloaded { varioref }
+ { \ctex_varioref_hook: }
+ {
+ \cs_new_eq:NN \CTEX@save@refstepcounter \refstepcounter
+ \RenewDocumentCommand \refstepcounter { m }
+ {
+ \CTEX@save@refstepcounter {#1}
+ \CTEX@setcurrentlabel@n {#1}
+ }
+ \ctex_at_end_package:nn { varioref } { \ctex_varioref_hook: }
+ }
+\ctex_scheme_input:o { \l__ctex_scheme_tl }
+%%
+%%
+%% End of file `ctex-report.def'.
diff --git a/Master/texmf-dist/tex/latex/ctex/ctex.sty b/Master/texmf-dist/tex/latex/ctex/ctex.sty
index a09da8e7373..eaf71f703a7 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctex.sty
+++ b/Master/texmf-dist/tex/latex/ctex/ctex.sty
@@ -1,22 +1,974 @@
-% ctex.sty
-
-\NeedsTeXFormat{LaTeX2e}[1995/12/01]
-\ProvidesPackage{ctex}
- [2014/06/09 v1.02d ctex
- macros package]
-
-\input{ctex-common-opts.def}
-
-\InputIfFileExists{ctexopts.cfg}{}{}
-
-\ProcessOptions
-
-\input{ctex-common.def}
-
-% ctex.cfg should be loaded very last
-\AtEndOfPackage{%
- \makeatletter
- \InputIfFileExists{ctex.cfg}{}{}
- \makeatother}
-
-\endinput
+%%
+%% This is file `ctex.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `package,style')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\NeedsTeXFormat{LaTeX2e}
+\RequirePackage{expl3}
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {Chinese adapter in LaTeX (CTEX)}
+\ProvidesExplPackage{\ExplFileName}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+\RequirePackage { xparse , l3keys2e }
+\RequirePackage { etoolbox , ifpdf , fix-cm , everysel }
+\tl_new:N \l__ctex_tmp_tl
+\int_new:N \l__ctex_tmp_int
+\dim_new:N \l__ctex_tmp_dim
+\box_new:N \l__ctex_tmp_box
+\msg_new:nnnn { ctex } { package-too-old }
+ { Support~package~`#1'~too~old. }
+ {
+ Please~update~an~up~to~date~version~of~the~package~`#1'\\
+ using~your~TeX~package~manager~or~from~CTAN.
+ }
+\cs_new_eq:NN \ctex_lua_now_x:n \luatex_directlua:D
+\ifpdf
+ \cs_new_eq:NN \ctex_if_pdfmode:TF \use_i:nn
+\else:
+ \cs_new_eq:NN \ctex_if_pdfmode:TF \use_ii:nn
+\fi:
+\prg_new_conditional:Npnn \ctex_if_preamble: { TF }
+ {
+ \if_meaning:w \@onlypreamble \@notprerr
+ \prg_return_false:
+ \else:
+ \prg_return_true:
+ \fi:
+ }
+\cs_new_protected:Npn \ctex_at_end_package:nn #1#2
+ {
+ \@ifpackageloaded { #1 }
+ { #2 }
+ { \ctex_add_hook:cn { g__ctex_at_end_ #1 _hook_tl } { #2 } }
+ }
+\cs_new_protected:Npn \ctex_add_hook:Nn #1#2
+ {
+ \tl_if_exist:NF #1 { \tl_new:N #1 }
+ \tl_gput_right:Nn #1 { #2 }
+ }
+\cs_generate_variant:Nn \ctex_add_hook:Nn { c }
+\cs_new_protected_nopar:Npn \ctex_package_end_hook:n #1
+ {
+ \cs_if_exist_use:cT { g__ctex_at_end_ #1 _hook_tl }
+ { \cs_undefine:c { g__ctex_at_end_ #1 _hook_tl } }
+ }
+\cs_generate_variant:Nn \ctex_package_end_hook:n { o }
+\tl_put_left:Nn \@popfilename
+ { \ctex_package_end_hook:o { \@currname } }
+\cs_new_protected:Npn \ctex_file_wrapper:nnn #1#2#3
+ {
+ \use:x
+ {
+ \ExplSyntaxOff
+ \char_set_catcode_letter:n { 64 }
+ #1
+ \exp_not:n {#2}
+ \bool_if:NTF \l__kernel_expl_bool
+ { \ExplSyntaxOn }
+ { \ExplSyntaxOff }
+ \char_set_catcode:nn { 64 } { \char_value_catcode:n { 64 } }
+ #3
+ }
+ }
+\cs_new_protected_nopar:Npn \ctex_file_input:n #1
+ { \ctex_file_wrapper:nnn { } { \file_input:n {#1} } { } }
+\cs_new_protected_nopar:Npn \ctex_scheme_input:n #1
+ {
+ \ctex_file_wrapper:nnn
+ { }
+ {
+ \tl_if_exist:NTF \c__ctex_class_tl
+ {
+ \file_if_exist_input:nF { ctex-scheme- #1 - \c__ctex_class_tl .def }
+ { \file_input:n { ctex-scheme- #1 .def } }
+ }
+ { \file_input:n { ctex-scheme- #1 .def } }
+ }
+ { }
+ }
+\cs_generate_variant:Nn \ctex_scheme_input:n { o }
+\cs_new_protected:Npn \ctex_parse_name:NN #1#2
+ { \ctex_parse_name:NNx #1#2 { \cs_to_str:N #2 } }
+\group_begin:
+\char_set_lccode:nn { `\< } { `\{ }
+\char_set_lccode:nn { `\/ } { `\\ }
+\char_set_lccode:nn { `\A } { `\t }
+\tl_map_function:nN { \A \E \S \O \P } \char_set_catcode_other:N
+\tex_lowercase:D
+ {
+ \group_end:
+ \cs_new_protected:Npn \ctex_parse_name:NNn #1#2#3
+ {
+ \bool_if:nTF { \cs_if_exist_p:c { #3 ~ } || \cs_if_exist_p:c { /#3 } }
+ {
+ \group_begin:
+ \use:x
+ {
+ \__ctex_parse_name:nNNNnN { \token_get_replacement_spec:N #2 }
+ \exp_not:N #2 \exp_not:c { #3 ~ } \exp_not:c { /#3 } {#3}
+ } #1
+ }
+ { #1#2 }
+ }
+ \cs_new_protected:Npn \__ctex_parse_name:nNNNnN #1#2#3#4#5#6
+ {
+ \group_end:
+ \exp_args:Nc #6
+ {
+ \str_case:nnTF {#1}
+ {
+ { \protect #3 } { }
+ { \x@protect #2 \protect #3 } { }
+ }
+ {
+ \str_if_eq_x:nnTF { \exp_not:n { /@protected@ #3 /#3 } }
+ {
+ \exp_last_unbraced:Nf \__ctex_parse_name:w
+ \token_get_replacement_spec:N #3 AESAOPA ~ < \q_stop
+ }
+ { /#5 ~ } { #5 ~ }
+ }
+ {
+ \str_case:onTF { \__ctex_parse_name:w #1 AESAOPA ~ < \q_stop }
+ {
+ { /@protected@ #2 #4 } { }
+ { /@ #4 } { }
+ }
+ { /#5 } {#5}
+ }
+ }
+ }
+ \cs_new:Npn \__ctex_parse_name:w #1 AESAOPA ~ #2 < #3 \q_stop { #1#2 }
+ }
+\cs_generate_variant:Nn \ctex_parse_name:NNn { NNx }
+\cs_new_protected:Npn \ctex_patch_cmd:NnnTF { \ctex_parse_name:NN \patchcmd }
+\cs_new_protected:Npn \ctex_preto_cmd:NnTF { \ctex_parse_name:NN \pretocmd }
+\cs_new_protected:Npn \ctex_appto_cmd:NnTF { \ctex_parse_name:NN \apptocmd }
+\cs_new_protected:Npn \ctex_patch_cmd:Nnn
+ {
+ \group_begin:
+ \char_set_catcode_other:N \#
+ \__ctex_patch_cmd:Nnn
+ }
+\cs_new_protected:Npn \__ctex_patch_cmd:Nnn #1#2#3
+ {
+ \group_end:
+ \group_begin:
+ \ExplSyntaxOff
+ \ctex_patch_cmd:NnnTF #1 {#2} {#3}
+ {
+ \cs_gset_eq:NN \__ctex_tmp:w #1
+ \group_end:
+ \cs_set_eq:NN #1 \__ctex_tmp:w
+ \cs_undefine:N \__ctex_tmp:w
+ }
+ { \group_end: \ctex_patch_failure:N #1 }
+ }
+\cs_new_protected:Npn \ctex_patch_failure:N #1
+ { \msg_warning:nnx { ctex } { patch-failure } { \token_to_str:N #1 } }
+\msg_new:nnn { ctex } { patch-failure }
+ {
+ Patching~command~`#1'~failed.\\
+ ctex~may~not~work~as~expected.
+ }
+\cs_new:Npn \ctex_set_default_ccwd:Nn #1#2
+ {
+ \dim_compare:nNnTF
+ { \ctex_default_pt:n {#2} } = { \ctex_default_pt:n { #2 ~ mm } }
+ { \tl_set:Nn #1 {#2} }
+ { \tl_set:Nn #1 { #2 \ccwd } }
+ }
+\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
+ }
+\group_begin:
+ \char_set_catcode_other:N \P
+ \char_set_catcode_other:N \T
+\tex_lowercase:D
+ {
+ \group_end:
+ \cs_new:Npn \__ctex_default_pt:w #1 PT #2 \q_stop { #1 PT }
+ }
+\tl_new:N \l__ctex_encoding_tl
+\tl_set:Nx \l__ctex_encoding_tl
+ { \pdftex_if_engine:TF { GBK } { UTF8 } }
+\cs_new_eq:NN \g__ctex_section_depth_flag \c_two
+\bool_new:N \g__ctex_zhmCJK_bool
+\tl_new:N \l__ctex_autoindent_tl
+\cs_new_eq:NN \ctex_if_autoindent_touched:F \use:n
+\cs_new_eq:NN \ctex_zhmap_case:nnn \use_ii:nnn
+\cs_new_protected_nopar:Npn \ctex_at_end:n { \AtEndOfPackage }
+\msg_new:nnn { ctex } { invalid-option }
+ { Option~`\l_keys_key_tl'~is~invalid~in~current~mode. }
+\msg_new:nnn { ctex } { invalid-value }
+ { Value~`#1'~is~invalid~for~the~key~`\l_keys_key_tl'. }
+\msg_new:nnn { ctex } { deprecated-option }
+ { Option~ `\l_keys_key_tl'~ is~ deprecated.\\ #1 }
+\msg_new:nnn { ctex } { deprecated-command }
+ { Command~ #1 is~ deprecated.\\ #2 }
+\msg_new:nnn { ctex } { deprecated-environment }
+ { Environment~ `#1'~ is~ deprecated.\\ #2 }
+\cs_new_eq:NN \g__ctex_font_size_flag \c_minus_one
+\keys_define:nn { ctex / option }
+ {
+ zihao .choice: ,
+ zihao .default:n = { 5 } ,
+ 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 } ,
+ c5size .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { Option~ `zihao=5'~ is~ set. }
+ \keys_set:nn { ctex / option } { zihao = 5 }
+ } ,
+ cs4size .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { Option~ `zihao=-4'~ is~ set. }
+ \keys_set:nn { ctex / option } { zihao = -4 }
+ } ,
+ c5size .value_forbidden: ,
+ cs4size .value_forbidden: ,
+ linespread .fp_set:N = \l__ctex_line_spread_fp ,
+ linespread .initial:n = { \c_nan_fp } ,
+ linespread .value_required: ,
+ autoindent .choice: ,
+ autoindent .default:n = { true } ,
+ autoindent / true .code:n =
+ {
+ \tl_set:Nn \l__ctex_autoindent_tl { 2 \ccwd }
+ \cs_set_eq:NN \ctex_if_autoindent_touched:F \use_none:n
+ } ,
+ autoindent / false .code:n =
+ {
+ \tl_clear:N \l__ctex_autoindent_tl
+ \cs_set_eq:NN \ctex_if_autoindent_touched:F \use_none:n
+ } ,
+ autoindent / unknown .code:n =
+ {
+ \ctex_set_default_ccwd:Nn \l__ctex_autoindent_tl {#1}
+ \cs_set_eq:NN \ctex_if_autoindent_touched:F \use_none:n
+ } ,
+ indent .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ {
+ The~ indentfirst~ package~ will~ be~ loaded~ but~ the~
+ functionality~ may~ be~ removed~ in~ later~ version.
+ It's~ better~ to~ set~ the~ heading~ styles~ via~ beforeskip~
+ options.~
+ }
+ \keys_set:nn { ctex / option } { autoindent = true }
+ } ,
+ indent .value_forbidden: ,
+ noindent .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ {
+ The~ functionality~ has~ been~ removed.~
+ It's~ better~ to~ set~ the~ heading~ styles~ via~ beforeskip~
+ options.
+ }
+ \keys_set:nn { ctex / option } { autoindent = false }
+ } ,
+ noindent .value_forbidden: ,
+ GBK .code:n = { \tl_set:Nn \l__ctex_encoding_tl { GBK } } ,
+ UTF8 .code:n = { \tl_set:Nn \l__ctex_encoding_tl { UTF8 } } ,
+ GBK .value_forbidden: ,
+ UTF8 .value_forbidden: ,
+ fontset .tl_gset:N = \g__ctex_fontset_tl ,
+ nofonts .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ {
+ Option~ `fontset=none'~ is~ set.~ It~ is~ better~ to~ use~
+ fontset~ option.
+ }
+ \keys_set:nn { ctex / option } { fontset = none }
+ } ,
+ adobefonts .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ {
+ Option~ `fontset=adobe'~ is~ set.~ It~ is~ better~ to~ use~
+ fontset~ option.
+ }
+ \keys_set:nn { ctex / option } { fontset = none }
+ } ,
+ winfonts .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ {
+ Option~ `fontset=windows'~ is~ set.~ It~ is~ better~ to~ use~
+ fontset~ option.
+ }
+ \keys_set:nn { ctex / option } { fontset = none }
+ } ,
+ nofonts .value_forbidden: ,
+ winfonts .value_forbidden: ,
+ adobefonts .value_forbidden: ,
+ zhmap .choice: ,
+ zhmap .default:n = { true } ,
+ zhmap / zhmCJK .code:n =
+ {
+ \bool_gset_true:N \g__ctex_zhmCJK_bool
+ \cs_gset_eq:NN \ctex_zhmap_case:nnn \use_i:nnn
+ } ,
+ zhmap / true .code:n =
+ {
+ \bool_gset_false:N \g__ctex_zhmCJK_bool
+ \cs_gset_eq:NN \ctex_zhmap_case:nnn \use_ii:nnn
+ } ,
+ zhmap / false .code:n =
+ {
+ \bool_gset_false:N \g__ctex_zhmCJK_bool
+ \cs_gset_eq:NN \ctex_zhmap_case:nnn \use_iii:nnn
+ } ,
+ nozhmap .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { Option~ `zhmap=false'~ is~ set. }
+ \keys_set:nn { ctex / option } { zhmap = false }
+ } ,
+ nozhmap .value_forbidden: ,
+ punct .tl_set:N = \l__ctex_punct_tl ,
+ punct .default:n = { quanjiao } ,
+ punct .initial:n = { quanjiao } ,
+ nopunct .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { Option~ `punct=plain'~ is~ set. }
+ \keys_set:nn { ctex / option } { punct = plain }
+ } ,
+ nopunct .value_forbidden: ,
+ space .choices:nn =
+ { true , auto , false }
+ {
+ \exp_args:Nx \ctex_at_end:n
+ { \keys_set:nn { ctex } { space = \l_keys_choice_tl } }
+ } ,
+ space .default:n = { true } ,
+ nospace .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { Option~ `space=false'~ is~ set. }
+ \keys_set:nn { ctex / option } { space = false }
+ } ,
+ nospace .value_forbidden: ,
+ heading .bool_set:N = \l__ctex_heading_bool ,
+ scheme .tl_set:N = \l__ctex_scheme_tl ,
+ scheme .default:n = { chinese },
+ scheme .initial:n = { chinese },
+ cap .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { Option~ `scheme = chinese' ~ is~ set. }
+ \keys_set:nn { ctex / option } { scheme = chinese }
+ } ,
+ nocap .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { Option~ `scheme = plain' ~ is~ set. }
+ \keys_set:nn { ctex / option } { scheme = plain }
+ } ,
+ cap .value_forbidden: ,
+ nocap .value_forbidden: ,
+ sub3section .code:n =
+ { \cs_gset_eq:NN \g__ctex_section_depth_flag \c_three } ,
+ sub4section .code:n =
+ { \cs_gset_eq:NN \g__ctex_section_depth_flag \c_four } ,
+ sub3section .value_forbidden: ,
+ sub4section .value_forbidden: ,
+ fntef .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { `(xe)CJKfntef'~ package~ is~ always~ loaded. }
+ } ,
+ fancyhdr .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { `fancyhdr'~ package~ is~ loaded. }
+ \RequirePackage{ fancyhdr }
+ } ,
+ hyperref .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { `hyperref'~ package~ will~ be~ loaded. }
+ \AtEndPreamble { \RequirePackage { hyperref } }
+ } ,
+ }
+\tl_clear:N \l__ctex_tmp_tl
+\clist_map_inline:nn
+ {
+ 10pt , 11pt , 12pt ,
+ 8pt , 9pt , 14pt , 17pt , 20pt , 25pt , 30pt , 36pt , 48pt , 60pt
+ }
+ {
+ \tl_put_right:Nn \l__ctex_tmp_tl
+ {
+ #1 .code:n =
+ { \cs_gset_eq:NN \g__ctex_font_size_flag \c_minus_one } ,
+ #1 .value_forbidden: ,
+ }
+ }
+\use:x { \keys_define:nn { ctex / option } { \exp_not:o { \l__ctex_tmp_tl } } }
+\tl_clear:N \l__ctex_tmp_tl
+\ctex_file_input:n { ctexopts.cfg }
+\ProcessKeysOptions { ctex / option }
+\tl_set_eq:Nc \l__ctex_tmp_tl { ver@ \@currname . \@currext }
+\msg_new:nnnn { ctex } { ctexsize-loaded }
+ { Package~`ctexsize'~can~not~be~loaded~before~`ctex'. }
+ {
+ `ctexsize'~is~actually~a~part~of~`ctex'.\\
+ It~is~not~necessary~to~load~it~separately.
+ }
+\@ifpackageloaded { ctexsize }
+ { \msg_error:nn { ctex } { ctexsize-loaded } }
+ { \cs_new_eq:cN { ver@ctexsize. \@pkgextension } \l__ctex_tmp_tl }
+\NewDocumentCommand \ctexset { +m }
+ { \keys_set:nn { ctex } {#1} }
+\NewDocumentCommand \CTEXsetup { +o > { \TrimSpaces } m }
+ {
+ \msg_warning:nnnn { ctex } { deprecated-command } { \CTEXsetup }
+ { \ctexset~ {~ #2~ =~ {~ #1~ }~ }~ is~ set. }
+ \IfNoValueF {#1} { \keys_set:nn { ctex / #2 } {#1} }
+ }
+\NewDocumentCommand \CTEXoptions { +o }
+ {
+ \msg_warning:nnnn { ctex } { deprecated-command } { \CTEXoptions }
+ { \ctexset~ {~ #1~ }~ is~ set. }
+ \IfNoValueF {#1} { \keys_set:nn { ctex } {#1} }
+ }
+\@ifpackageloaded { hyperref }
+ {
+ \cs_new_protected_nopar:Npn \ctex_hypersetup:n #1
+ { \hypersetup {#1} }
+ }
+ {
+ \cs_new_protected_nopar:Npn \ctex_hypersetup:n #1
+ { \PassOptionsToPackage {#1} { hyperref } }
+ }
+\ctex_hypersetup:n { colorlinks = true }
+\pdftex_if_engine:TF
+ {
+ \tl_set:Nx \l__ctex_encoding_tl { \l__ctex_encoding_tl }
+ \ctex_file_input:n { ctex-engine-pdftex.def }
+ }
+ {
+ \tl_set:Nn \l__ctex_encoding_tl { UTF8 }
+ \xetex_if_engine:TF
+ { \ctex_file_input:n { ctex-engine-xetex.def } }
+ { \ctex_file_input:n { ctex-engine-luatex.def } }
+ }
+\keys_define:nn { ctex }
+ {
+ autoindent .choice: ,
+ autoindent .default:n = { true } ,
+ autoindent / true .code:n =
+ {
+ \tl_set:Nn \l__ctex_autoindent_tl { 2 \ccwd }
+ \ctex_select_size:
+ } ,
+ autoindent / false .code:n =
+ { \tl_clear:N \l__ctex_autoindent_tl } ,
+ autoindent / unknown .code:n =
+ {
+ \ctex_set_default_ccwd:Nn \l__ctex_autoindent_tl {#1}
+ \ctex_select_size:
+ }
+ }
+\NewDocumentCommand \CTEXsetfont { } { \ctex_select_size: }
+\cs_new_protected_nopar:Npn \ctex_select_size:
+ { \cs_if_free:NTF \size@update { \ctex_update_size: } { \selectfont } }
+\cs_new_protected_nopar:Npn \ctex_update_size:
+ {
+ \tl_if_eq:NNTF \l__ctex_ziju_tl \c__ctex_zero_tl
+ {
+ \ctex_update_stretch:
+ \ctex_update_parindent:
+ }
+ { \ctex_update_ziju: }
+ }
+\tl_const:Nx \c__ctex_zero_tl { \fp_use:N \c_zero_fp }
+\tl_new:N \l__ctex_ziju_tl
+\tl_set_eq:NN \l__ctex_ziju_tl \c__ctex_zero_tl
+\ctex_add_to_selectfont:n
+ { \cs_if_free:NF \size@update { \ctex_update_size: } }
+\keys_define:nn { ctex }
+ {
+ linestretch .code:n =
+ {
+ \ctex_set_default_ccwd:Nn \l__ctex_line_stretch_tl {#1}
+ \ctex_select_size:
+ } ,
+ linestretch .value_required:
+ }
+\tl_new:N \l__ctex_line_stretch_tl
+\tl_set:Nn \l__ctex_line_stretch_tl { \ccwd }
+\cs_new_protected_nopar:Npn \ctex_update_stretch:
+ {
+ \ctex_update_em_unit:
+ \dim_set:Nn \l__ctex_tmp_dim { \l__ctex_line_stretch_tl }
+ \dim_compare:nNnTF \l__ctex_tmp_dim = \c_max_dim
+ {
+ \ctex_if_ccglue_touched:TF
+ { \ctex_update_ccwd: }
+ {
+ \dim_set:Nn \l__ctex_tmp_dim
+ { \baselinestretch \etex_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:
+ }
+ }
+ {
+ \int_set:Nn \l__ctex_tmp_int
+ { \etex_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
+ {
+ \skip_set:Nn \l__ctex_ccglue_skip
+ {
+ \c_zero_dim plus \dim_eval:n
+ {
+ ( \linewidth - \ccwd - \l__ctex_tmp_int \ccwd ) /
+ \l__ctex_tmp_int
+ }
+ }
+ }
+ { \skip_zero:N \l__ctex_ccglue_skip }
+ \ctex_update_ccglue:
+ }
+ }
+\cs_new_protected_nopar:Npn \ctex_update_parindent:
+ {
+ \tl_if_empty:NF \l__ctex_autoindent_tl
+ {
+ \dim_compare:nNnF \parindent = \c_zero_dim
+ { \dim_set:Nn \parindent { \l__ctex_autoindent_tl } }
+ }
+ }
+\NewDocumentCommand \ziju { m }
+ { \exp_args:Nx \ctex_ziju:n {#1} \tex_ignorespaces:D }
+\cs_new_protected_nopar:Npn \ctex_ziju:n #1
+ {
+ \tl_set:Nx \l__ctex_ziju_tl { \fp_eval:n {#1} }
+ \ctex_select_size:
+ }
+\cs_new_protected_nopar:Npn \ctex_update_ziju:
+ {
+ \ctex_update_em_unit:
+ \dim_set:Nn \l__ctex_ziju_dim { \l__ctex_ziju_tl \ccwd }
+ \dim_add:Nn \ccwd { \l__ctex_ziju_dim }
+ \dim_compare:nNnTF \ccwd > \c_zero_dim
+ {
+ \dim_set:Nn \l__ctex_tmp_dim
+ { \linewidth - \ccwd + \l__ctex_ziju_dim }
+ \int_set:Nn \l__ctex_tmp_int { \l__ctex_tmp_dim }
+ \tex_divide:D \l__ctex_tmp_int \ccwd
+ \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 } }
+ }
+ \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 ) }
+ }
+ }
+ { \skip_set:Nn \l__ctex_ccglue_skip { \l__ctex_ziju_dim } }
+ \ctex_update_ccglue:
+ \ctex_update_parindent:
+ }
+\dim_new:N \l__ctex_ziju_dim
+\NewDocumentCommand \CTEXindent { }
+ {
+ \msg_warning:nnnn { ctex } { deprecated-command } { \CTEXindent }
+ { \parindent is~ set~ to~ 2\ccwd. }
+ \ctex_update_ccwd: \dim_set:Nn \parindent { 2 \ccwd }
+ }
+\NewDocumentCommand \CTEXnoindent { }
+ {
+ \msg_warning:nnnn { ctex } { deprecated-command } { \CTEXnoindent }
+ { \parindent is~ set~ to~ 0pt. }
+ \dim_zero:N \parindent
+ }
+\bool_if:NT \l__ctex_indent_bool
+ { \RequirePackage { indentfirst } }
+\PassOptionsToPackage { encoding = \l__ctex_encoding_tl } { zhnumber }
+\RequirePackage { zhnumber }
+\cs_new_eq:NN \chinese \zhnum
+\cs_new_eq:NN \Chinese \chinese
+\cs_new_eq:NN \CTEXcounter \use_none:n
+\NewDocumentCommand \CTEXnumber { m m }
+ { \protected@edef #1 { \zhnumber {#2} } }
+\NewDocumentCommand \CTEXdigits { m m }
+ { \protected@edef #1 { \zhdigits {#2} } }
+\cs_set_eq:NN \CTEX@todayold \today
+\keys_define:nn { ctex }
+ {
+ today .choice: ,
+ today / old .code:n =
+ { \cs_set_eq:NN \today \CTEX@todayold } ,
+ today / small .code:n =
+ {
+ \cs_set_eq:NN \today \zhtoday
+ \zhnumsetup { time = Arabic }
+ } ,
+ today / big .code:n =
+ {
+ \cs_set_eq:NN \today \zhtoday
+ \zhnumsetup { time = Chinese }
+ } ,
+ today / unknown .code:n =
+ { \msg_error:nnx { ctex } { today-undef } {#1} }
+ }
+\msg_new:nnnn { ctex } { today-undef }
+ { Today~format~`#1'~is~undefined. }
+ { Available~today~formats~are~`old',~`small',~and~`big'. }
+\keys_define:nn { ctex }
+ {
+ contentsname .tl_set:N = \contentsname ,
+ listfigurename .tl_set:N = \listfigurename ,
+ listtablename .tl_set:N = \listtablename ,
+ figurename .tl_set:N = \figurename ,
+ tablename .tl_set:N = \tablename ,
+ abstractname .tl_set:N = \abstractname ,
+ indexname .tl_set:N = \indexname ,
+ appendixname .tl_set:N = \appendixname ,
+ }
+\msg_new:nnn { ctex } { ctexbibname }
+ {
+ Neither~`\token_to_str:N \bibname'~nor~`\token_to_str:N \refname'~can~be~found.\\
+ The~key~`bibname'~will~set~`\token_to_str:N \ctexbibname'~to~the~given~value.
+ }
+\tl_if_exist:NTF \bibname
+ { \keys_define:nn { ctex } { bibname .tl_set:N = \bibname } }
+ {
+ \tl_if_exist:NTF \refname
+ { \keys_define:nn { ctex } { bibname .tl_set:N = \refname } }
+ {
+ \msg_warning:nn { ctex } { ctexbibname }
+ \keys_define:nn { ctex } { bibname .tl_set:N = \ctexbibname }
+ }
+ }
+\msg_new:nnn { ctex } { not-standard-class }
+ {
+ None~of~the~standard~document~classes~was~loaded.\\
+ Heading~`#1'~is~selected.\\
+ ctex~may~not~work~as~expected.
+ }
+\bool_if:NTF \l__ctex_heading_bool
+ {
+ \clist_map_inline:nn { article , book , report }
+ {
+ \@ifclassloaded {#1}
+ { \clist_map_break:n { \tl_const:Nn \c__ctex_class_tl {#1} } } { }
+ }
+ \tl_if_exist:NF \c__ctex_class_tl
+ {
+ \cs_if_exist:NTF \chapter
+ {
+ \cs_if_exist:NF \if@mainmatter
+ { \cs_new_eq:NN \if@mainmatter \tex_iftrue:D }
+ \tl_const:Nn \c__ctex_class_tl { book }
+ }
+ { \tl_const:Nn \c__ctex_class_tl { article } }
+ \msg_warning:nnx { ctex } { not-standard-class } { \c__ctex_class_tl }
+ }
+ \ctex_file_input:n { ctex- \c__ctex_class_tl .def }
+ }
+ { \ctex_scheme_input:o { \l__ctex_scheme_tl } }
+\NewDocumentCommand \zihao { m }
+ { \exp_args:Nx \ctex_zihao:n {#1} \tex_ignorespaces:D }
+\cs_new_protected_nopar:Npn \ctex_zihao:n #1
+ {
+ \prop_get:NnNTF \c__ctex_font_size_prop {#1} \l__ctex_font_size_tl
+ { \exp_after:wN \fontsize \l__ctex_font_size_tl \selectfont }
+ { \msg_error:nnn { ctex } { fontsize } {#1} }
+ }
+\msg_new:nnnn { ctex } { fontsize }
+ { Undefined~Chinese~font~size~`#1'~in~command~\token_to_str:N \zihao.}
+ {
+ The~old~font~size~is~used~if~you~continue.\\
+ The~available~font~sizes~are~listed~as~follow.\\
+ \seq_use:Nnnn \c__ctex_font_size_seq { ~and~ } { ,~ } { ,~and~ }.
+ }
+\prop_new:N \c__ctex_font_size_prop
+\seq_new:N \c__ctex_font_size_seq
+\cs_new_protected_nopar:Npn \__ctex_save_font_size:nn #1#2
+ {
+ \use:x
+ {
+ \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 } }
+ }
+ }
+ \seq_gput_right:Nn \c__ctex_font_size_seq {#1}
+ }
+\clist_map_inline:nn
+ {
+ { 8 } { 5 bp } ,
+ { 7 } { 5.5 bp } ,
+ { -6 } { 6.5 bp } ,
+ { 6 } { 7.5 bp } ,
+ { -5 } { 9 bp } ,
+ { 5 } { 10.5 bp } ,
+ { -4 } { 12 bp } ,
+ { 4 } { 14 bp } ,
+ { -3 } { 15 bp } ,
+ { 3 } { 16 bp } ,
+ { -2 } { 18 bp } ,
+ { 2 } { 22 bp } ,
+ { -1 } { 24 bp } ,
+ { 1 } { 26 bp } ,
+ { -0 } { 36 bp } ,
+ { 0 } { 42 bp }
+ }
+ { \__ctex_save_font_size:nn #1 }
+\cs_new_protected_nopar:Npn \ctex_declare_math_sizes:nnnn #1#2#3#4
+ {
+ \__ctex_get_font_sizes:Nn \l__ctex_font_size_tl { {#1} {#2} {#3} {#4} }
+ \exp_after:wN \DeclareMathSizes \l__ctex_font_size_tl
+ }
+\cs_new_protected_nopar:Npn \__ctex_get_font_sizes:Nn #1#2
+ {
+ \tl_clear:N #1
+ \tl_map_inline:nn {#2}
+ {
+ \prop_get:NnNTF \c__ctex_font_size_prop {##1} \l__ctex_tmp_tl
+ { \tl_put_right:Nx #1 { { \tl_head:N \l__ctex_tmp_tl } } }
+ { \tl_put_right:Nx #1 { { \dim_to_decimal:n { ##1 } } } }
+ }
+ }
+\clist_map_inline:nn
+ {
+ { 8 }{ 8 }{ 5pt }{ 5pt } ,
+ { 7 }{ 7 }{ 5pt }{ 5pt } ,
+ { -6 }{ -6 }{ 5pt }{ 5pt } ,
+ { 6 }{ 6 }{ 5pt }{ 5pt } ,
+ { -5 }{ -5 }{ 6pt }{ 5pt } ,
+ { 5 }{ 5 }{ 7pt }{ 5pt } ,
+ { -4 }{ -4 }{ 8pt }{ 6pt } ,
+ { 4 }{ 4 }{ 5 }{ 6 } ,
+ { -3 }{ -3 }{ -4 }{ -5 } ,
+ { 3 }{ 3 }{ 4 }{ 5 } ,
+ { -2 }{ -2 }{ -3 }{ -4 } ,
+ { 2 }{ 2 }{ 3 }{ 4 } ,
+ { -1 }{ -1 }{ -2 }{ -3 } ,
+ { 1 }{ 1 }{ 2 }{ 3 } ,
+ { -0 }{ -0 }{ -1 }{ -2 } ,
+ { 0 }{ 0 }{ 1 }{ 2 }
+ }
+ { \ctex_declare_math_sizes:nnnn #1 }
+\cs_new_protected:Npn \ctex_set_font_size:Nnn #1#2#3
+ {
+ \prop_get:NnNTF \c__ctex_font_size_prop {#2} \l__ctex_font_size_tl
+ { \exp_after:wN \__ctex_set_font_size:nnNn \l__ctex_font_size_tl #1 {#3} }
+ { \msg_error:nnn { ctex } { fontsize } {#2} }
+ }
+\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
+ \ctex_file_input:n { ctex-c5size.clo }
+\or:
+ \ctex_file_input:n { ctex-cs4size.clo }
+\fi:
+\fp_compare:nNnF { \l__ctex_line_spread_fp } ? { \c_zero_fp }
+ {
+ \linespread { \fp_use:N \l__ctex_line_spread_fp }
+ \group_begin: \footnotesize \exp_args:NNNo \group_end:
+ \dim_set:Nn \footnotesep { \dim_use:N \box_ht:N \strutbox }
+ }
+\normalsize
+\NewDocumentCommand \CTeX { }
+ { \ifincsname CTeX \else: C \TeX \fi: }
+\AtBeginDocument
+ {
+ \cs_if_exist_use:NT \pdfstringdefDisableCommands
+ { { \tl_set:Nn \CTeX { CTeX } } }
+ }
+\keys_define:nn { ctex }
+ {
+ captiondelimiter .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { You~can~load~the~package~`caption'~to~get~its~functionality. }
+ }
+ }
+\group_begin:
+\char_set_catcode_other:N \#
+\use:n
+ {
+ \group_end:
+ \ExplSyntaxOff
+ \ctex_at_end_package:nn { breqn }
+ {
+ \ctex_patch_cmd:NnnTF \end { \csname end#1 \endcsname }
+ {
+ \csuse { @end@#1@hook }
+ \csname end#1 \endcsname
+ } { }
+ {
+ \ctex_preto_cmd:NnTF \end { \csuse { @end@#1@hook } }
+ { } { \ctex_patch_failure:N \end }
+ }
+ }
+ \ExplSyntaxOn
+ }
+\cs_new_protected_nopar:Npn \ctex_fontset_error:n #1
+ { \msg_critical:nnn { ctex } { fontset-unavailable } {#1} }
+\msg_new:nnn { ctex } { fontset-unavailable }
+ { CTeX~fontset~`#1'~is~unavailable~in~current~mode. }
+\cs_new_protected_nopar:Npn \ctex_load_fontset:
+ {
+ \tl_if_empty:NTF \g__ctex_fontset_tl
+ {
+ \ctex_detected_platform:
+ \ctex_file_input:n { ctex-fontset- \g__ctex_fontset_tl .def }
+ }
+ {
+ \file_if_exist:nTF { ctex-fontset- \g__ctex_fontset_tl .def }
+ { \ctex_file_input:n { ctex-fontset- \g__ctex_fontset_tl .def } }
+ {
+ \use:x
+ {
+ \ctex_detected_platform:
+ \msg_error:nnxx { ctex } { fontset-not-found }
+ { \g__ctex_fontset_tl } { \exp_not:N \g__ctex_fontset_tl }
+ }
+ \ctex_file_input:n { ctex-fontset- \g__ctex_fontset_tl .def }
+ }
+ }
+ }
+\@onlypreamble \ctex_load_fontset:
+\msg_new:nnnn { ctex } { fontset-not-found }
+ {
+ CTeX~fontset~`#1'~could~not~be~found.\\
+ Fontset~`#2'~will~be~used~instead.
+ }
+ { You~may~run~`mktexlsr'~firstly. }
+\keys_define:nn { ctex }
+ {
+ fontset .code:n =
+ {
+ \ctex_if_preamble:TF
+ {
+ \str_if_eq_x:nnTF {#1} { none }
+ { \msg_warning:nnn { ctex } { invalid-value } {#1} }
+ {
+ \str_if_eq:onTF { \g__ctex_fontset_tl } { none }
+ {
+ \tl_gset:Nx \g__ctex_fontset_tl {#1}
+ \ctex_load_fontset:
+ }
+ {
+ \msg_error:nnxx { ctex } { fontset-loaded }
+ { \g__ctex_fontset_tl } {#1}
+ }
+ }
+ }
+ { \msg_error:nn { ctex } { fontset-only-preamble } }
+ }
+ }
+\msg_new:nnnn { ctex } { fontset-loaded }
+ {
+ CTeX~fontset~`#1'~has~been~loaded.
+ \str_if_eq:nnF {#1} {#2} { \\ Fontset~`#2'~will~be~ignored. }
+ }
+ { Only~one~fontset~can~be~loaded~in~the~preamble. }
+\msg_new:nnn { ctex } { fontset-only-preamble }
+ {
+ The~ `fontset'~ option~ can~ be~ used~ only~ in~ preamble.
+ }
+\str_if_eq:onF { \g__ctex_fontset_tl } { none }
+ { \ctex_load_fontset: }
+\ctex_at_end:n { \ctex_file_input:n { ctex.cfg } }
+%%
+%% This package consists of the file ctex.dtx,
+%% and the derived files ctex.pdf,
+%% ctex.ins,
+%% ctex.sty,
+%% ctexcap.sty,
+%% ctexsize.sty,
+%% ctexart.cls,
+%% ctexbook.cls,
+%% ctexrep.cls,
+%% ctex-c5size.clo,
+%% ctex-cs4size.clo,
+%% ctex-article.def,
+%% ctex-book.def,
+%% ctex-report.def,
+%% ctex-scheme-plain.def,
+%% ctex-scheme-plain-article.def,
+%% ctex-scheme-plain-book.def,
+%% ctex-scheme-plain-report.def,
+%% ctex-scheme-chinese.def,
+%% ctex-scheme-chinese-article.def,
+%% ctex-scheme-chinese-book.def,
+%% ctex-scheme-chinese-report.def,
+%% ctex-name-gbk.cfg,
+%% ctex-name-utf8.cfg,
+%% ctex.cfg,
+%% ctexopts.cfg,
+%% ctex-engine-pdftex.def,
+%% ctex-engine-xetex.def,
+%% ctex-engine-luatex.def,
+%% c19rm.fd,
+%% c19sf.fd,
+%% c19tt.fd,
+%% c70rm.fd,
+%% c70sf.fd,
+%% c70tt.fd,
+%% ctex-fontset-windows.def,
+%% ctex-fontset-windowsnew.def,
+%% ctex-fontset-windowsold.def,
+%% ctex-fontset-adobe.def,
+%% ctex-fontset-fandol.def,
+%% ctex-fontset-mac.def,
+%% ctex-fontset-founder.def,
+%% ctex-fontset-ubuntu.def,
+%% ctexspa.def,
+%% ctexpunct.spa,
+%% ctexmakespa.tex,
+%% ctexspamacro.tex,
+%% zhadobefonts.tex,
+%% zhfandolfonts.tex,
+%% zhfounderfonts.tex,
+%% zhubuntufonts.tex,
+%% zhwindowsfonts.tex, and
+%% README.
+%%
+%% End of file `ctex.sty'.
diff --git a/Master/texmf-dist/tex/latex/ctex/ctexart.cls b/Master/texmf-dist/tex/latex/ctex/ctexart.cls
index c6bc963160c..31ce3f77e79 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctexart.cls
+++ b/Master/texmf-dist/tex/latex/ctex/ctexart.cls
@@ -1,29 +1,1236 @@
-% ctexart.cls
-
-\NeedsTeXFormat{LaTeX2e}[1995/12/01]
-\ProvidesClass{ctexart}
- [2014/06/09 v1.02d ctexart
- document class]
-
-\def\CTEX@classtoload{article}
-
-\input{ctex-common-opts.def}
-\input{ctex-caption-opts.def}
-\input{ctex-class-opts.def}
-
-\InputIfFileExists{ctexopts.cfg}{}{}
-
-\input{ctex-loadclass.def}
-
-\input{ctex-common.def}
-\input{ctex-caption.def}
-\input{ctex-class.def}
-\input{ctex-article.def}
-
-% ctex.cfg should be loaded very last
-\AtEndOfPackage{%
- \makeatletter
- \InputIfFileExists{ctex.cfg}{}{}
- \makeatother}
-
-\endinput
+%%
+%% This is file `ctexart.cls',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `class,article')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\NeedsTeXFormat{LaTeX2e}
+\RequirePackage{expl3}
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {Chinese adapter for class article (CTEX)}
+\ProvidesExplClass{ctexart}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+\RequirePackage { xparse , l3keys2e }
+\msg_new:nnnn { ctex } { l3-too-old }
+ { Support~package~`#1'~too~old. }
+ {
+ Please~update~an~up~to~date~version~of~the~bundles\\\\
+ `l3kernel'~and~`l3packages'\\\\
+ using~your~TeX~package~manager~or~from~CTAN.
+ }
+\@ifpackagelater { expl3 } { 2014/07/20 } { }
+ { \msg_error:nnn { ctex } { l3-too-old } { expl3 } }
+\@ifpackagelater { l3keys2e } { 2014/05/05 } { }
+ { \msg_error:nnn { ctex } { l3-too-old } { l3keys2e } }
+\RequirePackage { etoolbox , ifpdf , fix-cm , everysel }
+\tl_new:N \l__ctex_tmp_tl
+\int_new:N \l__ctex_tmp_int
+\dim_new:N \l__ctex_tmp_dim
+\box_new:N \l__ctex_tmp_box
+\msg_new:nnnn { ctex } { package-too-old }
+ { Support~package~`#1'~too~old. }
+ {
+ Please~update~an~up~to~date~version~of~the~package~`#1'\\
+ using~your~TeX~package~manager~or~from~CTAN.
+ }
+\cs_new_eq:NN \ctex_lua_now_x:n \luatex_directlua:D
+\ifpdf
+ \cs_new_eq:NN \ctex_if_pdfmode:TF \use_i:nn
+\else:
+ \cs_new_eq:NN \ctex_if_pdfmode:TF \use_ii:nn
+\fi:
+\prg_new_conditional:Npnn \ctex_if_preamble: { TF }
+ {
+ \if_meaning:w \@onlypreamble \@notprerr
+ \prg_return_false:
+ \else:
+ \prg_return_true:
+ \fi:
+ }
+\cs_new_protected:Npn \ctex_at_end_package:nn #1#2
+ {
+ \@ifpackageloaded { #1 }
+ { #2 }
+ { \ctex_add_hook:cn { g__ctex_at_end_ #1 _hook_tl } { #2 } }
+ }
+\cs_new_protected:Npn \ctex_add_hook:Nn #1#2
+ {
+ \tl_if_exist:NF #1 { \tl_new:N #1 }
+ \tl_gput_right:Nn #1 { #2 }
+ }
+\cs_generate_variant:Nn \ctex_add_hook:Nn { c }
+\cs_new_protected_nopar:Npn \ctex_package_end_hook:n #1
+ {
+ \cs_if_exist_use:cT { g__ctex_at_end_ #1 _hook_tl }
+ { \cs_undefine:c { g__ctex_at_end_ #1 _hook_tl } }
+ }
+\cs_generate_variant:Nn \ctex_package_end_hook:n { o }
+\tl_put_left:Nn \@popfilename
+ { \ctex_package_end_hook:o { \@currname } }
+\cs_new_protected:Npn \ctex_file_wrapper:nnn #1#2#3
+ {
+ \use:x
+ {
+ \ExplSyntaxOff
+ \char_set_catcode_letter:n { 64 }
+ #1
+ \exp_not:n {#2}
+ \bool_if:NTF \l__kernel_expl_bool
+ { \ExplSyntaxOn }
+ { \ExplSyntaxOff }
+ \char_set_catcode:nn { 64 } { \char_value_catcode:n { 64 } }
+ #3
+ }
+ }
+\cs_new_protected_nopar:Npn \ctex_file_input:n #1
+ { \ctex_file_wrapper:nnn { } { \file_input:n {#1} } { } }
+\cs_new_protected_nopar:Npn \ctex_scheme_input:n #1
+ {
+ \ctex_file_wrapper:nnn
+ { }
+ {
+ \tl_if_exist:NTF \c__ctex_class_tl
+ {
+ \file_if_exist_input:nF { ctex-scheme- #1 - \c__ctex_class_tl .def }
+ { \file_input:n { ctex-scheme- #1 .def } }
+ }
+ { \file_input:n { ctex-scheme- #1 .def } }
+ }
+ { }
+ }
+\cs_generate_variant:Nn \ctex_scheme_input:n { o }
+\cs_new_protected:Npn \ctex_parse_name:NN #1#2
+ { \ctex_parse_name:NNx #1#2 { \cs_to_str:N #2 } }
+\group_begin:
+\char_set_lccode:nn { `\< } { `\{ }
+\char_set_lccode:nn { `\/ } { `\\ }
+\char_set_lccode:nn { `\A } { `\t }
+\tl_map_function:nN { \A \E \S \O \P } \char_set_catcode_other:N
+\tex_lowercase:D
+ {
+ \group_end:
+ \cs_new_protected:Npn \ctex_parse_name:NNn #1#2#3
+ {
+ \bool_if:nTF { \cs_if_exist_p:c { #3 ~ } || \cs_if_exist_p:c { /#3 } }
+ {
+ \group_begin:
+ \use:x
+ {
+ \__ctex_parse_name:nNNNnN { \token_get_replacement_spec:N #2 }
+ \exp_not:N #2 \exp_not:c { #3 ~ } \exp_not:c { /#3 } {#3}
+ } #1
+ }
+ { #1#2 }
+ }
+ \cs_new_protected:Npn \__ctex_parse_name:nNNNnN #1#2#3#4#5#6
+ {
+ \group_end:
+ \exp_args:Nc #6
+ {
+ \str_case:nnTF {#1}
+ {
+ { \protect #3 } { }
+ { \x@protect #2 \protect #3 } { }
+ }
+ {
+ \str_if_eq_x:nnTF { \exp_not:n { /@protected@ #3 /#3 } }
+ {
+ \exp_last_unbraced:Nf \__ctex_parse_name:w
+ \token_get_replacement_spec:N #3 AESAOPA ~ < \q_stop
+ }
+ { /#5 ~ } { #5 ~ }
+ }
+ {
+ \str_case:onTF { \__ctex_parse_name:w #1 AESAOPA ~ < \q_stop }
+ {
+ { /@protected@ #2 #4 } { }
+ { /@ #4 } { }
+ }
+ { /#5 } {#5}
+ }
+ }
+ }
+ \cs_new:Npn \__ctex_parse_name:w #1 AESAOPA ~ #2 < #3 \q_stop { #1#2 }
+ }
+\cs_generate_variant:Nn \ctex_parse_name:NNn { NNx }
+\cs_new_protected:Npn \ctex_patch_cmd:NnnTF { \ctex_parse_name:NN \patchcmd }
+\cs_new_protected:Npn \ctex_preto_cmd:NnTF { \ctex_parse_name:NN \pretocmd }
+\cs_new_protected:Npn \ctex_appto_cmd:NnTF { \ctex_parse_name:NN \apptocmd }
+\cs_new_protected:Npn \ctex_patch_cmd:Nnn
+ {
+ \group_begin:
+ \char_set_catcode_other:N \#
+ \__ctex_patch_cmd:Nnn
+ }
+\cs_new_protected:Npn \__ctex_patch_cmd:Nnn #1#2#3
+ {
+ \group_end:
+ \group_begin:
+ \ExplSyntaxOff
+ \ctex_patch_cmd:NnnTF #1 {#2} {#3}
+ {
+ \cs_gset_eq:NN \__ctex_tmp:w #1
+ \group_end:
+ \cs_set_eq:NN #1 \__ctex_tmp:w
+ \cs_undefine:N \__ctex_tmp:w
+ }
+ { \group_end: \ctex_patch_failure:N #1 }
+ }
+\cs_new_protected:Npn \ctex_patch_failure:N #1
+ { \msg_warning:nnx { ctex } { patch-failure } { \token_to_str:N #1 } }
+\msg_new:nnn { ctex } { patch-failure }
+ {
+ Patching~command~`#1'~failed.\\
+ ctex~may~not~work~as~expected.
+ }
+\cs_new:Npn \ctex_set_default_ccwd:Nn #1#2
+ {
+ \dim_compare:nNnTF
+ { \ctex_default_pt:n {#2} } = { \ctex_default_pt:n { #2 ~ mm } }
+ { \tl_set:Nn #1 {#2} }
+ { \tl_set:Nn #1 { #2 \ccwd } }
+ }
+\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
+ }
+\group_begin:
+ \char_set_catcode_other:N \P
+ \char_set_catcode_other:N \T
+\tex_lowercase:D
+ {
+ \group_end:
+ \cs_new:Npn \__ctex_default_pt:w #1 PT #2 \q_stop { #1 PT }
+ }
+\tl_new:N \l__ctex_encoding_tl
+\tl_set:Nx \l__ctex_encoding_tl
+ { \pdftex_if_engine:TF { GBK } { UTF8 } }
+\cs_new_eq:NN \g__ctex_section_depth_flag \c_two
+\bool_new:N \g__ctex_zhmCJK_bool
+\tl_new:N \l__ctex_autoindent_tl
+\cs_new_eq:NN \ctex_if_autoindent_touched:F \use:n
+\cs_new_eq:NN \ctex_zhmap_case:nnn \use_ii:nnn
+\cs_new_protected_nopar:Npn \ctex_at_end:n { \AtEndOfClass }
+\clist_new:N \g__ctex_std_options_clist
+\msg_new:nnn { ctex } { invalid-option }
+ { Option~`\l_keys_key_tl'~is~invalid~in~current~mode. }
+\msg_new:nnn { ctex } { invalid-value }
+ { Value~`#1'~is~invalid~for~the~key~`\l_keys_key_tl'. }
+\msg_new:nnn { ctex } { deprecated-option }
+ { Option~ `\l_keys_key_tl'~ is~ deprecated.\\ #1 }
+\msg_new:nnn { ctex } { deprecated-command }
+ { Command~ #1 is~ deprecated.\\ #2 }
+\msg_new:nnn { ctex } { deprecated-environment }
+ { Environment~ `#1'~ is~ deprecated.\\ #2 }
+\cs_new_eq:NN \g__ctex_font_size_flag \c_minus_one
+\keys_define:nn { ctex / option }
+ {
+ zihao .choice: ,
+ zihao .default:n = { 5 } ,
+ 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 } ,
+ c5size .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { Option~ `zihao=5'~ is~ set. }
+ \keys_set:nn { ctex / option } { zihao = 5 }
+ } ,
+ cs4size .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { Option~ `zihao=-4'~ is~ set. }
+ \keys_set:nn { ctex / option } { zihao = -4 }
+ } ,
+ c5size .value_forbidden: ,
+ cs4size .value_forbidden: ,
+ linespread .fp_set:N = \l__ctex_line_spread_fp ,
+ linespread .initial:n = { \c_nan_fp } ,
+ linespread .value_required: ,
+ autoindent .choice: ,
+ autoindent .default:n = { true } ,
+ autoindent / true .code:n =
+ {
+ \tl_set:Nn \l__ctex_autoindent_tl { 2 \ccwd }
+ \cs_set_eq:NN \ctex_if_autoindent_touched:F \use_none:n
+ } ,
+ autoindent / false .code:n =
+ {
+ \tl_clear:N \l__ctex_autoindent_tl
+ \cs_set_eq:NN \ctex_if_autoindent_touched:F \use_none:n
+ } ,
+ autoindent / unknown .code:n =
+ {
+ \ctex_set_default_ccwd:Nn \l__ctex_autoindent_tl {#1}
+ \cs_set_eq:NN \ctex_if_autoindent_touched:F \use_none:n
+ } ,
+ indent .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ {
+ The~ indentfirst~ package~ will~ be~ loaded~ but~ the~
+ functionality~ may~ be~ removed~ in~ later~ version.
+ It's~ better~ to~ set~ the~ heading~ styles~ via~ beforeskip~
+ options.~
+ }
+ \keys_set:nn { ctex / option } { autoindent = true }
+ } ,
+ indent .value_forbidden: ,
+ noindent .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ {
+ The~ functionality~ has~ been~ removed.~
+ It's~ better~ to~ set~ the~ heading~ styles~ via~ beforeskip~
+ options.
+ }
+ \keys_set:nn { ctex / option } { autoindent = false }
+ } ,
+ noindent .value_forbidden: ,
+ GBK .code:n = { \tl_set:Nn \l__ctex_encoding_tl { GBK } } ,
+ UTF8 .code:n = { \tl_set:Nn \l__ctex_encoding_tl { UTF8 } } ,
+ GBK .value_forbidden: ,
+ UTF8 .value_forbidden: ,
+ fontset .tl_gset:N = \g__ctex_fontset_tl ,
+ nofonts .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ {
+ Option~ `fontset=none'~ is~ set.~ It~ is~ better~ to~ use~
+ fontset~ option.
+ }
+ \keys_set:nn { ctex / option } { fontset = none }
+ } ,
+ adobefonts .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ {
+ Option~ `fontset=adobe'~ is~ set.~ It~ is~ better~ to~ use~
+ fontset~ option.
+ }
+ \keys_set:nn { ctex / option } { fontset = none }
+ } ,
+ winfonts .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ {
+ Option~ `fontset=windows'~ is~ set.~ It~ is~ better~ to~ use~
+ fontset~ option.
+ }
+ \keys_set:nn { ctex / option } { fontset = none }
+ } ,
+ nofonts .value_forbidden: ,
+ winfonts .value_forbidden: ,
+ adobefonts .value_forbidden: ,
+ zhmap .choice: ,
+ zhmap .default:n = { true } ,
+ zhmap / zhmCJK .code:n =
+ {
+ \bool_gset_true:N \g__ctex_zhmCJK_bool
+ \cs_gset_eq:NN \ctex_zhmap_case:nnn \use_i:nnn
+ } ,
+ zhmap / true .code:n =
+ {
+ \bool_gset_false:N \g__ctex_zhmCJK_bool
+ \cs_gset_eq:NN \ctex_zhmap_case:nnn \use_ii:nnn
+ } ,
+ zhmap / false .code:n =
+ {
+ \bool_gset_false:N \g__ctex_zhmCJK_bool
+ \cs_gset_eq:NN \ctex_zhmap_case:nnn \use_iii:nnn
+ } ,
+ nozhmap .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { Option~ `zhmap=false'~ is~ set. }
+ \keys_set:nn { ctex / option } { zhmap = false }
+ } ,
+ nozhmap .value_forbidden: ,
+ punct .tl_set:N = \l__ctex_punct_tl ,
+ punct .default:n = { quanjiao } ,
+ punct .initial:n = { quanjiao } ,
+ nopunct .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { Option~ `punct=plain'~ is~ set. }
+ \keys_set:nn { ctex / option } { punct = plain }
+ } ,
+ nopunct .value_forbidden: ,
+ space .choices:nn =
+ { true , auto , false }
+ {
+ \exp_args:Nx \ctex_at_end:n
+ { \keys_set:nn { ctex } { space = \l_keys_choice_tl } }
+ } ,
+ space .default:n = { true } ,
+ nospace .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { Option~ `space=false'~ is~ set. }
+ \keys_set:nn { ctex / option } { space = false }
+ } ,
+ nospace .value_forbidden: ,
+ heading .bool_set:N = \l__ctex_heading_bool ,
+ scheme .tl_set:N = \l__ctex_scheme_tl ,
+ scheme .default:n = { chinese },
+ scheme .initial:n = { chinese },
+ cap .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { Option~ `scheme = chinese' ~ is~ set. }
+ \keys_set:nn { ctex / option } { scheme = chinese }
+ } ,
+ nocap .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { Option~ `scheme = plain' ~ is~ set. }
+ \keys_set:nn { ctex / option } { scheme = plain }
+ } ,
+ cap .value_forbidden: ,
+ nocap .value_forbidden: ,
+ sub3section .code:n =
+ { \cs_gset_eq:NN \g__ctex_section_depth_flag \c_three } ,
+ sub4section .code:n =
+ { \cs_gset_eq:NN \g__ctex_section_depth_flag \c_four } ,
+ sub3section .value_forbidden: ,
+ sub4section .value_forbidden: ,
+ fntef .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { `(xe)CJKfntef'~ package~ is~ always~ loaded. }
+ } ,
+ fancyhdr .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { `fancyhdr'~ package~ is~ loaded. }
+ \RequirePackage{ fancyhdr }
+ } ,
+ hyperref .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { `hyperref'~ package~ will~ be~ loaded. }
+ \AtEndPreamble { \RequirePackage { hyperref } }
+ } ,
+ }
+\tl_clear:N \l__ctex_tmp_tl
+\clist_map_inline:nn
+ {
+ 10pt , 11pt , 12pt ,
+ 8pt , 9pt , 14pt , 17pt , 20pt , 25pt , 30pt , 36pt , 48pt , 60pt
+ }
+ {
+ \tl_put_right:Nn \l__ctex_tmp_tl
+ {
+ #1 .code:n =
+ {
+ \cs_gset_eq:NN \g__ctex_font_size_flag \c_minus_one
+ \clist_gput_right:Nn \g__ctex_std_options_clist {#1}
+ } ,
+ #1 .value_forbidden: ,
+ }
+ }
+\use:x { \keys_define:nn { ctex / option } { \exp_not:o { \l__ctex_tmp_tl } } }
+\tl_clear:N \l__ctex_tmp_tl
+\keys_define:nn { ctex / option }
+ {
+ unknown .code:n =
+ { \clist_gput_right:No \g__ctex_std_options_clist { \CurrentOption } }
+ }
+\ctex_file_input:n { ctexopts.cfg }
+\ProcessKeysOptions { ctex / option }
+\if_case:w \g__ctex_font_size_flag
+ \clist_gput_right:Nn \g__ctex_std_options_clist { 10pt }
+\or:
+ \clist_gput_right:Nn \g__ctex_std_options_clist { 12pt }
+\fi:
+\tl_const:Nn \c__ctex_class_tl { article }
+\PassOptionsToClass { \g__ctex_std_options_clist } { article }
+\LoadClass { article }
+\tl_set_eq:Nc \l__ctex_tmp_tl { ver@ \@currname . \@currext }
+\cs_new_eq:cN { ver@ctex. \@pkgextension } \l__ctex_tmp_tl
+\cs_new_eq:cN { ver@ctexcap. \@pkgextension } \l__ctex_tmp_tl
+\cs_new_eq:cN { ver@ctexsize. \@pkgextension } \l__ctex_tmp_tl
+\NewDocumentCommand \ctexset { +m }
+ { \keys_set:nn { ctex } {#1} }
+\NewDocumentCommand \CTEXsetup { +o > { \TrimSpaces } m }
+ {
+ \msg_warning:nnnn { ctex } { deprecated-command } { \CTEXsetup }
+ { \ctexset~ {~ #2~ =~ {~ #1~ }~ }~ is~ set. }
+ \IfNoValueF {#1} { \keys_set:nn { ctex / #2 } {#1} }
+ }
+\NewDocumentCommand \CTEXoptions { +o }
+ {
+ \msg_warning:nnnn { ctex } { deprecated-command } { \CTEXoptions }
+ { \ctexset~ {~ #1~ }~ is~ set. }
+ \IfNoValueF {#1} { \keys_set:nn { ctex } {#1} }
+ }
+\@ifpackageloaded { hyperref }
+ {
+ \cs_new_protected_nopar:Npn \ctex_hypersetup:n #1
+ { \hypersetup {#1} }
+ }
+ {
+ \cs_new_protected_nopar:Npn \ctex_hypersetup:n #1
+ { \PassOptionsToPackage {#1} { hyperref } }
+ }
+\ctex_hypersetup:n { colorlinks = true }
+\pdftex_if_engine:TF
+ {
+ \tl_set:Nx \l__ctex_encoding_tl { \l__ctex_encoding_tl }
+ \ctex_file_input:n { ctex-engine-pdftex.def }
+ }
+ {
+ \tl_set:Nn \l__ctex_encoding_tl { UTF8 }
+ \xetex_if_engine:TF
+ { \ctex_file_input:n { ctex-engine-xetex.def } }
+ { \ctex_file_input:n { ctex-engine-luatex.def } }
+ }
+\keys_define:nn { ctex }
+ {
+ autoindent .choice: ,
+ autoindent .default:n = { true } ,
+ autoindent / true .code:n =
+ {
+ \tl_set:Nn \l__ctex_autoindent_tl { 2 \ccwd }
+ \ctex_select_size:
+ } ,
+ autoindent / false .code:n =
+ { \tl_clear:N \l__ctex_autoindent_tl } ,
+ autoindent / unknown .code:n =
+ {
+ \ctex_set_default_ccwd:Nn \l__ctex_autoindent_tl {#1}
+ \ctex_select_size:
+ }
+ }
+\NewDocumentCommand \CTEXsetfont { } { \ctex_select_size: }
+\cs_new_protected_nopar:Npn \ctex_select_size:
+ { \cs_if_free:NTF \size@update { \ctex_update_size: } { \selectfont } }
+\cs_new_protected_nopar:Npn \ctex_update_size:
+ {
+ \tl_if_eq:NNTF \l__ctex_ziju_tl \c__ctex_zero_tl
+ {
+ \ctex_update_stretch:
+ \ctex_update_parindent:
+ }
+ { \ctex_update_ziju: }
+ }
+\tl_const:Nx \c__ctex_zero_tl { \fp_use:N \c_zero_fp }
+\tl_new:N \l__ctex_ziju_tl
+\tl_set_eq:NN \l__ctex_ziju_tl \c__ctex_zero_tl
+\ctex_add_to_selectfont:n
+ { \cs_if_free:NF \size@update { \ctex_update_size: } }
+\keys_define:nn { ctex }
+ {
+ linestretch .code:n =
+ {
+ \ctex_set_default_ccwd:Nn \l__ctex_line_stretch_tl {#1}
+ \ctex_select_size:
+ } ,
+ linestretch .value_required:
+ }
+\tl_new:N \l__ctex_line_stretch_tl
+\tl_set:Nn \l__ctex_line_stretch_tl { \ccwd }
+\cs_new_protected_nopar:Npn \ctex_update_stretch:
+ {
+ \ctex_update_em_unit:
+ \dim_set:Nn \l__ctex_tmp_dim { \l__ctex_line_stretch_tl }
+ \dim_compare:nNnTF \l__ctex_tmp_dim = \c_max_dim
+ {
+ \ctex_if_ccglue_touched:TF
+ { \ctex_update_ccwd: }
+ {
+ \dim_set:Nn \l__ctex_tmp_dim
+ { \baselinestretch \etex_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:
+ }
+ }
+ {
+ \int_set:Nn \l__ctex_tmp_int
+ { \etex_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
+ {
+ \skip_set:Nn \l__ctex_ccglue_skip
+ {
+ \c_zero_dim plus \dim_eval:n
+ {
+ ( \linewidth - \ccwd - \l__ctex_tmp_int \ccwd ) /
+ \l__ctex_tmp_int
+ }
+ }
+ }
+ { \skip_zero:N \l__ctex_ccglue_skip }
+ \ctex_update_ccglue:
+ }
+ }
+\cs_new_protected_nopar:Npn \ctex_update_parindent:
+ {
+ \tl_if_empty:NF \l__ctex_autoindent_tl
+ {
+ \dim_compare:nNnF \parindent = \c_zero_dim
+ { \dim_set:Nn \parindent { \l__ctex_autoindent_tl } }
+ }
+ }
+\NewDocumentCommand \ziju { m }
+ { \exp_args:Nx \ctex_ziju:n {#1} \tex_ignorespaces:D }
+\cs_new_protected_nopar:Npn \ctex_ziju:n #1
+ {
+ \tl_set:Nx \l__ctex_ziju_tl { \fp_eval:n {#1} }
+ \ctex_select_size:
+ }
+\cs_new_protected_nopar:Npn \ctex_update_ziju:
+ {
+ \ctex_update_em_unit:
+ \dim_set:Nn \l__ctex_ziju_dim { \l__ctex_ziju_tl \ccwd }
+ \dim_add:Nn \ccwd { \l__ctex_ziju_dim }
+ \dim_compare:nNnTF \ccwd > \c_zero_dim
+ {
+ \dim_set:Nn \l__ctex_tmp_dim
+ { \linewidth - \ccwd + \l__ctex_ziju_dim }
+ \int_set:Nn \l__ctex_tmp_int { \l__ctex_tmp_dim }
+ \tex_divide:D \l__ctex_tmp_int \ccwd
+ \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 } }
+ }
+ \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 ) }
+ }
+ }
+ { \skip_set:Nn \l__ctex_ccglue_skip { \l__ctex_ziju_dim } }
+ \ctex_update_ccglue:
+ \ctex_update_parindent:
+ }
+\dim_new:N \l__ctex_ziju_dim
+\NewDocumentCommand \CTEXindent { }
+ {
+ \msg_warning:nnnn { ctex } { deprecated-command } { \CTEXindent }
+ { \parindent is~ set~ to~ 2\ccwd. }
+ \ctex_update_ccwd: \dim_set:Nn \parindent { 2 \ccwd }
+ }
+\NewDocumentCommand \CTEXnoindent { }
+ {
+ \msg_warning:nnnn { ctex } { deprecated-command } { \CTEXnoindent }
+ { \parindent is~ set~ to~ 0pt. }
+ \dim_zero:N \parindent
+ }
+\bool_if:NT \l__ctex_indent_bool
+ { \RequirePackage { indentfirst } }
+\PassOptionsToPackage { encoding = \l__ctex_encoding_tl } { zhnumber }
+\RequirePackage { zhnumber }
+\cs_new_eq:NN \chinese \zhnum
+\cs_new_eq:NN \Chinese \chinese
+\cs_new_eq:NN \CTEXcounter \use_none:n
+\NewDocumentCommand \CTEXnumber { m m }
+ { \protected@edef #1 { \zhnumber {#2} } }
+\NewDocumentCommand \CTEXdigits { m m }
+ { \protected@edef #1 { \zhdigits {#2} } }
+\cs_set_eq:NN \CTEX@todayold \today
+\keys_define:nn { ctex }
+ {
+ today .choice: ,
+ today / old .code:n =
+ { \cs_set_eq:NN \today \CTEX@todayold } ,
+ today / small .code:n =
+ {
+ \cs_set_eq:NN \today \zhtoday
+ \zhnumsetup { time = Arabic }
+ } ,
+ today / big .code:n =
+ {
+ \cs_set_eq:NN \today \zhtoday
+ \zhnumsetup { time = Chinese }
+ } ,
+ today / unknown .code:n =
+ { \msg_error:nnx { ctex } { today-undef } {#1} }
+ }
+\msg_new:nnnn { ctex } { today-undef }
+ { Today~format~`#1'~is~undefined. }
+ { Available~today~formats~are~`old',~`small',~and~`big'. }
+\keys_define:nn { ctex }
+ {
+ contentsname .tl_set:N = \contentsname ,
+ listfigurename .tl_set:N = \listfigurename ,
+ listtablename .tl_set:N = \listtablename ,
+ figurename .tl_set:N = \figurename ,
+ tablename .tl_set:N = \tablename ,
+ abstractname .tl_set:N = \abstractname ,
+ indexname .tl_set:N = \indexname ,
+ appendixname .tl_set:N = \appendixname ,
+ bibname .tl_set:N = \refname
+ }
+\seq_new:N \c__ctex_headings_seq
+\seq_gset_from_clist:Nn \c__ctex_headings_seq
+ {
+ part , section , subsection , subsubsection ,
+ paragraph , subparagraph
+ }
+\cs_new_protected_nopar:Npn \__ctex_initial_heading:n #1
+ {
+ \tl_new:c { CTEX@pre#1 }
+ \tl_new:c { CTEX@post#1 }
+ \tl_const:cx { CTEXthe#1 }
+ {
+ \exp_not:c { CTEX@pre#1 }
+ \exp_not:c { CTEX@the#1 }
+ \exp_not:c { CTEX@post#1 }
+ }
+ \tl_const:cx { CTEX@#1name }
+ {
+ \exp_not:c { CTEX@#1@nameformat }
+ \exp_not:c { CTEX@pre#1 }
+ \exp_not:N \tl_if_empty:NTF \exp_not:c { CTEX@#1@numberformat }
+ { \exp_not:c { CTEX@the#1 } }
+ {
+ \group_begin:
+ \exp_not:c { CTEX@#1@numberformat }
+ \exp_not:c { CTEX@the#1 }
+ \group_end:
+ }
+ \exp_not:c { CTEX@post#1 }
+ \exp_not:c { CTEX@#1@aftername }
+ }
+ }
+\cs_new_protected_nopar:Npn \__ctex_def_heading_keys:n #1
+ {
+ \tl_put_right:Nx \l__ctex_tmp_tl
+ {
+ #1 .meta:nn = { ctex / #1 } { ####1 } ,
+ #1 / name .code:n =
+ { \ctex_assign_heading_name:nn {#1} { ####1 } } ,
+ #1 / number .tl_set:N = \exp_not:c { CTEX@the#1 } ,
+ #1 / format .tl_set:N = \exp_not:c { CTEX@#1@format } ,
+ #1 / nameformat .tl_set:N = \exp_not:c { CTEX@#1@nameformat } ,
+ #1 / numberformat .tl_set:N = \exp_not:c { CTEX@#1@numberformat } ,
+ #1 / aftername .tl_set:N = \exp_not:c { CTEX@#1@aftername } ,
+ #1 / titleformat .tl_set:N = \exp_not:c { CTEX@#1@titleformat } ,
+ #1 / beforeskip .tl_set:N = \exp_not:c { CTEX@#1@beforeskip } ,
+ #1 / afterskip .tl_set:N = \exp_not:c { CTEX@#1@afterskip} ,
+ #1 / indent .tl_set:N = \exp_not:c { CTEX@#1@indent } ,
+ #1 / format+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@format } { ####1 } } ,
+ #1 / nameformat+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@nameformat } { ####1 } } ,
+ #1 / numberformat+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@numberformat } { ####1 } } ,
+ #1 / aftername+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftername } { ####1 } } ,
+ #1 / titleformat+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@titleformat } { ####1 } } ,
+ #1 / beforeskip .initial:n = \c_zero_skip ,
+ #1 / afterskip .initial:n = \c_zero_skip ,
+ #1 / indent .initial:n = \c_zero_dim ,
+ #1 / beforeskip .value_required: ,
+ #1 / afterskip .value_required: ,
+ #1 / indent .value_required: ,
+ }
+ }
+\NewDocumentCommand \ctex_assign_heading_name:nn
+ { m > { \SplitArgument { \c_one } { , } } +m }
+ { \__ctex_assign_heading_name:nnn {#1} #2 }
+\cs_new_protected:Npn \__ctex_assign_heading_name:nnn #1#2#3
+ {
+ \tl_set:cn { CTEX@pre#1 } {#2}
+ \IfNoValueTF {#3}
+ { \tl_clear:c { CTEX@post#1 } }
+ { \tl_set:cn { CTEX@post#1 } {#3} }
+ }
+\tl_clear:N \l__ctex_tmp_tl
+\seq_map_inline:Nn \c__ctex_headings_seq
+ {
+ \__ctex_initial_heading:n {#1}
+ \__ctex_def_heading_keys:n {#1}
+ }
+\use:x { \keys_define:nn { ctex } { \exp_not:o { \l__ctex_tmp_tl } } }
+\tl_clear:N \l__ctex_tmp_tl
+\renewcommand\part{%
+ \if@noskipsec \leavevmode \fi
+ \par
+ \@tempskipa \CTEX@part@beforeskip \relax
+ \ifdim \@tempskipa <\z@
+ \@tempskipa -\@tempskipa \@afterindentfalse
+ \else
+ \@afterindenttrue
+ \fi
+ \addvspace{\@tempskipa}%
+ \secdef\@part\@spart}
+\def\@part[#1]#2{%
+ \ifnum \c@secnumdepth >\m@ne
+ \refstepcounter{part}%
+ \addcontentsline{toc}{part}{\CTEXthepart\hspace{1em}#1}%
+ \else
+ \addcontentsline{toc}{part}{#1}%
+ \fi
+ {\interlinepenalty \@M
+ \normalfont \parindent \CTEX@part@indent \CTEX@part@format
+ \ifnum \c@secnumdepth >\m@ne
+ \CTEX@partname
+ \fi
+ \CTEX@part@titleformat{#2}%
+ \markboth{}{}\par}%
+ \nobreak
+ \vskip \CTEX@part@afterskip
+ \@afterheading}
+\def\@spart#1{%
+ {\interlinepenalty \@M
+ \normalfont \parindent \CTEX@part@indent \CTEX@part@format
+ \CTEX@part@titleformat{#1}\par}%
+ \nobreak
+ \vskip \CTEX@part@afterskip
+ \@afterheading}
+\def\@seccntformat#1{%
+ \@ifundefined{CTEX@#1name}%
+ {\csname the#1\endcsname\quad}%
+ {\csname CTEX@#1name\endcsname}}
+\def\@sect#1#2#3#4#5#6[#7]#8{%
+ \ifnum #2>\c@secnumdepth
+ \let\@svsec\@empty
+ \else
+ \refstepcounter{#1}%
+ \protected@edef\@svsec{\@seccntformat{#1}\relax}%
+ \fi
+ \@tempskipa #5\relax
+ \ifdim \@tempskipa>\z@
+ \begingroup
+ #6{%
+ \@hangfrom{\hskip #3\relax\@svsec}%
+ \interlinepenalty \@M
+ \csname CTEX@#1@titleformat\endcsname{#8}\@@par}%
+ \endgroup
+ \csname #1mark\endcsname{#7}%
+ \addcontentsline{toc}{#1}{%
+ \ifnum #2>\c@secnumdepth \else
+ \protect\numberline{\@ifundefined{CTEXthe#1}%
+ {\csname the#1\endcsname}%
+ {\csname CTEXthe#1\endcsname}}%
+ \fi
+ #7}%
+ \else
+ \def\@svsechd{%
+ #6{\hskip #3\relax
+ \@svsec \csname CTEX@#1@titleformat\endcsname{#8}}%
+ \csname #1mark\endcsname{#7}%
+ \addcontentsline{toc}{#1}{%
+ \ifnum #2>\c@secnumdepth \else
+ \protect\numberline{\@ifundefined{CTEXthe#1}%
+ {\csname the#1\endcsname}%
+ {\csname CTEXthe#1\endcsname}}%
+ \fi
+ #7}}%
+ \fi
+ \@xsect{#5}}
+\def\@ssect#1#2#3#4#5{%
+ \@tempskipa #3\relax
+ \ifdim \@tempskipa>\z@
+ \begingroup
+ #4{%
+ \@hangfrom{\hskip #1}%
+ \interlinepenalty \@M
+ \CTEX@titleformat@n{#5}\@@par}%
+ \endgroup
+ \else
+ \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}}}%
+ \fi
+ \@xsect{#3}}
+\cs_new_protected_nopar:Npn \CTEX@set@titleformat@n #1
+ { \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat } }
+\cs_new_eq:NN \CTEX@titleformat@n \use:n
+\int_zero:N \l__ctex_tmp_int
+\clist_map_inline:nn
+ { section , subsection , subsubsection , paragraph , subparagraph }
+ {
+ \int_incr:N \l__ctex_tmp_int
+ \cs_gset_protected_nopar:cpx {#1}
+ {
+ \exp_not:N \@startsection {#1}
+ { \int_use:N \l__ctex_tmp_int }
+ { \exp_not:c { CTEX@#1@indent } }
+ { \exp_not:c { CTEX@#1@beforeskip } }
+ { \exp_not:c { CTEX@#1@afterskip } }
+ {
+ \CTEX@set@titleformat@n {#1}
+ \exp_not:N \normalfont \exp_not:c { CTEX@#1@format }
+ }
+ }
+ }
+\tl_new:N \CTEX@preappendix
+\tl_new:N \CTEX@postappendix
+\keys_define:nn { ctex }
+ { appendix .meta:nn = { ctex / appendix } {#1} }
+\keys_define:nn { ctex / appendix }
+ {
+ name .code:n = { \ctex_assign_heading_name:nn { appendix } {#1} } ,
+ number .tl_set:N = \CTEX@appendixnumber
+ }
+\cs_new_eq:NN \CTEX@save@appendix \appendix
+\cs_gset_protected_nopar:Npn \appendix
+ {
+ \CTEX@save@appendix
+ \gdef \CTEX@presection { \CTEX@preappendix }
+ \gdef \CTEX@thesection { \CTEX@appendixnumber }
+ \gdef \CTEX@postsection { \CTEX@postappendix }
+ }
+\cs_new_protected:Npn \CTEX@toc@width@n #1
+ {
+ \hbox_set:Nn \l__ctex_tmp_box {#1}
+ \dim_set:Nn \@tempdima
+ {
+ \dim_max:nn { \@tempdima }
+ { \box_wd:N \l__ctex_tmp_box + \f@size \p@ / \c_two }
+ }
+ }
+\group_begin:
+\char_set_catcode_other:N \#
+\use:n
+ {
+ \group_end:
+ \ExplSyntaxOff
+ \ctex_preto_cmd:NnTF \numberline { \CTEX@toc@width@n {#1} } { }
+ { \ctex_patch_failure:N \numberline }
+ \@ifpackageloaded { tocloft }
+ { }
+ {
+ \ctex_at_end_package:nn { tocloft }
+ {
+ \ctex_preto_cmd:NnTF \numberline { \CTEX@toc@width@n {#1} } { }
+ { \ctex_patch_failure:N \numberline }
+ }
+ }
+ \ExplSyntaxOn
+ }
+\ctex_patch_cmd:Nnn \ps@headings { \thesection } { \CTEXthesection }
+\if@twoside
+ \ctex_patch_cmd:Nnn \ps@headings { \thesubsection } { \CTEXthesubsection }
+\fi:
+\ctex_at_end_package:nn { fancyhdr }
+ {
+ \ctex_patch_cmd:Nnn \ps@fancy
+ { \thesection \hskip 1em \relax } { \CTEXthesection \quad }
+ \ctex_patch_cmd:Nnn \ps@fancy
+ { \thesubsection \hskip 1em \relax } { \CTEXthesubsection \quad }
+ }
+\cs_new_protected_nopar:Npn \CTEX@setcurrentlabel@n #1
+ {
+ \protected@edef \@currentlabel
+ {
+ \cs_if_exist:cTF { CTEX@the#1 }
+ { \exp_args:cc { p@#1 } { CTEX@the#1 } }
+ { \exp_not:o { \@currentlabel } }
+ }
+ }
+\cs_new_protected_nopar:Npn \ctex_varioref_hook:
+ {
+ \seq_map_inline:Nn \c__ctex_headings_seq
+ { \ctex_fix_varioref_label:n { ##1 } }
+ }
+\cs_new_protected_nopar:Npn \ctex_fix_varioref_label:n #1
+ {
+ \tl_if_empty:cT { p@#1 }
+ { \exp_args:Nno \labelformat {#1} { \cs:w CTEX@the#1 \cs_end: } }
+ }
+\@ifpackageloaded { varioref }
+ { \ctex_varioref_hook: }
+ {
+ \cs_new_eq:NN \CTEX@save@refstepcounter \refstepcounter
+ \RenewDocumentCommand \refstepcounter { m }
+ {
+ \CTEX@save@refstepcounter {#1}
+ \CTEX@setcurrentlabel@n {#1}
+ }
+ \ctex_at_end_package:nn { varioref } { \ctex_varioref_hook: }
+ }
+\ctex_scheme_input:o { \l__ctex_scheme_tl }
+\NewDocumentCommand \zihao { m }
+ { \exp_args:Nx \ctex_zihao:n {#1} \tex_ignorespaces:D }
+\cs_new_protected_nopar:Npn \ctex_zihao:n #1
+ {
+ \prop_get:NnNTF \c__ctex_font_size_prop {#1} \l__ctex_font_size_tl
+ { \exp_after:wN \fontsize \l__ctex_font_size_tl \selectfont }
+ { \msg_error:nnn { ctex } { fontsize } {#1} }
+ }
+\msg_new:nnnn { ctex } { fontsize }
+ { Undefined~Chinese~font~size~`#1'~in~command~\token_to_str:N \zihao.}
+ {
+ The~old~font~size~is~used~if~you~continue.\\
+ The~available~font~sizes~are~listed~as~follow.\\
+ \seq_use:Nnnn \c__ctex_font_size_seq { ~and~ } { ,~ } { ,~and~ }.
+ }
+\prop_new:N \c__ctex_font_size_prop
+\seq_new:N \c__ctex_font_size_seq
+\cs_new_protected_nopar:Npn \__ctex_save_font_size:nn #1#2
+ {
+ \use:x
+ {
+ \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 } }
+ }
+ }
+ \seq_gput_right:Nn \c__ctex_font_size_seq {#1}
+ }
+\clist_map_inline:nn
+ {
+ { 8 } { 5 bp } ,
+ { 7 } { 5.5 bp } ,
+ { -6 } { 6.5 bp } ,
+ { 6 } { 7.5 bp } ,
+ { -5 } { 9 bp } ,
+ { 5 } { 10.5 bp } ,
+ { -4 } { 12 bp } ,
+ { 4 } { 14 bp } ,
+ { -3 } { 15 bp } ,
+ { 3 } { 16 bp } ,
+ { -2 } { 18 bp } ,
+ { 2 } { 22 bp } ,
+ { -1 } { 24 bp } ,
+ { 1 } { 26 bp } ,
+ { -0 } { 36 bp } ,
+ { 0 } { 42 bp }
+ }
+ { \__ctex_save_font_size:nn #1 }
+\cs_new_protected_nopar:Npn \ctex_declare_math_sizes:nnnn #1#2#3#4
+ {
+ \__ctex_get_font_sizes:Nn \l__ctex_font_size_tl { {#1} {#2} {#3} {#4} }
+ \exp_after:wN \DeclareMathSizes \l__ctex_font_size_tl
+ }
+\cs_new_protected_nopar:Npn \__ctex_get_font_sizes:Nn #1#2
+ {
+ \tl_clear:N #1
+ \tl_map_inline:nn {#2}
+ {
+ \prop_get:NnNTF \c__ctex_font_size_prop {##1} \l__ctex_tmp_tl
+ { \tl_put_right:Nx #1 { { \tl_head:N \l__ctex_tmp_tl } } }
+ { \tl_put_right:Nx #1 { { \dim_to_decimal:n { ##1 } } } }
+ }
+ }
+\clist_map_inline:nn
+ {
+ { 8 }{ 8 }{ 5pt }{ 5pt } ,
+ { 7 }{ 7 }{ 5pt }{ 5pt } ,
+ { -6 }{ -6 }{ 5pt }{ 5pt } ,
+ { 6 }{ 6 }{ 5pt }{ 5pt } ,
+ { -5 }{ -5 }{ 6pt }{ 5pt } ,
+ { 5 }{ 5 }{ 7pt }{ 5pt } ,
+ { -4 }{ -4 }{ 8pt }{ 6pt } ,
+ { 4 }{ 4 }{ 5 }{ 6 } ,
+ { -3 }{ -3 }{ -4 }{ -5 } ,
+ { 3 }{ 3 }{ 4 }{ 5 } ,
+ { -2 }{ -2 }{ -3 }{ -4 } ,
+ { 2 }{ 2 }{ 3 }{ 4 } ,
+ { -1 }{ -1 }{ -2 }{ -3 } ,
+ { 1 }{ 1 }{ 2 }{ 3 } ,
+ { -0 }{ -0 }{ -1 }{ -2 } ,
+ { 0 }{ 0 }{ 1 }{ 2 }
+ }
+ { \ctex_declare_math_sizes:nnnn #1 }
+\cs_new_protected:Npn \ctex_set_font_size:Nnn #1#2#3
+ {
+ \prop_get:NnNTF \c__ctex_font_size_prop {#2} \l__ctex_font_size_tl
+ { \exp_after:wN \__ctex_set_font_size:nnNn \l__ctex_font_size_tl #1 {#3} }
+ { \msg_error:nnn { ctex } { fontsize } {#2} }
+ }
+\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
+ \ctex_file_input:n { ctex-c5size.clo }
+\or:
+ \ctex_file_input:n { ctex-cs4size.clo }
+\fi:
+\fp_compare:nNnF { \l__ctex_line_spread_fp } ? { \c_zero_fp }
+ {
+ \linespread { \fp_use:N \l__ctex_line_spread_fp }
+ \group_begin: \footnotesize \exp_args:NNNo \group_end:
+ \dim_set:Nn \footnotesep { \dim_use:N \box_ht:N \strutbox }
+ }
+\normalsize
+\NewDocumentCommand \CTeX { }
+ { \ifincsname CTeX \else: C \TeX \fi: }
+\AtBeginDocument
+ {
+ \cs_if_exist_use:NT \pdfstringdefDisableCommands
+ { { \tl_set:Nn \CTeX { CTeX } } }
+ }
+\keys_define:nn { ctex }
+ {
+ captiondelimiter .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { You~can~load~the~package~`caption'~to~get~its~functionality. }
+ }
+ }
+\group_begin:
+\char_set_catcode_other:N \#
+\use:n
+ {
+ \group_end:
+ \ExplSyntaxOff
+ \ctex_at_end_package:nn { breqn }
+ {
+ \ctex_patch_cmd:NnnTF \end { \csname end#1 \endcsname }
+ {
+ \csuse { @end@#1@hook }
+ \csname end#1 \endcsname
+ } { }
+ {
+ \ctex_preto_cmd:NnTF \end { \csuse { @end@#1@hook } }
+ { } { \ctex_patch_failure:N \end }
+ }
+ }
+ \ExplSyntaxOn
+ }
+\cs_new_protected_nopar:Npn \ctex_fontset_error:n #1
+ { \msg_critical:nnn { ctex } { fontset-unavailable } {#1} }
+\msg_new:nnn { ctex } { fontset-unavailable }
+ { CTeX~fontset~`#1'~is~unavailable~in~current~mode. }
+\cs_new_protected_nopar:Npn \ctex_load_fontset:
+ {
+ \tl_if_empty:NTF \g__ctex_fontset_tl
+ {
+ \ctex_detected_platform:
+ \ctex_file_input:n { ctex-fontset- \g__ctex_fontset_tl .def }
+ }
+ {
+ \file_if_exist:nTF { ctex-fontset- \g__ctex_fontset_tl .def }
+ { \ctex_file_input:n { ctex-fontset- \g__ctex_fontset_tl .def } }
+ {
+ \use:x
+ {
+ \ctex_detected_platform:
+ \msg_error:nnxx { ctex } { fontset-not-found }
+ { \g__ctex_fontset_tl } { \exp_not:N \g__ctex_fontset_tl }
+ }
+ \ctex_file_input:n { ctex-fontset- \g__ctex_fontset_tl .def }
+ }
+ }
+ }
+\@onlypreamble \ctex_load_fontset:
+\msg_new:nnnn { ctex } { fontset-not-found }
+ {
+ CTeX~fontset~`#1'~could~not~be~found.\\
+ Fontset~`#2'~will~be~used~instead.
+ }
+ { You~may~run~`mktexlsr'~firstly. }
+\keys_define:nn { ctex }
+ {
+ fontset .code:n =
+ {
+ \ctex_if_preamble:TF
+ {
+ \str_if_eq_x:nnTF {#1} { none }
+ { \msg_warning:nnn { ctex } { invalid-value } {#1} }
+ {
+ \str_if_eq:onTF { \g__ctex_fontset_tl } { none }
+ {
+ \tl_gset:Nx \g__ctex_fontset_tl {#1}
+ \ctex_load_fontset:
+ }
+ {
+ \msg_error:nnxx { ctex } { fontset-loaded }
+ { \g__ctex_fontset_tl } {#1}
+ }
+ }
+ }
+ { \msg_error:nn { ctex } { fontset-only-preamble } }
+ }
+ }
+\msg_new:nnnn { ctex } { fontset-loaded }
+ {
+ CTeX~fontset~`#1'~has~been~loaded.
+ \str_if_eq:nnF {#1} {#2} { \\ Fontset~`#2'~will~be~ignored. }
+ }
+ { Only~one~fontset~can~be~loaded~in~the~preamble. }
+\msg_new:nnn { ctex } { fontset-only-preamble }
+ {
+ The~ `fontset'~ option~ can~ be~ used~ only~ in~ preamble.
+ }
+\str_if_eq:onF { \g__ctex_fontset_tl } { none }
+ { \ctex_load_fontset: }
+\ctex_at_end:n { \ctex_file_input:n { ctex.cfg } }
+%%
+%% This package consists of the file ctex.dtx,
+%% and the derived files ctex.pdf,
+%% ctex.ins,
+%% ctex.sty,
+%% ctexcap.sty,
+%% ctexsize.sty,
+%% ctexart.cls,
+%% ctexbook.cls,
+%% ctexrep.cls,
+%% ctex-c5size.clo,
+%% ctex-cs4size.clo,
+%% ctex-article.def,
+%% ctex-book.def,
+%% ctex-report.def,
+%% ctex-scheme-plain.def,
+%% ctex-scheme-plain-article.def,
+%% ctex-scheme-plain-book.def,
+%% ctex-scheme-plain-report.def,
+%% ctex-scheme-chinese.def,
+%% ctex-scheme-chinese-article.def,
+%% ctex-scheme-chinese-book.def,
+%% ctex-scheme-chinese-report.def,
+%% ctex-name-gbk.cfg,
+%% ctex-name-utf8.cfg,
+%% ctex.cfg,
+%% ctexopts.cfg,
+%% ctex-engine-pdftex.def,
+%% ctex-engine-xetex.def,
+%% ctex-engine-luatex.def,
+%% c19rm.fd,
+%% c19sf.fd,
+%% c19tt.fd,
+%% c70rm.fd,
+%% c70sf.fd,
+%% c70tt.fd,
+%% ctex-fontset-windows.def,
+%% ctex-fontset-windowsnew.def,
+%% ctex-fontset-windowsold.def,
+%% ctex-fontset-adobe.def,
+%% ctex-fontset-fandol.def,
+%% ctex-fontset-mac.def,
+%% ctex-fontset-founder.def,
+%% ctex-fontset-ubuntu.def,
+%% ctexspa.def,
+%% ctexpunct.spa,
+%% ctexmakespa.tex,
+%% ctexspamacro.tex,
+%% zhadobefonts.tex,
+%% zhfandolfonts.tex,
+%% zhfounderfonts.tex,
+%% zhubuntufonts.tex,
+%% zhwindowsfonts.tex, and
+%% README.
+%%
+%% End of file `ctexart.cls'.
diff --git a/Master/texmf-dist/tex/latex/ctex/ctexbook.cls b/Master/texmf-dist/tex/latex/ctex/ctexbook.cls
index accd2ac4be6..12767698313 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctexbook.cls
+++ b/Master/texmf-dist/tex/latex/ctex/ctexbook.cls
@@ -1,29 +1,1283 @@
-% ctexbook.cls
-
-\NeedsTeXFormat{LaTeX2e}[1995/12/01]
-\ProvidesClass{ctexbook}
- [2014/06/09 v1.02d ctexbook
- document class]
-
-\def\CTEX@classtoload{book}
-
-\input{ctex-common-opts.def}
-\input{ctex-caption-opts.def}
-\input{ctex-class-opts.def}
-
-\InputIfFileExists{ctexopts.cfg}{}{}
-
-\input{ctex-loadclass.def}
-
-\input{ctex-common.def}
-\input{ctex-caption.def}
-\input{ctex-class.def}
-\input{ctex-book.def}
-
-% ctex.cfg should be loaded very last
-\AtEndOfPackage{%
- \makeatletter
- \InputIfFileExists{ctex.cfg}{}{}
- \makeatother}
-
-\endinput
+%%
+%% This is file `ctexbook.cls',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `class,book')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\NeedsTeXFormat{LaTeX2e}
+\RequirePackage{expl3}
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {Chinese adapter for class book (CTEX)}
+\ProvidesExplClass{ctexbook}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+\RequirePackage { xparse , l3keys2e }
+\msg_new:nnnn { ctex } { l3-too-old }
+ { Support~package~`#1'~too~old. }
+ {
+ Please~update~an~up~to~date~version~of~the~bundles\\\\
+ `l3kernel'~and~`l3packages'\\\\
+ using~your~TeX~package~manager~or~from~CTAN.
+ }
+\@ifpackagelater { expl3 } { 2014/07/20 } { }
+ { \msg_error:nnn { ctex } { l3-too-old } { expl3 } }
+\@ifpackagelater { l3keys2e } { 2014/05/05 } { }
+ { \msg_error:nnn { ctex } { l3-too-old } { l3keys2e } }
+\RequirePackage { etoolbox , ifpdf , fix-cm , everysel }
+\tl_new:N \l__ctex_tmp_tl
+\int_new:N \l__ctex_tmp_int
+\dim_new:N \l__ctex_tmp_dim
+\box_new:N \l__ctex_tmp_box
+\msg_new:nnnn { ctex } { package-too-old }
+ { Support~package~`#1'~too~old. }
+ {
+ Please~update~an~up~to~date~version~of~the~package~`#1'\\
+ using~your~TeX~package~manager~or~from~CTAN.
+ }
+\cs_new_eq:NN \ctex_lua_now_x:n \luatex_directlua:D
+\ifpdf
+ \cs_new_eq:NN \ctex_if_pdfmode:TF \use_i:nn
+\else:
+ \cs_new_eq:NN \ctex_if_pdfmode:TF \use_ii:nn
+\fi:
+\prg_new_conditional:Npnn \ctex_if_preamble: { TF }
+ {
+ \if_meaning:w \@onlypreamble \@notprerr
+ \prg_return_false:
+ \else:
+ \prg_return_true:
+ \fi:
+ }
+\cs_new_protected:Npn \ctex_at_end_package:nn #1#2
+ {
+ \@ifpackageloaded { #1 }
+ { #2 }
+ { \ctex_add_hook:cn { g__ctex_at_end_ #1 _hook_tl } { #2 } }
+ }
+\cs_new_protected:Npn \ctex_add_hook:Nn #1#2
+ {
+ \tl_if_exist:NF #1 { \tl_new:N #1 }
+ \tl_gput_right:Nn #1 { #2 }
+ }
+\cs_generate_variant:Nn \ctex_add_hook:Nn { c }
+\cs_new_protected_nopar:Npn \ctex_package_end_hook:n #1
+ {
+ \cs_if_exist_use:cT { g__ctex_at_end_ #1 _hook_tl }
+ { \cs_undefine:c { g__ctex_at_end_ #1 _hook_tl } }
+ }
+\cs_generate_variant:Nn \ctex_package_end_hook:n { o }
+\tl_put_left:Nn \@popfilename
+ { \ctex_package_end_hook:o { \@currname } }
+\cs_new_protected:Npn \ctex_file_wrapper:nnn #1#2#3
+ {
+ \use:x
+ {
+ \ExplSyntaxOff
+ \char_set_catcode_letter:n { 64 }
+ #1
+ \exp_not:n {#2}
+ \bool_if:NTF \l__kernel_expl_bool
+ { \ExplSyntaxOn }
+ { \ExplSyntaxOff }
+ \char_set_catcode:nn { 64 } { \char_value_catcode:n { 64 } }
+ #3
+ }
+ }
+\cs_new_protected_nopar:Npn \ctex_file_input:n #1
+ { \ctex_file_wrapper:nnn { } { \file_input:n {#1} } { } }
+\cs_new_protected_nopar:Npn \ctex_scheme_input:n #1
+ {
+ \ctex_file_wrapper:nnn
+ { }
+ {
+ \tl_if_exist:NTF \c__ctex_class_tl
+ {
+ \file_if_exist_input:nF { ctex-scheme- #1 - \c__ctex_class_tl .def }
+ { \file_input:n { ctex-scheme- #1 .def } }
+ }
+ { \file_input:n { ctex-scheme- #1 .def } }
+ }
+ { }
+ }
+\cs_generate_variant:Nn \ctex_scheme_input:n { o }
+\cs_new_protected:Npn \ctex_parse_name:NN #1#2
+ { \ctex_parse_name:NNx #1#2 { \cs_to_str:N #2 } }
+\group_begin:
+\char_set_lccode:nn { `\< } { `\{ }
+\char_set_lccode:nn { `\/ } { `\\ }
+\char_set_lccode:nn { `\A } { `\t }
+\tl_map_function:nN { \A \E \S \O \P } \char_set_catcode_other:N
+\tex_lowercase:D
+ {
+ \group_end:
+ \cs_new_protected:Npn \ctex_parse_name:NNn #1#2#3
+ {
+ \bool_if:nTF { \cs_if_exist_p:c { #3 ~ } || \cs_if_exist_p:c { /#3 } }
+ {
+ \group_begin:
+ \use:x
+ {
+ \__ctex_parse_name:nNNNnN { \token_get_replacement_spec:N #2 }
+ \exp_not:N #2 \exp_not:c { #3 ~ } \exp_not:c { /#3 } {#3}
+ } #1
+ }
+ { #1#2 }
+ }
+ \cs_new_protected:Npn \__ctex_parse_name:nNNNnN #1#2#3#4#5#6
+ {
+ \group_end:
+ \exp_args:Nc #6
+ {
+ \str_case:nnTF {#1}
+ {
+ { \protect #3 } { }
+ { \x@protect #2 \protect #3 } { }
+ }
+ {
+ \str_if_eq_x:nnTF { \exp_not:n { /@protected@ #3 /#3 } }
+ {
+ \exp_last_unbraced:Nf \__ctex_parse_name:w
+ \token_get_replacement_spec:N #3 AESAOPA ~ < \q_stop
+ }
+ { /#5 ~ } { #5 ~ }
+ }
+ {
+ \str_case:onTF { \__ctex_parse_name:w #1 AESAOPA ~ < \q_stop }
+ {
+ { /@protected@ #2 #4 } { }
+ { /@ #4 } { }
+ }
+ { /#5 } {#5}
+ }
+ }
+ }
+ \cs_new:Npn \__ctex_parse_name:w #1 AESAOPA ~ #2 < #3 \q_stop { #1#2 }
+ }
+\cs_generate_variant:Nn \ctex_parse_name:NNn { NNx }
+\cs_new_protected:Npn \ctex_patch_cmd:NnnTF { \ctex_parse_name:NN \patchcmd }
+\cs_new_protected:Npn \ctex_preto_cmd:NnTF { \ctex_parse_name:NN \pretocmd }
+\cs_new_protected:Npn \ctex_appto_cmd:NnTF { \ctex_parse_name:NN \apptocmd }
+\cs_new_protected:Npn \ctex_patch_cmd:Nnn
+ {
+ \group_begin:
+ \char_set_catcode_other:N \#
+ \__ctex_patch_cmd:Nnn
+ }
+\cs_new_protected:Npn \__ctex_patch_cmd:Nnn #1#2#3
+ {
+ \group_end:
+ \group_begin:
+ \ExplSyntaxOff
+ \ctex_patch_cmd:NnnTF #1 {#2} {#3}
+ {
+ \cs_gset_eq:NN \__ctex_tmp:w #1
+ \group_end:
+ \cs_set_eq:NN #1 \__ctex_tmp:w
+ \cs_undefine:N \__ctex_tmp:w
+ }
+ { \group_end: \ctex_patch_failure:N #1 }
+ }
+\cs_new_protected:Npn \ctex_patch_failure:N #1
+ { \msg_warning:nnx { ctex } { patch-failure } { \token_to_str:N #1 } }
+\msg_new:nnn { ctex } { patch-failure }
+ {
+ Patching~command~`#1'~failed.\\
+ ctex~may~not~work~as~expected.
+ }
+\cs_new:Npn \ctex_set_default_ccwd:Nn #1#2
+ {
+ \dim_compare:nNnTF
+ { \ctex_default_pt:n {#2} } = { \ctex_default_pt:n { #2 ~ mm } }
+ { \tl_set:Nn #1 {#2} }
+ { \tl_set:Nn #1 { #2 \ccwd } }
+ }
+\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
+ }
+\group_begin:
+ \char_set_catcode_other:N \P
+ \char_set_catcode_other:N \T
+\tex_lowercase:D
+ {
+ \group_end:
+ \cs_new:Npn \__ctex_default_pt:w #1 PT #2 \q_stop { #1 PT }
+ }
+\tl_new:N \l__ctex_encoding_tl
+\tl_set:Nx \l__ctex_encoding_tl
+ { \pdftex_if_engine:TF { GBK } { UTF8 } }
+\cs_new_eq:NN \g__ctex_section_depth_flag \c_two
+\bool_new:N \g__ctex_zhmCJK_bool
+\tl_new:N \l__ctex_autoindent_tl
+\cs_new_eq:NN \ctex_if_autoindent_touched:F \use:n
+\cs_new_eq:NN \ctex_zhmap_case:nnn \use_ii:nnn
+\cs_new_protected_nopar:Npn \ctex_at_end:n { \AtEndOfClass }
+\clist_new:N \g__ctex_std_options_clist
+\msg_new:nnn { ctex } { invalid-option }
+ { Option~`\l_keys_key_tl'~is~invalid~in~current~mode. }
+\msg_new:nnn { ctex } { invalid-value }
+ { Value~`#1'~is~invalid~for~the~key~`\l_keys_key_tl'. }
+\msg_new:nnn { ctex } { deprecated-option }
+ { Option~ `\l_keys_key_tl'~ is~ deprecated.\\ #1 }
+\msg_new:nnn { ctex } { deprecated-command }
+ { Command~ #1 is~ deprecated.\\ #2 }
+\msg_new:nnn { ctex } { deprecated-environment }
+ { Environment~ `#1'~ is~ deprecated.\\ #2 }
+\cs_new_eq:NN \g__ctex_font_size_flag \c_minus_one
+\keys_define:nn { ctex / option }
+ {
+ zihao .choice: ,
+ zihao .default:n = { 5 } ,
+ 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 } ,
+ c5size .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { Option~ `zihao=5'~ is~ set. }
+ \keys_set:nn { ctex / option } { zihao = 5 }
+ } ,
+ cs4size .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { Option~ `zihao=-4'~ is~ set. }
+ \keys_set:nn { ctex / option } { zihao = -4 }
+ } ,
+ c5size .value_forbidden: ,
+ cs4size .value_forbidden: ,
+ linespread .fp_set:N = \l__ctex_line_spread_fp ,
+ linespread .initial:n = { \c_nan_fp } ,
+ linespread .value_required: ,
+ autoindent .choice: ,
+ autoindent .default:n = { true } ,
+ autoindent / true .code:n =
+ {
+ \tl_set:Nn \l__ctex_autoindent_tl { 2 \ccwd }
+ \cs_set_eq:NN \ctex_if_autoindent_touched:F \use_none:n
+ } ,
+ autoindent / false .code:n =
+ {
+ \tl_clear:N \l__ctex_autoindent_tl
+ \cs_set_eq:NN \ctex_if_autoindent_touched:F \use_none:n
+ } ,
+ autoindent / unknown .code:n =
+ {
+ \ctex_set_default_ccwd:Nn \l__ctex_autoindent_tl {#1}
+ \cs_set_eq:NN \ctex_if_autoindent_touched:F \use_none:n
+ } ,
+ indent .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ {
+ The~ indentfirst~ package~ will~ be~ loaded~ but~ the~
+ functionality~ may~ be~ removed~ in~ later~ version.
+ It's~ better~ to~ set~ the~ heading~ styles~ via~ beforeskip~
+ options.~
+ }
+ \keys_set:nn { ctex / option } { autoindent = true }
+ } ,
+ indent .value_forbidden: ,
+ noindent .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ {
+ The~ functionality~ has~ been~ removed.~
+ It's~ better~ to~ set~ the~ heading~ styles~ via~ beforeskip~
+ options.
+ }
+ \keys_set:nn { ctex / option } { autoindent = false }
+ } ,
+ noindent .value_forbidden: ,
+ GBK .code:n = { \tl_set:Nn \l__ctex_encoding_tl { GBK } } ,
+ UTF8 .code:n = { \tl_set:Nn \l__ctex_encoding_tl { UTF8 } } ,
+ GBK .value_forbidden: ,
+ UTF8 .value_forbidden: ,
+ fontset .tl_gset:N = \g__ctex_fontset_tl ,
+ nofonts .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ {
+ Option~ `fontset=none'~ is~ set.~ It~ is~ better~ to~ use~
+ fontset~ option.
+ }
+ \keys_set:nn { ctex / option } { fontset = none }
+ } ,
+ adobefonts .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ {
+ Option~ `fontset=adobe'~ is~ set.~ It~ is~ better~ to~ use~
+ fontset~ option.
+ }
+ \keys_set:nn { ctex / option } { fontset = none }
+ } ,
+ winfonts .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ {
+ Option~ `fontset=windows'~ is~ set.~ It~ is~ better~ to~ use~
+ fontset~ option.
+ }
+ \keys_set:nn { ctex / option } { fontset = none }
+ } ,
+ nofonts .value_forbidden: ,
+ winfonts .value_forbidden: ,
+ adobefonts .value_forbidden: ,
+ zhmap .choice: ,
+ zhmap .default:n = { true } ,
+ zhmap / zhmCJK .code:n =
+ {
+ \bool_gset_true:N \g__ctex_zhmCJK_bool
+ \cs_gset_eq:NN \ctex_zhmap_case:nnn \use_i:nnn
+ } ,
+ zhmap / true .code:n =
+ {
+ \bool_gset_false:N \g__ctex_zhmCJK_bool
+ \cs_gset_eq:NN \ctex_zhmap_case:nnn \use_ii:nnn
+ } ,
+ zhmap / false .code:n =
+ {
+ \bool_gset_false:N \g__ctex_zhmCJK_bool
+ \cs_gset_eq:NN \ctex_zhmap_case:nnn \use_iii:nnn
+ } ,
+ nozhmap .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { Option~ `zhmap=false'~ is~ set. }
+ \keys_set:nn { ctex / option } { zhmap = false }
+ } ,
+ nozhmap .value_forbidden: ,
+ punct .tl_set:N = \l__ctex_punct_tl ,
+ punct .default:n = { quanjiao } ,
+ punct .initial:n = { quanjiao } ,
+ nopunct .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { Option~ `punct=plain'~ is~ set. }
+ \keys_set:nn { ctex / option } { punct = plain }
+ } ,
+ nopunct .value_forbidden: ,
+ space .choices:nn =
+ { true , auto , false }
+ {
+ \exp_args:Nx \ctex_at_end:n
+ { \keys_set:nn { ctex } { space = \l_keys_choice_tl } }
+ } ,
+ space .default:n = { true } ,
+ nospace .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { Option~ `space=false'~ is~ set. }
+ \keys_set:nn { ctex / option } { space = false }
+ } ,
+ nospace .value_forbidden: ,
+ heading .bool_set:N = \l__ctex_heading_bool ,
+ scheme .tl_set:N = \l__ctex_scheme_tl ,
+ scheme .default:n = { chinese },
+ scheme .initial:n = { chinese },
+ cap .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { Option~ `scheme = chinese' ~ is~ set. }
+ \keys_set:nn { ctex / option } { scheme = chinese }
+ } ,
+ nocap .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { Option~ `scheme = plain' ~ is~ set. }
+ \keys_set:nn { ctex / option } { scheme = plain }
+ } ,
+ cap .value_forbidden: ,
+ nocap .value_forbidden: ,
+ sub3section .code:n =
+ { \cs_gset_eq:NN \g__ctex_section_depth_flag \c_three } ,
+ sub4section .code:n =
+ { \cs_gset_eq:NN \g__ctex_section_depth_flag \c_four } ,
+ sub3section .value_forbidden: ,
+ sub4section .value_forbidden: ,
+ fntef .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { `(xe)CJKfntef'~ package~ is~ always~ loaded. }
+ } ,
+ fancyhdr .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { `fancyhdr'~ package~ is~ loaded. }
+ \RequirePackage{ fancyhdr }
+ } ,
+ hyperref .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { `hyperref'~ package~ will~ be~ loaded. }
+ \AtEndPreamble { \RequirePackage { hyperref } }
+ } ,
+ }
+\tl_clear:N \l__ctex_tmp_tl
+\clist_map_inline:nn
+ {
+ 10pt , 11pt , 12pt ,
+ 8pt , 9pt , 14pt , 17pt , 20pt , 25pt , 30pt , 36pt , 48pt , 60pt
+ }
+ {
+ \tl_put_right:Nn \l__ctex_tmp_tl
+ {
+ #1 .code:n =
+ {
+ \cs_gset_eq:NN \g__ctex_font_size_flag \c_minus_one
+ \clist_gput_right:Nn \g__ctex_std_options_clist {#1}
+ } ,
+ #1 .value_forbidden: ,
+ }
+ }
+\use:x { \keys_define:nn { ctex / option } { \exp_not:o { \l__ctex_tmp_tl } } }
+\tl_clear:N \l__ctex_tmp_tl
+\keys_define:nn { ctex / option }
+ {
+ unknown .code:n =
+ { \clist_gput_right:No \g__ctex_std_options_clist { \CurrentOption } }
+ }
+\ctex_file_input:n { ctexopts.cfg }
+\ProcessKeysOptions { ctex / option }
+\if_case:w \g__ctex_font_size_flag
+ \clist_gput_right:Nn \g__ctex_std_options_clist { 10pt }
+\or:
+ \clist_gput_right:Nn \g__ctex_std_options_clist { 12pt }
+\fi:
+\tl_const:Nn \c__ctex_class_tl { book }
+\PassOptionsToClass { \g__ctex_std_options_clist } { book }
+\LoadClass { book }
+\tl_set_eq:Nc \l__ctex_tmp_tl { ver@ \@currname . \@currext }
+\cs_new_eq:cN { ver@ctex. \@pkgextension } \l__ctex_tmp_tl
+\cs_new_eq:cN { ver@ctexcap. \@pkgextension } \l__ctex_tmp_tl
+\cs_new_eq:cN { ver@ctexsize. \@pkgextension } \l__ctex_tmp_tl
+\NewDocumentCommand \ctexset { +m }
+ { \keys_set:nn { ctex } {#1} }
+\NewDocumentCommand \CTEXsetup { +o > { \TrimSpaces } m }
+ {
+ \msg_warning:nnnn { ctex } { deprecated-command } { \CTEXsetup }
+ { \ctexset~ {~ #2~ =~ {~ #1~ }~ }~ is~ set. }
+ \IfNoValueF {#1} { \keys_set:nn { ctex / #2 } {#1} }
+ }
+\NewDocumentCommand \CTEXoptions { +o }
+ {
+ \msg_warning:nnnn { ctex } { deprecated-command } { \CTEXoptions }
+ { \ctexset~ {~ #1~ }~ is~ set. }
+ \IfNoValueF {#1} { \keys_set:nn { ctex } {#1} }
+ }
+\@ifpackageloaded { hyperref }
+ {
+ \cs_new_protected_nopar:Npn \ctex_hypersetup:n #1
+ { \hypersetup {#1} }
+ }
+ {
+ \cs_new_protected_nopar:Npn \ctex_hypersetup:n #1
+ { \PassOptionsToPackage {#1} { hyperref } }
+ }
+\ctex_hypersetup:n { colorlinks = true }
+\pdftex_if_engine:TF
+ {
+ \tl_set:Nx \l__ctex_encoding_tl { \l__ctex_encoding_tl }
+ \ctex_file_input:n { ctex-engine-pdftex.def }
+ }
+ {
+ \tl_set:Nn \l__ctex_encoding_tl { UTF8 }
+ \xetex_if_engine:TF
+ { \ctex_file_input:n { ctex-engine-xetex.def } }
+ { \ctex_file_input:n { ctex-engine-luatex.def } }
+ }
+\keys_define:nn { ctex }
+ {
+ autoindent .choice: ,
+ autoindent .default:n = { true } ,
+ autoindent / true .code:n =
+ {
+ \tl_set:Nn \l__ctex_autoindent_tl { 2 \ccwd }
+ \ctex_select_size:
+ } ,
+ autoindent / false .code:n =
+ { \tl_clear:N \l__ctex_autoindent_tl } ,
+ autoindent / unknown .code:n =
+ {
+ \ctex_set_default_ccwd:Nn \l__ctex_autoindent_tl {#1}
+ \ctex_select_size:
+ }
+ }
+\NewDocumentCommand \CTEXsetfont { } { \ctex_select_size: }
+\cs_new_protected_nopar:Npn \ctex_select_size:
+ { \cs_if_free:NTF \size@update { \ctex_update_size: } { \selectfont } }
+\cs_new_protected_nopar:Npn \ctex_update_size:
+ {
+ \tl_if_eq:NNTF \l__ctex_ziju_tl \c__ctex_zero_tl
+ {
+ \ctex_update_stretch:
+ \ctex_update_parindent:
+ }
+ { \ctex_update_ziju: }
+ }
+\tl_const:Nx \c__ctex_zero_tl { \fp_use:N \c_zero_fp }
+\tl_new:N \l__ctex_ziju_tl
+\tl_set_eq:NN \l__ctex_ziju_tl \c__ctex_zero_tl
+\ctex_add_to_selectfont:n
+ { \cs_if_free:NF \size@update { \ctex_update_size: } }
+\keys_define:nn { ctex }
+ {
+ linestretch .code:n =
+ {
+ \ctex_set_default_ccwd:Nn \l__ctex_line_stretch_tl {#1}
+ \ctex_select_size:
+ } ,
+ linestretch .value_required:
+ }
+\tl_new:N \l__ctex_line_stretch_tl
+\tl_set:Nn \l__ctex_line_stretch_tl { \ccwd }
+\cs_new_protected_nopar:Npn \ctex_update_stretch:
+ {
+ \ctex_update_em_unit:
+ \dim_set:Nn \l__ctex_tmp_dim { \l__ctex_line_stretch_tl }
+ \dim_compare:nNnTF \l__ctex_tmp_dim = \c_max_dim
+ {
+ \ctex_if_ccglue_touched:TF
+ { \ctex_update_ccwd: }
+ {
+ \dim_set:Nn \l__ctex_tmp_dim
+ { \baselinestretch \etex_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:
+ }
+ }
+ {
+ \int_set:Nn \l__ctex_tmp_int
+ { \etex_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
+ {
+ \skip_set:Nn \l__ctex_ccglue_skip
+ {
+ \c_zero_dim plus \dim_eval:n
+ {
+ ( \linewidth - \ccwd - \l__ctex_tmp_int \ccwd ) /
+ \l__ctex_tmp_int
+ }
+ }
+ }
+ { \skip_zero:N \l__ctex_ccglue_skip }
+ \ctex_update_ccglue:
+ }
+ }
+\cs_new_protected_nopar:Npn \ctex_update_parindent:
+ {
+ \tl_if_empty:NF \l__ctex_autoindent_tl
+ {
+ \dim_compare:nNnF \parindent = \c_zero_dim
+ { \dim_set:Nn \parindent { \l__ctex_autoindent_tl } }
+ }
+ }
+\NewDocumentCommand \ziju { m }
+ { \exp_args:Nx \ctex_ziju:n {#1} \tex_ignorespaces:D }
+\cs_new_protected_nopar:Npn \ctex_ziju:n #1
+ {
+ \tl_set:Nx \l__ctex_ziju_tl { \fp_eval:n {#1} }
+ \ctex_select_size:
+ }
+\cs_new_protected_nopar:Npn \ctex_update_ziju:
+ {
+ \ctex_update_em_unit:
+ \dim_set:Nn \l__ctex_ziju_dim { \l__ctex_ziju_tl \ccwd }
+ \dim_add:Nn \ccwd { \l__ctex_ziju_dim }
+ \dim_compare:nNnTF \ccwd > \c_zero_dim
+ {
+ \dim_set:Nn \l__ctex_tmp_dim
+ { \linewidth - \ccwd + \l__ctex_ziju_dim }
+ \int_set:Nn \l__ctex_tmp_int { \l__ctex_tmp_dim }
+ \tex_divide:D \l__ctex_tmp_int \ccwd
+ \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 } }
+ }
+ \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 ) }
+ }
+ }
+ { \skip_set:Nn \l__ctex_ccglue_skip { \l__ctex_ziju_dim } }
+ \ctex_update_ccglue:
+ \ctex_update_parindent:
+ }
+\dim_new:N \l__ctex_ziju_dim
+\NewDocumentCommand \CTEXindent { }
+ {
+ \msg_warning:nnnn { ctex } { deprecated-command } { \CTEXindent }
+ { \parindent is~ set~ to~ 2\ccwd. }
+ \ctex_update_ccwd: \dim_set:Nn \parindent { 2 \ccwd }
+ }
+\NewDocumentCommand \CTEXnoindent { }
+ {
+ \msg_warning:nnnn { ctex } { deprecated-command } { \CTEXnoindent }
+ { \parindent is~ set~ to~ 0pt. }
+ \dim_zero:N \parindent
+ }
+\bool_if:NT \l__ctex_indent_bool
+ { \RequirePackage { indentfirst } }
+\PassOptionsToPackage { encoding = \l__ctex_encoding_tl } { zhnumber }
+\RequirePackage { zhnumber }
+\cs_new_eq:NN \chinese \zhnum
+\cs_new_eq:NN \Chinese \chinese
+\cs_new_eq:NN \CTEXcounter \use_none:n
+\NewDocumentCommand \CTEXnumber { m m }
+ { \protected@edef #1 { \zhnumber {#2} } }
+\NewDocumentCommand \CTEXdigits { m m }
+ { \protected@edef #1 { \zhdigits {#2} } }
+\cs_set_eq:NN \CTEX@todayold \today
+\keys_define:nn { ctex }
+ {
+ today .choice: ,
+ today / old .code:n =
+ { \cs_set_eq:NN \today \CTEX@todayold } ,
+ today / small .code:n =
+ {
+ \cs_set_eq:NN \today \zhtoday
+ \zhnumsetup { time = Arabic }
+ } ,
+ today / big .code:n =
+ {
+ \cs_set_eq:NN \today \zhtoday
+ \zhnumsetup { time = Chinese }
+ } ,
+ today / unknown .code:n =
+ { \msg_error:nnx { ctex } { today-undef } {#1} }
+ }
+\msg_new:nnnn { ctex } { today-undef }
+ { Today~format~`#1'~is~undefined. }
+ { Available~today~formats~are~`old',~`small',~and~`big'. }
+\keys_define:nn { ctex }
+ {
+ contentsname .tl_set:N = \contentsname ,
+ listfigurename .tl_set:N = \listfigurename ,
+ listtablename .tl_set:N = \listtablename ,
+ figurename .tl_set:N = \figurename ,
+ tablename .tl_set:N = \tablename ,
+ abstractname .tl_set:N = \abstractname ,
+ indexname .tl_set:N = \indexname ,
+ appendixname .tl_set:N = \appendixname ,
+ bibname .tl_set:N = \bibname
+ }
+\seq_new:N \c__ctex_headings_seq
+\seq_gset_from_clist:Nn \c__ctex_headings_seq
+ {
+ part , chapter , section , subsection , subsubsection ,
+ paragraph , subparagraph
+ }
+\cs_new_protected_nopar:Npn \__ctex_initial_heading:n #1
+ {
+ \tl_new:c { CTEX@pre#1 }
+ \tl_new:c { CTEX@post#1 }
+ \tl_const:cx { CTEXthe#1 }
+ {
+ \exp_not:c { CTEX@pre#1 }
+ \exp_not:c { CTEX@the#1 }
+ \exp_not:c { CTEX@post#1 }
+ }
+ \tl_const:cx { CTEX@#1name }
+ {
+ \exp_not:c { CTEX@#1@nameformat }
+ \exp_not:c { CTEX@pre#1 }
+ \exp_not:N \tl_if_empty:NTF \exp_not:c { CTEX@#1@numberformat }
+ { \exp_not:c { CTEX@the#1 } }
+ {
+ \group_begin:
+ \exp_not:c { CTEX@#1@numberformat }
+ \exp_not:c { CTEX@the#1 }
+ \group_end:
+ }
+ \exp_not:c { CTEX@post#1 }
+ \exp_not:c { CTEX@#1@aftername }
+ }
+ }
+\cs_new_protected_nopar:Npn \__ctex_def_heading_keys:n #1
+ {
+ \tl_put_right:Nx \l__ctex_tmp_tl
+ {
+ #1 .meta:nn = { ctex / #1 } { ####1 } ,
+ #1 / name .code:n =
+ { \ctex_assign_heading_name:nn {#1} { ####1 } } ,
+ #1 / number .tl_set:N = \exp_not:c { CTEX@the#1 } ,
+ #1 / format .tl_set:N = \exp_not:c { CTEX@#1@format } ,
+ #1 / nameformat .tl_set:N = \exp_not:c { CTEX@#1@nameformat } ,
+ #1 / numberformat .tl_set:N = \exp_not:c { CTEX@#1@numberformat } ,
+ #1 / aftername .tl_set:N = \exp_not:c { CTEX@#1@aftername } ,
+ #1 / titleformat .tl_set:N = \exp_not:c { CTEX@#1@titleformat } ,
+ #1 / beforeskip .tl_set:N = \exp_not:c { CTEX@#1@beforeskip } ,
+ #1 / afterskip .tl_set:N = \exp_not:c { CTEX@#1@afterskip} ,
+ #1 / indent .tl_set:N = \exp_not:c { CTEX@#1@indent } ,
+ #1 / format+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@format } { ####1 } } ,
+ #1 / nameformat+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@nameformat } { ####1 } } ,
+ #1 / numberformat+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@numberformat } { ####1 } } ,
+ #1 / aftername+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftername } { ####1 } } ,
+ #1 / titleformat+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@titleformat } { ####1 } } ,
+ #1 / beforeskip .initial:n = \c_zero_skip ,
+ #1 / afterskip .initial:n = \c_zero_skip ,
+ #1 / indent .initial:n = \c_zero_dim ,
+ #1 / beforeskip .value_required: ,
+ #1 / afterskip .value_required: ,
+ #1 / indent .value_required: ,
+ }
+ }
+\NewDocumentCommand \ctex_assign_heading_name:nn
+ { m > { \SplitArgument { \c_one } { , } } +m }
+ { \__ctex_assign_heading_name:nnn {#1} #2 }
+\cs_new_protected:Npn \__ctex_assign_heading_name:nnn #1#2#3
+ {
+ \tl_set:cn { CTEX@pre#1 } {#2}
+ \IfNoValueTF {#3}
+ { \tl_clear:c { CTEX@post#1 } }
+ { \tl_set:cn { CTEX@post#1 } {#3} }
+ }
+\tl_clear:N \l__ctex_tmp_tl
+\seq_map_inline:Nn \c__ctex_headings_seq
+ {
+ \__ctex_initial_heading:n {#1}
+ \__ctex_def_heading_keys:n {#1}
+ }
+\use:x { \keys_define:nn { ctex } { \exp_not:o { \l__ctex_tmp_tl } } }
+\tl_clear:N \l__ctex_tmp_tl
+\keys_define:nn { ctex }
+ {
+ part / pagestyle .tl_set:N = \CTEX@part@pagestyle ,
+ chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle
+ }
+\def\@part[#1]#2{%
+ \thispagestyle{\CTEX@part@pagestyle}%
+ \ifnum \c@secnumdepth >-2\relax
+ \refstepcounter{part}%
+ \addcontentsline{toc}{part}{\CTEXthepart\hspace{1em}#1}%
+ \else
+ \addcontentsline{toc}{part}{#1}%
+ \fi
+ \markboth{}{}%
+ {\interlinepenalty \@M
+ \normalfont \CTEX@part@format
+ \ifnum \c@secnumdepth >-2\relax
+ \CTEX@partname
+ \fi
+ \CTEX@part@titleformat{#2}\par}%
+ \@endpart}
+\def\@spart#1{%
+ {\interlinepenalty \@M
+ \normalfont \CTEX@part@format
+ \CTEX@part@titleformat{#1}\par}%
+ \@endpart}
+\def\@chapter[#1]#2{%
+ \ifnum \c@secnumdepth >\m@ne
+ \if@mainmatter
+ \refstepcounter{chapter}%
+ \typeout{\CTEXthechapter}%
+ \addcontentsline{toc}{chapter}
+ {\protect\numberline{\CTEXthechapter\hspace{0.3em}}#1}%
+ \else
+ \addcontentsline{toc}{chapter}{#1}%
+ \fi
+ \else
+ \addcontentsline{toc}{chapter}{#1}%
+ \fi
+ \chaptermark{#1}%
+ \addtocontents{lof}{\protect\addvspace{10\p@}}%
+ \addtocontents{lot}{\protect\addvspace{10\p@}}%
+ \if@twocolumn
+ \@topnewpage[\@makechapterhead{#2}]%
+ \else
+ \@makechapterhead{#2}%
+ \@afterheading
+ \fi}
+\def\@makechapterhead#1{%
+ \thispagestyle{\CTEX@chapter@pagestyle}%
+ \@tempskipa \CTEX@chapter@beforeskip \relax
+ \ifdim \@tempskipa <\z@
+ \@tempskipa -\@tempskipa \@afterindentfalse
+ \else
+ \@afterindenttrue
+ \fi
+ \vspace*{\@tempskipa}%
+ {\normalfont \parindent \CTEX@chapter@indent \CTEX@chapter@format
+ \ifnum \c@secnumdepth >\m@ne
+ \if@mainmatter
+ \CTEX@chaptername
+ \fi
+ \fi
+ \interlinepenalty\@M
+ \CTEX@chapter@titleformat{#1}\par\nobreak
+ \vskip \CTEX@chapter@afterskip
+ }}
+\def\@makeschapterhead#1{%
+ \thispagestyle{\CTEX@chapter@pagestyle}%
+ \@tempskipa \CTEX@chapter@beforeskip \relax
+ \ifdim \@tempskipa <\z@
+ \@tempskipa -\@tempskipa \@afterindentfalse
+ \else
+ \@afterindenttrue
+ \fi
+ \vspace*{\@tempskipa}%
+ {\normalfont \parindent \CTEX@chapter@indent \CTEX@chapter@format
+ \interlinepenalty\@M
+ \CTEX@chapter@titleformat{#1}\par\nobreak
+ \vskip \CTEX@chapter@afterskip
+ }}
+\def\@seccntformat#1{%
+ \@ifundefined{CTEX@#1name}%
+ {\csname the#1\endcsname\quad}%
+ {\csname CTEX@#1name\endcsname}}
+\def\@sect#1#2#3#4#5#6[#7]#8{%
+ \ifnum #2>\c@secnumdepth
+ \let\@svsec\@empty
+ \else
+ \refstepcounter{#1}%
+ \protected@edef\@svsec{\@seccntformat{#1}\relax}%
+ \fi
+ \@tempskipa #5\relax
+ \ifdim \@tempskipa>\z@
+ \begingroup
+ #6{%
+ \@hangfrom{\hskip #3\relax\@svsec}%
+ \interlinepenalty \@M
+ \csname CTEX@#1@titleformat\endcsname{#8}\@@par}%
+ \endgroup
+ \csname #1mark\endcsname{#7}%
+ \addcontentsline{toc}{#1}{%
+ \ifnum #2>\c@secnumdepth \else
+ \protect\numberline{\@ifundefined{CTEXthe#1}%
+ {\csname the#1\endcsname}%
+ {\csname CTEXthe#1\endcsname}}%
+ \fi
+ #7}%
+ \else
+ \def\@svsechd{%
+ #6{\hskip #3\relax
+ \@svsec \csname CTEX@#1@titleformat\endcsname{#8}}%
+ \csname #1mark\endcsname{#7}%
+ \addcontentsline{toc}{#1}{%
+ \ifnum #2>\c@secnumdepth \else
+ \protect\numberline{\@ifundefined{CTEXthe#1}%
+ {\csname the#1\endcsname}%
+ {\csname CTEXthe#1\endcsname}}%
+ \fi
+ #7}}%
+ \fi
+ \@xsect{#5}}
+\def\@ssect#1#2#3#4#5{%
+ \@tempskipa #3\relax
+ \ifdim \@tempskipa>\z@
+ \begingroup
+ #4{%
+ \@hangfrom{\hskip #1}%
+ \interlinepenalty \@M
+ \CTEX@titleformat@n{#5}\@@par}%
+ \endgroup
+ \else
+ \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}}}%
+ \fi
+ \@xsect{#3}}
+\cs_new_protected_nopar:Npn \CTEX@set@titleformat@n #1
+ { \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat } }
+\cs_new_eq:NN \CTEX@titleformat@n \use:n
+\int_zero:N \l__ctex_tmp_int
+\clist_map_inline:nn
+ { section , subsection , subsubsection , paragraph , subparagraph }
+ {
+ \int_incr:N \l__ctex_tmp_int
+ \cs_gset_protected_nopar:cpx {#1}
+ {
+ \exp_not:N \@startsection {#1}
+ { \int_use:N \l__ctex_tmp_int }
+ { \exp_not:c { CTEX@#1@indent } }
+ { \exp_not:c { CTEX@#1@beforeskip } }
+ { \exp_not:c { CTEX@#1@afterskip } }
+ {
+ \CTEX@set@titleformat@n {#1}
+ \exp_not:N \normalfont \exp_not:c { CTEX@#1@format }
+ }
+ }
+ }
+\tl_new:N \CTEX@preappendix
+\tl_new:N \CTEX@postappendix
+\keys_define:nn { ctex }
+ { appendix .meta:nn = { ctex / appendix } {#1} }
+\keys_define:nn { ctex / appendix }
+ {
+ name .code:n = { \ctex_assign_heading_name:nn { appendix } {#1} } ,
+ number .tl_set:N = \CTEX@appendixnumber
+ }
+\cs_new_eq:NN \CTEX@save@appendix \appendix
+\cs_gset_protected_nopar:Npn \appendix
+ {
+ \CTEX@save@appendix
+ \gdef \CTEX@prechapter { \CTEX@preappendix }
+ \gdef \CTEX@thechapter { \CTEX@appendixnumber }
+ \gdef \CTEX@postchapter { \CTEX@postappendix }
+ }
+\cs_new_protected:Npn \CTEX@toc@width@n #1
+ {
+ \hbox_set:Nn \l__ctex_tmp_box {#1}
+ \dim_set:Nn \@tempdima
+ {
+ \dim_max:nn { \@tempdima }
+ { \box_wd:N \l__ctex_tmp_box + \f@size \p@ / \c_two }
+ }
+ }
+\group_begin:
+\char_set_catcode_other:N \#
+\use:n
+ {
+ \group_end:
+ \ExplSyntaxOff
+ \ctex_preto_cmd:NnTF \numberline { \CTEX@toc@width@n {#1} } { }
+ { \ctex_patch_failure:N \numberline }
+ \@ifpackageloaded { tocloft }
+ { }
+ {
+ \ctex_at_end_package:nn { tocloft }
+ {
+ \ctex_preto_cmd:NnTF \numberline { \CTEX@toc@width@n {#1} } { }
+ { \ctex_patch_failure:N \numberline }
+ }
+ }
+ \ExplSyntaxOn
+ }
+\ctex_patch_cmd:Nnn \ps@headings
+ { \@chapapp\ \thechapter.~\ } { \CTEXthechapter \quad }
+\if@twoside
+ \ctex_patch_cmd:Nnn \ps@headings { \thesection.~\ } { \CTEXthesection \quad }
+\fi:
+\ctex_at_end_package:nn { fancyhdr }
+ {
+ \ctex_patch_cmd:Nnn \ps@fancy
+ { \@chapapp\ \thechapter.~\ } { \if@mainmatter \CTEXthechapter \quad \fi }
+ \ctex_patch_cmd:Nnn \ps@fancy
+ { \thesection.~\ } { \CTEXthesection \quad }
+ }
+\cs_new_protected_nopar:Npn \CTEX@setcurrentlabel@n #1
+ {
+ \protected@edef \@currentlabel
+ {
+ \cs_if_exist:cTF { CTEX@the#1 }
+ { \exp_args:cc { p@#1 } { CTEX@the#1 } }
+ { \exp_not:o { \@currentlabel } }
+ }
+ }
+\cs_new_protected_nopar:Npn \ctex_varioref_hook:
+ {
+ \seq_map_inline:Nn \c__ctex_headings_seq
+ { \ctex_fix_varioref_label:n { ##1 } }
+ }
+\cs_new_protected_nopar:Npn \ctex_fix_varioref_label:n #1
+ {
+ \tl_if_empty:cT { p@#1 }
+ { \exp_args:Nno \labelformat {#1} { \cs:w CTEX@the#1 \cs_end: } }
+ }
+\@ifpackageloaded { varioref }
+ { \ctex_varioref_hook: }
+ {
+ \cs_new_eq:NN \CTEX@save@refstepcounter \refstepcounter
+ \RenewDocumentCommand \refstepcounter { m }
+ {
+ \CTEX@save@refstepcounter {#1}
+ \CTEX@setcurrentlabel@n {#1}
+ }
+ \ctex_at_end_package:nn { varioref } { \ctex_varioref_hook: }
+ }
+\ctex_scheme_input:o { \l__ctex_scheme_tl }
+\NewDocumentCommand \zihao { m }
+ { \exp_args:Nx \ctex_zihao:n {#1} \tex_ignorespaces:D }
+\cs_new_protected_nopar:Npn \ctex_zihao:n #1
+ {
+ \prop_get:NnNTF \c__ctex_font_size_prop {#1} \l__ctex_font_size_tl
+ { \exp_after:wN \fontsize \l__ctex_font_size_tl \selectfont }
+ { \msg_error:nnn { ctex } { fontsize } {#1} }
+ }
+\msg_new:nnnn { ctex } { fontsize }
+ { Undefined~Chinese~font~size~`#1'~in~command~\token_to_str:N \zihao.}
+ {
+ The~old~font~size~is~used~if~you~continue.\\
+ The~available~font~sizes~are~listed~as~follow.\\
+ \seq_use:Nnnn \c__ctex_font_size_seq { ~and~ } { ,~ } { ,~and~ }.
+ }
+\prop_new:N \c__ctex_font_size_prop
+\seq_new:N \c__ctex_font_size_seq
+\cs_new_protected_nopar:Npn \__ctex_save_font_size:nn #1#2
+ {
+ \use:x
+ {
+ \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 } }
+ }
+ }
+ \seq_gput_right:Nn \c__ctex_font_size_seq {#1}
+ }
+\clist_map_inline:nn
+ {
+ { 8 } { 5 bp } ,
+ { 7 } { 5.5 bp } ,
+ { -6 } { 6.5 bp } ,
+ { 6 } { 7.5 bp } ,
+ { -5 } { 9 bp } ,
+ { 5 } { 10.5 bp } ,
+ { -4 } { 12 bp } ,
+ { 4 } { 14 bp } ,
+ { -3 } { 15 bp } ,
+ { 3 } { 16 bp } ,
+ { -2 } { 18 bp } ,
+ { 2 } { 22 bp } ,
+ { -1 } { 24 bp } ,
+ { 1 } { 26 bp } ,
+ { -0 } { 36 bp } ,
+ { 0 } { 42 bp }
+ }
+ { \__ctex_save_font_size:nn #1 }
+\cs_new_protected_nopar:Npn \ctex_declare_math_sizes:nnnn #1#2#3#4
+ {
+ \__ctex_get_font_sizes:Nn \l__ctex_font_size_tl { {#1} {#2} {#3} {#4} }
+ \exp_after:wN \DeclareMathSizes \l__ctex_font_size_tl
+ }
+\cs_new_protected_nopar:Npn \__ctex_get_font_sizes:Nn #1#2
+ {
+ \tl_clear:N #1
+ \tl_map_inline:nn {#2}
+ {
+ \prop_get:NnNTF \c__ctex_font_size_prop {##1} \l__ctex_tmp_tl
+ { \tl_put_right:Nx #1 { { \tl_head:N \l__ctex_tmp_tl } } }
+ { \tl_put_right:Nx #1 { { \dim_to_decimal:n { ##1 } } } }
+ }
+ }
+\clist_map_inline:nn
+ {
+ { 8 }{ 8 }{ 5pt }{ 5pt } ,
+ { 7 }{ 7 }{ 5pt }{ 5pt } ,
+ { -6 }{ -6 }{ 5pt }{ 5pt } ,
+ { 6 }{ 6 }{ 5pt }{ 5pt } ,
+ { -5 }{ -5 }{ 6pt }{ 5pt } ,
+ { 5 }{ 5 }{ 7pt }{ 5pt } ,
+ { -4 }{ -4 }{ 8pt }{ 6pt } ,
+ { 4 }{ 4 }{ 5 }{ 6 } ,
+ { -3 }{ -3 }{ -4 }{ -5 } ,
+ { 3 }{ 3 }{ 4 }{ 5 } ,
+ { -2 }{ -2 }{ -3 }{ -4 } ,
+ { 2 }{ 2 }{ 3 }{ 4 } ,
+ { -1 }{ -1 }{ -2 }{ -3 } ,
+ { 1 }{ 1 }{ 2 }{ 3 } ,
+ { -0 }{ -0 }{ -1 }{ -2 } ,
+ { 0 }{ 0 }{ 1 }{ 2 }
+ }
+ { \ctex_declare_math_sizes:nnnn #1 }
+\cs_new_protected:Npn \ctex_set_font_size:Nnn #1#2#3
+ {
+ \prop_get:NnNTF \c__ctex_font_size_prop {#2} \l__ctex_font_size_tl
+ { \exp_after:wN \__ctex_set_font_size:nnNn \l__ctex_font_size_tl #1 {#3} }
+ { \msg_error:nnn { ctex } { fontsize } {#2} }
+ }
+\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
+ \ctex_file_input:n { ctex-c5size.clo }
+\or:
+ \ctex_file_input:n { ctex-cs4size.clo }
+\fi:
+\fp_compare:nNnF { \l__ctex_line_spread_fp } ? { \c_zero_fp }
+ {
+ \linespread { \fp_use:N \l__ctex_line_spread_fp }
+ \group_begin: \footnotesize \exp_args:NNNo \group_end:
+ \dim_set:Nn \footnotesep { \dim_use:N \box_ht:N \strutbox }
+ }
+\normalsize
+\NewDocumentCommand \CTeX { }
+ { \ifincsname CTeX \else: C \TeX \fi: }
+\AtBeginDocument
+ {
+ \cs_if_exist_use:NT \pdfstringdefDisableCommands
+ { { \tl_set:Nn \CTeX { CTeX } } }
+ }
+\keys_define:nn { ctex }
+ {
+ captiondelimiter .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { You~can~load~the~package~`caption'~to~get~its~functionality. }
+ }
+ }
+\group_begin:
+\char_set_catcode_other:N \#
+\use:n
+ {
+ \group_end:
+ \ExplSyntaxOff
+ \ctex_at_end_package:nn { breqn }
+ {
+ \ctex_patch_cmd:NnnTF \end { \csname end#1 \endcsname }
+ {
+ \csuse { @end@#1@hook }
+ \csname end#1 \endcsname
+ } { }
+ {
+ \ctex_preto_cmd:NnTF \end { \csuse { @end@#1@hook } }
+ { } { \ctex_patch_failure:N \end }
+ }
+ }
+ \ExplSyntaxOn
+ }
+\cs_new_protected_nopar:Npn \ctex_fontset_error:n #1
+ { \msg_critical:nnn { ctex } { fontset-unavailable } {#1} }
+\msg_new:nnn { ctex } { fontset-unavailable }
+ { CTeX~fontset~`#1'~is~unavailable~in~current~mode. }
+\cs_new_protected_nopar:Npn \ctex_load_fontset:
+ {
+ \tl_if_empty:NTF \g__ctex_fontset_tl
+ {
+ \ctex_detected_platform:
+ \ctex_file_input:n { ctex-fontset- \g__ctex_fontset_tl .def }
+ }
+ {
+ \file_if_exist:nTF { ctex-fontset- \g__ctex_fontset_tl .def }
+ { \ctex_file_input:n { ctex-fontset- \g__ctex_fontset_tl .def } }
+ {
+ \use:x
+ {
+ \ctex_detected_platform:
+ \msg_error:nnxx { ctex } { fontset-not-found }
+ { \g__ctex_fontset_tl } { \exp_not:N \g__ctex_fontset_tl }
+ }
+ \ctex_file_input:n { ctex-fontset- \g__ctex_fontset_tl .def }
+ }
+ }
+ }
+\@onlypreamble \ctex_load_fontset:
+\msg_new:nnnn { ctex } { fontset-not-found }
+ {
+ CTeX~fontset~`#1'~could~not~be~found.\\
+ Fontset~`#2'~will~be~used~instead.
+ }
+ { You~may~run~`mktexlsr'~firstly. }
+\keys_define:nn { ctex }
+ {
+ fontset .code:n =
+ {
+ \ctex_if_preamble:TF
+ {
+ \str_if_eq_x:nnTF {#1} { none }
+ { \msg_warning:nnn { ctex } { invalid-value } {#1} }
+ {
+ \str_if_eq:onTF { \g__ctex_fontset_tl } { none }
+ {
+ \tl_gset:Nx \g__ctex_fontset_tl {#1}
+ \ctex_load_fontset:
+ }
+ {
+ \msg_error:nnxx { ctex } { fontset-loaded }
+ { \g__ctex_fontset_tl } {#1}
+ }
+ }
+ }
+ { \msg_error:nn { ctex } { fontset-only-preamble } }
+ }
+ }
+\msg_new:nnnn { ctex } { fontset-loaded }
+ {
+ CTeX~fontset~`#1'~has~been~loaded.
+ \str_if_eq:nnF {#1} {#2} { \\ Fontset~`#2'~will~be~ignored. }
+ }
+ { Only~one~fontset~can~be~loaded~in~the~preamble. }
+\msg_new:nnn { ctex } { fontset-only-preamble }
+ {
+ The~ `fontset'~ option~ can~ be~ used~ only~ in~ preamble.
+ }
+\str_if_eq:onF { \g__ctex_fontset_tl } { none }
+ { \ctex_load_fontset: }
+\ctex_at_end:n { \ctex_file_input:n { ctex.cfg } }
+%%
+%% This package consists of the file ctex.dtx,
+%% and the derived files ctex.pdf,
+%% ctex.ins,
+%% ctex.sty,
+%% ctexcap.sty,
+%% ctexsize.sty,
+%% ctexart.cls,
+%% ctexbook.cls,
+%% ctexrep.cls,
+%% ctex-c5size.clo,
+%% ctex-cs4size.clo,
+%% ctex-article.def,
+%% ctex-book.def,
+%% ctex-report.def,
+%% ctex-scheme-plain.def,
+%% ctex-scheme-plain-article.def,
+%% ctex-scheme-plain-book.def,
+%% ctex-scheme-plain-report.def,
+%% ctex-scheme-chinese.def,
+%% ctex-scheme-chinese-article.def,
+%% ctex-scheme-chinese-book.def,
+%% ctex-scheme-chinese-report.def,
+%% ctex-name-gbk.cfg,
+%% ctex-name-utf8.cfg,
+%% ctex.cfg,
+%% ctexopts.cfg,
+%% ctex-engine-pdftex.def,
+%% ctex-engine-xetex.def,
+%% ctex-engine-luatex.def,
+%% c19rm.fd,
+%% c19sf.fd,
+%% c19tt.fd,
+%% c70rm.fd,
+%% c70sf.fd,
+%% c70tt.fd,
+%% ctex-fontset-windows.def,
+%% ctex-fontset-windowsnew.def,
+%% ctex-fontset-windowsold.def,
+%% ctex-fontset-adobe.def,
+%% ctex-fontset-fandol.def,
+%% ctex-fontset-mac.def,
+%% ctex-fontset-founder.def,
+%% ctex-fontset-ubuntu.def,
+%% ctexspa.def,
+%% ctexpunct.spa,
+%% ctexmakespa.tex,
+%% ctexspamacro.tex,
+%% zhadobefonts.tex,
+%% zhfandolfonts.tex,
+%% zhfounderfonts.tex,
+%% zhubuntufonts.tex,
+%% zhwindowsfonts.tex, and
+%% README.
+%%
+%% End of file `ctexbook.cls'.
diff --git a/Master/texmf-dist/tex/latex/ctex/ctexcap.sty b/Master/texmf-dist/tex/latex/ctex/ctexcap.sty
index 1f880e8dbb4..f60d398afe1 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctexcap.sty
+++ b/Master/texmf-dist/tex/latex/ctex/ctexcap.sty
@@ -1,30 +1,92 @@
-% ctexcap.sty
-
-\NeedsTeXFormat{LaTeX2e}[1995/12/01]
-\ProvidesPackage{ctexcap}
- [2014/06/09 v1.02d ctexcap
- macros package]
-
-\input{ctex-common-opts.def}
-\input{ctex-caption-opts.def}
-
-\InputIfFileExists{ctexopts.cfg}{}{}
-
-\ProcessOptions
-
-\input{ctex-common.def}
-\input{ctex-caption.def}
-
-\@ifundefined{if@mainmatter}{\let\if@mainmatter\iftrue}{}
-
-\ifCTEX@cls{article}{\input{ctex-article.def}}{}
-\ifCTEX@cls{report}{\input{ctex-report.def}}{}
-\ifCTEX@cls{book}{\input{ctex-book.def}}{}
-
-% ctex.cfg should be loaded very last
-\AtEndOfPackage{%
- \makeatletter
- \InputIfFileExists{ctex.cfg}{}{}
- \makeatother}
-
-\endinput
+%%
+%% This is file `ctexcap.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `package,ctexcap')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\NeedsTeXFormat{LaTeX2e}
+\RequirePackage{expl3}
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {Chinese adapter in LaTeX (CTEX)}
+\ProvidesExplPackage{ctexcap}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+\PassOptionsToPackage { heading = true } { ctexcap }
+\RequirePackageWithOptions { ctex }
+%%
+%% This package consists of the file ctex.dtx,
+%% and the derived files ctex.pdf,
+%% ctex.ins,
+%% ctex.sty,
+%% ctexcap.sty,
+%% ctexsize.sty,
+%% ctexart.cls,
+%% ctexbook.cls,
+%% ctexrep.cls,
+%% ctex-c5size.clo,
+%% ctex-cs4size.clo,
+%% ctex-article.def,
+%% ctex-book.def,
+%% ctex-report.def,
+%% ctex-scheme-plain.def,
+%% ctex-scheme-plain-article.def,
+%% ctex-scheme-plain-book.def,
+%% ctex-scheme-plain-report.def,
+%% ctex-scheme-chinese.def,
+%% ctex-scheme-chinese-article.def,
+%% ctex-scheme-chinese-book.def,
+%% ctex-scheme-chinese-report.def,
+%% ctex-name-gbk.cfg,
+%% ctex-name-utf8.cfg,
+%% ctex.cfg,
+%% ctexopts.cfg,
+%% ctex-engine-pdftex.def,
+%% ctex-engine-xetex.def,
+%% ctex-engine-luatex.def,
+%% c19rm.fd,
+%% c19sf.fd,
+%% c19tt.fd,
+%% c70rm.fd,
+%% c70sf.fd,
+%% c70tt.fd,
+%% ctex-fontset-windows.def,
+%% ctex-fontset-windowsnew.def,
+%% ctex-fontset-windowsold.def,
+%% ctex-fontset-adobe.def,
+%% ctex-fontset-fandol.def,
+%% ctex-fontset-mac.def,
+%% ctex-fontset-founder.def,
+%% ctex-fontset-ubuntu.def,
+%% ctexspa.def,
+%% ctexpunct.spa,
+%% ctexmakespa.tex,
+%% ctexspamacro.tex,
+%% zhadobefonts.tex,
+%% zhfandolfonts.tex,
+%% zhfounderfonts.tex,
+%% zhubuntufonts.tex,
+%% zhwindowsfonts.tex, and
+%% README.
+%%
+%% End of file `ctexcap.sty'.
diff --git a/Master/texmf-dist/tex/latex/ctex/ctexrep.cls b/Master/texmf-dist/tex/latex/ctex/ctexrep.cls
index 557e94fb60e..933298d00c4 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctexrep.cls
+++ b/Master/texmf-dist/tex/latex/ctex/ctexrep.cls
@@ -1,29 +1,1277 @@
-% ctexrep.cls
-
-\NeedsTeXFormat{LaTeX2e}[1995/12/01]
-\ProvidesClass{ctexrep}
- [2014/06/09 v1.02d ctexrep
- document class]
-
-\def\CTEX@classtoload{report}
-
-\input{ctex-common-opts.def}
-\input{ctex-caption-opts.def}
-\input{ctex-class-opts.def}
-
-\InputIfFileExists{ctexopts.cfg}{}{}
-
-\input{ctex-loadclass.def}
-
-\input{ctex-common.def}
-\input{ctex-caption.def}
-\input{ctex-class.def}
-\input{ctex-report.def}
-
-% ctex.cfg should be loaded very last
-\AtEndOfPackage{%
- \makeatletter
- \InputIfFileExists{ctex.cfg}{}{}
- \makeatother}
-
-\endinput
+%%
+%% This is file `ctexrep.cls',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `class,report')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\NeedsTeXFormat{LaTeX2e}
+\RequirePackage{expl3}
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {Chinese adapter for class report (CTEX)}
+\ProvidesExplClass{ctexrep}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+\RequirePackage { xparse , l3keys2e }
+\msg_new:nnnn { ctex } { l3-too-old }
+ { Support~package~`#1'~too~old. }
+ {
+ Please~update~an~up~to~date~version~of~the~bundles\\\\
+ `l3kernel'~and~`l3packages'\\\\
+ using~your~TeX~package~manager~or~from~CTAN.
+ }
+\@ifpackagelater { expl3 } { 2014/07/20 } { }
+ { \msg_error:nnn { ctex } { l3-too-old } { expl3 } }
+\@ifpackagelater { l3keys2e } { 2014/05/05 } { }
+ { \msg_error:nnn { ctex } { l3-too-old } { l3keys2e } }
+\RequirePackage { etoolbox , ifpdf , fix-cm , everysel }
+\tl_new:N \l__ctex_tmp_tl
+\int_new:N \l__ctex_tmp_int
+\dim_new:N \l__ctex_tmp_dim
+\box_new:N \l__ctex_tmp_box
+\msg_new:nnnn { ctex } { package-too-old }
+ { Support~package~`#1'~too~old. }
+ {
+ Please~update~an~up~to~date~version~of~the~package~`#1'\\
+ using~your~TeX~package~manager~or~from~CTAN.
+ }
+\cs_new_eq:NN \ctex_lua_now_x:n \luatex_directlua:D
+\ifpdf
+ \cs_new_eq:NN \ctex_if_pdfmode:TF \use_i:nn
+\else:
+ \cs_new_eq:NN \ctex_if_pdfmode:TF \use_ii:nn
+\fi:
+\prg_new_conditional:Npnn \ctex_if_preamble: { TF }
+ {
+ \if_meaning:w \@onlypreamble \@notprerr
+ \prg_return_false:
+ \else:
+ \prg_return_true:
+ \fi:
+ }
+\cs_new_protected:Npn \ctex_at_end_package:nn #1#2
+ {
+ \@ifpackageloaded { #1 }
+ { #2 }
+ { \ctex_add_hook:cn { g__ctex_at_end_ #1 _hook_tl } { #2 } }
+ }
+\cs_new_protected:Npn \ctex_add_hook:Nn #1#2
+ {
+ \tl_if_exist:NF #1 { \tl_new:N #1 }
+ \tl_gput_right:Nn #1 { #2 }
+ }
+\cs_generate_variant:Nn \ctex_add_hook:Nn { c }
+\cs_new_protected_nopar:Npn \ctex_package_end_hook:n #1
+ {
+ \cs_if_exist_use:cT { g__ctex_at_end_ #1 _hook_tl }
+ { \cs_undefine:c { g__ctex_at_end_ #1 _hook_tl } }
+ }
+\cs_generate_variant:Nn \ctex_package_end_hook:n { o }
+\tl_put_left:Nn \@popfilename
+ { \ctex_package_end_hook:o { \@currname } }
+\cs_new_protected:Npn \ctex_file_wrapper:nnn #1#2#3
+ {
+ \use:x
+ {
+ \ExplSyntaxOff
+ \char_set_catcode_letter:n { 64 }
+ #1
+ \exp_not:n {#2}
+ \bool_if:NTF \l__kernel_expl_bool
+ { \ExplSyntaxOn }
+ { \ExplSyntaxOff }
+ \char_set_catcode:nn { 64 } { \char_value_catcode:n { 64 } }
+ #3
+ }
+ }
+\cs_new_protected_nopar:Npn \ctex_file_input:n #1
+ { \ctex_file_wrapper:nnn { } { \file_input:n {#1} } { } }
+\cs_new_protected_nopar:Npn \ctex_scheme_input:n #1
+ {
+ \ctex_file_wrapper:nnn
+ { }
+ {
+ \tl_if_exist:NTF \c__ctex_class_tl
+ {
+ \file_if_exist_input:nF { ctex-scheme- #1 - \c__ctex_class_tl .def }
+ { \file_input:n { ctex-scheme- #1 .def } }
+ }
+ { \file_input:n { ctex-scheme- #1 .def } }
+ }
+ { }
+ }
+\cs_generate_variant:Nn \ctex_scheme_input:n { o }
+\cs_new_protected:Npn \ctex_parse_name:NN #1#2
+ { \ctex_parse_name:NNx #1#2 { \cs_to_str:N #2 } }
+\group_begin:
+\char_set_lccode:nn { `\< } { `\{ }
+\char_set_lccode:nn { `\/ } { `\\ }
+\char_set_lccode:nn { `\A } { `\t }
+\tl_map_function:nN { \A \E \S \O \P } \char_set_catcode_other:N
+\tex_lowercase:D
+ {
+ \group_end:
+ \cs_new_protected:Npn \ctex_parse_name:NNn #1#2#3
+ {
+ \bool_if:nTF { \cs_if_exist_p:c { #3 ~ } || \cs_if_exist_p:c { /#3 } }
+ {
+ \group_begin:
+ \use:x
+ {
+ \__ctex_parse_name:nNNNnN { \token_get_replacement_spec:N #2 }
+ \exp_not:N #2 \exp_not:c { #3 ~ } \exp_not:c { /#3 } {#3}
+ } #1
+ }
+ { #1#2 }
+ }
+ \cs_new_protected:Npn \__ctex_parse_name:nNNNnN #1#2#3#4#5#6
+ {
+ \group_end:
+ \exp_args:Nc #6
+ {
+ \str_case:nnTF {#1}
+ {
+ { \protect #3 } { }
+ { \x@protect #2 \protect #3 } { }
+ }
+ {
+ \str_if_eq_x:nnTF { \exp_not:n { /@protected@ #3 /#3 } }
+ {
+ \exp_last_unbraced:Nf \__ctex_parse_name:w
+ \token_get_replacement_spec:N #3 AESAOPA ~ < \q_stop
+ }
+ { /#5 ~ } { #5 ~ }
+ }
+ {
+ \str_case:onTF { \__ctex_parse_name:w #1 AESAOPA ~ < \q_stop }
+ {
+ { /@protected@ #2 #4 } { }
+ { /@ #4 } { }
+ }
+ { /#5 } {#5}
+ }
+ }
+ }
+ \cs_new:Npn \__ctex_parse_name:w #1 AESAOPA ~ #2 < #3 \q_stop { #1#2 }
+ }
+\cs_generate_variant:Nn \ctex_parse_name:NNn { NNx }
+\cs_new_protected:Npn \ctex_patch_cmd:NnnTF { \ctex_parse_name:NN \patchcmd }
+\cs_new_protected:Npn \ctex_preto_cmd:NnTF { \ctex_parse_name:NN \pretocmd }
+\cs_new_protected:Npn \ctex_appto_cmd:NnTF { \ctex_parse_name:NN \apptocmd }
+\cs_new_protected:Npn \ctex_patch_cmd:Nnn
+ {
+ \group_begin:
+ \char_set_catcode_other:N \#
+ \__ctex_patch_cmd:Nnn
+ }
+\cs_new_protected:Npn \__ctex_patch_cmd:Nnn #1#2#3
+ {
+ \group_end:
+ \group_begin:
+ \ExplSyntaxOff
+ \ctex_patch_cmd:NnnTF #1 {#2} {#3}
+ {
+ \cs_gset_eq:NN \__ctex_tmp:w #1
+ \group_end:
+ \cs_set_eq:NN #1 \__ctex_tmp:w
+ \cs_undefine:N \__ctex_tmp:w
+ }
+ { \group_end: \ctex_patch_failure:N #1 }
+ }
+\cs_new_protected:Npn \ctex_patch_failure:N #1
+ { \msg_warning:nnx { ctex } { patch-failure } { \token_to_str:N #1 } }
+\msg_new:nnn { ctex } { patch-failure }
+ {
+ Patching~command~`#1'~failed.\\
+ ctex~may~not~work~as~expected.
+ }
+\cs_new:Npn \ctex_set_default_ccwd:Nn #1#2
+ {
+ \dim_compare:nNnTF
+ { \ctex_default_pt:n {#2} } = { \ctex_default_pt:n { #2 ~ mm } }
+ { \tl_set:Nn #1 {#2} }
+ { \tl_set:Nn #1 { #2 \ccwd } }
+ }
+\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
+ }
+\group_begin:
+ \char_set_catcode_other:N \P
+ \char_set_catcode_other:N \T
+\tex_lowercase:D
+ {
+ \group_end:
+ \cs_new:Npn \__ctex_default_pt:w #1 PT #2 \q_stop { #1 PT }
+ }
+\tl_new:N \l__ctex_encoding_tl
+\tl_set:Nx \l__ctex_encoding_tl
+ { \pdftex_if_engine:TF { GBK } { UTF8 } }
+\cs_new_eq:NN \g__ctex_section_depth_flag \c_two
+\bool_new:N \g__ctex_zhmCJK_bool
+\tl_new:N \l__ctex_autoindent_tl
+\cs_new_eq:NN \ctex_if_autoindent_touched:F \use:n
+\cs_new_eq:NN \ctex_zhmap_case:nnn \use_ii:nnn
+\cs_new_protected_nopar:Npn \ctex_at_end:n { \AtEndOfClass }
+\clist_new:N \g__ctex_std_options_clist
+\msg_new:nnn { ctex } { invalid-option }
+ { Option~`\l_keys_key_tl'~is~invalid~in~current~mode. }
+\msg_new:nnn { ctex } { invalid-value }
+ { Value~`#1'~is~invalid~for~the~key~`\l_keys_key_tl'. }
+\msg_new:nnn { ctex } { deprecated-option }
+ { Option~ `\l_keys_key_tl'~ is~ deprecated.\\ #1 }
+\msg_new:nnn { ctex } { deprecated-command }
+ { Command~ #1 is~ deprecated.\\ #2 }
+\msg_new:nnn { ctex } { deprecated-environment }
+ { Environment~ `#1'~ is~ deprecated.\\ #2 }
+\cs_new_eq:NN \g__ctex_font_size_flag \c_minus_one
+\keys_define:nn { ctex / option }
+ {
+ zihao .choice: ,
+ zihao .default:n = { 5 } ,
+ 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 } ,
+ c5size .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { Option~ `zihao=5'~ is~ set. }
+ \keys_set:nn { ctex / option } { zihao = 5 }
+ } ,
+ cs4size .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { Option~ `zihao=-4'~ is~ set. }
+ \keys_set:nn { ctex / option } { zihao = -4 }
+ } ,
+ c5size .value_forbidden: ,
+ cs4size .value_forbidden: ,
+ linespread .fp_set:N = \l__ctex_line_spread_fp ,
+ linespread .initial:n = { \c_nan_fp } ,
+ linespread .value_required: ,
+ autoindent .choice: ,
+ autoindent .default:n = { true } ,
+ autoindent / true .code:n =
+ {
+ \tl_set:Nn \l__ctex_autoindent_tl { 2 \ccwd }
+ \cs_set_eq:NN \ctex_if_autoindent_touched:F \use_none:n
+ } ,
+ autoindent / false .code:n =
+ {
+ \tl_clear:N \l__ctex_autoindent_tl
+ \cs_set_eq:NN \ctex_if_autoindent_touched:F \use_none:n
+ } ,
+ autoindent / unknown .code:n =
+ {
+ \ctex_set_default_ccwd:Nn \l__ctex_autoindent_tl {#1}
+ \cs_set_eq:NN \ctex_if_autoindent_touched:F \use_none:n
+ } ,
+ indent .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ {
+ The~ indentfirst~ package~ will~ be~ loaded~ but~ the~
+ functionality~ may~ be~ removed~ in~ later~ version.
+ It's~ better~ to~ set~ the~ heading~ styles~ via~ beforeskip~
+ options.~
+ }
+ \keys_set:nn { ctex / option } { autoindent = true }
+ } ,
+ indent .value_forbidden: ,
+ noindent .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ {
+ The~ functionality~ has~ been~ removed.~
+ It's~ better~ to~ set~ the~ heading~ styles~ via~ beforeskip~
+ options.
+ }
+ \keys_set:nn { ctex / option } { autoindent = false }
+ } ,
+ noindent .value_forbidden: ,
+ GBK .code:n = { \tl_set:Nn \l__ctex_encoding_tl { GBK } } ,
+ UTF8 .code:n = { \tl_set:Nn \l__ctex_encoding_tl { UTF8 } } ,
+ GBK .value_forbidden: ,
+ UTF8 .value_forbidden: ,
+ fontset .tl_gset:N = \g__ctex_fontset_tl ,
+ nofonts .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ {
+ Option~ `fontset=none'~ is~ set.~ It~ is~ better~ to~ use~
+ fontset~ option.
+ }
+ \keys_set:nn { ctex / option } { fontset = none }
+ } ,
+ adobefonts .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ {
+ Option~ `fontset=adobe'~ is~ set.~ It~ is~ better~ to~ use~
+ fontset~ option.
+ }
+ \keys_set:nn { ctex / option } { fontset = none }
+ } ,
+ winfonts .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ {
+ Option~ `fontset=windows'~ is~ set.~ It~ is~ better~ to~ use~
+ fontset~ option.
+ }
+ \keys_set:nn { ctex / option } { fontset = none }
+ } ,
+ nofonts .value_forbidden: ,
+ winfonts .value_forbidden: ,
+ adobefonts .value_forbidden: ,
+ zhmap .choice: ,
+ zhmap .default:n = { true } ,
+ zhmap / zhmCJK .code:n =
+ {
+ \bool_gset_true:N \g__ctex_zhmCJK_bool
+ \cs_gset_eq:NN \ctex_zhmap_case:nnn \use_i:nnn
+ } ,
+ zhmap / true .code:n =
+ {
+ \bool_gset_false:N \g__ctex_zhmCJK_bool
+ \cs_gset_eq:NN \ctex_zhmap_case:nnn \use_ii:nnn
+ } ,
+ zhmap / false .code:n =
+ {
+ \bool_gset_false:N \g__ctex_zhmCJK_bool
+ \cs_gset_eq:NN \ctex_zhmap_case:nnn \use_iii:nnn
+ } ,
+ nozhmap .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { Option~ `zhmap=false'~ is~ set. }
+ \keys_set:nn { ctex / option } { zhmap = false }
+ } ,
+ nozhmap .value_forbidden: ,
+ punct .tl_set:N = \l__ctex_punct_tl ,
+ punct .default:n = { quanjiao } ,
+ punct .initial:n = { quanjiao } ,
+ nopunct .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { Option~ `punct=plain'~ is~ set. }
+ \keys_set:nn { ctex / option } { punct = plain }
+ } ,
+ nopunct .value_forbidden: ,
+ space .choices:nn =
+ { true , auto , false }
+ {
+ \exp_args:Nx \ctex_at_end:n
+ { \keys_set:nn { ctex } { space = \l_keys_choice_tl } }
+ } ,
+ space .default:n = { true } ,
+ nospace .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { Option~ `space=false'~ is~ set. }
+ \keys_set:nn { ctex / option } { space = false }
+ } ,
+ nospace .value_forbidden: ,
+ heading .bool_set:N = \l__ctex_heading_bool ,
+ scheme .tl_set:N = \l__ctex_scheme_tl ,
+ scheme .default:n = { chinese },
+ scheme .initial:n = { chinese },
+ cap .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { Option~ `scheme = chinese' ~ is~ set. }
+ \keys_set:nn { ctex / option } { scheme = chinese }
+ } ,
+ nocap .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { Option~ `scheme = plain' ~ is~ set. }
+ \keys_set:nn { ctex / option } { scheme = plain }
+ } ,
+ cap .value_forbidden: ,
+ nocap .value_forbidden: ,
+ sub3section .code:n =
+ { \cs_gset_eq:NN \g__ctex_section_depth_flag \c_three } ,
+ sub4section .code:n =
+ { \cs_gset_eq:NN \g__ctex_section_depth_flag \c_four } ,
+ sub3section .value_forbidden: ,
+ sub4section .value_forbidden: ,
+ fntef .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { `(xe)CJKfntef'~ package~ is~ always~ loaded. }
+ } ,
+ fancyhdr .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { `fancyhdr'~ package~ is~ loaded. }
+ \RequirePackage{ fancyhdr }
+ } ,
+ hyperref .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { `hyperref'~ package~ will~ be~ loaded. }
+ \AtEndPreamble { \RequirePackage { hyperref } }
+ } ,
+ }
+\tl_clear:N \l__ctex_tmp_tl
+\clist_map_inline:nn
+ {
+ 10pt , 11pt , 12pt ,
+ 8pt , 9pt , 14pt , 17pt , 20pt , 25pt , 30pt , 36pt , 48pt , 60pt
+ }
+ {
+ \tl_put_right:Nn \l__ctex_tmp_tl
+ {
+ #1 .code:n =
+ {
+ \cs_gset_eq:NN \g__ctex_font_size_flag \c_minus_one
+ \clist_gput_right:Nn \g__ctex_std_options_clist {#1}
+ } ,
+ #1 .value_forbidden: ,
+ }
+ }
+\use:x { \keys_define:nn { ctex / option } { \exp_not:o { \l__ctex_tmp_tl } } }
+\tl_clear:N \l__ctex_tmp_tl
+\keys_define:nn { ctex / option }
+ {
+ unknown .code:n =
+ { \clist_gput_right:No \g__ctex_std_options_clist { \CurrentOption } }
+ }
+\ctex_file_input:n { ctexopts.cfg }
+\ProcessKeysOptions { ctex / option }
+\if_case:w \g__ctex_font_size_flag
+ \clist_gput_right:Nn \g__ctex_std_options_clist { 10pt }
+\or:
+ \clist_gput_right:Nn \g__ctex_std_options_clist { 12pt }
+\fi:
+\tl_const:Nn \c__ctex_class_tl { report }
+\PassOptionsToClass { \g__ctex_std_options_clist } { report }
+\LoadClass { report }
+\tl_set_eq:Nc \l__ctex_tmp_tl { ver@ \@currname . \@currext }
+\cs_new_eq:cN { ver@ctex. \@pkgextension } \l__ctex_tmp_tl
+\cs_new_eq:cN { ver@ctexcap. \@pkgextension } \l__ctex_tmp_tl
+\cs_new_eq:cN { ver@ctexsize. \@pkgextension } \l__ctex_tmp_tl
+\NewDocumentCommand \ctexset { +m }
+ { \keys_set:nn { ctex } {#1} }
+\NewDocumentCommand \CTEXsetup { +o > { \TrimSpaces } m }
+ {
+ \msg_warning:nnnn { ctex } { deprecated-command } { \CTEXsetup }
+ { \ctexset~ {~ #2~ =~ {~ #1~ }~ }~ is~ set. }
+ \IfNoValueF {#1} { \keys_set:nn { ctex / #2 } {#1} }
+ }
+\NewDocumentCommand \CTEXoptions { +o }
+ {
+ \msg_warning:nnnn { ctex } { deprecated-command } { \CTEXoptions }
+ { \ctexset~ {~ #1~ }~ is~ set. }
+ \IfNoValueF {#1} { \keys_set:nn { ctex } {#1} }
+ }
+\@ifpackageloaded { hyperref }
+ {
+ \cs_new_protected_nopar:Npn \ctex_hypersetup:n #1
+ { \hypersetup {#1} }
+ }
+ {
+ \cs_new_protected_nopar:Npn \ctex_hypersetup:n #1
+ { \PassOptionsToPackage {#1} { hyperref } }
+ }
+\ctex_hypersetup:n { colorlinks = true }
+\pdftex_if_engine:TF
+ {
+ \tl_set:Nx \l__ctex_encoding_tl { \l__ctex_encoding_tl }
+ \ctex_file_input:n { ctex-engine-pdftex.def }
+ }
+ {
+ \tl_set:Nn \l__ctex_encoding_tl { UTF8 }
+ \xetex_if_engine:TF
+ { \ctex_file_input:n { ctex-engine-xetex.def } }
+ { \ctex_file_input:n { ctex-engine-luatex.def } }
+ }
+\keys_define:nn { ctex }
+ {
+ autoindent .choice: ,
+ autoindent .default:n = { true } ,
+ autoindent / true .code:n =
+ {
+ \tl_set:Nn \l__ctex_autoindent_tl { 2 \ccwd }
+ \ctex_select_size:
+ } ,
+ autoindent / false .code:n =
+ { \tl_clear:N \l__ctex_autoindent_tl } ,
+ autoindent / unknown .code:n =
+ {
+ \ctex_set_default_ccwd:Nn \l__ctex_autoindent_tl {#1}
+ \ctex_select_size:
+ }
+ }
+\NewDocumentCommand \CTEXsetfont { } { \ctex_select_size: }
+\cs_new_protected_nopar:Npn \ctex_select_size:
+ { \cs_if_free:NTF \size@update { \ctex_update_size: } { \selectfont } }
+\cs_new_protected_nopar:Npn \ctex_update_size:
+ {
+ \tl_if_eq:NNTF \l__ctex_ziju_tl \c__ctex_zero_tl
+ {
+ \ctex_update_stretch:
+ \ctex_update_parindent:
+ }
+ { \ctex_update_ziju: }
+ }
+\tl_const:Nx \c__ctex_zero_tl { \fp_use:N \c_zero_fp }
+\tl_new:N \l__ctex_ziju_tl
+\tl_set_eq:NN \l__ctex_ziju_tl \c__ctex_zero_tl
+\ctex_add_to_selectfont:n
+ { \cs_if_free:NF \size@update { \ctex_update_size: } }
+\keys_define:nn { ctex }
+ {
+ linestretch .code:n =
+ {
+ \ctex_set_default_ccwd:Nn \l__ctex_line_stretch_tl {#1}
+ \ctex_select_size:
+ } ,
+ linestretch .value_required:
+ }
+\tl_new:N \l__ctex_line_stretch_tl
+\tl_set:Nn \l__ctex_line_stretch_tl { \ccwd }
+\cs_new_protected_nopar:Npn \ctex_update_stretch:
+ {
+ \ctex_update_em_unit:
+ \dim_set:Nn \l__ctex_tmp_dim { \l__ctex_line_stretch_tl }
+ \dim_compare:nNnTF \l__ctex_tmp_dim = \c_max_dim
+ {
+ \ctex_if_ccglue_touched:TF
+ { \ctex_update_ccwd: }
+ {
+ \dim_set:Nn \l__ctex_tmp_dim
+ { \baselinestretch \etex_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:
+ }
+ }
+ {
+ \int_set:Nn \l__ctex_tmp_int
+ { \etex_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
+ {
+ \skip_set:Nn \l__ctex_ccglue_skip
+ {
+ \c_zero_dim plus \dim_eval:n
+ {
+ ( \linewidth - \ccwd - \l__ctex_tmp_int \ccwd ) /
+ \l__ctex_tmp_int
+ }
+ }
+ }
+ { \skip_zero:N \l__ctex_ccglue_skip }
+ \ctex_update_ccglue:
+ }
+ }
+\cs_new_protected_nopar:Npn \ctex_update_parindent:
+ {
+ \tl_if_empty:NF \l__ctex_autoindent_tl
+ {
+ \dim_compare:nNnF \parindent = \c_zero_dim
+ { \dim_set:Nn \parindent { \l__ctex_autoindent_tl } }
+ }
+ }
+\NewDocumentCommand \ziju { m }
+ { \exp_args:Nx \ctex_ziju:n {#1} \tex_ignorespaces:D }
+\cs_new_protected_nopar:Npn \ctex_ziju:n #1
+ {
+ \tl_set:Nx \l__ctex_ziju_tl { \fp_eval:n {#1} }
+ \ctex_select_size:
+ }
+\cs_new_protected_nopar:Npn \ctex_update_ziju:
+ {
+ \ctex_update_em_unit:
+ \dim_set:Nn \l__ctex_ziju_dim { \l__ctex_ziju_tl \ccwd }
+ \dim_add:Nn \ccwd { \l__ctex_ziju_dim }
+ \dim_compare:nNnTF \ccwd > \c_zero_dim
+ {
+ \dim_set:Nn \l__ctex_tmp_dim
+ { \linewidth - \ccwd + \l__ctex_ziju_dim }
+ \int_set:Nn \l__ctex_tmp_int { \l__ctex_tmp_dim }
+ \tex_divide:D \l__ctex_tmp_int \ccwd
+ \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 } }
+ }
+ \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 ) }
+ }
+ }
+ { \skip_set:Nn \l__ctex_ccglue_skip { \l__ctex_ziju_dim } }
+ \ctex_update_ccglue:
+ \ctex_update_parindent:
+ }
+\dim_new:N \l__ctex_ziju_dim
+\NewDocumentCommand \CTEXindent { }
+ {
+ \msg_warning:nnnn { ctex } { deprecated-command } { \CTEXindent }
+ { \parindent is~ set~ to~ 2\ccwd. }
+ \ctex_update_ccwd: \dim_set:Nn \parindent { 2 \ccwd }
+ }
+\NewDocumentCommand \CTEXnoindent { }
+ {
+ \msg_warning:nnnn { ctex } { deprecated-command } { \CTEXnoindent }
+ { \parindent is~ set~ to~ 0pt. }
+ \dim_zero:N \parindent
+ }
+\bool_if:NT \l__ctex_indent_bool
+ { \RequirePackage { indentfirst } }
+\PassOptionsToPackage { encoding = \l__ctex_encoding_tl } { zhnumber }
+\RequirePackage { zhnumber }
+\cs_new_eq:NN \chinese \zhnum
+\cs_new_eq:NN \Chinese \chinese
+\cs_new_eq:NN \CTEXcounter \use_none:n
+\NewDocumentCommand \CTEXnumber { m m }
+ { \protected@edef #1 { \zhnumber {#2} } }
+\NewDocumentCommand \CTEXdigits { m m }
+ { \protected@edef #1 { \zhdigits {#2} } }
+\cs_set_eq:NN \CTEX@todayold \today
+\keys_define:nn { ctex }
+ {
+ today .choice: ,
+ today / old .code:n =
+ { \cs_set_eq:NN \today \CTEX@todayold } ,
+ today / small .code:n =
+ {
+ \cs_set_eq:NN \today \zhtoday
+ \zhnumsetup { time = Arabic }
+ } ,
+ today / big .code:n =
+ {
+ \cs_set_eq:NN \today \zhtoday
+ \zhnumsetup { time = Chinese }
+ } ,
+ today / unknown .code:n =
+ { \msg_error:nnx { ctex } { today-undef } {#1} }
+ }
+\msg_new:nnnn { ctex } { today-undef }
+ { Today~format~`#1'~is~undefined. }
+ { Available~today~formats~are~`old',~`small',~and~`big'. }
+\keys_define:nn { ctex }
+ {
+ contentsname .tl_set:N = \contentsname ,
+ listfigurename .tl_set:N = \listfigurename ,
+ listtablename .tl_set:N = \listtablename ,
+ figurename .tl_set:N = \figurename ,
+ tablename .tl_set:N = \tablename ,
+ abstractname .tl_set:N = \abstractname ,
+ indexname .tl_set:N = \indexname ,
+ appendixname .tl_set:N = \appendixname ,
+ bibname .tl_set:N = \bibname
+ }
+\seq_new:N \c__ctex_headings_seq
+\seq_gset_from_clist:Nn \c__ctex_headings_seq
+ {
+ part , chapter , section , subsection , subsubsection ,
+ paragraph , subparagraph
+ }
+\cs_new_protected_nopar:Npn \__ctex_initial_heading:n #1
+ {
+ \tl_new:c { CTEX@pre#1 }
+ \tl_new:c { CTEX@post#1 }
+ \tl_const:cx { CTEXthe#1 }
+ {
+ \exp_not:c { CTEX@pre#1 }
+ \exp_not:c { CTEX@the#1 }
+ \exp_not:c { CTEX@post#1 }
+ }
+ \tl_const:cx { CTEX@#1name }
+ {
+ \exp_not:c { CTEX@#1@nameformat }
+ \exp_not:c { CTEX@pre#1 }
+ \exp_not:N \tl_if_empty:NTF \exp_not:c { CTEX@#1@numberformat }
+ { \exp_not:c { CTEX@the#1 } }
+ {
+ \group_begin:
+ \exp_not:c { CTEX@#1@numberformat }
+ \exp_not:c { CTEX@the#1 }
+ \group_end:
+ }
+ \exp_not:c { CTEX@post#1 }
+ \exp_not:c { CTEX@#1@aftername }
+ }
+ }
+\cs_new_protected_nopar:Npn \__ctex_def_heading_keys:n #1
+ {
+ \tl_put_right:Nx \l__ctex_tmp_tl
+ {
+ #1 .meta:nn = { ctex / #1 } { ####1 } ,
+ #1 / name .code:n =
+ { \ctex_assign_heading_name:nn {#1} { ####1 } } ,
+ #1 / number .tl_set:N = \exp_not:c { CTEX@the#1 } ,
+ #1 / format .tl_set:N = \exp_not:c { CTEX@#1@format } ,
+ #1 / nameformat .tl_set:N = \exp_not:c { CTEX@#1@nameformat } ,
+ #1 / numberformat .tl_set:N = \exp_not:c { CTEX@#1@numberformat } ,
+ #1 / aftername .tl_set:N = \exp_not:c { CTEX@#1@aftername } ,
+ #1 / titleformat .tl_set:N = \exp_not:c { CTEX@#1@titleformat } ,
+ #1 / beforeskip .tl_set:N = \exp_not:c { CTEX@#1@beforeskip } ,
+ #1 / afterskip .tl_set:N = \exp_not:c { CTEX@#1@afterskip} ,
+ #1 / indent .tl_set:N = \exp_not:c { CTEX@#1@indent } ,
+ #1 / format+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@format } { ####1 } } ,
+ #1 / nameformat+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@nameformat } { ####1 } } ,
+ #1 / numberformat+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@numberformat } { ####1 } } ,
+ #1 / aftername+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftername } { ####1 } } ,
+ #1 / titleformat+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@titleformat } { ####1 } } ,
+ #1 / beforeskip .initial:n = \c_zero_skip ,
+ #1 / afterskip .initial:n = \c_zero_skip ,
+ #1 / indent .initial:n = \c_zero_dim ,
+ #1 / beforeskip .value_required: ,
+ #1 / afterskip .value_required: ,
+ #1 / indent .value_required: ,
+ }
+ }
+\NewDocumentCommand \ctex_assign_heading_name:nn
+ { m > { \SplitArgument { \c_one } { , } } +m }
+ { \__ctex_assign_heading_name:nnn {#1} #2 }
+\cs_new_protected:Npn \__ctex_assign_heading_name:nnn #1#2#3
+ {
+ \tl_set:cn { CTEX@pre#1 } {#2}
+ \IfNoValueTF {#3}
+ { \tl_clear:c { CTEX@post#1 } }
+ { \tl_set:cn { CTEX@post#1 } {#3} }
+ }
+\tl_clear:N \l__ctex_tmp_tl
+\seq_map_inline:Nn \c__ctex_headings_seq
+ {
+ \__ctex_initial_heading:n {#1}
+ \__ctex_def_heading_keys:n {#1}
+ }
+\use:x { \keys_define:nn { ctex } { \exp_not:o { \l__ctex_tmp_tl } } }
+\tl_clear:N \l__ctex_tmp_tl
+\keys_define:nn { ctex }
+ {
+ part / pagestyle .tl_set:N = \CTEX@part@pagestyle ,
+ chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle
+ }
+\def\@part[#1]#2{%
+ \thispagestyle{\CTEX@part@pagestyle}%
+ \ifnum \c@secnumdepth >-2\relax
+ \refstepcounter{part}%
+ \addcontentsline{toc}{part}{\CTEXthepart\hspace{1em}#1}%
+ \else
+ \addcontentsline{toc}{part}{#1}%
+ \fi
+ \markboth{}{}%
+ {\interlinepenalty \@M
+ \normalfont \CTEX@part@format
+ \ifnum \c@secnumdepth >-2\relax
+ \CTEX@partname
+ \fi
+ \CTEX@part@titleformat{#2}\par}%
+ \@endpart}
+\def\@spart#1{%
+ {\interlinepenalty \@M
+ \normalfont \CTEX@part@format
+ \CTEX@part@titleformat{#1}\par}%
+ \@endpart}
+\def\@chapter[#1]#2{%
+ \ifnum \c@secnumdepth >\m@ne
+ \refstepcounter{chapter}%
+ \typeout{\CTEXthechapter}%
+ \addcontentsline{toc}{chapter}
+ {\protect\numberline{\CTEXthechapter\hspace{0.3em}}#1}%
+ \else
+ \addcontentsline{toc}{chapter}{#1}%
+ \fi
+ \chaptermark{#1}%
+ \addtocontents{lof}{\protect\addvspace{10\p@}}%
+ \addtocontents{lot}{\protect\addvspace{10\p@}}%
+ \if@twocolumn
+ \@topnewpage[\@makechapterhead{#2}]%
+ \else
+ \@makechapterhead{#2}%
+ \@afterheading
+ \fi}
+\def\@makechapterhead#1{%
+ \thispagestyle{\CTEX@chapter@pagestyle}%
+ \@tempskipa \CTEX@chapter@beforeskip \relax
+ \ifdim \@tempskipa <\z@
+ \@tempskipa -\@tempskipa \@afterindentfalse
+ \else
+ \@afterindenttrue
+ \fi
+ \vspace*{\@tempskipa}%
+ {\normalfont \parindent \CTEX@chapter@indent \CTEX@chapter@format
+ \ifnum \c@secnumdepth >\m@ne
+ \CTEX@chaptername
+ \fi
+ \interlinepenalty\@M
+ \CTEX@chapter@titleformat{#1}\par\nobreak
+ \vskip \CTEX@chapter@afterskip
+ }}
+\def\@makeschapterhead#1{%
+ \thispagestyle{\CTEX@chapter@pagestyle}%
+ \@tempskipa \CTEX@chapter@beforeskip \relax
+ \ifdim \@tempskipa <\z@
+ \@tempskipa -\@tempskipa \@afterindentfalse
+ \else
+ \@afterindenttrue
+ \fi
+ \vspace*{\@tempskipa}%
+ {\normalfont \parindent \CTEX@chapter@indent \CTEX@chapter@format
+ \interlinepenalty\@M
+ \CTEX@chapter@titleformat{#1}\par\nobreak
+ \vskip \CTEX@chapter@afterskip
+ }}
+\def\@seccntformat#1{%
+ \@ifundefined{CTEX@#1name}%
+ {\csname the#1\endcsname\quad}%
+ {\csname CTEX@#1name\endcsname}}
+\def\@sect#1#2#3#4#5#6[#7]#8{%
+ \ifnum #2>\c@secnumdepth
+ \let\@svsec\@empty
+ \else
+ \refstepcounter{#1}%
+ \protected@edef\@svsec{\@seccntformat{#1}\relax}%
+ \fi
+ \@tempskipa #5\relax
+ \ifdim \@tempskipa>\z@
+ \begingroup
+ #6{%
+ \@hangfrom{\hskip #3\relax\@svsec}%
+ \interlinepenalty \@M
+ \csname CTEX@#1@titleformat\endcsname{#8}\@@par}%
+ \endgroup
+ \csname #1mark\endcsname{#7}%
+ \addcontentsline{toc}{#1}{%
+ \ifnum #2>\c@secnumdepth \else
+ \protect\numberline{\@ifundefined{CTEXthe#1}%
+ {\csname the#1\endcsname}%
+ {\csname CTEXthe#1\endcsname}}%
+ \fi
+ #7}%
+ \else
+ \def\@svsechd{%
+ #6{\hskip #3\relax
+ \@svsec \csname CTEX@#1@titleformat\endcsname{#8}}%
+ \csname #1mark\endcsname{#7}%
+ \addcontentsline{toc}{#1}{%
+ \ifnum #2>\c@secnumdepth \else
+ \protect\numberline{\@ifundefined{CTEXthe#1}%
+ {\csname the#1\endcsname}%
+ {\csname CTEXthe#1\endcsname}}%
+ \fi
+ #7}}%
+ \fi
+ \@xsect{#5}}
+\def\@ssect#1#2#3#4#5{%
+ \@tempskipa #3\relax
+ \ifdim \@tempskipa>\z@
+ \begingroup
+ #4{%
+ \@hangfrom{\hskip #1}%
+ \interlinepenalty \@M
+ \CTEX@titleformat@n{#5}\@@par}%
+ \endgroup
+ \else
+ \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}}}%
+ \fi
+ \@xsect{#3}}
+\cs_new_protected_nopar:Npn \CTEX@set@titleformat@n #1
+ { \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat } }
+\cs_new_eq:NN \CTEX@titleformat@n \use:n
+\int_zero:N \l__ctex_tmp_int
+\clist_map_inline:nn
+ { section , subsection , subsubsection , paragraph , subparagraph }
+ {
+ \int_incr:N \l__ctex_tmp_int
+ \cs_gset_protected_nopar:cpx {#1}
+ {
+ \exp_not:N \@startsection {#1}
+ { \int_use:N \l__ctex_tmp_int }
+ { \exp_not:c { CTEX@#1@indent } }
+ { \exp_not:c { CTEX@#1@beforeskip } }
+ { \exp_not:c { CTEX@#1@afterskip } }
+ {
+ \CTEX@set@titleformat@n {#1}
+ \exp_not:N \normalfont \exp_not:c { CTEX@#1@format }
+ }
+ }
+ }
+\tl_new:N \CTEX@preappendix
+\tl_new:N \CTEX@postappendix
+\keys_define:nn { ctex }
+ { appendix .meta:nn = { ctex / appendix } {#1} }
+\keys_define:nn { ctex / appendix }
+ {
+ name .code:n = { \ctex_assign_heading_name:nn { appendix } {#1} } ,
+ number .tl_set:N = \CTEX@appendixnumber
+ }
+\cs_new_eq:NN \CTEX@save@appendix \appendix
+\cs_gset_protected_nopar:Npn \appendix
+ {
+ \CTEX@save@appendix
+ \gdef \CTEX@prechapter { \CTEX@preappendix }
+ \gdef \CTEX@thechapter { \CTEX@appendixnumber }
+ \gdef \CTEX@postchapter { \CTEX@postappendix }
+ }
+\cs_new_protected:Npn \CTEX@toc@width@n #1
+ {
+ \hbox_set:Nn \l__ctex_tmp_box {#1}
+ \dim_set:Nn \@tempdima
+ {
+ \dim_max:nn { \@tempdima }
+ { \box_wd:N \l__ctex_tmp_box + \f@size \p@ / \c_two }
+ }
+ }
+\group_begin:
+\char_set_catcode_other:N \#
+\use:n
+ {
+ \group_end:
+ \ExplSyntaxOff
+ \ctex_preto_cmd:NnTF \numberline { \CTEX@toc@width@n {#1} } { }
+ { \ctex_patch_failure:N \numberline }
+ \@ifpackageloaded { tocloft }
+ { }
+ {
+ \ctex_at_end_package:nn { tocloft }
+ {
+ \ctex_preto_cmd:NnTF \numberline { \CTEX@toc@width@n {#1} } { }
+ { \ctex_patch_failure:N \numberline }
+ }
+ }
+ \ExplSyntaxOn
+ }
+\ctex_patch_cmd:Nnn \ps@headings
+ { \@chapapp\ \thechapter.~\ } { \CTEXthechapter \quad }
+\if@twoside
+ \ctex_patch_cmd:Nnn \ps@headings { \thesection.~\ } { \CTEXthesection \quad }
+\fi:
+\ctex_at_end_package:nn { fancyhdr }
+ {
+ \ctex_patch_cmd:Nnn \ps@fancy
+ { \@chapapp\ \thechapter.~\ } { \CTEXthechapter \quad }
+ \ctex_patch_cmd:Nnn \ps@fancy
+ { \thesection.~\ } { \CTEXthesection \quad }
+ }
+\cs_new_protected_nopar:Npn \CTEX@setcurrentlabel@n #1
+ {
+ \protected@edef \@currentlabel
+ {
+ \cs_if_exist:cTF { CTEX@the#1 }
+ { \exp_args:cc { p@#1 } { CTEX@the#1 } }
+ { \exp_not:o { \@currentlabel } }
+ }
+ }
+\cs_new_protected_nopar:Npn \ctex_varioref_hook:
+ {
+ \seq_map_inline:Nn \c__ctex_headings_seq
+ { \ctex_fix_varioref_label:n { ##1 } }
+ }
+\cs_new_protected_nopar:Npn \ctex_fix_varioref_label:n #1
+ {
+ \tl_if_empty:cT { p@#1 }
+ { \exp_args:Nno \labelformat {#1} { \cs:w CTEX@the#1 \cs_end: } }
+ }
+\@ifpackageloaded { varioref }
+ { \ctex_varioref_hook: }
+ {
+ \cs_new_eq:NN \CTEX@save@refstepcounter \refstepcounter
+ \RenewDocumentCommand \refstepcounter { m }
+ {
+ \CTEX@save@refstepcounter {#1}
+ \CTEX@setcurrentlabel@n {#1}
+ }
+ \ctex_at_end_package:nn { varioref } { \ctex_varioref_hook: }
+ }
+\ctex_scheme_input:o { \l__ctex_scheme_tl }
+\NewDocumentCommand \zihao { m }
+ { \exp_args:Nx \ctex_zihao:n {#1} \tex_ignorespaces:D }
+\cs_new_protected_nopar:Npn \ctex_zihao:n #1
+ {
+ \prop_get:NnNTF \c__ctex_font_size_prop {#1} \l__ctex_font_size_tl
+ { \exp_after:wN \fontsize \l__ctex_font_size_tl \selectfont }
+ { \msg_error:nnn { ctex } { fontsize } {#1} }
+ }
+\msg_new:nnnn { ctex } { fontsize }
+ { Undefined~Chinese~font~size~`#1'~in~command~\token_to_str:N \zihao.}
+ {
+ The~old~font~size~is~used~if~you~continue.\\
+ The~available~font~sizes~are~listed~as~follow.\\
+ \seq_use:Nnnn \c__ctex_font_size_seq { ~and~ } { ,~ } { ,~and~ }.
+ }
+\prop_new:N \c__ctex_font_size_prop
+\seq_new:N \c__ctex_font_size_seq
+\cs_new_protected_nopar:Npn \__ctex_save_font_size:nn #1#2
+ {
+ \use:x
+ {
+ \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 } }
+ }
+ }
+ \seq_gput_right:Nn \c__ctex_font_size_seq {#1}
+ }
+\clist_map_inline:nn
+ {
+ { 8 } { 5 bp } ,
+ { 7 } { 5.5 bp } ,
+ { -6 } { 6.5 bp } ,
+ { 6 } { 7.5 bp } ,
+ { -5 } { 9 bp } ,
+ { 5 } { 10.5 bp } ,
+ { -4 } { 12 bp } ,
+ { 4 } { 14 bp } ,
+ { -3 } { 15 bp } ,
+ { 3 } { 16 bp } ,
+ { -2 } { 18 bp } ,
+ { 2 } { 22 bp } ,
+ { -1 } { 24 bp } ,
+ { 1 } { 26 bp } ,
+ { -0 } { 36 bp } ,
+ { 0 } { 42 bp }
+ }
+ { \__ctex_save_font_size:nn #1 }
+\cs_new_protected_nopar:Npn \ctex_declare_math_sizes:nnnn #1#2#3#4
+ {
+ \__ctex_get_font_sizes:Nn \l__ctex_font_size_tl { {#1} {#2} {#3} {#4} }
+ \exp_after:wN \DeclareMathSizes \l__ctex_font_size_tl
+ }
+\cs_new_protected_nopar:Npn \__ctex_get_font_sizes:Nn #1#2
+ {
+ \tl_clear:N #1
+ \tl_map_inline:nn {#2}
+ {
+ \prop_get:NnNTF \c__ctex_font_size_prop {##1} \l__ctex_tmp_tl
+ { \tl_put_right:Nx #1 { { \tl_head:N \l__ctex_tmp_tl } } }
+ { \tl_put_right:Nx #1 { { \dim_to_decimal:n { ##1 } } } }
+ }
+ }
+\clist_map_inline:nn
+ {
+ { 8 }{ 8 }{ 5pt }{ 5pt } ,
+ { 7 }{ 7 }{ 5pt }{ 5pt } ,
+ { -6 }{ -6 }{ 5pt }{ 5pt } ,
+ { 6 }{ 6 }{ 5pt }{ 5pt } ,
+ { -5 }{ -5 }{ 6pt }{ 5pt } ,
+ { 5 }{ 5 }{ 7pt }{ 5pt } ,
+ { -4 }{ -4 }{ 8pt }{ 6pt } ,
+ { 4 }{ 4 }{ 5 }{ 6 } ,
+ { -3 }{ -3 }{ -4 }{ -5 } ,
+ { 3 }{ 3 }{ 4 }{ 5 } ,
+ { -2 }{ -2 }{ -3 }{ -4 } ,
+ { 2 }{ 2 }{ 3 }{ 4 } ,
+ { -1 }{ -1 }{ -2 }{ -3 } ,
+ { 1 }{ 1 }{ 2 }{ 3 } ,
+ { -0 }{ -0 }{ -1 }{ -2 } ,
+ { 0 }{ 0 }{ 1 }{ 2 }
+ }
+ { \ctex_declare_math_sizes:nnnn #1 }
+\cs_new_protected:Npn \ctex_set_font_size:Nnn #1#2#3
+ {
+ \prop_get:NnNTF \c__ctex_font_size_prop {#2} \l__ctex_font_size_tl
+ { \exp_after:wN \__ctex_set_font_size:nnNn \l__ctex_font_size_tl #1 {#3} }
+ { \msg_error:nnn { ctex } { fontsize } {#2} }
+ }
+\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
+ \ctex_file_input:n { ctex-c5size.clo }
+\or:
+ \ctex_file_input:n { ctex-cs4size.clo }
+\fi:
+\fp_compare:nNnF { \l__ctex_line_spread_fp } ? { \c_zero_fp }
+ {
+ \linespread { \fp_use:N \l__ctex_line_spread_fp }
+ \group_begin: \footnotesize \exp_args:NNNo \group_end:
+ \dim_set:Nn \footnotesep { \dim_use:N \box_ht:N \strutbox }
+ }
+\normalsize
+\NewDocumentCommand \CTeX { }
+ { \ifincsname CTeX \else: C \TeX \fi: }
+\AtBeginDocument
+ {
+ \cs_if_exist_use:NT \pdfstringdefDisableCommands
+ { { \tl_set:Nn \CTeX { CTeX } } }
+ }
+\keys_define:nn { ctex }
+ {
+ captiondelimiter .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { You~can~load~the~package~`caption'~to~get~its~functionality. }
+ }
+ }
+\group_begin:
+\char_set_catcode_other:N \#
+\use:n
+ {
+ \group_end:
+ \ExplSyntaxOff
+ \ctex_at_end_package:nn { breqn }
+ {
+ \ctex_patch_cmd:NnnTF \end { \csname end#1 \endcsname }
+ {
+ \csuse { @end@#1@hook }
+ \csname end#1 \endcsname
+ } { }
+ {
+ \ctex_preto_cmd:NnTF \end { \csuse { @end@#1@hook } }
+ { } { \ctex_patch_failure:N \end }
+ }
+ }
+ \ExplSyntaxOn
+ }
+\cs_new_protected_nopar:Npn \ctex_fontset_error:n #1
+ { \msg_critical:nnn { ctex } { fontset-unavailable } {#1} }
+\msg_new:nnn { ctex } { fontset-unavailable }
+ { CTeX~fontset~`#1'~is~unavailable~in~current~mode. }
+\cs_new_protected_nopar:Npn \ctex_load_fontset:
+ {
+ \tl_if_empty:NTF \g__ctex_fontset_tl
+ {
+ \ctex_detected_platform:
+ \ctex_file_input:n { ctex-fontset- \g__ctex_fontset_tl .def }
+ }
+ {
+ \file_if_exist:nTF { ctex-fontset- \g__ctex_fontset_tl .def }
+ { \ctex_file_input:n { ctex-fontset- \g__ctex_fontset_tl .def } }
+ {
+ \use:x
+ {
+ \ctex_detected_platform:
+ \msg_error:nnxx { ctex } { fontset-not-found }
+ { \g__ctex_fontset_tl } { \exp_not:N \g__ctex_fontset_tl }
+ }
+ \ctex_file_input:n { ctex-fontset- \g__ctex_fontset_tl .def }
+ }
+ }
+ }
+\@onlypreamble \ctex_load_fontset:
+\msg_new:nnnn { ctex } { fontset-not-found }
+ {
+ CTeX~fontset~`#1'~could~not~be~found.\\
+ Fontset~`#2'~will~be~used~instead.
+ }
+ { You~may~run~`mktexlsr'~firstly. }
+\keys_define:nn { ctex }
+ {
+ fontset .code:n =
+ {
+ \ctex_if_preamble:TF
+ {
+ \str_if_eq_x:nnTF {#1} { none }
+ { \msg_warning:nnn { ctex } { invalid-value } {#1} }
+ {
+ \str_if_eq:onTF { \g__ctex_fontset_tl } { none }
+ {
+ \tl_gset:Nx \g__ctex_fontset_tl {#1}
+ \ctex_load_fontset:
+ }
+ {
+ \msg_error:nnxx { ctex } { fontset-loaded }
+ { \g__ctex_fontset_tl } {#1}
+ }
+ }
+ }
+ { \msg_error:nn { ctex } { fontset-only-preamble } }
+ }
+ }
+\msg_new:nnnn { ctex } { fontset-loaded }
+ {
+ CTeX~fontset~`#1'~has~been~loaded.
+ \str_if_eq:nnF {#1} {#2} { \\ Fontset~`#2'~will~be~ignored. }
+ }
+ { Only~one~fontset~can~be~loaded~in~the~preamble. }
+\msg_new:nnn { ctex } { fontset-only-preamble }
+ {
+ The~ `fontset'~ option~ can~ be~ used~ only~ in~ preamble.
+ }
+\str_if_eq:onF { \g__ctex_fontset_tl } { none }
+ { \ctex_load_fontset: }
+\ctex_at_end:n { \ctex_file_input:n { ctex.cfg } }
+%%
+%% This package consists of the file ctex.dtx,
+%% and the derived files ctex.pdf,
+%% ctex.ins,
+%% ctex.sty,
+%% ctexcap.sty,
+%% ctexsize.sty,
+%% ctexart.cls,
+%% ctexbook.cls,
+%% ctexrep.cls,
+%% ctex-c5size.clo,
+%% ctex-cs4size.clo,
+%% ctex-article.def,
+%% ctex-book.def,
+%% ctex-report.def,
+%% ctex-scheme-plain.def,
+%% ctex-scheme-plain-article.def,
+%% ctex-scheme-plain-book.def,
+%% ctex-scheme-plain-report.def,
+%% ctex-scheme-chinese.def,
+%% ctex-scheme-chinese-article.def,
+%% ctex-scheme-chinese-book.def,
+%% ctex-scheme-chinese-report.def,
+%% ctex-name-gbk.cfg,
+%% ctex-name-utf8.cfg,
+%% ctex.cfg,
+%% ctexopts.cfg,
+%% ctex-engine-pdftex.def,
+%% ctex-engine-xetex.def,
+%% ctex-engine-luatex.def,
+%% c19rm.fd,
+%% c19sf.fd,
+%% c19tt.fd,
+%% c70rm.fd,
+%% c70sf.fd,
+%% c70tt.fd,
+%% ctex-fontset-windows.def,
+%% ctex-fontset-windowsnew.def,
+%% ctex-fontset-windowsold.def,
+%% ctex-fontset-adobe.def,
+%% ctex-fontset-fandol.def,
+%% ctex-fontset-mac.def,
+%% ctex-fontset-founder.def,
+%% ctex-fontset-ubuntu.def,
+%% ctexspa.def,
+%% ctexpunct.spa,
+%% ctexmakespa.tex,
+%% ctexspamacro.tex,
+%% zhadobefonts.tex,
+%% zhfandolfonts.tex,
+%% zhfounderfonts.tex,
+%% zhubuntufonts.tex,
+%% zhwindowsfonts.tex, and
+%% README.
+%%
+%% End of file `ctexrep.cls'.
diff --git a/Master/texmf-dist/tex/latex/ctex/ctexsize.sty b/Master/texmf-dist/tex/latex/ctex/ctexsize.sty
new file mode 100644
index 00000000000..bb8d7120944
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ctex/ctexsize.sty
@@ -0,0 +1,215 @@
+%%
+%% This is file `ctexsize.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `package,ctexsize')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\NeedsTeXFormat{LaTeX2e}
+\RequirePackage{expl3}
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {Chinese font size definition (CTEX)}
+\ProvidesExplPackage{ctexsize}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+\RequirePackage { xparse , l3keys2e }
+\cs_new_eq:NN \g__ctex_font_size_flag \c_minus_one
+\keys_define:nn { ctex / option }
+ {
+ zihao .choice: ,
+ zihao .default:n = { 5 } ,
+ 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 } ,
+ }
+\tl_clear:N \l__ctex_tmp_tl
+\clist_map_inline:nn
+ {
+ 10pt , 11pt , 12pt ,
+ 8pt , 9pt , 14pt , 17pt , 20pt , 25pt , 30pt , 36pt , 48pt , 60pt
+ }
+ {
+ \tl_put_right:Nn \l__ctex_tmp_tl
+ {
+ #1 .code:n =
+ { \cs_gset_eq:NN \g__ctex_font_size_flag \c_minus_one } ,
+ #1 .value_forbidden: ,
+ }
+ }
+\use:x { \keys_define:nn { ctex / option } { \exp_not:o { \l__ctex_tmp_tl } } }
+\tl_clear:N \l__ctex_tmp_tl
+\ProcessKeysOptions { ctex / option }
+\NewDocumentCommand \zihao { m }
+ { \exp_args:Nx \ctex_zihao:n {#1} \tex_ignorespaces:D }
+\cs_new_protected_nopar:Npn \ctex_zihao:n #1
+ {
+ \prop_get:NnNTF \c__ctex_font_size_prop {#1} \l__ctex_font_size_tl
+ { \exp_after:wN \fontsize \l__ctex_font_size_tl \selectfont }
+ { \msg_error:nnn { ctex } { fontsize } {#1} }
+ }
+\msg_new:nnnn { ctex } { fontsize }
+ { Undefined~Chinese~font~size~`#1'~in~command~\token_to_str:N \zihao.}
+ {
+ The~old~font~size~is~used~if~you~continue.\\
+ The~available~font~sizes~are~listed~as~follow.\\
+ \seq_use:Nnnn \c__ctex_font_size_seq { ~and~ } { ,~ } { ,~and~ }.
+ }
+\prop_new:N \c__ctex_font_size_prop
+\seq_new:N \c__ctex_font_size_seq
+\cs_new_protected_nopar:Npn \__ctex_save_font_size:nn #1#2
+ {
+ \use:x
+ {
+ \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 } }
+ }
+ }
+ \seq_gput_right:Nn \c__ctex_font_size_seq {#1}
+ }
+\clist_map_inline:nn
+ {
+ { 8 } { 5 bp } ,
+ { 7 } { 5.5 bp } ,
+ { -6 } { 6.5 bp } ,
+ { 6 } { 7.5 bp } ,
+ { -5 } { 9 bp } ,
+ { 5 } { 10.5 bp } ,
+ { -4 } { 12 bp } ,
+ { 4 } { 14 bp } ,
+ { -3 } { 15 bp } ,
+ { 3 } { 16 bp } ,
+ { -2 } { 18 bp } ,
+ { 2 } { 22 bp } ,
+ { -1 } { 24 bp } ,
+ { 1 } { 26 bp } ,
+ { -0 } { 36 bp } ,
+ { 0 } { 42 bp }
+ }
+ { \__ctex_save_font_size:nn #1 }
+\cs_new_protected_nopar:Npn \ctex_declare_math_sizes:nnnn #1#2#3#4
+ {
+ \__ctex_get_font_sizes:Nn \l__ctex_font_size_tl { {#1} {#2} {#3} {#4} }
+ \exp_after:wN \DeclareMathSizes \l__ctex_font_size_tl
+ }
+\cs_new_protected_nopar:Npn \__ctex_get_font_sizes:Nn #1#2
+ {
+ \tl_clear:N #1
+ \tl_map_inline:nn {#2}
+ {
+ \prop_get:NnNTF \c__ctex_font_size_prop {##1} \l__ctex_tmp_tl
+ { \tl_put_right:Nx #1 { { \tl_head:N \l__ctex_tmp_tl } } }
+ { \tl_put_right:Nx #1 { { \dim_to_decimal:n { ##1 } } } }
+ }
+ }
+\clist_map_inline:nn
+ {
+ { 8 }{ 8 }{ 5pt }{ 5pt } ,
+ { 7 }{ 7 }{ 5pt }{ 5pt } ,
+ { -6 }{ -6 }{ 5pt }{ 5pt } ,
+ { 6 }{ 6 }{ 5pt }{ 5pt } ,
+ { -5 }{ -5 }{ 6pt }{ 5pt } ,
+ { 5 }{ 5 }{ 7pt }{ 5pt } ,
+ { -4 }{ -4 }{ 8pt }{ 6pt } ,
+ { 4 }{ 4 }{ 5 }{ 6 } ,
+ { -3 }{ -3 }{ -4 }{ -5 } ,
+ { 3 }{ 3 }{ 4 }{ 5 } ,
+ { -2 }{ -2 }{ -3 }{ -4 } ,
+ { 2 }{ 2 }{ 3 }{ 4 } ,
+ { -1 }{ -1 }{ -2 }{ -3 } ,
+ { 1 }{ 1 }{ 2 }{ 3 } ,
+ { -0 }{ -0 }{ -1 }{ -2 } ,
+ { 0 }{ 0 }{ 1 }{ 2 }
+ }
+ { \ctex_declare_math_sizes:nnnn #1 }
+\cs_new_protected:Npn \ctex_set_font_size:Nnn #1#2#3
+ {
+ \prop_get:NnNTF \c__ctex_font_size_prop {#2} \l__ctex_font_size_tl
+ { \exp_after:wN \__ctex_set_font_size:nnNn \l__ctex_font_size_tl #1 {#3} }
+ { \msg_error:nnn { ctex } { fontsize } {#2} }
+ }
+\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
+ \ctex_file_input:n { ctex-c5size.clo }
+\or:
+ \ctex_file_input:n { ctex-cs4size.clo }
+\fi:
+\normalsize
+%%
+%% This package consists of the file ctex.dtx,
+%% and the derived files ctex.pdf,
+%% ctex.ins,
+%% ctex.sty,
+%% ctexcap.sty,
+%% ctexsize.sty,
+%% ctexart.cls,
+%% ctexbook.cls,
+%% ctexrep.cls,
+%% ctex-c5size.clo,
+%% ctex-cs4size.clo,
+%% ctex-article.def,
+%% ctex-book.def,
+%% ctex-report.def,
+%% ctex-scheme-plain.def,
+%% ctex-scheme-plain-article.def,
+%% ctex-scheme-plain-book.def,
+%% ctex-scheme-plain-report.def,
+%% ctex-scheme-chinese.def,
+%% ctex-scheme-chinese-article.def,
+%% ctex-scheme-chinese-book.def,
+%% ctex-scheme-chinese-report.def,
+%% ctex-name-gbk.cfg,
+%% ctex-name-utf8.cfg,
+%% ctex.cfg,
+%% ctexopts.cfg,
+%% ctex-engine-pdftex.def,
+%% ctex-engine-xetex.def,
+%% ctex-engine-luatex.def,
+%% c19rm.fd,
+%% c19sf.fd,
+%% c19tt.fd,
+%% c70rm.fd,
+%% c70sf.fd,
+%% c70tt.fd,
+%% ctex-fontset-windows.def,
+%% ctex-fontset-windowsnew.def,
+%% ctex-fontset-windowsold.def,
+%% ctex-fontset-adobe.def,
+%% ctex-fontset-fandol.def,
+%% ctex-fontset-mac.def,
+%% ctex-fontset-founder.def,
+%% ctex-fontset-ubuntu.def,
+%% ctexspa.def,
+%% ctexpunct.spa,
+%% ctexmakespa.tex,
+%% ctexspamacro.tex,
+%% zhadobefonts.tex,
+%% zhfandolfonts.tex,
+%% zhfounderfonts.tex,
+%% zhubuntufonts.tex,
+%% zhwindowsfonts.tex, and
+%% README.
+%%
+%% End of file `ctexsize.sty'.
diff --git a/Master/texmf-dist/tex/latex/ctex/ctexspa.def b/Master/texmf-dist/tex/latex/ctex/ctexspa.def
new file mode 100644
index 00000000000..5e1940a04bc
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ctex/ctexspa.def
@@ -0,0 +1,64 @@
+%%
+%% This is file `ctexspa.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `ctexspa')
+%% ctexpunct.spa
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\ProvidesFile{ctexspa.def}%
+ [2014/06/12 v2.0 Space info for CJKpunct (CTEX)]
+\ctexspadef{adobezhsong}{70,15,61,8,63,14,58,7,64,13,62,12,60,11,61,15,62,14,51,6,58,5,58,8,7,5,12,12,10,68,13,63,17,63,20,69,19,69,17,63,19,70,17,55,10,10,14,63,10,65,10,61,13,62,15,61,7,49,7,56,8,58,15,69,8,61,14,63,8,57,,,}
+\ctexspadef{adobezhhei}{78,3,64,3,64,2,61,3,72,3,70,3,72,3,70,3,60,3,51,3,62,3,66,3,0,0,10,10,3,70,5,70,6,75,6,78,17,67,13,67,17,67,4,50,8,8,3,72,3,70,3,72,3,70,3,60,3,51,3,62,3,66,3,78,7,62,3,63,3,61,,,}
+\ctexspadef{adobezhkai}{76,10,55,8,63,4,62,4,71,4,65,4,71,4,74,4,54,4,54,4,62,4,62,4,0,0,11,11,5,72,6,71,7,78,7,79,18,68,18,68,18,68,2,46,14,12,4,71,4,65,4,71,4,74,4,54,4,54,4,62,4,62,10,76,8,55,4,63,4,62,,,}
+\ctexspadef{adobezhfs}{76,10,56,8,63,4,61,4,71,4,65,4,71,4,74,4,54,4,54,4,62,4,62,4,0,0,11,11,4,72,5,71,8,79,8,79,18,68,19,68,18,68,2,46,14,13,4,71,4,65,4,71,4,74,4,54,4,54,4,62,4,62,10,76,8,56,4,63,4,61,,,}
+\ctexspadef{fandolzhsong}{69,19,58,8,59,9,60,10,60,11,63,13,67,17,57,7,61,11,54,5,57,7,58,7,0,0,17,17,15,65,14,64,19,69,8,81,20,70,19,69,20,70,7,57,14,14,11,61,13,63,17,67,7,57,11,61,4,55,7,57,7,58,19,69,8,58,9,59,10,60,,,}
+\ctexspadef{fandolzhsongb}{66,16,54,4,59,9,60,10,60,11,63,13,66,16,57,7,61,11,54,5,57,7,58,7,0,0,14,14,15,65,14,64,17,67,6,78,17,67,17,67,17,67,32,32,14,14,11,61,13,63,16,66,7,57,11,61,4,55,7,57,7,58,16,66,4,54,9,59,10,60,,,}
+\ctexspadef{fandolzhhei}{71,21,60,10,59,9,60,10,60,11,62,12,67,17,55,5,61,11,54,5,57,7,58,7,0,0,18,18,15,65,14,64,21,71,10,82,21,71,21,71,21,71,32,32,14,14,11,61,12,62,17,67,5,55,11,61,5,55,7,57,7,58,21,71,10,60,9,59,10,60,,,}
+\ctexspadef{fandolzhheib}{70,20,60,10,59,9,60,10,60,11,63,13,65,15,56,6,61,11,54,5,57,7,58,7,3,3,18,18,15,65,14,64,20,70,8,82,20,70,20,70,20,69,33,33,11,11,11,61,13,63,15,65,6,56,11,61,5,55,7,57,7,58,20,70,10,60,9,59,10,60,,,}
+\ctexspadef{fandolzhkai}{69,19,58,8,59,9,60,10,60,11,63,13,67,18,57,7,61,11,54,5,57,7,58,7,0,0,11,11,15,65,14,64,19,69,11,78,20,70,19,69,20,70,32,32,14,14,11,61,13,63,17,67,7,57,11,61,5,55,7,57,7,58,19,69,8,58,9,59,10,60,,,}
+\ctexspadef{fandolzhfs}{69,19,58,8,59,9,60,10,60,11,63,13,67,17,55,5,61,11,54,5,57,7,58,7,0,0,17,17,15,65,14,64,19,69,8,81,20,70,19,69,20,70,32,32,14,14,11,61,13,63,17,67,5,55,11,61,5,55,7,57,7,58,19,69,8,58,9,59,10,60,,,}
+\ctexspadef{founderzhsong}{68,18,50,7,48,18,45,27,48,25,46,27,48,29,48,40,48,23,42,17,45,30,45,30,0,0,10,10,11,60,12,61,18,68,7,82,18,68,17,66,19,68,8,57,12,12,25,48,27,46,29,48,40,47,23,48,17,42,30,45,30,45,18,68,8,57,18,48,27,45,,,}
+\ctexspadef{founderzhsongb}{67,17,55,5,48,20,45,27,48,26,45,29,48,28,48,40,48,23,44,18,45,30,45,31,0,0,9,9,15,64,14,64,16,66,4,79,18,66,17,67,17,68,7,57,11,11,26,48,29,45,28,48,40,47,23,48,18,44,30,45,32,45,17,67,6,55,20,48,27,45,,,}
+\ctexspadef{founderzhhei}{68,18,56,6,47,20,44,27,47,28,45,35,47,30,47,37,46,23,39,16,45,30,45,30,0,0,10,10,10,60,9,59,18,68,7,80,18,68,18,68,21,71,5,55,9,9,28,47,35,45,30,47,37,47,23,46,16,39,30,45,30,45,18,68,6,56,20,47,27,44,,,}
+\ctexspadef{founderzhheil}{69,19,64,14,48,18,45,27,48,27,48,37,48,28,48,39,48,24,44,19,45,30,45,31,0,0,13,13,11,61,9,59,19,69,9,81,21,73,21,73,23,73,4,54,9,9,27,48,37,48,28,48,39,48,24,48,19,44,30,45,31,45,19,69,14,64,18,48,27,45,,,}
+\ctexspadef{founderzhkai}{68,18,50,7,48,19,45,27,48,27,46,27,48,29,48,40,48,22,42,17,45,30,45,30,0,0,10,11,10,61,12,61,14,66,7,82,18,68,13,66,18,69,8,58,16,16,27,48,27,46,29,48,40,47,22,48,17,42,30,45,30,45,18,67,7,50,19,48,27,45,,,}
+\ctexspadef{founderzhfs}{68,18,50,7,48,19,45,27,48,27,46,27,48,29,48,40,48,22,42,17,45,30,45,30,0,0,11,10,11,59,12,61,18,68,10,80,18,68,17,66,19,68,8,57,27,27,27,48,27,46,29,48,40,47,22,48,17,42,30,45,30,45,18,68,8,57,19,48,27,45,,,}
+\ctexspadef{founderzhli}{69,19,58,9,48,21,45,27,48,25,47,32,48,27,48,39,48,21,43,17,47,33,47,33,0,0,11,11,11,61,13,63,17,66,7,80,20,70,19,68,20,70,3,54,9,9,25,48,32,47,27,48,40,48,21,48,17,43,33,47,33,47,19,69,9,58,21,48,27,45,,,}
+\ctexspadef{founderzhyou}{67,16,61,11,48,11,45,14,48,20,48,17,48,16,48,39,48,12,42,16,48,30,48,30,0,0,12,11,11,61,9,59,17,67,11,83,20,70,18,69,21,70,4,54,12,12,20,48,17,48,16,48,39,48,12,48,16,41,30,48,29,48,16,67,11,61,11,48,14,45,,,}
+\ctexspadef{founderzhyoub}{69,18,60,10,46,13,43,16,46,17,45,20,46,18,46,31,45,13,38,14,44,29,46,30,-3,0,10,9,9,61,9,59,19,69,7,82,18,68,18,67,20,69,2,52,17,17,17,46,20,45,18,46,32,46,13,45,14,38,29,44,30,46,19,69,10,60,14,46,17,43,,,}
+\ctexspadef{ubuntuzhsong}{66,21,58,7,58,8,55,11,59,18,71,7,71,2,40,38,58,13,52,4,64,6,58,14,7,7,11,10,38,38,38,38,17,73,21,70,13,78,13,75,27,63,4,52,4,5,18,59,7,71,2,71,38,40,13,58,4,51,6,64,14,58,16,70,8,56,10,58,11,54,,,}
+\ctexspadef{ubuntuzhhei}{6,6,4,4,60,10,61,11,62,12,65,15,67,15,62,15,63,13,57,6,19,52,63,13,-0,0,11,11,10,70,10,68,44,44,45,44,44,44,44,44,43,45,27,27,19,16,12,62,15,65,15,67,15,62,13,63,6,56,3,68,13,63,6,6,4,4,10,60,11,61,,,}
+\ctexspadef{ubuntuzhkai}{68,20,58,9,58,8,55,11,59,18,59,20,59,18,53,23,58,13,52,4,58,8,58,14,7,7,11,10,38,38,38,38,40,42,43,43,43,43,43,43,43,43,25,28,10,11,18,59,20,59,18,59,24,53,13,58,4,51,8,58,14,58,17,70,9,58,10,58,11,54,,,}
+\ctexspadef{windowszhsong}{67,13,46,13,62,14,61,14,65,17,57,14,55,14,53,18,64,11,54,10,47,11,49,14,3,3,10,10,11,64,14,64,11,71,13,73,12,73,12,73,23,63,14,52,15,13,16,66,14,57,14,55,19,52,11,66,9,54,11,48,14,51,14,68,13,48,14,62,14,61,,,}
+\ctexspadef{windowszhhei}{78,9,56,9,50,20,50,20,50,23,61,11,54,14,50,26,50,16,50,7,47,11,49,14,0,0,9,11,14,64,13,63,14,72,14,73,19,68,18,68,25,64,15,48,12,12,22,50,11,60,14,55,25,50,16,50,7,50,11,48,14,51,8,79,8,56,18,50,18,50,,,}
+\ctexspadef{windowszhkai}{67,13,46,13,50,20,50,20,50,23,61,11,54,14,50,26,50,16,50,7,47,11,49,14,0,0,10,10,11,64,13,63,11,71,13,73,17,68,17,68,23,63,15,48,12,12,22,50,11,60,14,55,25,50,16,50,7,50,11,48,14,51,14,68,13,48,18,50,18,50,,,}
+\ctexspadef{windowszhfs}{67,13,46,13,62,14,61,14,65,17,57,14,55,14,53,18,64,11,54,10,47,11,49,14,3,3,11,11,14,66,14,63,14,71,14,73,14,72,14,72,23,63,14,52,16,12,16,66,14,57,14,55,19,52,11,66,9,54,11,48,14,51,14,68,13,48,14,62,14,61,,,}
+\ctexspadef{windowszhli}{63,9,42,6,66,11,62,11,55,12,61,9,69,11,55,19,58,16,52,2,52,6,52,6,29,4,9,5,8,64,4,66,8,73,12,72,23,66,20,63,21,65,34,32,12,12,9,59,15,57,14,66,20,50,16,59,7,48,9,52,9,45,4,66,6,43,14,62,14,61,,,}
+\ctexspadef{windowszhyou}{63,9,42,6,66,11,62,11,55,12,61,9,69,11,61,12,58,16,52,2,52,6,52,6,14,4,9,5,8,64,4,66,8,73,12,72,23,66,20,63,21,65,34,32,11,10,9,59,15,57,14,66,14,56,16,59,7,48,9,52,9,45,4,66,6,43,14,62,14,61,,,}
+\ctexspadef{windowszhyahei}{80,6,63,6,64,8,59,8,64,10,40,34,44,35,38,37,60,11,49,7,55,7,56,10,0,0,7,7,6,70,6,69,40,45,44,44,44,44,40,44,44,44,33,28,10,10,10,64,34,40,35,44,37,38,11,60,8,48,7,55,10,56,6,80,6,63,8,64,8,59,,,}
+\ctexspadef{windowszhyaheib}{74,6,53,6,60,7,57,7,62,8,38,31,42,34,36,35,57,9,48,4,55,5,57,6,0,0,7,7,3,67,5,68,38,43,41,41,41,41,38,41,41,41,31,27,8,8,8,62,31,38,34,42,35,36,9,56,4,48,5,55,6,57,6,74,6,53,7,60,8,57,,,}
+%%
+%%
+%% End of file `ctexspa.def'.
diff --git a/Master/texmf-dist/tex/latex/ctex/def/ctex-article.def b/Master/texmf-dist/tex/latex/ctex/def/ctex-article.def
deleted file mode 100644
index 607af578781..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/def/ctex-article.def
+++ /dev/null
@@ -1,220 +0,0 @@
-% ctex-article.def: definitions for article class files
-% vim:ft=tex
-
-\def\CTEX@prepart{Part\space}
-\def\CTEX@prechapter{Chapter\space}
-\def\CTEX@part@format{\raggedright}
-\def\CTEX@part@nameformat{\Large\bfseries}
-\def\CTEX@part@aftername{\par\nobreak}
-\def\CTEX@part@titleformat{\huge\bfseries}
-\def\CTEX@part@beforeskip{4ex}
-\def\CTEX@part@afterskip{3ex}
-\def\CTEX@part@indent{\z@}
-\def\CTEX@chapter@format{\raggedright}
-\def\CTEX@chapter@nameformat{\huge\bfseries}
-\def\CTEX@chapter@aftername{\par\nobreak\vskip 20\p@}
-\def\CTEX@chapter@titleformat{\Huge\bfseries}
-\def\CTEX@chapter@beforeskip{50\p@}
-\def\CTEX@chapter@afterskip{40\p@}
-\def\CTEX@chapter@indent{\z@}
-\def\CTEX@section@format{\Large\bfseries}
-\def\CTEX@section@aftername{\quad}
-\def\CTEX@section@beforeskip{-3.5ex \@plus -1ex \@minus -.2ex}
-\def\CTEX@section@afterskip{2.3ex \@plus .2ex}
-\def\CTEX@section@indent{\z@}
-\def\CTEX@subsection@format{\large\bfseries}
-\def\CTEX@subsection@aftername{\quad}
-\def\CTEX@subsection@beforeskip{-3.25ex \@plus -1ex \@minus -.2ex}
-\def\CTEX@subsection@afterskip{1.5ex \@plus .2ex}
-\def\CTEX@subsection@indent{\z@}
-\def\CTEX@subsubsection@format{\normalsize\bfseries}
-\def\CTEX@subsubsection@aftername{\quad}
-\def\CTEX@subsubsection@beforeskip{-3.25ex \@plus -1ex \@minus -.2ex}
-\def\CTEX@subsubsection@afterskip{1.5ex \@plus .2ex}
-\def\CTEX@subsubsection@indent{\z@}
-\def\CTEX@paragraph@format{\normalsize\bfseries}
-\def\CTEX@paragraph@aftername{\quad}
-\ifnum\c@CTEX@sectiondepth>2
- \def\CTEX@paragraph@beforeskip{-3.25ex \@plus -1ex \@minus -.2ex}
- \def\CTEX@paragraph@afterskip{1ex \@plus .2ex}
-\else
- \def\CTEX@paragraph@beforeskip{3.25ex \@plus1ex \@minus .2ex}
- \def\CTEX@paragraph@afterskip{-1em}
-\fi
-\def\CTEX@paragraph@indent{\z@}
-\def\CTEX@subparagraph@format{\normalsize\bfseries}
-\def\CTEX@subparagraph@aftername{\quad}
-\ifnum\c@CTEX@sectiondepth>3
- \def\CTEX@subparagraph@beforeskip{-3.25ex \@plus -1ex \@minus -.2ex}
- \def\CTEX@subparagraph@afterskip{1ex \@plus .2ex}
-\else
- \def\CTEX@subparagraph@beforeskip{3.25ex \@plus1ex \@minus .2ex}
- \def\CTEX@subparagraph@afterskip{-1em}
-\fi
-\ifnum\c@CTEX@sectiondepth>2
- \def\CTEX@subparagraph@indent{\z@}
-\else
- \def\CTEX@subparagraph@indent{\parindent}
-\fi
-\def\CTEX@appendixname{}
-\def\CTEX@appendixnumber{\@Alph\c@section}
-\let\CTEX@save@appendix\appendix
-\renewcommand*\appendix{\CTEX@save@appendix%
- \gdef\CTEX@presection{\CTEX@appendixname}%
- \gdef\CTEX@thesection{\CTEX@appendixnumber}%
- \gdef\CTEX@postsection{}}%
-\renewcommand\part{%
- \if@noskipsec \leavevmode \fi
- \par
- \addvspace{\CTEX@part@beforeskip}%
- \@afterindentfalse
- \secdef\@part\@spart}
-\def\@part[#1]#2{%
- \ifnum \c@secnumdepth >\m@ne
- \refstepcounter{part}%
- \addcontentsline{toc}{part}{\CTEXthepart\hspace{1em}#1}%
- \else
- \addcontentsline{toc}{part}{#1}%
- \fi
- {\interlinepenalty \@M
- \normalfont \parindent \CTEX@part@indent \CTEX@part@format
- \ifnum \c@secnumdepth >\m@ne
- \CTEX@partname
- \fi
- \CTEX@part@titleformat #2%
- \markboth{}{}\par}%
- \nobreak
- \vskip \CTEX@part@afterskip
- \@afterheading}
-\def\@spart#1{%
- {\interlinepenalty \@M
- \normalfont \parindent \CTEX@part@indent \CTEX@part@format
- \CTEX@part@titleformat #1\par}%
- \nobreak
- \vskip \CTEX@part@afterskip
- \@afterheading}
-\def\@seccntformat#1{%
- \@ifundefined{CTEX@#1name}%
- {\csname the#1\endcsname\quad}%
- {\csname CTEX@#1name\endcsname}}
-\def\@sect#1#2#3#4#5#6[#7]#8{%
- \ifnum #2>\c@secnumdepth
- \let\@svsec\@empty
- \else
- \refstepcounter{#1}%
- \protected@edef\@svsec{\@seccntformat{#1}\relax}%
- \fi
- \@tempskipa #5\relax
- \ifdim \@tempskipa>\z@
- \begingroup
- #6{%
- \@hangfrom{\hskip #3\relax\@svsec}%
- \interlinepenalty \@M
- \csname CTEX@#1@titleformat\endcsname #8\@@par}%
- \endgroup
- \csname #1mark\endcsname{#7}%
- \addcontentsline{toc}{#1}{%
- \ifnum #2>\c@secnumdepth \else
- \protect\numberline{\@ifundefined{CTEXthe#1}%
- {\csname the#1\endcsname}%
- {\csname CTEXthe#1\endcsname}}%
- \fi
- #7}%
- \else
- \def\@svsechd{%
- #6{\hskip #3\relax
- \@svsec \csname CTEX@#1@titleformat\endcsname #8}%
- \csname #1mark\endcsname{#7}%
- \addcontentsline{toc}{#1}{%
- \ifnum #2>\c@secnumdepth \else
- \protect\numberline{\@ifundefined{CTEXthe#1}%
- {\csname the#1\endcsname}%
- {\csname CTEXthe#1\endcsname}}%
- \fi
- #7}}%
- \fi
- \@xsect{#5}}
-\def\numberline#1{%
- \settowidth\@tempdimb{#1\hspace{0.5em}}%
- \ifdim\@tempdima<\@tempdimb%
- \@tempdima=\@tempdimb%
- \fi%
- \hb@xt@\@tempdima{#1\hfil}}
-\renewcommand\section{\@startsection{section}{1}%
- {\CTEX@section@indent}%
- {\CTEX@section@beforeskip}%
- {\CTEX@section@afterskip}%
- {\normalfont\CTEX@section@format}}
-\renewcommand\subsection{\@startsection{subsection}{2}%
- {\CTEX@subsection@indent}%
- {\CTEX@subsection@beforeskip}%
- {\CTEX@subsection@afterskip}%
- {\normalfont\CTEX@subsection@format}}
-\renewcommand\subsubsection{\@startsection{subsubsection}{3}%
- {\CTEX@subsubsection@indent}%
- {\CTEX@subsubsection@beforeskip}%
- {\CTEX@subsubsection@afterskip}%
- {\normalfont\CTEX@subsubsection@format}}
-\renewcommand\paragraph{\@startsection{paragraph}{4}%
- {\CTEX@paragraph@indent}%
- {\CTEX@paragraph@beforeskip}%
- {\CTEX@paragraph@afterskip}%
- {\normalfont\CTEX@paragraph@format}}
-\renewcommand\subparagraph{\@startsection{subparagraph}{5}%
- {\CTEX@subparagraph@indent}%
- {\CTEX@subparagraph@beforeskip}%
- {\CTEX@subparagraph@afterskip}%
- {\normalfont\CTEX@subparagraph@format}}
-\if@twoside
- \def\ps@headings{%
- \let\@oddfoot\@empty\let\@evenfoot\@empty
- \def\@evenhead{\thepage\hfil\slshape\leftmark}%
- \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
- \let\@mkboth\markboth
- \def\sectionmark##1{%
- \markboth {\MakeUppercase{%
- \ifnum \c@secnumdepth >\z@
- \CTEXthesection\quad %
- \fi
- ##1}}{}}%
- \def\subsectionmark##1{%
- \markright {%
- \ifnum \c@secnumdepth >\@ne
- \CTEXthesubsection\quad %
- \fi
- ##1}}}
-\else
- \def\ps@headings{%
- \let\@oddfoot\@empty
- \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
- \let\@mkboth\markboth
- \def\sectionmark##1{%
- \markright {\MakeUppercase{%
- \ifnum \c@secnumdepth >\m@ne
- \CTEXthesection\quad %
- \fi
- ##1}}}}
-\fi
-\pagestyle{headings}
-\@ifundefined{ps@fancy}{}{%
- \def\ps@fancy{%
- \@ifundefined{@chapapp}{\let\@chapapp\chaptername}{}%for amsbook
- \@ifundefined{MakeUppercase}{\def\MakeUppercase{\uppercase}}{}%
- \@ifundefined{chapter}{\def\sectionmark##1{\markboth
- {\MakeUppercase{\ifnum \c@secnumdepth>\z@
- \CTEXthesection\quad \fi ##1}}{}}%
- \def\subsectionmark##1{\markright {\ifnum \c@secnumdepth >\@ne
- \CTEXthesubsection\quad \fi ##1}}}%
- {\def\chaptermark##1{\markboth {\MakeUppercase{\ifnum \c@secnumdepth>\m@ne
- \ifCTEX@cls{book}{\if@mainmatter\CTEXthechapter \quad\fi}{\CTEXthechapter \quad}
- \fi ##1}}{}}%
- \def\sectionmark##1{\markright{\MakeUppercase{\ifnum \c@secnumdepth >\z@
- \CTEXthesection \quad \fi ##1}}}}%
- \ps@@fancy
- \gdef\ps@fancy{\@fancyplainfalse\ps@@fancy}%
- \ifdim\headwidth<0sp
- \global\advance\headwidth123456789sp\global\advance\headwidth\textwidth
- \fi}
-}
-
-\endinput
diff --git a/Master/texmf-dist/tex/latex/ctex/def/ctex-book.def b/Master/texmf-dist/tex/latex/ctex/def/ctex-book.def
deleted file mode 100644
index 557cf127764..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/def/ctex-book.def
+++ /dev/null
@@ -1,252 +0,0 @@
-% ctex-book.def: definitions for book class files
-% vim:ft=tex
-
-\def\CTEX@prepart{Part\space}
-\def\CTEX@prechapter{Chapter\space}
-\def\CTEX@part@format{\centering}
-\def\CTEX@part@nameformat{\huge\bfseries}
-\def\CTEX@part@aftername{\par\vskip 20\p@}
-\def\CTEX@part@titleformat{\Huge\bfseries}
-\def\CTEX@chapter@format{\raggedright}
-\def\CTEX@chapter@nameformat{\huge\bfseries}
-\def\CTEX@chapter@aftername{\par\nobreak\vskip 20\p@}
-\def\CTEX@chapter@titleformat{\Huge\bfseries}
-\def\CTEX@chapter@beforeskip{50\p@}
-\def\CTEX@chapter@afterskip{40\p@}
-\def\CTEX@chapter@indent{\z@}
-\def\CTEX@section@format{\Large\bfseries}
-\def\CTEX@section@aftername{\quad}
-\def\CTEX@section@beforeskip{-3.5ex \@plus -1ex \@minus -.2ex}
-\def\CTEX@section@afterskip{2.3ex \@plus .2ex}
-\def\CTEX@section@indent{\z@}
-\def\CTEX@subsection@format{\large\bfseries}
-\def\CTEX@subsection@aftername{\quad}
-\def\CTEX@subsection@beforeskip{-3.25ex \@plus -1ex \@minus -.2ex}
-\def\CTEX@subsection@afterskip{1.5ex \@plus .2ex}
-\def\CTEX@subsection@indent{\z@}
-\def\CTEX@subsubsection@format{\normalsize\bfseries}
-\def\CTEX@subsubsection@aftername{\quad}
-\def\CTEX@subsubsection@beforeskip{-3.25ex \@plus -1ex \@minus -.2ex}
-\def\CTEX@subsubsection@afterskip{1.5ex \@plus .2ex}
-\def\CTEX@subsubsection@indent{\z@}
-\def\CTEX@paragraph@format{\normalsize\bfseries}
-\def\CTEX@paragraph@aftername{\quad}
-\ifnum\c@CTEX@sectiondepth>2
- \def\CTEX@paragraph@beforeskip{-3.25ex \@plus -1ex \@minus -.2ex}
- \def\CTEX@paragraph@afterskip{1ex \@plus .2ex}
-\else
- \def\CTEX@paragraph@beforeskip{3.25ex \@plus1ex \@minus .2ex}
- \def\CTEX@paragraph@afterskip{-1em}
-\fi
-\def\CTEX@paragraph@indent{\z@}
-\def\CTEX@subparagraph@format{\normalsize\bfseries}
-\def\CTEX@subparagraph@aftername{\quad}
-\ifnum\c@CTEX@sectiondepth>3
- \def\CTEX@subparagraph@beforeskip{-3.25ex \@plus -1ex \@minus -.2ex}
- \def\CTEX@subparagraph@afterskip{1ex \@plus .2ex}
-\else
- \def\CTEX@subparagraph@beforeskip{3.25ex \@plus1ex \@minus .2ex}
- \def\CTEX@subparagraph@afterskip{-1em}
-\fi
-\ifnum\c@CTEX@sectiondepth>2
- \def\CTEX@subparagraph@indent{\z@}
-\else
- \def\CTEX@subparagraph@indent{\parindent}
-\fi
-\def\CTEX@appendixname{Appendix\space}
-\def\CTEX@appendixnumber{\@Alph\c@chapter}
-\let\CTEX@save@appendix\appendix
-\renewcommand*\appendix{\CTEX@save@appendix%
- \gdef\CTEX@prechapter{\CTEX@appendixname}%
- \gdef\CTEX@thechapter{\CTEX@appendixnumber}%
- \gdef\CTEX@postchapter{}}%
-\def\@part[#1]#2{%
- \ifnum \c@secnumdepth >-2\relax
- \refstepcounter{part}%
- \addcontentsline{toc}{part}{\CTEXthepart\hspace{1em}#1}%
- \else
- \addcontentsline{toc}{part}{#1}%
- \fi
- \markboth{}{}%
- {\interlinepenalty \@M
- \normalfont \CTEX@part@format
- \ifnum \c@secnumdepth >-2\relax
- \CTEX@partname
- \fi
- \CTEX@part@titleformat #2\par}%
- \@endpart}
-\def\@spart#1{%
- {\interlinepenalty \@M
- \normalfont \CTEX@part@format
- \CTEX@part@titleformat #1\par}%
- \@endpart}
-\def\@chapter[#1]#2{%
- \ifnum \c@secnumdepth >\m@ne
- \if@mainmatter
- \refstepcounter{chapter}%
- \typeout{\CTEXthechapter}%
- \addcontentsline{toc}{chapter}
- {\protect\numberline{\CTEXthechapter\hspace{0.3em}}#1}%
- \else
- \addcontentsline{toc}{chapter}{#1}%
- \fi
- \else
- \addcontentsline{toc}{chapter}{#1}%
- \fi
- \chaptermark{#1}%
- \addtocontents{lof}{\protect\addvspace{10\p@}}%
- \addtocontents{lot}{\protect\addvspace{10\p@}}%
- \if@twocolumn
- \@topnewpage[\@makechapterhead{#2}]%
- \else
- \@makechapterhead{#2}%
- \@afterheading
- \fi}
-\def\@makechapterhead#1{%
- \vspace*{\CTEX@chapter@beforeskip}%
- {\normalfont \parindent \CTEX@chapter@indent \CTEX@chapter@format
- \ifnum \c@secnumdepth >\m@ne
- \if@mainmatter
- \CTEX@chaptername
- \fi
- \fi
- \interlinepenalty\@M
- \CTEX@chapter@titleformat #1\par\nobreak
- \vskip \CTEX@chapter@afterskip
- }}
-\def\@makeschapterhead#1{%
- \vspace*{\CTEX@chapter@beforeskip}%
- {\normalfont \parindent \CTEX@chapter@indent \CTEX@chapter@format
- \interlinepenalty\@M
- \CTEX@chapter@titleformat #1\par\nobreak
- \vskip \CTEX@chapter@afterskip
- }}
-\def\@seccntformat#1{%
- \@ifundefined{CTEX@#1name}%
- {\csname the#1\endcsname\quad}%
- {\csname CTEX@#1name\endcsname}}
-\def\@sect#1#2#3#4#5#6[#7]#8{%
- \ifnum #2>\c@secnumdepth
- \let\@svsec\@empty
- \else
- \refstepcounter{#1}%
- \protected@edef\@svsec{\@seccntformat{#1}\relax}%
- \fi
- \@tempskipa #5\relax
- \ifdim \@tempskipa>\z@
- \begingroup
- #6{%
- \@hangfrom{\hskip #3\relax\@svsec}%
- \interlinepenalty \@M
- \csname CTEX@#1@titleformat\endcsname #8\@@par}%
- \endgroup
- \csname #1mark\endcsname{#7}%
- \addcontentsline{toc}{#1}{%
- \ifnum #2>\c@secnumdepth \else
- \protect\numberline{\@ifundefined{CTEXthe#1}%
- {\csname the#1\endcsname}%
- {\csname CTEXthe#1\endcsname}}%
- \fi
- #7}%
- \else
- \def\@svsechd{%
- #6{\hskip #3\relax
- \@svsec \csname CTEX@#1@titleformat\endcsname #8}%
- \csname #1mark\endcsname{#7}%
- \addcontentsline{toc}{#1}{%
- \ifnum #2>\c@secnumdepth \else
- \protect\numberline{\@ifundefined{CTEXthe#1}%
- {\csname the#1\endcsname}%
- {\csname CTEXthe#1\endcsname}}%
- \fi
- #7}}%
- \fi
- \@xsect{#5}}
-\def\numberline#1{%
- \settowidth\@tempdimb{#1\hspace{0.5em}}%
- \ifdim\@tempdima<\@tempdimb%
- \@tempdima=\@tempdimb%
- \fi%
- \hb@xt@\@tempdima{#1\hfil}}
-\renewcommand\section{\@startsection{section}{1}%
- {\CTEX@section@indent}%
- {\CTEX@section@beforeskip}%
- {\CTEX@section@afterskip}%
- {\normalfont\CTEX@section@format}}
-\renewcommand\subsection{\@startsection{subsection}{2}%
- {\CTEX@subsection@indent}%
- {\CTEX@subsection@beforeskip}%
- {\CTEX@subsection@afterskip}%
- {\normalfont\CTEX@subsection@format}}
-\renewcommand\subsubsection{\@startsection{subsubsection}{3}%
- {\CTEX@subsubsection@indent}%
- {\CTEX@subsubsection@beforeskip}%
- {\CTEX@subsubsection@afterskip}%
- {\normalfont\CTEX@subsubsection@format}}
-\renewcommand\paragraph{\@startsection{paragraph}{4}%
- {\CTEX@paragraph@indent}%
- {\CTEX@paragraph@beforeskip}%
- {\CTEX@paragraph@afterskip}%
- {\normalfont\CTEX@paragraph@format}}
-\renewcommand\subparagraph{\@startsection{subparagraph}{5}%
- {\CTEX@subparagraph@indent}%
- {\CTEX@subparagraph@beforeskip}%
- {\CTEX@subparagraph@afterskip}%
- {\normalfont\CTEX@subparagraph@format}}
-\if@twoside
- \def\ps@headings{%
- \let\@oddfoot\@empty\let\@evenfoot\@empty
- \def\@evenhead{\thepage\hfil\slshape\leftmark}%
- \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
- \let\@mkboth\markboth
- \def\chaptermark##1{%
- \markboth {\MakeUppercase{%
- \ifnum \c@secnumdepth >\m@ne
- \if@mainmatter
- \CTEXthechapter \quad %
- \fi
- \fi
- ##1}}{}}%
- \def\sectionmark##1{%
- \markright {\MakeUppercase{%
- \ifnum \c@secnumdepth >\z@
- \CTEXthesection \quad %
- \fi
- ##1}}}}
-\else
- \def\ps@headings{%
- \let\@oddfoot\@empty
- \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
- \let\@mkboth\markboth
- \def\chaptermark##1{%
- \markright {\MakeUppercase{%
- \ifnum \c@secnumdepth >\m@ne
- \if@mainmatter
- \CTEXthechapter \quad %
- \fi
- \fi
- ##1}}}}
-\fi
-\pagestyle{headings}
-\@ifundefined{ps@fancy}{}{%
- \def\ps@fancy{%
- \@ifundefined{@chapapp}{\let\@chapapp\chaptername}{}%for amsbook
- \@ifundefined{MakeUppercase}{\def\MakeUppercase{\uppercase}}{}%
- \@ifundefined{chapter}{\def\sectionmark##1{\markboth
- {\MakeUppercase{\ifnum \c@secnumdepth>\z@
- \CTEXthesection\quad \fi ##1}}{}}%
- \def\subsectionmark##1{\markright {\ifnum \c@secnumdepth >\@ne
- \CTEXthesubsection\quad \fi ##1}}}%
- {\def\chaptermark##1{\markboth {\MakeUppercase{\ifnum \c@secnumdepth>\m@ne
- \ifCTEX@cls{book}{\if@mainmatter\CTEXthechapter \quad\fi}{\CTEXthechapter \quad}
- \fi ##1}}{}}%
- \def\sectionmark##1{\markright{\MakeUppercase{\ifnum \c@secnumdepth >\z@
- \CTEXthesection \quad \fi ##1}}}}%
- \ps@@fancy
- \gdef\ps@fancy{\@fancyplainfalse\ps@@fancy}%
- \ifdim\headwidth<0sp
- \global\advance\headwidth123456789sp\global\advance\headwidth\textwidth
- \fi}
-}
-
-\endinput
diff --git a/Master/texmf-dist/tex/latex/ctex/def/ctex-caption.def b/Master/texmf-dist/tex/latex/ctex/def/ctex-caption.def
deleted file mode 100644
index 9dda3fa6285..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/def/ctex-caption.def
+++ /dev/null
@@ -1,165 +0,0 @@
-% ctex-caption.def: definitions only ctexcap.sty and ctex document classes used
-% vim:ft=tex
-
-% Load caption file
-
-\ifCTEX@caption
- \AtEndOfPackage{%
- \makeatletter
- \InputIfFileExists{ctexcap.cfg}{}{%
- \PackageError{ctex}{%
- Can't find ctexcap.cfg}{%
- The english captions are used if you continue.}}
- \makeatother}
-\fi
-
-% section format
-
-\def\CTEX@defsecformat#1{%
- \expandafter\def\csname CTEX@pre#1\endcsname{}%
- \expandafter\def\csname CTEX@post#1\endcsname{}%
- \expandafter\def\csname CTEX@the#1\endcsname{%
- \csname the#1\endcsname}%
- \expandafter\def\csname CTEXthe#1\endcsname{%
- \csname CTEX@pre#1\endcsname%
- \csname CTEX@the#1\endcsname%
- \csname CTEX@post#1\endcsname}%
- \expandafter\def\csname CTEX@#1@format\endcsname{}%
- \expandafter\def\csname CTEX@#1@nameformat\endcsname{}%
- \expandafter\def\csname CTEX@#1@numberformat\endcsname{}%
- \expandafter\def\csname CTEX@#1@aftername\endcsname{}%
- \expandafter\def\csname CTEX@#1@titleformat\endcsname{}
- \expandafter\def\csname CTEX@#1name\endcsname{%
- \csname CTEX@#1@nameformat\endcsname%
- \csname CTEX@pre#1\endcsname%
- \begingroup%
- \csname CTEX@#1@numberformat\endcsname%
- \csname CTEX@the#1\endcsname%
- \endgroup%
- \csname CTEX@post#1\endcsname%
- \csname CTEX@#1@aftername\endcsname}%
- \expandafter\def\csname CTEX@#1@beforeskip\endcsname{}%
- \expandafter\def\csname CTEX@#1@afterskip\endcsname{}%
- \expandafter\def\csname CTEX@#1@indent\endcsname{}%
-}
-\CTEX@defsecformat{part}
-\CTEX@defsecformat{chapter}
-\CTEX@defsecformat{section}
-\CTEX@defsecformat{subsection}
-\CTEX@defsecformat{subsubsection}
-\CTEX@defsecformat{paragraph}
-\CTEX@defsecformat{subparagraph}
-
-% Default caption names
-
-\def\CTEX@contentsname{Contents}
-\def\CTEX@listfigurename{List of Figures}
-\def\CTEX@listtablename{List of Tables}
-\def\CTEX@figurename{Figure}
-\def\CTEX@tablename{Table}
-\def\CTEX@abstractname{Abstract}
-\def\CTEX@indexname{Index}
-\def\CTEX@bibname{Bibliography}
-
-\renewcommand*\contentsname{\CTEX@contentsname}
-\renewcommand*\listfigurename{\CTEX@listfigurename}
-\renewcommand*\listtablename{\CTEX@listtablename}
-\renewcommand*\figurename{\CTEX@figurename}
-\renewcommand*\tablename{\CTEX@tablename}
-\@ifundefined{abstractname}{}{
- \renewcommand*\abstractname{\CTEX@abstractname}}
-\renewcommand*\partname{\CTEX@thepart}
-\@ifundefined{chaptername}{}{
- \renewcommand*\chaptername{\CTEX@thechapter}}
-\renewcommand*\appendixname{\CTEX@appendixname}
-\renewcommand*\indexname{\CTEX@indexname}
-
-\ifCTEX@cls{article}{
- \renewcommand*\refname{\CTEX@bibname}
- }{
- \renewcommand*\bibname{\CTEX@bibname}
- }
-
-\def\CTEX@setsecname#1[#2,#3]{%
- \expandafter\def\csname CTEX@pre#1\endcsname{#2}%
- \expandafter\def\csname CTEX@post#1\endcsname{\ignorespaces#3}}
-\def\CTEX@setsecnumber#1[#2]{%
- \expandafter\def\csname CTEX@the#1\endcsname{#2}}
-\def\CTEX@setsecformat#1#2[#3]{%
- \expandafter\def\csname CTEX@#1@#2\endcsname{#3}}
-\def\CTEX@addsecformat#1#2[#3]{%
- \expandafter\let\expandafter\reserved@a\csname CTEX@#1@#2\endcsname%
- \expandafter\expandafter\expandafter\def\expandafter\expandafter%
- \csname CTEX@#1@#2\endcsname\expandafter{\reserved@a#3}}
-\def\CTEX@defseckey#1{%
- \CTEX@subkey{#1}{name}{\CTEX@setsecname{#1}[##1]}%
- \CTEX@subkey{#1}{number}{\CTEX@setsecnumber{#1}[##1]}%
- \CTEX@subkey{#1}{format}{\CTEX@setsecformat{#1}{format}[##1]}%
- \CTEX@subkey{#1}{format+}{\CTEX@addsecformat{#1}{format}[##1]}%
- \CTEX@subkey{#1}{nameformat}{\CTEX@setsecformat{#1}{nameformat}[##1]}%
- \CTEX@subkey{#1}{nameformat+}{\CTEX@addsecformat{#1}{nameformat}[##1]}%
- \CTEX@subkey{#1}{numberformat}{\CTEX@setsecformat{#1}{numberformat}[##1]}%
- \CTEX@subkey{#1}{numberformat+}{\CTEX@addsecformat{#1}{numberformat}[##1]}%
- \CTEX@subkey{#1}{aftername}{\CTEX@setsecformat{#1}{aftername}[##1]}%
- \CTEX@subkey{#1}{aftername+}{\CTEX@addsecformat{#1}{aftername}[##1]}%
- \CTEX@subkey{#1}{titleformat}{\CTEX@setsecformat{#1}{titleformat}[##1]}%
- \CTEX@subkey{#1}{titleformat+}{\CTEX@addsecformat{#1}{titleformat}[##1]}%
- \CTEX@subkey{#1}{beforeskip}{\CTEX@setsecformat{#1}{beforeskip}[##1]}%
- \CTEX@subkey{#1}{afterskip}{\CTEX@setsecformat{#1}{afterskip}[##1]}%
- \CTEX@subkey{#1}{indent}{\CTEX@setsecformat{#1}{indent}[##1]}%
-}
-\CTEX@defseckey{part}
-\CTEX@defseckey{chapter}
-\CTEX@defseckey{section}
-\CTEX@defseckey{subsection}
-\CTEX@defseckey{subsubsection}
-\CTEX@defseckey{paragraph}
-\CTEX@defseckey{subparagraph}
-\CTEX@subkey{appendix}{name}{\def\CTEX@appendixname{#1}}
-\CTEX@subkey{appendix}{number}{\def\CTEX@appendixnumber{#1}}
-\CTEX@key{contentsname}{\def\CTEX@contentsname{#1}}
-\CTEX@key{listfigurename}{\def\CTEX@listfigurename{#1}}
-\CTEX@key{listtablename}{\def\CTEX@listtablename{#1}}
-\CTEX@key{figurename}{\def\CTEX@figurename{#1}}
-\CTEX@key{tablename}{\def\CTEX@tablename{#1}}
-\CTEX@key{abstractname}{\def\CTEX@abstractname{#1}}
-\CTEX@key{indexname}{\def\CTEX@indexname{#1}}
-\CTEX@key{bibname}{\def\CTEX@bibname{#1}}
-
-% caption delimiter
-
-\def\CTEX@caption@delimiter{: }
-\long\def\@makecaption#1#2{%
- \vskip\abovecaptionskip
- \sbox\@tempboxa{#1\CTEX@caption@delimiter #2}%
- \ifdim \wd\@tempboxa >\hsize
- #1\CTEX@caption@delimiter #2\par
- \else
- \global \@minipagefalse
- \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
- \fi
- \vskip\belowcaptionskip}
-\CTEX@key{captiondelimiter}{\CTEX@setcaptiondelimiter{#1}}
-\newcommand*\CTEX@setcaptiondelimiter[1]{%
- \def\CTEX@caption@delimiter{#1}}
-
-% Change the parindent of verse and quotation to two Chinese characters
-\renewenvironment{verse}
- {\let\\\@centercr
- \list{}{\itemsep \z@
- \itemindent -2\ccwd%
- \listparindent\itemindent
- \rightmargin \leftmargin
- \advance\leftmargin 2\ccwd}%
- \item\relax}
- {\endlist}
-\renewenvironment{quotation}
- {\list{}{\listparindent 2\ccwd%
- \itemindent \listparindent
- \rightmargin \leftmargin
- \parsep \z@ \@plus\p@}%
- \item\relax}
- {\endlist}
-
-\endinput
-
diff --git a/Master/texmf-dist/tex/latex/ctex/def/ctex-class.def b/Master/texmf-dist/tex/latex/ctex/def/ctex-class.def
deleted file mode 100644
index 964692aa770..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/def/ctex-class.def
+++ /dev/null
@@ -1,96 +0,0 @@
-% ctex-class.def: definitions for ctex document class files (not in style files)
-% vim:ft=tex
-
-% font size definitions
-
-\ifCTEX@sfoursize
- \renewcommand\normalsize{% 12bp
- \@setfontsize\normalsize{\CTEX@fs@sfour}{\CTEX@fs@sfourskip}%
- \abovedisplayskip 12\p@ \@plus3\p@ \@minus7\p@
- \abovedisplayshortskip \z@ \@plus3\p@
- \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
- \belowdisplayskip \abovedisplayskip
- \let\@listi\@listI}
- \normalsize
- \renewcommand\small{% 10.5bp
- \@setfontsize\small{\CTEX@fs@five}{\CTEX@fs@fiveskip}%
- \abovedisplayskip 11\p@ \@plus3\p@ \@minus6\p@
- \abovedisplayshortskip \z@ \@plus3\p@
- \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
- \def\@listi{\leftmargin\leftmargini
- \topsep 9\p@ \@plus3\p@ \@minus5\p@
- \parsep 4.5\p@ \@plus2\p@ \@minus\p@
- \itemsep \parsep}%
- \belowdisplayskip \abovedisplayskip}
- \renewcommand\footnotesize{% 9bp
- \@setfontsize\footnotesize{\CTEX@fs@sfive}{\CTEX@fs@sfiveskip}%
- \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
- \abovedisplayshortskip \z@ \@plus3\p@
- \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
- \def\@listi{\leftmargin\leftmargini
- \topsep 6\p@ \@plus2\p@ \@minus2\p@
- \parsep 3\p@ \@plus2\p@ \@minus\p@
- \itemsep \parsep}%
- \belowdisplayskip \abovedisplayskip}
- \renewcommand\scriptsize{% 7.5bp
- \@setfontsize\scriptsize{\CTEX@fs@six}{\CTEX@fs@sixskip}}
- \renewcommand\tiny{% 6.5bp
- \@setfontsize\tiny{\CTEX@fs@ssix}{\CTEX@fs@ssixskip}}
- \renewcommand\large{% 15bp
- \@setfontsize\large{\CTEX@fs@sthree}{\CTEX@fs@sthreeskip}}
- \renewcommand\Large{% 18bp
- \@setfontsize\Large{\CTEX@fs@stwo}{\CTEX@fs@stwoskip}}
- \renewcommand\LARGE{% 22bp
- \@setfontsize\LARGE{\CTEX@fs@two}{\CTEX@fs@twoskip}}
- \renewcommand\huge{% 24bp
- \@setfontsize\huge{\CTEX@fs@sone}{\CTEX@fs@soneskip}}
- \renewcommand\Huge{% 26bp
- \@setfontsize\Huge{\CTEX@fs@one}{\CTEX@fs@oneskip}}
-\fi
-\ifCTEX@fivesize
- \renewcommand\normalsize{% 10.5bp
- \@setfontsize\normalsize{\CTEX@fs@five}{\CTEX@fs@fiveskip}%
- \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
- \abovedisplayshortskip \z@ \@plus3\p@
- \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
- \belowdisplayskip \abovedisplayskip
- \let\@listi\@listI}
- \normalsize
- \renewcommand\small{% 9bp
- \@setfontsize\small{\CTEX@fs@sfive}{\CTEX@fs@sfiveskip}%
- \abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@
- \abovedisplayshortskip \z@ \@plus2\p@
- \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@
- \def\@listi{\leftmargin\leftmargini
- \topsep 4\p@ \@plus2\p@ \@minus2\p@
- \parsep 2\p@ \@plus\p@ \@minus\p@
- \itemsep \parsep}%
- \belowdisplayskip \abovedisplayskip}
- \renewcommand\footnotesize{% 7.5bp
- \@setfontsize\footnotesize{\CTEX@fs@six}{\CTEX@fs@sixskip}%
- \abovedisplayskip 6\p@ \@plus2\p@ \@minus4\p@
- \abovedisplayshortskip \z@ \@plus\p@
- \belowdisplayshortskip 3\p@ \@plus\p@ \@minus2\p@
- \def\@listi{\leftmargin\leftmargini
- \topsep 3\p@ \@plus\p@ \@minus\p@
- \parsep 2\p@ \@plus\p@ \@minus\p@
- \itemsep \parsep}%
- \belowdisplayskip \abovedisplayskip}
- \renewcommand\scriptsize{% 6.5bp
- \@setfontsize\scriptsize{\CTEX@fs@ssix}{\CTEX@fs@ssixskip}}
- \renewcommand\tiny{% 5.5bp
- \@setfontsize\tiny{\CTEX@fs@seven}{\CTEX@fs@sevenskip}}
- \renewcommand\large{% 12bp
- \@setfontsize\large{\CTEX@fs@sfour}{\CTEX@fs@sfourskip}}
- \renewcommand\Large{% 15bp
- \@setfontsize\Large{\CTEX@fs@sthree}{\CTEX@fs@sthreeskip}}
- \renewcommand\LARGE{% 18bp
- \@setfontsize\LARGE{\CTEX@fs@stwo}{\CTEX@fs@stwoskip}}
- \renewcommand\huge{% 22bp
- \@setfontsize\huge{\CTEX@fs@two}{\CTEX@fs@twoskip}}
- \renewcommand\Huge{% 26bp
- \@setfontsize\Huge{\CTEX@fs@one}{\CTEX@fs@oneskip}}
-\fi
-
-\endinput
-
diff --git a/Master/texmf-dist/tex/latex/ctex/def/ctex-common.def b/Master/texmf-dist/tex/latex/ctex/def/ctex-common.def
deleted file mode 100644
index 54436e2bed2..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/def/ctex-common.def
+++ /dev/null
@@ -1,423 +0,0 @@
-% ctex-common.def: common definitions for all ctex packages/classes
-% vim:ft=tex
-
-\@ifclassloaded{article}{\def\CTEX@cls@article{}}{}
-\@ifclassloaded{report}{\def\CTEX@cls@report{}}{}
-\@ifclassloaded{book}{\def\CTEX@cls@book{}}{}
-
-% Load some extra packages
-
-\IfFileExists{expl3.sty}{%
- \RequirePackage{expl3}}{}
-
-\RequirePackage{etoolbox}
-\RequirePackage{ifpdf}
-\RequirePackage{ifxetex}
-
-\ifxetex
- \CTEX@GBKfalse % XeTeX always uses UTF-8 as default encoding
-\fi
-
-\RequirePackage{keyval}[1999/03/16]
-\ifCTEX@indent
- \RequirePackage{indentfirst}
-\fi
-\RequirePackage{fix-cm}
-\ifCTEX@fancyhdr
- \RequirePackage{fancyhdr}
-\fi
-
-% Useful definitions
-
-\DeclareRobustCommand\CTeX{C\kern-.05em\TeX{}}
-\newcommand*\CTEX@key{\define@key{CTEX}}
-\newcommand*\CTEXoptions[1][]{\setkeys{CTEX}{#1}}
-\newcommand*\CTEX@subkey[1]{\define@key{CTEX#1}}
-\newcommand*\CTEXsetup[2][]{\setkeys{CTEX#2}{#1}}
-
-\def\ifCTEX@cls#1{%
- \expandafter\ifx\csname CTEX@cls@#1\endcsname\relax
- \expandafter\@secondoftwo
- \else
- \expandafter\@firstoftwo
- \fi}
-\def\CTEX@replacecommand#1#2#3{%
- \expandafter\expandafter\expandafter\let\expandafter
- \csname #1#3\expandafter\endcsname
- \csname #2#3\endcsname
- \expandafter\expandafter\expandafter\def\expandafter
- \csname #2#3\expandafter\endcsname
- {\csname #1#3\endcsname}}
-
-% Select engine: xetex has the highest priority, if not,
-% then try cct, otherwise we use traditional cjk.
-
-\ifxetex
- \input{ctex-xecjk-engine.def}
-\else
- \ifCTEX@cct
- \input{ctex-cct-engine.def}
- \else
- \input{ctex-cjk-engine.def}
- \fi
-\fi
-
-\AtEndOfPackage{%
- \makeatletter
- \ifCTEX@GBK
- \input{ctex-gbk.def}
- \else
- \input{ctex-utf8.def}
- \fi\makeatother}
-
-\newcommand*\CTEXindent{\CTEXsetfont\parindent2\ccwd}
-\newcommand*\CTEXnoindent{\parindent\z@}
-\ifCTEX@indent
- \AtBeginDocument{\CTEXindent}
-\fi
-\def\baselinestretch{1.3}
-
-% About font sizing
-
-\def\CTEX@fs@eight{5.02} \def\CTEX@fs@eightskip{6.02} %八号字 5bp
-\def\CTEX@fs@seven{5.52} \def\CTEX@fs@sevenskip{6.62} %七号字 5.5bp
-\def\CTEX@fs@ssix{6.52} \def\CTEX@fs@ssixskip{7.83} %小六号 6.5bp
-\def\CTEX@fs@six{7.53} \def\CTEX@fs@sixskip{9.03} %六号字 7.5bp
-\def\CTEX@fs@sfive{9.03} \def\CTEX@fs@sfiveskip{10.84} %小五号 9bp
-\def\CTEX@fs@five{10.54} \def\CTEX@fs@fiveskip{12.65} %五号字 10.5bp
-\def\CTEX@fs@sfour{12.05} \def\CTEX@fs@sfourskip{14.45} %小四号 12bp
-\def\CTEX@fs@four{14.05} \def\CTEX@fs@fourskip{16.86} %四号字 14bp
-\def\CTEX@fs@sthree{15.06} \def\CTEX@fs@sthreeskip{18.07} %小三号 15bp
-\def\CTEX@fs@three{16.06} \def\CTEX@fs@threeskip{19.27} %三号字 16bp
-\def\CTEX@fs@stwo{18.07} \def\CTEX@fs@stwoskip{21.68} %小二号 18bp
-\def\CTEX@fs@two{22.08} \def\CTEX@fs@twoskip{26.50} %二号字 22bp
-\def\CTEX@fs@sone{24.09} \def\CTEX@fs@soneskip{28.91} %小一号 24bp
-\def\CTEX@fs@one{26.10} \def\CTEX@fs@oneskip{31.32} %一号字 26bp
-\def\CTEX@fs@szero{36.14} \def\CTEX@fs@szeroskip{43.36} %小初号 36bp
-\def\CTEX@fs@zero{42.16} \def\CTEX@fs@zeroskip{50.59} %初号字 42bp
-\DeclareMathSizes{\CTEX@fs@eight}{\CTEX@fs@eight}{5}{5}
-\DeclareMathSizes{\CTEX@fs@seven}{\CTEX@fs@seven}{5}{5}
-\DeclareMathSizes{\CTEX@fs@ssix}{\CTEX@fs@ssix}{5}{5}
-\DeclareMathSizes{\CTEX@fs@six}{\CTEX@fs@six}{5}{5}
-\DeclareMathSizes{\CTEX@fs@sfive}{\CTEX@fs@sfive}{6}{5}
-\DeclareMathSizes{\CTEX@fs@five}{\CTEX@fs@five}{7}{5}
-\DeclareMathSizes{\CTEX@fs@sfour}{\CTEX@fs@sfour}{8}{6}
-\DeclareMathSizes{\CTEX@fs@four}
- {\CTEX@fs@four}{\CTEX@fs@five}{\CTEX@fs@six}
-\DeclareMathSizes{\CTEX@fs@sthree}
- {\CTEX@fs@sthree}{\CTEX@fs@sfour}{\CTEX@fs@sfive}
-\DeclareMathSizes{\CTEX@fs@three}
- {\CTEX@fs@three}{\CTEX@fs@four}{\CTEX@fs@five}
-\DeclareMathSizes{\CTEX@fs@stwo}
- {\CTEX@fs@stwo}{\CTEX@fs@sthree}{\CTEX@fs@sfour}
-\DeclareMathSizes{\CTEX@fs@two}
- {\CTEX@fs@two}{\CTEX@fs@three}{\CTEX@fs@four}
-\DeclareMathSizes{\CTEX@fs@sone}
- {\CTEX@fs@sone}{\CTEX@fs@stwo}{\CTEX@fs@sthree}
-\DeclareMathSizes{\CTEX@fs@one}
- {\CTEX@fs@one}{\CTEX@fs@two}{\CTEX@fs@three}
-\DeclareMathSizes{\CTEX@fs@szero}
- {\CTEX@fs@szero}{\CTEX@fs@sone}{\CTEX@fs@stwo}
-\DeclareMathSizes{\CTEX@fs@zero}
- {\CTEX@fs@zero}{\CTEX@fs@one}{\CTEX@fs@two}
-\def\CTEX@zihao{}
-\DeclareRobustCommand*\zihao[1]{\def\CTEX@zihao{#1}%
- \ifnum #11<0%
- \@tempcnta=-#1
- \ifcase\@tempcnta%
- \fontsize\CTEX@fs@szero\CTEX@fs@szeroskip%
- \or \fontsize\CTEX@fs@sone\CTEX@fs@soneskip%
- \or \fontsize\CTEX@fs@stwo\CTEX@fs@stwoskip%
- \or \fontsize\CTEX@fs@sthree\CTEX@fs@sthreeskip%
- \or \fontsize\CTEX@fs@sfour\CTEX@fs@sfourskip%
- \or \fontsize\CTEX@fs@sfive\CTEX@fs@sfiveskip%
- \or \fontsize\CTEX@fs@ssix\CTEX@fs@ssixskip%
- \else \PackageError{ctex}{%
- Undefined Chinese font size in command \protect\zihao}{%
- The old font size is used if you continue.}%
- \fi%
- \else%
- \@tempcnta=#1
- \ifcase\@tempcnta%
- \fontsize\CTEX@fs@zero\CTEX@fs@zeroskip%
- \or \fontsize\CTEX@fs@one\CTEX@fs@oneskip%
- \or \fontsize\CTEX@fs@two\CTEX@fs@twoskip%
- \or \fontsize\CTEX@fs@three\CTEX@fs@threeskip%
- \or \fontsize\CTEX@fs@four\CTEX@fs@fourskip%
- \or \fontsize\CTEX@fs@five\CTEX@fs@fiveskip%
- \or \fontsize\CTEX@fs@six\CTEX@fs@sixskip%
- \or \fontsize\CTEX@fs@seven\CTEX@fs@sevenskip%
- \or \fontsize\CTEX@fs@eight\CTEX@fs@eightskip%
- \else \PackageError{ctex}{%
- Undefined Chinese font size in command \protect\zihao}{%
- The old font size is used if you continue.}%
- \fi%
- \fi%
- \selectfont\ignorespaces}
-
-% About numbers
-
-\newif\ifCTEX@zero@
-\newif\ifCTEX@previous@
-\newif\ifCTEX@null@
-\newcount\CTEX@q
-\newcount\CTEX@r
-\def\CTEX@appendstring#1#2{%
- \expandafter\def\expandafter#1\expandafter{#1#2}}
-\def\CTEX@appendnumber#1#2{%
- \ifcase #2\relax
- \ifCTEX@null@
- \CTEX@appendstring{#1}{\CTEX@null}%
- \else
- \CTEX@appendstring{#1}{\CTEX@zero}%
- \fi
- \or \CTEX@appendstring{#1}{\CTEX@one}%
- \or \CTEX@appendstring{#1}{\CTEX@two}%
- \or \CTEX@appendstring{#1}{\CTEX@three}%
- \or \CTEX@appendstring{#1}{\CTEX@four}%
- \or \CTEX@appendstring{#1}{\CTEX@five}%
- \or \CTEX@appendstring{#1}{\CTEX@six}%
- \or \CTEX@appendstring{#1}{\CTEX@seven}%
- \or \CTEX@appendstring{#1}{\CTEX@eight}%
- \or \CTEX@appendstring{#1}{\CTEX@nine}%
- \fi}
-\def\CTEX@splitnumber#1{%
- \CTEX@q #1\relax
- \CTEX@r #1\relax
- \divide\CTEX@q \@M
- \begingroup
- \multiply\CTEX@q \@M
- \advance\CTEX@r -\CTEX@q
- \ifnum\CTEX@r = \z@
- \xdef\CTEX@low{}%
- \else
- \xdef\CTEX@low{\number\CTEX@r}%
- \fi
- \endgroup
- \ifnum\CTEX@q > \z@
- \CTEX@r \CTEX@q
- \divide\CTEX@q \@M
- \begingroup
- \multiply\CTEX@q \@M
- \advance\CTEX@r -\CTEX@q
- \ifnum\CTEX@r = \z@
- \xdef\CTEX@high{}%
- \else
- \xdef\CTEX@high{\number\CTEX@r}%
- \fi
- \endgroup
- \ifnum\CTEX@q > \z@
- \xdef\CTEX@yi{\number\CTEX@q}%
- \else
- \xdef\CTEX@yi{}%
- \fi
- \else
- \xdef\CTEX@high{}%
- \xdef\CTEX@yi{}%
- \fi
-}
-\def\CTEX@processnumber#1#2{%
- \CTEX@zero@false
- \CTEX@q #2\relax
- \CTEX@r #2\relax
- \divide\CTEX@q \@m
- \ifnum\CTEX@q = \z@
- \ifCTEX@previous@
- \CTEX@zero@true
- \fi
- \else
- \ifCTEX@zero@
- \CTEX@appendstring{#1}{\CTEX@zero}%
- \fi
- \CTEX@appendnumber{#1}{\CTEX@q}%
- \CTEX@appendstring{#1}{\CTEX@thousand}%
- \CTEX@previous@true
- \CTEX@zero@false
- \fi
- \multiply\CTEX@q \@m
- \advance\CTEX@r -\CTEX@q
- \CTEX@q \CTEX@r
- \divide\CTEX@q 100\relax
- \ifnum\CTEX@q = \z@
- \ifCTEX@previous@
- \CTEX@zero@true
- \fi
- \else
- \ifCTEX@zero@
- \CTEX@appendstring{#1}{\CTEX@zero}%
- \fi
- \CTEX@appendnumber{#1}{\CTEX@q}%
- \CTEX@appendstring{#1}{\CTEX@hundred}%
- \CTEX@previous@true
- \CTEX@zero@false
- \fi
- \multiply\CTEX@q 100
- \advance\CTEX@r -\CTEX@q
- \CTEX@q \CTEX@r
- \divide \CTEX@q 10\relax
- \ifnum\CTEX@q = \z@
- \ifCTEX@previous@
- \CTEX@zero@true
- \fi
- \else
- \ifCTEX@zero@
- \CTEX@appendstring{#1}{\CTEX@zero}%
- \fi
- \ifnum\CTEX@q = \@ne
- \ifCTEX@previous@
- \CTEX@appendstring{#1}{\CTEX@one}%
- \fi
- \else
- \CTEX@appendnumber{#1}{\CTEX@q}%
- \fi
- \CTEX@appendstring{#1}{\CTEX@ten}%
- \CTEX@previous@true
- \CTEX@zero@false
- \fi
- \multiply\CTEX@q 10
- \advance\CTEX@r -\CTEX@q
- \ifnum\CTEX@r = \z@
- \else
- \ifCTEX@zero@
- \CTEX@appendstring{#1}{\CTEX@zero}%
- \fi
- \CTEX@appendnumber{#1}{\CTEX@r}%
- \CTEX@previous@true
- \fi}
-\DeclareRobustCommand\CTEXnumber[2]{%
- \def#1{}%
- \CTEX@null@false
- \CTEX@q #2\relax
- \ifnum\CTEX@q < \z@
- \multiply\CTEX@q \m@ne
- \CTEX@appendstring{#1}{\CTEX@minus}%
- \fi
- \CTEX@previous@false
- \CTEX@zero@false
- \ifnum\CTEX@q = \z@
- \CTEX@appendstring{#1}{\CTEX@zero}%
- \else
- \CTEX@splitnumber{\CTEX@q}%
- \ifx\CTEX@yi \@empty
- \else
- \CTEX@processnumber{#1}{\CTEX@yi}%
- \CTEX@appendstring{#1}{\CTEX@hundredmillion}%
- \fi
- \ifx\CTEX@high \@empty
- \else
- \CTEX@processnumber{#1}{\CTEX@high}%
- \CTEX@appendstring{#1}{\CTEX@tenthousand}%
- \fi
- \ifx\CTEX@low \@empty
- \else
- \ifx\CTEX@yi \@empty
- \else
- \ifx\CTEX@high \@empty
- \CTEX@appendstring{#1}{\CTEX@zero}% this catches 100002345
- \fi
- \fi
- \CTEX@processnumber{#1}{\CTEX@low}%
- \fi
- \fi}
-\def\CTEX@getdigit#1#2\@nil{%
- \edef\CTEX@tempa{#1}%
- \edef\CTEX@tempb{#2}}
-\DeclareRobustCommand\CTEXdigits[2]{%
- \def#1{}%
- \CTEX@null@true
- \edef\CTEX@tempa{}%
- \edef\CTEX@tempb{#2}%
- \ifx\CTEX@tempb \@empty
- \else
- \loop
- \expandafter\CTEX@getdigit\CTEX@tempb\@nil
- \CTEX@appendnumber{#1}{\CTEX@tempa}%
- \ifx\CTEX@tempb \@empty
- \else
- \repeat
- \fi}
-\DeclareRobustCommand\CTEXcounter[1]{%
- \@ifundefined{c@#1}{}{%
- \CTEXnumber{\reserved@a}{\@arabic\csname c@#1\endcsname}%
- \expandafter\expandafter\expandafter\def%
- \expandafter\expandafter\csname cc@#1\endcsname%
- \expandafter{\reserved@a}}}
-\AtBeginDocument{%
- \makeatletter%
- \@ifundefined{CTEX@save@setcounter}{%
- \let\CTEX@save@setcounter\setcounter%
- \def\setcounter#1#2{%
- \CTEX@save@setcounter{#1}{#2}%
- \CTEXcounter{#1}}}{}
- \@ifundefined{CTEX@save@addtocounter}{%
- \let\CTEX@save@addtocounter\addtocounter%
- \def\addtocounter#1#2{%
- \CTEX@save@addtocounter{#1}{#2}%
- \CTEXcounter{#1}}}{}
- \@ifundefined{CTEX@save@stepcounter}{%
- \let\CTEX@save@stepcounter\stepcounter%
- \def\stepcounter#1{%
- \CTEX@save@stepcounter{#1}%
- \CTEXcounter{#1}}}{}
- \makeatother}
-\def\chinese#1{%
- \@ifundefined{cc@#1}{\CTEX@null}{\csname cc@#1\endcsname}}
-\def\Chinese#1{\CTEXcounter{#1}\chinese{#1}}
-
-% About caption
-
-\ifCTEX@caption
- \let\CTEX@save@refstepcounter\refstepcounter
- \def\refstepcounter#1{\CTEX@save@refstepcounter{#1}%
- \protected@edef\@currentlabel
- {\csname p@#1\endcsname%
- \@ifundefined{CTEX@the#1}%
- {\csname the#1\endcsname}%
- {\csname CTEX@the#1\endcsname}%
- }}%
-\fi
-
-% `today' definitions
-
-\let\CTEX@todayold\today
-\ifCTEX@caption
- \renewcommand*\today{\CTEX@todaysmall}
-\fi
-\CTEX@key{today}{\CTEX@settoday{#1}}
-\newcommand*\CTEX@settoday[1]{%
- \@ifundefined{CTEX@today#1}
- {\PackageError{ctex}{%
- unknown today format}{%
- Available today format are "old", "small", and "big".}}
- {\renewcommand*\today{\csname CTEX@today#1\endcsname}}}
-
-% Put hyperref as bottom as possible, otherwise there may be page
-% count issues
-\ifCTEX@hyperref
-\providecommand\hypersetup[1]{%
- \PassOptionsToPackage{#1}{hyperref}}
-\AtEndPreamble{%
- \@ifpackageloaded{hyperref}{}{\RequirePackage{hyperref}}}
-\AtEndOfPackage{%
- \ifxetex
- \hypersetup{xetex,unicode}
- \else
- \ifpdf % pdftex
- \hypersetup{pdftex}
- \else % dvipdfmx
- \hypersetup{dvipdfmx}
- \ifCTEX@GBK
- \AtBeginDvi{\special{pdf:tounicode GBK-EUC-UCS2}}
- \fi
- \fi
- \ifCTEX@GBK
- \hypersetup{CJKbookmarks}
- \else
- \hypersetup{unicode}
- \fi
- \fi
- \hypersetup{colorlinks=true}
-}
-\fi
-
-\endinput
diff --git a/Master/texmf-dist/tex/latex/ctex/def/ctex-gbk.def b/Master/texmf-dist/tex/latex/ctex/def/ctex-gbk.def
deleted file mode 100644
index 8976f88fe7a..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/def/ctex-gbk.def
+++ /dev/null
@@ -1,31 +0,0 @@
-% ctex-gbk.def
-% vim:ft=tex
-
-\def\CTEXnullspace{0pt}
-\def\CTEX@null{\kern\CTEXnullspace{}\kern\CTEXnullspace}
-\def\CTEX@zero{}
-\def\CTEX@one{һ}
-\def\CTEX@two{}
-\def\CTEX@three{}
-\def\CTEX@four{}
-\def\CTEX@five{}
-\def\CTEX@six{}
-\def\CTEX@seven{}
-\def\CTEX@eight{}
-\def\CTEX@nine{}
-\def\CTEX@ten{ʮ}
-\def\CTEX@hundred{}
-\def\CTEX@thousand{ǧ}
-\def\CTEX@tenthousand{}
-\def\CTEX@hundredmillion{}
-\def\CTEX@minus{}
-
-\def\CTEX@todaysmall{~\the\year~~\the\month~~\the\day~}
-\def\CTEX@todaybig{%
- \CTEXdigits{\temp@year}{\the\year}%
- \CTEXnumber{\temp@month}{\the\month}%
- \CTEXnumber{\temp@day}{\the\day}%
- \temp@year{}\temp@month{}\temp@day{}}
-
-\endinput
-
diff --git a/Master/texmf-dist/tex/latex/ctex/def/ctex-loadclass.def b/Master/texmf-dist/tex/latex/ctex/def/ctex-loadclass.def
deleted file mode 100644
index 99a8bf14d63..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/def/ctex-loadclass.def
+++ /dev/null
@@ -1,16 +0,0 @@
-% ctex-loadclass.def: load standard LaTeX class
-% vim:ft=tex
-
-\ProcessOptions
-
-\ifCTEX@sfoursize
- \PassOptionsToClass{12pt}%
- {\CTEX@classtoload}
-\fi
-\ifCTEX@fivesize
- \PassOptionsToClass{10pt}%
- {\CTEX@classtoload}
-\fi
-\LoadClass{\CTEX@classtoload}
-
-\endinput
diff --git a/Master/texmf-dist/tex/latex/ctex/def/ctex-report.def b/Master/texmf-dist/tex/latex/ctex/def/ctex-report.def
deleted file mode 100644
index b64c64990e3..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/def/ctex-report.def
+++ /dev/null
@@ -1,242 +0,0 @@
-% ctex-report.def: definitions for report class files
-% vim:ft=tex
-
-\def\CTEX@prepart{Part\space}
-\def\CTEX@prechapter{Chapter\space}
-\def\CTEX@part@format{\centering}
-\def\CTEX@part@nameformat{\huge\bfseries}
-\def\CTEX@part@aftername{\par\vskip 20\p@}
-\def\CTEX@part@titleformat{\Huge\bfseries}
-\def\CTEX@chapter@format{\raggedright}
-\def\CTEX@chapter@nameformat{\huge\bfseries}
-\def\CTEX@chapter@aftername{\par\nobreak\vskip 20\p@}
-\def\CTEX@chapter@titleformat{\Huge\bfseries}
-\def\CTEX@chapter@beforeskip{50\p@}
-\def\CTEX@chapter@afterskip{40\p@}
-\def\CTEX@chapter@indent{\z@}
-\def\CTEX@section@format{\Large\bfseries}
-\def\CTEX@section@aftername{\quad}
-\def\CTEX@section@beforeskip{-3.5ex \@plus -1ex \@minus -.2ex}
-\def\CTEX@section@afterskip{2.3ex \@plus .2ex}
-\def\CTEX@section@indent{\z@}
-\def\CTEX@subsection@format{\large\bfseries}
-\def\CTEX@subsection@aftername{\quad}
-\def\CTEX@subsection@beforeskip{-3.25ex \@plus -1ex \@minus -.2ex}
-\def\CTEX@subsection@afterskip{1.5ex \@plus .2ex}
-\def\CTEX@subsection@indent{\z@}
-\def\CTEX@subsubsection@format{\normalsize\bfseries}
-\def\CTEX@subsubsection@aftername{\quad}
-\def\CTEX@subsubsection@beforeskip{-3.25ex \@plus -1ex \@minus -.2ex}
-\def\CTEX@subsubsection@afterskip{1.5ex \@plus .2ex}
-\def\CTEX@subsubsection@indent{\z@}
-\def\CTEX@paragraph@format{\normalsize\bfseries}
-\def\CTEX@paragraph@aftername{\quad}
-\ifnum\c@CTEX@sectiondepth>2
- \def\CTEX@paragraph@beforeskip{-3.25ex \@plus -1ex \@minus -.2ex}
- \def\CTEX@paragraph@afterskip{1ex \@plus .2ex}
-\else
- \def\CTEX@paragraph@beforeskip{3.25ex \@plus1ex \@minus .2ex}
- \def\CTEX@paragraph@afterskip{-1em}
-\fi
-\def\CTEX@paragraph@indent{\z@}
-\def\CTEX@subparagraph@format{\normalsize\bfseries}
-\def\CTEX@subparagraph@aftername{\quad}
-\ifnum\c@CTEX@sectiondepth>3
- \def\CTEX@subparagraph@beforeskip{-3.25ex \@plus -1ex \@minus -.2ex}
- \def\CTEX@subparagraph@afterskip{1ex \@plus .2ex}
-\else
- \def\CTEX@subparagraph@beforeskip{3.25ex \@plus1ex \@minus .2ex}
- \def\CTEX@subparagraph@afterskip{-1em}
-\fi
-\ifnum\c@CTEX@sectiondepth>2
- \def\CTEX@subparagraph@indent{\z@}
-\else
- \def\CTEX@subparagraph@indent{\parindent}
-\fi
-\def\CTEX@appendixname{Appendix\space}
-\def\CTEX@appendixnumber{\@Alph\c@chapter}
-\let\CTEX@save@appendix\appendix
-\renewcommand*\appendix{\CTEX@save@appendix%
- \gdef\CTEX@prechapter{\CTEX@appendixname}%
- \gdef\CTEX@thechapter{\CTEX@appendixnumber}%
- \gdef\CTEX@postchapter{}}%
-\def\@part[#1]#2{%
- \ifnum \c@secnumdepth >-2\relax
- \refstepcounter{part}%
- \addcontentsline{toc}{part}{\CTEXthepart\hspace{1em}#1}%
- \else
- \addcontentsline{toc}{part}{#1}%
- \fi
- \markboth{}{}%
- {\interlinepenalty \@M
- \normalfont \CTEX@part@format
- \ifnum \c@secnumdepth >-2\relax
- \CTEX@partname
- \fi
- \CTEX@part@titleformat #2\par}%
- \@endpart}
-\def\@spart#1{%
- {\interlinepenalty \@M
- \normalfont \CTEX@part@format
- \CTEX@part@titleformat #1\par}%
- \@endpart}
-\def\@chapter[#1]#2{%
- \ifnum \c@secnumdepth >\m@ne
- \refstepcounter{chapter}%
- \typeout{\CTEXthechapter}%
- \addcontentsline{toc}{chapter}
- {\protect\numberline{\CTEXthechapter\hspace{0.3em}}#1}%
- \else
- \addcontentsline{toc}{chapter}{#1}%
- \fi
- \chaptermark{#1}%
- \addtocontents{lof}{\protect\addvspace{10\p@}}%
- \addtocontents{lot}{\protect\addvspace{10\p@}}%
- \if@twocolumn
- \@topnewpage[\@makechapterhead{#2}]%
- \else
- \@makechapterhead{#2}%
- \@afterheading
- \fi}
-\def\@makechapterhead#1{%
- \vspace*{\CTEX@chapter@beforeskip}%
- {\normalfont \parindent \CTEX@chapter@indent \CTEX@chapter@format
- \ifnum \c@secnumdepth >\m@ne
- \CTEX@chaptername
- \fi
- \interlinepenalty\@M
- \CTEX@chapter@titleformat #1\par\nobreak
- \vskip \CTEX@chapter@afterskip
- }}
-\def\@makeschapterhead#1{%
- \vspace*{\CTEX@chapter@beforeskip}%
- {\normalfont \parindent \CTEX@chapter@indent \CTEX@chapter@format
- \interlinepenalty\@M
- \CTEX@chapter@titleformat #1\par\nobreak
- \vskip \CTEX@chapter@afterskip
- }}
-\def\@seccntformat#1{%
- \@ifundefined{CTEX@#1name}%
- {\csname the#1\endcsname\quad}%
- {\csname CTEX@#1name\endcsname}}
-\def\@sect#1#2#3#4#5#6[#7]#8{%
- \ifnum #2>\c@secnumdepth
- \let\@svsec\@empty
- \else
- \refstepcounter{#1}%
- \protected@edef\@svsec{\@seccntformat{#1}\relax}%
- \fi
- \@tempskipa #5\relax
- \ifdim \@tempskipa>\z@
- \begingroup
- #6{%
- \@hangfrom{\hskip #3\relax\@svsec}%
- \interlinepenalty \@M
- \csname CTEX@#1@titleformat\endcsname #8\@@par}%
- \endgroup
- \csname #1mark\endcsname{#7}%
- \addcontentsline{toc}{#1}{%
- \ifnum #2>\c@secnumdepth \else
- \protect\numberline{\@ifundefined{CTEXthe#1}%
- {\csname the#1\endcsname}%
- {\csname CTEXthe#1\endcsname}}%
- \fi
- #7}%
- \else
- \def\@svsechd{%
- #6{\hskip #3\relax
- \@svsec \csname CTEX@#1@titleformat\endcsname #8}%
- \csname #1mark\endcsname{#7}%
- \addcontentsline{toc}{#1}{%
- \ifnum #2>\c@secnumdepth \else
- \protect\numberline{\@ifundefined{CTEXthe#1}%
- {\csname the#1\endcsname}%
- {\csname CTEXthe#1\endcsname}}%
- \fi
- #7}}%
- \fi
- \@xsect{#5}}
-\def\numberline#1{%
- \settowidth\@tempdimb{#1\hspace{0.5em}}%
- \ifdim\@tempdima<\@tempdimb%
- \@tempdima=\@tempdimb%
- \fi%
- \hb@xt@\@tempdima{#1\hfil}}
-\renewcommand\section{\@startsection{section}{1}%
- {\CTEX@section@indent}%
- {\CTEX@section@beforeskip}%
- {\CTEX@section@afterskip}%
- {\normalfont\CTEX@section@format}}
-\renewcommand\subsection{\@startsection{subsection}{2}%
- {\CTEX@subsection@indent}%
- {\CTEX@subsection@beforeskip}%
- {\CTEX@subsection@afterskip}%
- {\normalfont\CTEX@subsection@format}}
-\renewcommand\subsubsection{\@startsection{subsubsection}{3}%
- {\CTEX@subsubsection@indent}%
- {\CTEX@subsubsection@beforeskip}%
- {\CTEX@subsubsection@afterskip}%
- {\normalfont\CTEX@subsubsection@format}}
-\renewcommand\paragraph{\@startsection{paragraph}{4}%
- {\CTEX@paragraph@indent}%
- {\CTEX@paragraph@beforeskip}%
- {\CTEX@paragraph@afterskip}%
- {\normalfont\CTEX@paragraph@format}}
-\renewcommand\subparagraph{\@startsection{subparagraph}{5}%
- {\CTEX@subparagraph@indent}%
- {\CTEX@subparagraph@beforeskip}%
- {\CTEX@subparagraph@afterskip}%
- {\normalfont\CTEX@subparagraph@format}}
-\if@twoside
- \def\ps@headings{%
- \let\@oddfoot\@empty\let\@evenfoot\@empty
- \def\@evenhead{\thepage\hfil\slshape\leftmark}%
- \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
- \let\@mkboth\markboth
- \def\chaptermark##1{%
- \markboth {\MakeUppercase{%
- \ifnum \c@secnumdepth >\m@ne
- \CTEXthechapter \quad %
- \fi
- ##1}}{}}%
- \def\sectionmark##1{%
- \markright {\MakeUppercase{%
- \ifnum \c@secnumdepth >\z@
- \CTEXthesection \quad %
- \fi
- ##1}}}}
-\else
- \def\ps@headings{%
- \let\@oddfoot\@empty
- \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
- \let\@mkboth\markboth
- \def\chaptermark##1{%
- \markright {\MakeUppercase{%
- \ifnum \c@secnumdepth >\m@ne
- \CTEXthechapter \quad %
- \fi
- ##1}}}}
-\fi
-\pagestyle{headings}
-\@ifundefined{ps@fancy}{}{%
- \def\ps@fancy{%
- \@ifundefined{@chapapp}{\let\@chapapp\chaptername}{}%for amsbook
- \@ifundefined{MakeUppercase}{\def\MakeUppercase{\uppercase}}{}%
- \@ifundefined{chapter}{\def\sectionmark##1{\markboth
- {\MakeUppercase{\ifnum \c@secnumdepth>\z@
- \CTEXthesection\quad \fi ##1}}{}}%
- \def\subsectionmark##1{\markright {\ifnum \c@secnumdepth >\@ne
- \CTEXthesubsection\quad \fi ##1}}}%
- {\def\chaptermark##1{\markboth {\MakeUppercase{\ifnum \c@secnumdepth>\m@ne
- \ifCTEX@cls{book}{\if@mainmatter\CTEXthechapter \quad\fi}{\CTEXthechapter \quad}
- \fi ##1}}{}}%
- \def\sectionmark##1{\markright{\MakeUppercase{\ifnum \c@secnumdepth >\z@
- \CTEXthesection \quad \fi ##1}}}}%
- \ps@@fancy
- \gdef\ps@fancy{\@fancyplainfalse\ps@@fancy}%
- \ifdim\headwidth<0sp
- \global\advance\headwidth123456789sp\global\advance\headwidth\textwidth
- \fi}
-}
-
-\endinput
diff --git a/Master/texmf-dist/tex/latex/ctex/def/ctex-utf8.def b/Master/texmf-dist/tex/latex/ctex/def/ctex-utf8.def
deleted file mode 100644
index 10493a5b381..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/def/ctex-utf8.def
+++ /dev/null
@@ -1,31 +0,0 @@
-% ctex-utf8.def
-% vim:ft=tex
-
-\def\CTEXnullspace{0pt}
-\def\CTEX@null{\kern\CTEXnullspace{}〇\kern\CTEXnullspace}
-\def\CTEX@zero{零}
-\def\CTEX@one{一}
-\def\CTEX@two{二}
-\def\CTEX@three{三}
-\def\CTEX@four{四}
-\def\CTEX@five{五}
-\def\CTEX@six{六}
-\def\CTEX@seven{七}
-\def\CTEX@eight{八}
-\def\CTEX@nine{九}
-\def\CTEX@ten{十}
-\def\CTEX@hundred{百}
-\def\CTEX@thousand{千}
-\def\CTEX@tenthousand{万}
-\def\CTEX@hundredmillion{亿}
-\def\CTEX@minus{-}
-
-\def\CTEX@todaysmall{~\the\year~年~\the\month~月~\the\day~日}
-\def\CTEX@todaybig{%
- \CTEXdigits{\temp@year}{\the\year}%
- \CTEXnumber{\temp@month}{\the\month}%
- \CTEXnumber{\temp@day}{\the\day}%
- \temp@year{}年\temp@month{}月\temp@day{}日}
-
-\endinput
-
diff --git a/Master/texmf-dist/tex/latex/ctex/engine/ctex-cct-engine.def b/Master/texmf-dist/tex/latex/ctex/engine/ctex-cct-engine.def
deleted file mode 100644
index cd54033ed97..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/engine/ctex-cct-engine.def
+++ /dev/null
@@ -1,82 +0,0 @@
-% ctex-cct-engine.def: for LaTeX engine with CCT
-% vim:ft=tex
-
-\ifCTEX@cctfont
- \RequirePackage{cctbase}[2003/04/05]
-\else
- \RequirePackage[CJK]{cctbase}[2003/04/05]
-\fi
-\ifCTEX@punct
- \CCTpuncttrue
-\else
- \CCTpunctfalse
-\fi
-\ifCTEX@fntef
- \RequirePackage{CCTfntef}
- \normalem
-\fi
-\ifCTEX@space
- \AtBeginDocument{\CCTspace}
-\else
- \AtBeginDocument{\CCTnospace}
-\fi
-\def\CTEXspace{\CCTspace}
-\def\CTEXnospace{\CCTnospace}
-\ifCTEX@cctfont\else
- \CCTdefziti A song song % 宋体
- \CCTdefziti B hei song % 黑体
- \CCTdefziti C kai song % 楷体
- \CCTdefziti D fs song % 仿宋
- \CCTdefziti E bs hei % 标宋
- \CCTdefziti F li hei % 隶书
- \CCTdefziti G you kai % 幼圆
- \DeclareRobustCommand*{\songti}{\ziti{A}\relax} % 宋体
- \DeclareRobustCommand*{\heiti}{\ziti{B}\relax} % 黑体
- \DeclareRobustCommand*{\kaishu}{\ziti{C}\relax} % 楷书
- \DeclareRobustCommand*{\fangsong}{\ziti{D}\relax} % 仿宋
- \DeclareRobustCommand*{\biaosong}{\ziti{E}\relax} % 标宋
- \DeclareRobustCommand*{\lishu}{\ziti{F}\relax} % 隶书
- \DeclareRobustCommand*{\youyuan}{\ziti{G}\relax} % 幼圆
-\fi
-\ifx\CCT@set@fontsize\undefined
- \let\CCT@set@fontsize\oset@fontsize
-\fi
-\let\CTEX@save@set@fontsize\set@fontsize
-\def\set@fontsize#1#2#3{%
- \CCT@set@fontsize{#1}{#2}{#3}%
- \zihaoAny{#2}%
- \CTEXsetfont}
-\let\CTEX@save@ziju\ziju
-\renewcommand*\ziju[1]{% 字距
- \CTEX@save@ziju{#1}%
- \CTEXsetfont}
-\newcommand*\CTEXsetfont{%
- \ifdim\parindent=0pt\else\parindent2\ccwd\fi}
-\ifCTEX@fntef
- \def\CTEXunderdot{\CCTunderdot}
- \def\CTEXunderline{\CCTunderline}
- \def\CTEXunderdblline{\CCTunderdblline}
- \def\CTEXunderwave{\CCTunderwave}
- \def\CTEXsout{\CCTsout}
- \def\CTEXxout{\CCTxout}
- \def\CTEXfilltwosides{\CCTfilltwosides}
- \def\endCTEXfilltwosides{\endCCTfilltwosides}
- \CTEX@replacecommand{CTEX}{CCT}{underdotbasesep}
- \CTEX@replacecommand{CTEX}{CCT}{underdotsep}
- \CTEX@replacecommand{CTEX}{CCT}{underlinebasesep}
- \CTEX@replacecommand{CTEX}{CCT}{underlinesep}
- \CTEX@replacecommand{CTEX}{CCT}{underdbllinebasesep}
- \CTEX@replacecommand{CTEX}{CCT}{underdbllinesep}
- \CTEX@replacecommand{CTEX}{CCT}{underwavebasesep}
- \CTEX@replacecommand{CTEX}{CCT}{underwavesepa}
- \CTEX@replacecommand{CTEX}{CCT}{underwavesep}
- \CTEX@replacecommand{CTEX}{CCT}{southeight}
- \CTEX@replacecommand{CTEX}{CCT}{xoutheight}
- \CTEX@replacecommand{CTEX}{CCT}{underdotcolor}
- \CTEX@replacecommand{CTEX}{CCT}{underwavecolor}
- \CTEX@replacecommand{CTEX}{CCT}{underlinecolor}
- \CTEX@replacecommand{CTEX}{CCT}{underdbllinecolor}
- \CTEX@replacecommand{CTEX}{CCT}{soutcolor}
- \CTEX@replacecommand{CTEX}{CCT}{xoutcolor}
-\fi
-\endinput
diff --git a/Master/texmf-dist/tex/latex/ctex/engine/ctex-cjk-common.def b/Master/texmf-dist/tex/latex/ctex/engine/ctex-cjk-common.def
deleted file mode 100644
index ad641c45ecf..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/engine/ctex-cjk-common.def
+++ /dev/null
@@ -1,57 +0,0 @@
-% ctex-cjk-common.def: common definitions shared by cjk-engine and xecjk-engine
-% vim:ft=tex
-
-\ifCTEX@fntef
- \RequirePackage{CJKfntef}
- \normalem
-\fi
-
-\def\CTEXspace{\CJKspace}
-\def\CTEXnospace{\CJKnospace}
-
-\let\CTEX@save@set@fontsize\set@fontsize
-\def\set@fontsize#1#2#3{%
- \CTEX@save@set@fontsize{#1}{#2}{#3}%
- \CTEXsetfont}
-\newcommand*\ziju[1]{% 字距
- \begingroup
- \settowidth\@tempdima{\CTEX@spaceChar}%
- \expandafter\endgroup%
- \expandafter\renewcommand%
- \expandafter\CJKglue%
- \expandafter{\expandafter\hskip\the\dimexpr#1\@tempdima\relax\@plus.08\baselineskip\relax}%
- \CTEXsetfont} % is it a good definition?
-\newdimen\ccwd % 字宽
-\newcommand*\CTEXsetfont{%
- \begingroup
- \settowidth\ccwd{\CTEX@spaceChar\CJKglue}%
- \expandafter\endgroup\expandafter\ccwd\the\ccwd\relax
- \unless\ifdim\parindent=\z@\parindent2\ccwd\fi}
-\def\CTEX@spaceChar{\hskip \f@size \p@\relax}
-\ifCTEX@fntef
- \def\CTEXunderdot{\CJKunderdot}
- \def\CTEXunderline{\CJKunderline}
- \def\CTEXunderdblline{\CJKunderdblline}
- \def\CTEXunderwave{\CJKunderwave}
- \def\CTEXsout{\CJKsout}
- \def\CTEXxout{\CJKxout}
- \def\CTEXfilltwosides{\CJKfilltwosides}
- \def\endCTEXfilltwosides{\endCJKfilltwosides}
- \CTEX@replacecommand{CTEX}{CJK}{underdotbasesep}
- \CTEX@replacecommand{CTEX}{CJK}{underdotsep}
- \CTEX@replacecommand{CTEX}{CJK}{underlinebasesep}
- \CTEX@replacecommand{CTEX}{CJK}{underlinesep}
- \CTEX@replacecommand{CTEX}{CJK}{underdbllinebasesep}
- \CTEX@replacecommand{CTEX}{CJK}{underdbllinesep}
- \CTEX@replacecommand{CTEX}{CJK}{underwavebasesep}
- \CTEX@replacecommand{CTEX}{CJK}{underwavesep}
- \CTEX@replacecommand{CTEX}{CJK}{southeight}
- \CTEX@replacecommand{CTEX}{CJK}{underdotcolor}
- \CTEX@replacecommand{CTEX}{CJK}{underwavecolor}
- \CTEX@replacecommand{CTEX}{CJK}{underlinecolor}
- \CTEX@replacecommand{CTEX}{CJK}{underdbllinecolor}
- \CTEX@replacecommand{CTEX}{CJK}{soutcolor}
- \CTEX@replacecommand{CTEX}{CJK}{xoutcolor}
-\fi
-
-\endinput
diff --git a/Master/texmf-dist/tex/latex/ctex/engine/ctex-cjk-engine.def b/Master/texmf-dist/tex/latex/ctex/engine/ctex-cjk-engine.def
deleted file mode 100644
index 05634b7663b..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/engine/ctex-cjk-engine.def
+++ /dev/null
@@ -1,66 +0,0 @@
-% ctex-cjk-engine.def: for LaTeX engine with CJK
-% vim:ft=tex
-
-\ifCTEX@GBK
- \RequirePackage{CJK}[2003/03/28]
-\else
- \RequirePackage{CJKutf8}[2003/03/28]
-\fi
-
-\ifCTEX@punct
- \RequirePackage{CJKpunct}[2009/05/06]
-\fi
-
-\AtEndOfPackage{\CJK@makeActive}
-
-\ifCTEX@space
- \ifCTEX@GBK
- \def\CTEX@beginCJK{\begin{CJK}{GBK}{rm}}
- \else
- \def\CTEX@beginCJK{\begin{CJK}{UTF8}{rm}}
- \fi
- \def\CTEX@endCJK{\clearpage\end{CJK}}
-\else
- \ifCTEX@GBK
- \def\CTEX@beginCJK{\begin{CJK*}{GBK}{rm}\CJKtilde}
- \else
- \def\CTEX@beginCJK{\begin{CJK*}{UTF8}{rm}\CJKtilde}
- \fi
- \def\CTEX@endCJK{\clearpage\end{CJK*}}
-\fi
-
-\let\CTEX@begindocumenthook\@begindocumenthook
-\let\CTEX@enddocumenthook\@enddocumenthook
-\def\AtBeginDocument{\g@addto@macro\CTEX@begindocumenthook}
-\def\AtEndDocument{\g@addto@macro\CTEX@enddocumenthook}
-\def\@begindocumenthook{\CTEX@begindocumenthook\CTEX@beginCJK}
-\def\@enddocumenthook{\CTEX@endCJK\CTEX@enddocumenthook}
-
-\input{ctex-cjk-common.def}
-
-\providecommand*\CTEX@rm@family{}
-\providecommand*\CTEX@sf@family{}
-\providecommand*\CTEX@tt@family{}
-
-\ifCTEX@nofonts
- \renewcommand*\CTEX@rm@family{gbsn}
- \renewcommand*\CTEX@sf@family{gbsn}
- \renewcommand*\CTEX@tt@family{gbsn}
-\else
- \ifCTEX@winfonts
- \input{ctex-cjk-winfonts.def}
- \else\ifCTEX@adobefonts
- \input{ctex-cjk-adobefonts.def}
- \fi\fi
-\fi
-
-\let\CTEX@save@rmfamily\rmfamily
-\renewcommand*\rmfamily{\CTEX@save@rmfamily\CJKfamily{\CTEX@rm@family}}
-\let\CTEX@save@sffamily\sffamily
-\renewcommand*\sffamily{\CTEX@save@sffamily\CJKfamily{\CTEX@sf@family}}
-\let\CTEX@save@ttfamily\ttfamily
-\renewcommand*\ttfamily{\CTEX@save@ttfamily\CJKfamily{\CTEX@tt@family}}
-\let\CTEX@save@normalfont\normalfont
-\renewcommand*\normalfont{\CTEX@save@normalfont\CJKfamily{\CTEX@rm@family}}
-
-\endinput
diff --git a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-luatex.def b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-luatex.def
new file mode 100644
index 00000000000..c4756ab29fc
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-luatex.def
@@ -0,0 +1,1047 @@
+%%
+%% This is file `ctex-engine-luatex.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `luatex')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {LuaLaTeX adapter (CTEX)}
+\ProvidesExplFile{ctex-engine-luatex.def}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+\msg_new:nnn { ctex } { luatexja-loaded }
+ {
+ Package~`luatexja'~can~not~be~loaded~before~`ctex'.\\
+ Loading~file~`#1'~will~abort!
+ }
+\@ifpackageloaded { luatexja }
+ { \msg_critical:nnx { ctex } { luatexja-loaded } { \g_file_current_name_tl } }
+ { \tl_const:cn { ver@ltj-latex.\@pkgextension } { 9999/99/99 } }
+\RequirePackage { luatexja }
+\@ifpackagelater { luatexja-core } { 2015/02/22 } { }
+ { \msg_error:nnn { ctex } { package-too-old } { luatexja } }
+\RequirePackage { fontspec }
+\@ifpackagelater { fontspec } { 2014/05/25 } { }
+ { \msg_error:nnn { ctex } { package-too-old } { fontspec } }
+\ExplSyntaxOff
+\ltjdefcharrange{1}{"80-"36F, "1E00-"1EFF}
+\ltjdefcharrange{2}{"370-"4FF, "1F00-"1FFF}
+\ltjdefcharrange{3}{%
+ "2000-"243F, "2500-"27BF, "2900-"29FF, "2B00-"2BFF}
+\ltjdefcharrange{4}{%
+ "500-"10FF, "1200-"1DFF, "2440-"245F, "27C0-"28FF, "2A00-"2AFF,
+ "2C00-"2E7F, "4DC0-"4DFF, "A4D0-"A82F, "A840-"ABFF, "FB00-"FE0F,
+ "FE20-"FE2F, "FE70-"FEFF, "10000-"1FFFF, "E000-"F8FF} % non-Japanese
+\ltjdefcharrange{5}{"D800-"DFFF, "E0000-"E00FF, "E01F0-"10FFFF}
+\ltjdefcharrange{6}{%
+ "2460-"24FF, "2E80-"2EFF, "3000-"30FF, "3190-"319F, "31F0-"4DBF,
+ "4E00-"9FFF, "F900-"FAFF, "FE10-"FE6F, "20000-"2FFFF, "E0100-"E01EF}
+\ltjdefcharrange{7}{
+ "1100-"11FF, "2F00-"2FFF, "3100-"31EF, "A000-"A4CF, "A830-"A83F,
+ "AC00-"D7FF}
+\ltjdefcharrange{8}{"A7, "A8, "B0, "B1, "B4, "B6, "D7, "F7}
+\ltjsetparameter{jacharrange={-1, +2, +3, -4, -5, +6, +7, +8}}
+\directlua{for x=128,255 do luatexja.math.is_math_letters[x] = true end}
+\directlua{
+ local s = kpse.find_file('ltj-kinsoku.lua', 'tex')
+ luatexja.stack.charprop_stack_table[0] = s and dofile(s) or {}
+}
+\ltjsetparameter{kanjiskip=\z@ plus .4pt minus .4pt,
+ xkanjiskip=.25\zw plus 1pt minus 1pt,
+ autospacing, autoxspacing, jacharrange={-1},
+ yalbaselineshift=\z@, yjabaselineshift=\z@,
+ jcharwidowpenalty=500, differentjfm=paverage
+}
+\ExplSyntaxOn
+\RequirePackage { xunicode-addon }
+\AtBeginUTFCommand
+ {
+ \group_begin:
+ \ctex_lua_now_x:n { tex.globaldefs = 0 }
+ \ltj@allalchar
+ }
+\AtEndUTFCommand { \group_end: }
+\RequirePackage { lltjp-fontspec }
+\group_begin:
+\char_set_catcode_other:n { \c_zero }
+\cs_new_protected:Npn \__ctex_ltj_um_char:Nw #1 = #2 \q_nil
+ {
+ \group_begin:
+ \char_set_lccode:nn { \c_zero } {#2}
+ \tex_lowercase:D
+ {
+ \group_end:
+ \cs_gset_protected_nopar:Npn #1
+ {
+ \mode_if_math:TF { ^^@ }
+ { {
+ \ctex_lua_now_x:n { tex.globaldefs = 0 }
+ \ltj@allalchar ^^@
+ } }
+ }
+ }
+ \ltjsetmathletter {#2}
+ }
+\group_end:
+\ctex_at_end_package:nn { unicode-math }
+ {
+ \cs_if_free:NF \um_cs_set_eq_active_char:Nw
+ { \cs_set_eq:NN \um_cs_set_eq_active_char:Nw \__ctex_ltj_um_char:Nw }
+ }
+\ctex_at_end_package:nn { listings }
+ {
+ \use:x
+ {
+ \exp_not:N \RequirePackage { lltjp-listings }
+ \tl_set:Nn \exp_not:N \lstlistingname
+ { \exp_not:o { \lstlistingname } }
+ \tl_set:Nn \exp_not:N \lstlistlistingname
+ { \exp_not:o { \lstlistlistingname } }
+ }
+ }
+\cs_new_protected_nopar:Npn \ctex_ltj_select_font:
+ {
+ \cs_if_exist_use:cF { \l__ctex_ltj_current_font_tl }
+ { \tl_if_empty:NF \CJK@family { \__ctex_ltj_select_font_aux: } }
+ }
+\tl_new:N \CJK@family
+\tl_new:N \l__ctex_ltj_current_font_tl
+\tl_set:Nn \l__ctex_ltj_current_font_tl
+ { \CJK@encoding / \CJK@family / \f@series / \f@shape / \f@size }
+\cs_new_protected_nopar:Npn \__ctex_ltj_select_font_aux:
+ {
+ \group_begin:
+ \tl_set_eq:NN \f@encoding \CJK@encoding
+ \tl_set_eq:NN \f@family \CJK@family
+ \__ctex_ltj_push_fontname:n { \use:c { \curr@fontshape / \f@size } }
+ \ctex_ltj_pickup_font:
+ \group_end:
+ \font@name
+ \__ctex_ltj_pop_fontname:
+ \cs_if_exist:cF { \l__ctex_ltj_current_font_tl }
+ { \__ctex_ltj_select_font_aux: }
+ }
+\cs_new_protected_nopar:Npn \__ctex_ltj_push_fontname:n #1
+ {
+ \cs_gset_eq:NN \__ctex_ltj_save_fontname:w \font@name
+ \cs_gset_nopar:Npx \font@name {#1}
+ }
+\cs_new_protected_nopar:Npn \__ctex_ltj_pop_fontname:
+ { \cs_gset_eq:NN \font@name \__ctex_ltj_save_fontname:w }
+\cs_new_protected_nopar:Npn \ctex_ltj_pickup_font:
+ {
+ \exp_after:wN \cs_if_exist:NF \font@name
+ {
+ \group_begin:
+ \cs_set_eq:NN \extract@font \ctex_ltj_extract_font:
+ \cs_set_eq:NN \do@subst@correction \ctex_ltj_subst_font:
+ \define@newfont
+ \group_end:
+ }
+ }
+\cs_new_eq:NN \pickup@jfont \ctex_ltj_pickup_font:
+\cs_new_protected_nopar:Npn \ctex_ltj_extract_font:
+ {
+ \get@external@font
+ \ctex_ltj_if_alternate_shape_exist:nT { \curr@fontshape }
+ {
+ \tl_set:Nx \external@font
+ { \exp_after:wN \__ctex_ltj_patch_external_font:w \external@font }
+ }
+ \exp_after:wN \globaljfont \font@name \external@font \scan_stop:
+ \font@name
+ \ctex_lua_now_x:n { font.current(tex.attribute['ltj@curjfnt']) }
+ \use:c { \f@encoding + \f@family }
+ \use:c { \curr@fontshape }
+ }
+\cs_new_protected_nopar:Npn \ctex_ltj_subst_font:
+ {
+ \ctex_ltj_if_alternate_shape_exist:nF { \curr@fontshape }
+ {
+ \group_begin:
+ \tl_set_eq:NN \CJK@family \f@family
+ \cs_if_exist:cF { \l__ctex_ltj_current_font_tl }
+ {
+ \cs_gset_protected_nopar:Npx \subst@correction
+ {
+ \cs_new_eq:NN
+ \exp_not:c { \l__ctex_ltj_current_font_tl }
+ \font@name
+ }
+ \group_insert_after:N \group_insert_after:N
+ \group_insert_after:N \subst@correction
+ }
+ \group_end:
+ }
+ }
+\prg_new_conditional:Npnn \ctex_ltj_if_alternate_shape_exist:n #1 { T , F , TF }
+ {
+ \ctex_lua_now_x:n { luatexja.jfont.does_alt_set ('\luatexluaescapestring {#1}') }
+ \prg_return_true: \else: \prg_return_false: \fi:
+ }
+\cs_new_nopar:Npn \__ctex_ltj_patch_external_font:w #1 ~ at
+ { #1 \ctex_lua_now_x:n { luatexja.jfont.print_aftl_address() } ~ at }
+\cs_new_protected_nopar:Npn \ctex_ltj_select_alternate_font:
+ {
+ \ctex_ltj_if_alternate_shape_exist:nT { \l__ctex_ltj_current_shape_tl }
+ {
+ \ctex_lua_now_x:n
+ {
+ luatexja.jfont.output_alt_font_cmd
+ ('y', '\luatexluaescapestring { \l__ctex_ltj_current_shape_tl }')
+ }
+ \ctex_lua_now_x:n { luatexja.jfont.pickup_alt_font_a ('\f@size') }
+ }
+ }
+\tl_new:N \l__ctex_ltj_current_shape_tl
+\tl_set:Nn \l__ctex_ltj_current_shape_tl
+ { \CJK@encoding / \CJK@family / \f@series / \f@shape }
+\cs_new_protected_nopar:Npn \ltj@pickup@altfont@auxy #1
+ {
+ \cs_if_exist:cF { #1/\f@size }
+ {
+ \group_begin:
+ \use:x { \exp_not:N \split@name #1 / \f@size } \@nil
+ \__ctex_ltj_push_fontname:n { \use:c { \curr@fontshape / \f@size } }
+ \ctex_ltj_pickup_font:
+ \group_end:
+ \__ctex_ltj_pop_fontname:
+ }
+ }
+\cs_new_protected_nopar:Npn \ltj@pickup@altfont@copy #1#2
+ {
+ \ltj@@getjfontnumber #1
+ \ctex_lua_now_x:n
+ {
+ luatexja.jfont.pickup_alt_font_b
+ ( \the\ltj@tempcntc, '\luatexluaescapestring {#2}' )
+ }
+ }
+\ExplSyntaxOff
+\def\ltj@@IsFontJapanese#1{%
+ \directlua{luatexja.jfont.is_kenc(string.match(
+ '\luatexluaescapestring{#1}', '[^/]+'))}}
+{\catcode`M=12%
+\gdef\ltj@@mathJapaneseFonts#1M#2#3\relax{\ltj@@IsFontJapanese{#3}}}
+\let\ltj@@al@getanddefine@fonts=\getanddefine@fonts
+\def\ltj@@ja@getanddefine@fonts#1#2{%
+ \xdef\font@name{\csname \string#2/\tf@size\endcsname}%
+ \pickup@jfont\let\textfont@name\font@name
+ \xdef\font@name{\csname \string#2/\sf@size\endcsname}%
+ \pickup@jfont\let\scriptfont@name\font@name
+ \xdef\font@name{\csname \string#2/\ssf@size\endcsname}%
+ \pickup@jfont
+ \edef\math@fonts{\math@fonts\ltj@setpar@global%
+ \ltj@@set@stackfont#1,\textfont@name:{MJT}%
+ \ltj@@set@stackfont#1,\scriptfont@name:{MJS}%
+ \ltj@@set@stackfont#1,\font@name:{MJSS}%
+ }%
+}
+\def\getanddefine@fonts#1#2{%
+ \ltj@tempcnta=#1\ltj@@IsFontJapanese{\string#2}%
+ \ifin@\let\ltj@temp=\ltj@@ja@getanddefine@fonts%
+ \else \let\ltj@temp=\ltj@@al@getanddefine@fonts\fi
+ \ltj@temp{#1}{#2}%
+}
+\def\use@mathgroup#1#2{\relax\ifmmode
+ \math@bgroup
+ \expandafter\ifx\csname M@\f@encoding\endcsname#1\else
+ #1\fi\ltj@tempcnta=#2 \expandafter\ltj@@mathJapaneseFonts\string#1\relax%
+ \ifin@\jfam#2\relax\else\mathgroup#2\relax\fi
+ \expandafter\math@egroup\fi}%
+\let\@@italiccorr=\/
+\ExplSyntaxOn
+\cs_new_protected_nopar:Npn \ctex_mono_jfm:n #1
+ {
+ \str_if_eq:nnTF {#1} { plain }
+ { \tl_set:Nn \l__ctex_ltj_jfm_tl { mono } }
+ { \tl_set:Nn \l__ctex_ltj_jfm_tl {#1} }
+ }
+\tl_new:N \l__ctex_ltj_jfm_tl
+\cs_generate_variant:Nn \ctex_mono_jfm:n { o }
+\ctex_mono_jfm:o { \l__ctex_punct_tl }
+\tl_const:Nn \CJK@encoding { LTJY3 }
+\DeclareFontEncoding { \CJK@encoding } { } { }
+\DeclareFontSubstitution { LTJY3 } { song } { \mddefault } { \updefault }
+\ctex_lua_now_x:n { luatexja.jfont.add_kyenc_list('\CJK@encoding') }
+\cs_new_protected_nopar:Npn \__ctex_ltj_change_encoding:
+ { \tl_set_eq:NN \g_fontspec_encoding_tl \CJK@encoding }
+\DeclareFontFamily { \CJK@encoding } { song } { }
+\DeclareFontShape { \CJK@encoding } { song } { \mddefault } { \updefault }
+ { <-> psft:SimSun:cid=Adobe-GB1-5;jfm=\l__ctex_ltj_jfm_tl } { }
+\DeclareFontShape { \CJK@encoding } { song } { \bfdefault } { \updefault }
+ { <-> psft:SimHei:cid=Adobe-GB1-5;jfm=\l__ctex_ltj_jfm_tl } { }
+\tl_const:Nn \c__ctex_ltj_math_tl { CJKmath }
+\DeclareSymbolFont { \c__ctex_ltj_math_tl }
+ { \CJK@encoding } { song } { \mddefault } { \updefault }
+\SetSymbolFont { \c__ctex_ltj_math_tl } { bold }
+ { \CJK@encoding } { song } { \bfdefault } { \updefault }
+\int_const:Nn \c__ctex_ltj_math_fam_int { \use:c { sym \c__ctex_ltj_math_tl } }
+\jfam \c__ctex_ltj_math_fam_int
+\newfontfeature { CID } { cid = #1 }
+\newfontfeature { JFM } { jfm = #1 }
+\newfontfeature { JFM-var } { jfmvar = #1 }
+\keys_define:nn { fontspec-preparse-external }
+ {
+ NoEmbed .code:n =
+ { \cs_set_eq:NN \__fontspec_namewrap:n \__ctex_ltj_noembed_wrap:n }
+ }
+\cs_new:Npn \__ctex_ltj_noembed_wrap:n #1 { psft: #1 }
+\cs_new_protected:Npn \ctex_ltj_set_family:nnn #1#2#3
+ {
+ \group_begin:
+ \clist_clear:N \l__ctex_ltj_char_range_clist
+ \seq_clear:N \l__ctex_ltj_alternate_seq
+ \tl_set:Nn \l__ctex_ltj_base_CJKfamily_tl {#1}
+ \keys_set_known:nnN { ctex_ltj / fontspec } {#2} \l__ctex_ltj_tmp_tl
+ \clist_set:No \l__ctex_ltj_font_options_clist { \l__ctex_ltj_tmp_tl }
+ \ctex_ltj_set_alternate_family:nnF {#1} {#3}
+ {
+ \prop_gput:Nnn \g__ctex_ltj_family_font_name_prop {#1} {#3}
+ \prop_gput:Nno \g__ctex_ltj_family_font_options_prop
+ {#1} { \l__ctex_ltj_font_options_clist }
+ \__ctex_ltj_update_family_uid:N \l__ctex_ltj_font_options_clist
+ \__ctex_ltj_use_global_options:N \l__ctex_ltj_font_options_clist
+ \__ctex_ltj_gset_family_cs:nn {#1} {#3}
+ }
+ \group_end:
+ }
+\cs_new_protected:Npn \ctex_ltj_set_family:xxx #1#2#3
+ { \use:x { \ctex_ltj_set_family:nnn {#1} {#2} {#3} } }
+\tl_new:N \l__ctex_ltj_base_CJKfamily_tl
+\clist_new:N \l__ctex_ltj_font_options_clist
+\cs_new_protected_nopar:Npn \__ctex_ltj_use_global_options:N #1
+ {
+ \clist_concat:NNN #1 \g__ctex_ltj_default_features_clist #1
+ \clist_put_left:Nx #1 { JFM = \l__ctex_ltj_jfm_tl }
+ }
+\prop_new:N \g__ctex_ltj_family_name_prop
+\prop_new:N \g__ctex_ltj_family_font_name_prop
+\prop_new:N \g__ctex_ltj_family_font_options_prop
+\cs_new_protected_nopar:Npn \__ctex_ltj_check_family:n #1
+ {
+ \prop_gpop:NnNT \g__ctex_ltj_family_font_name_prop {#1} \l__ctex_ltj_tmp_tl
+ {
+ \cs_undefine:c { \__ctex_ltj_family_csname:n {#1} }
+ \cs_undefine:c { \__ctex_ltj_alternate_cs:n {#1} }
+ \prop_gpop:NnNT \g__ctex_ltj_family_name_prop {#1} \l__ctex_ltj_base_family_tl
+ {
+ \use:c { \__ctex_ltj_alternate_cs:n { clear / #1 } }
+ \cs_undefine:c { \__ctex_ltj_alternate_cs:n { clear / #1 } }
+ \cs_undefine:c { \__ctex_ltj_alternate_cs:n { reset / #1 } }
+ \prop_gremove:Nn \g__ctex_ltj_reset_alternate_prop {#1}
+ }
+ \msg_warning:nnxx { ctex } { redefine-family } {#1} { \l__ctex_ltj_tmp_tl }
+ }
+ }
+\tl_new:N \l__ctex_ltj_tmp_tl
+\msg_new:nnn { ctex } { redefine-family }
+ { Redefining~CJKfamily~`\__ctex_ltj_msg_family_map:n {#1}'~(#2). }
+\cs_new_protected_nopar:Npn \__ctex_ltj_gset_family_cs:nn #1#2
+ {
+ \cs_gset_protected_nopar:cpx { \__ctex_ltj_family_csname:n {#1} }
+ {
+ \group_begin:
+ \__ctex_ltj_change_encoding:
+ \exp_not:n { \cs_set_eq:NN \CJKfamily \use_none:n }
+ \exp_not:n { \fontspec_set_family:Nnn \g__ctex_ltj_fontspec_family_tl }
+ { \exp_not:o { \l__ctex_ltj_font_options_clist } } {#2}
+ \prop_gput:Nno \exp_not:N \g__ctex_ltj_family_name_prop {#1}
+ { \exp_not:N \g__ctex_ltj_fontspec_family_tl }
+ \tl_gset_eq:NN \exp_not:N \g__ctex_ltj_fontspec_family_tl
+ \exp_not:N \g__ctex_ltj_fontspec_family_tl
+ \__ctex_ltj_set_alternate_family:n {#1}
+ \group_end:
+ }
+ }
+\tl_new:N \l__ctex_ltj_base_family_tl
+\tl_new:N \g__ctex_ltj_fontspec_family_tl
+\cs_new_nopar:Npn \__ctex_ltj_family_csname:n #1 { ctex_ltj/family/#1 }
+\cs_new_protected_nopar:Npn \__ctex_ltj_set_alternate_family:n #1
+ {
+ \tl_set:Nn \l__ctex_ltj_base_CJKfamily_tl {#1}
+ \tl_set_eq:NN \l__ctex_ltj_base_family_tl \g__ctex_ltj_fontspec_family_tl
+ \cs_if_exist_use:c { \__ctex_ltj_alternate_cs:n { reset / #1 } }
+ \cs_if_exist_use:c { \__ctex_ltj_alternate_cs:n {#1} }
+ }
+\cs_new:Npn \__ctex_ltj_alternate_cs:n #1 { ctex_ltj/alternate_family/#1 }
+\NewDocumentCommand \CJKfamily { m }
+ { \ctex_ltj_switch_family:x {#1} \tex_ignorespaces:D }
+\cs_new_protected_nopar:Npn \ctex_ltj_switch_family:n #1
+ {
+ \ctex_ltj_family_if_exist:xNTF {#1} \CJK@family
+ {
+ \tl_set:Nn \l_ctex_ltj_family_tl {#1}
+ \selectfont
+ }
+ { \__ctex_ltj_family_unknown_warning:n {#1} }
+ }
+\tl_new:N \l_ctex_ltj_family_tl
+\cs_generate_variant:Nn \ctex_ltj_switch_family:n { x }
+\prg_new_protected_conditional:Npnn \ctex_ltj_family_if_exist:xN #1#2 { T , F , TF }
+ {
+ \prop_get:NxNTF \g__ctex_ltj_family_name_prop {#1} #2
+ { \prg_return_true: }
+ {
+ \cs_if_exist_use:cTF { \__ctex_ltj_family_csname:n {#1} }
+ {
+ \tl_set_eq:NN #2 \g__ctex_ltj_fontspec_family_tl
+ \prg_return_true:
+ }
+ { \prg_return_false: }
+ }
+ }
+\cs_generate_variant:Nn \prop_get:NnNTF { Nx }
+\cs_new_protected_nopar:Npn \__ctex_ltj_family_unknown_warning:n #1
+ {
+ \prop_if_empty:NF \g__ctex_ltj_family_font_name_prop
+ {
+ \seq_if_in:NnF \g__ctex_ltj_unknown_family_seq {#1}
+ {
+ \seq_gput_right:Nn \g__ctex_ltj_unknown_family_seq {#1}
+ \msg_warning:nnn { ctex } { family-unknown } {#1}
+ }
+ }
+ }
+\seq_new:N \g__ctex_ltj_unknown_family_seq
+\msg_new:nnn { ctex } { family-unknown }
+ {
+ Unknown~CJK~family~`\__ctex_ltj_msg_family_map:n {#1}'~is~being~ignored.\\
+ Try~to~use~`\__ctex_ltj_msg_def_family_map:n {#1}'~to~define~it.
+ }
+\cs_new_nopar:Npn \__ctex_ltj_msg_def_family_map:n #1
+ {
+ \str_case_x:nnF {#1}
+ {
+ \CJKrmdefault { \token_to_str:N \setCJKmainfont }
+ \CJKsfdefault { \token_to_str:N \setCJKsansfont }
+ \CJKttdefault { \token_to_str:N \setCJKmonofont }
+ }
+ { \token_to_str:N \setCJKfamilyfont \{ #1 \} }
+ [...]\{...\}
+ }
+\cs_new_nopar:Npn \__ctex_ltj_msg_family_map:n #1
+ {
+ \str_case_x:nnF {#1}
+ {
+ \CJKrmdefault { \token_to_str:N \CJKrmdefault }
+ \CJKsfdefault { \token_to_str:N \CJKsfdefault }
+ \CJKttdefault { \token_to_str:N \CJKttdefault }
+ }
+ {#1}
+ }
+\cs_new_protected_nopar:Npn \ctex_ltj_fontspec:nn #1#2
+ {
+ \prop_get:NnNTF \g__ctex_ltj_fontspec_prop
+ { CJKfontspec/#1/#2/id } \l_ctex_ltj_family_tl
+ { \ctex_ltj_switch_family:x { \l_ctex_ltj_family_tl } }
+ {
+ \int_gincr:N \g__ctex_ltj_family_int
+ \__ctex_ltj_fontspec:xnn
+ { CJKfontspec ( \int_use:N \g__ctex_ltj_family_int ) }
+ {#1} {#2}
+ }
+ }
+\cs_new_protected_nopar:Npn \ctex_ltj_fontspec:xx #1#2
+ { \use:x { \ctex_ltj_fontspec:nn {#1} {#2} } }
+\cs_new_protected_nopar:Npn \__ctex_ltj_fontspec:nnn #1#2#3
+ {
+ \bool_if:NT \l__ctex_ltj_add_alternate_bool
+ {
+ \cs_if_free:cF
+ { \__ctex_ltj_alternate_cs:n { reset / \l_ctex_ltj_family_tl } }
+ {
+ \cs_gset_eq:cc
+ { \__ctex_ltj_alternate_cs:n { reset / #1 } }
+ { \__ctex_ltj_alternate_cs:n { reset / \l_ctex_ltj_family_tl } }
+ \cs_gset_eq:cc
+ { \__ctex_ltj_alternate_cs:n { clear / #1 } }
+ { \__ctex_ltj_alternate_cs:n { clear / \l_ctex_ltj_family_tl } }
+ }
+ \bool_set_false:N \l__ctex_ltj_add_alternate_bool
+ }
+ \prop_gput:Nnn \g__ctex_ltj_fontspec_prop { CJKfontspec/#2/#3/id } {#1}
+ \ctex_ltj_set_family:nnn {#1} {#2} {#3}
+ \ctex_ltj_switch_family:n {#1}
+ }
+\cs_generate_variant:Nn \__ctex_ltj_fontspec:nnn { x }
+\prop_new:N \g__ctex_ltj_fontspec_prop
+\cs_new_protected_nopar:Npn \ctex_ltj_add_font_features:n #1
+ { \ctex_ltj_add_font_features:xn { \l_ctex_ltj_family_tl } {#1} }
+\cs_new_protected_nopar:Npn \ctex_ltj_add_font_features:nn #1#2
+ {
+ \prop_get:NnNTF \g__ctex_ltj_family_font_name_prop
+ {#1} \l__ctex_ltj_tmp_tl
+ {
+ \prop_get:NnN \g__ctex_ltj_family_font_options_prop
+ {#1} \l__ctex_ltj_font_options_clist
+ \clist_put_right:Nn \l__ctex_ltj_font_options_clist {#2}
+ \bool_set_true:N \l__ctex_ltj_add_alternate_bool
+ \ctex_ltj_fontspec:xx
+ { \exp_not:o { \l__ctex_ltj_font_options_clist } }
+ { \exp_not:o { \l__ctex_ltj_tmp_tl } }
+ }
+ { \msg_warning:nn { ctex } { addCJKfontfeature-ignored } }
+ }
+\bool_new:N \l__ctex_ltj_add_alternate_bool
+\cs_generate_variant:Nn \ctex_ltj_add_font_features:n { x }
+\cs_generate_variant:Nn \ctex_ltj_add_font_features:nn { x }
+\msg_new:nnn { ctex } { addCJKfontfeature-ignored }
+ {
+ \token_to_str:N \addCJKfontfeature (s)~ignored.\\
+ It~cannot~be~used~with~a~font~that~wasn't~selected~by~ctex.
+ }
+\NewDocumentCommand \setCJKfamilyfont { m O { } m }
+ { \ctex_ltj_set_family:xxx {#1} {#2} {#3} }
+\NewDocumentCommand \newCJKfontfamily { o m O { } m }
+ {
+ \tl_set:Nx \l__ctex_ltj_tmp_tl
+ { \IfNoValueTF {#1} { \cs_to_str:N #2 } {#1} }
+ \cs_new_protected_nopar:Npx #2
+ { \ctex_ltj_switch_family:n { \l__ctex_ltj_tmp_tl } }
+ \ctex_ltj_set_family:xxx { \l__ctex_ltj_tmp_tl } {#3} {#4}
+ }
+\NewDocumentCommand \CJKfontspec { O { } m }
+ {
+ \ctex_ltj_fontspec:xx {#1} {#2}
+ \tex_ignorespaces:D
+ }
+\NewDocumentCommand \addCJKfontfeatures { m }
+ {
+ \ctex_ltj_add_font_features:x {#1}
+ \tex_ignorespaces:D
+ }
+\cs_new_eq:NN \addCJKfontfeature \addCJKfontfeatures
+\NewDocumentCommand \setCJKmainfont { O { } m }
+ {
+ \ctex_ltj_set_family:xxx { \CJKrmdefault } {#1} {#2}
+ \normalfont
+ }
+\cs_new_eq:NN \setCJKromanfont \setCJKmainfont
+\NewDocumentCommand \setCJKsansfont { O { } m }
+ {
+ \ctex_ltj_set_family:xxx { \CJKsfdefault } {#1} {#2}
+ \normalfont
+ }
+\NewDocumentCommand \setCJKmonofont { O { } m }
+ {
+ \ctex_ltj_set_family:xxx { \CJKttdefault } {#1} {#2}
+ \normalfont
+ }
+\NewDocumentCommand \setCJKmathfont { O { } m }
+ { \ctex_ltj_set_family:xxx { \c__ctex_ltj_math_tl } {#1} {#2} }
+\NewDocumentCommand \defaultCJKfontfeatures { m }
+ { \clist_gset:Nn \g__ctex_ltj_default_features_clist {#1} }
+\clist_new:N \g__ctex_ltj_default_features_clist
+\@onlypreamble \setCJKmainfont
+\@onlypreamble \setCJKsansfont
+\@onlypreamble \setCJKmonofont
+\@onlypreamble \setCJKmathfont
+\@onlypreamble \setCJKromanfont
+\@onlypreamble \defaultCJKfontfeatures
+\tl_if_exist:NF \CJKfamilydefault
+ { \tl_const:Nn \CJKfamilydefault { \CJKrmdefault } }
+\tl_if_exist:NF \CJKrmdefault { \tl_const:Nn \CJKrmdefault { rm } }
+\tl_if_exist:NF \CJKsfdefault { \tl_const:Nn \CJKsfdefault { sf } }
+\tl_if_exist:NF \CJKttdefault { \tl_const:Nn \CJKttdefault { tt } }
+\ctex_preto_cmd:NnTF \rmfamily { \CJKfamily { \CJKrmdefault } } { }
+ { \ctex_patch_failure:N \rmfamily }
+\ctex_preto_cmd:NnTF \sffamily { \CJKfamily { \CJKsfdefault } } { }
+ { \ctex_patch_failure:N \sffamily }
+\ctex_preto_cmd:NnTF \ttfamily { \CJKfamily { \CJKttdefault } } { }
+ { \ctex_patch_failure:N \ttfamily }
+\ctex_preto_cmd:NnTF \normalfont { \CJKfamily { \CJKfamilydefault } }
+ { \cs_set_eq:NN \reset@font \normalfont }
+ { \ctex_patch_failure:N \normalfont }
+\cs_new_protected_nopar:Npn \ctex_ltj_ensure_default_family:
+ {
+ \prop_if_empty:NF \g__ctex_ltj_family_font_name_prop
+ {
+ \ctex_ltj_family_if_exist:xNF { \CJKfamilydefault } \l__ctex_ltj_tmpa_tl
+ {
+ \str_if_eq_x:nnTF { \CJKfamilydefault } { \CJKrmdefault }
+ { \use:n }
+ {
+ \ctex_ltj_family_if_exist:xNTF { \CJKrmdefault } \l__ctex_ltj_tmpa_tl
+ { \tl_gset:Nn \CJKfamilydefault { \CJKrmdefault } \use_none:n }
+ { \use:n }
+ }
+ {
+ \prop_map_inline:Nn \g__ctex_ltj_family_font_name_prop
+ {
+ \prop_map_break:n
+ { \tl_gset_rescan:Nnn \CJKfamilydefault { } { ##1 } }
+ }
+ }
+ }
+ \normalfont
+ \ctex_ltj_update_mathfont:
+ }
+ }
+\cs_new_protected_nopar:Npn \ctex_ltj_update_mathfont:
+ {
+ \ctex_ltj_family_if_exist:xNTF { \c__ctex_ltj_math_tl } \l__ctex_ltj_tmp_tl
+ { \ctex_ltj_update_mathfont:n { \l__ctex_ltj_tmp_tl } }
+ {
+ \ctex_ltj_family_if_exist:xNT { \CJKfamilydefault } \l__ctex_ltj_tmp_tl
+ { \ctex_ltj_update_mathfont:n { \l__ctex_ltj_tmp_tl } }
+ }
+ }
+\cs_new_protected_nopar:Npn \ctex_ltj_update_mathfont:n #1
+ {
+ \tl_const:Nx \c__ctex_ltj_math_family_tl {#1}
+ \DeclareSymbolFont { \c__ctex_ltj_math_tl } { \CJK@encoding }
+ { \c__ctex_ltj_math_family_tl } { \mddefault } { \updefault }
+ \cs_if_free:cTF
+ { \CJK@encoding/\c__ctex_ltj_math_family_tl/\bfdefault/\updefault }
+ {
+ \SetSymbolFont { \c__ctex_ltj_math_tl } { bold } { \CJK@encoding }
+ { \c__ctex_ltj_math_family_tl } { \mddefault } { \updefault }
+ }
+ {
+ \SetSymbolFont { \c__ctex_ltj_math_tl } { bold } { \CJK@encoding }
+ { \c__ctex_ltj_math_family_tl } { \bfdefault } { \updefault }
+ }
+ }
+\keys_define:nn { ctex_ltj / fontspec }
+ {
+ AlternateFont .code:n = \ctex_ltj_set_alternate_seq:n {#1} ,
+ AlternateFont .value_required: ,
+ CharRange .clist_set:N = \l__ctex_ltj_char_range_clist ,
+ CharRange .value_required:
+ }
+\group_begin:
+\char_set_catcode_active:N \/
+\char_set_lccode:nn { `\/ } { `\| }
+\tex_lowercase:D
+ {
+ \group_end:
+ \cs_new_protected:Npn \ctex_ltj_set_alternate_seq:n #1
+ {
+ \clist_if_empty:NT \l__ctex_ltj_char_range_clist
+ {
+ \tl_set:Nn \l__ctex_ltj_tmp_tl {#1}
+ \tl_replace_all:Nnn \l__ctex_ltj_tmp_tl { // } { || }
+ \seq_set_split:NnV \l__ctex_ltj_tmp_seq { || } \l__ctex_ltj_tmp_tl
+ \seq_set_filter:NNn \l__ctex_ltj_tmp_seq \l__ctex_ltj_tmp_seq
+ { ! \tl_if_blank_p:n { ##1 } }
+ \seq_concat:NNN \l__ctex_ltj_alternate_seq
+ \l__ctex_ltj_alternate_seq \l__ctex_ltj_tmp_seq
+ }
+ }
+ }
+\seq_new:N \l__ctex_ltj_tmp_seq
+\seq_new:N \l__ctex_ltj_alternate_seq
+\cs_new_protected_nopar:Npn \ctex_ltj_set_alternate_family:nnF #1#2#3
+ {
+ \clist_if_empty:NTF \l__ctex_ltj_char_range_clist
+ {
+ \__ctex_ltj_check_family:n {#1}
+ \seq_if_empty:NF \l__ctex_ltj_alternate_seq
+ { \ctex_ltj_save_alternate_seq:cn { \__ctex_ltj_alternate_cs:n {#1} } {#2} }
+ #3
+ }
+ { \ctex_ltj_set_alternate_family:nn {#1} {#2} }
+ }
+\cs_new_protected_nopar:Npn \ctex_ltj_save_alternate_seq:Nn #1#2
+ {
+ \seq_map_inline:Nn \l__ctex_ltj_alternate_seq
+ { \ctex_ltj_save_alternate_seq:Nnnwnw #1 {#2} ##1 { } \q_stop }
+ }
+\cs_generate_variant:Nn \ctex_ltj_save_alternate_seq:Nn { c }
+\NewDocumentCommand \ctex_ltj_save_alternate_seq:Nnnwnw
+ { m m m +O{ } m u{ \q_stop } }
+ {
+ \clist_set:Nn \l__ctex_ltj_char_range_clist {#3}
+ \clist_set:Nn \l__ctex_ltj_alternate_options_clist {#4}
+ \__ctex_ltj_use_global_options:N \l__ctex_ltj_alternate_options_clist
+ \tl_if_blank:nTF {#5}
+ { \tl_set:Nn \l__ctex_ltj_tmp_tl {#2} }
+ {
+ \tl_set:Nn \l__ctex_ltj_tmp_tl {#5}
+ \tl_replace_all:Nnn \l__ctex_ltj_tmp_tl { * } {#2}
+ }
+ \use:x
+ {
+ \ctex_ltj_save_alternate_family:Nnnn \exp_not:N #1
+ { \exp_not:o { \l__ctex_ltj_char_range_clist } }
+ { \exp_not:o { \l__ctex_ltj_alternate_options_clist } }
+ { \exp_not:o { \l__ctex_ltj_tmp_tl } }
+ }
+ }
+\clist_new:N \l__ctex_ltj_alternate_options_clist
+\cs_new_protected_nopar:Npn \ctex_ltj_set_alternate_family:nn #1#2
+ {
+ \__ctex_ltj_update_family_uid:N \l__ctex_ltj_font_options_clist
+ \__ctex_ltj_use_global_options:N \l__ctex_ltj_font_options_clist
+ \ctex_ltj_set_alternate_family:coonn
+ { \__ctex_ltj_alternate_cs:n {#1} }
+ { \l__ctex_ltj_char_range_clist }
+ { \l__ctex_ltj_font_options_clist } {#2} {#1}
+ }
+\cs_new_protected_nopar:Npn \ctex_ltj_set_alternate_family:Nnnnn #1#2#3#4#5
+ {
+ \prop_get:NnNT \g__ctex_ltj_family_name_prop {#5} \l__ctex_ltj_base_family_tl
+ { \ctex_ltj_set_alternate_family:nnn {#2} {#3} {#4} }
+ \ctex_ltj_save_alternate_family:Nnnn #1 {#2} {#3} {#4}
+ }
+\cs_generate_variant:Nn \ctex_ltj_set_alternate_family:Nnnnn { coo }
+\cs_new_protected_nopar:Npn \ctex_ltj_save_alternate_family:Nnnn #1#2#3#4
+ {
+ \cs_if_exist:NF #1 { \cs_set_eq:NN #1 \prg_do_nothing: }
+ \cs_gset_protected_nopar:Npx #1
+ { \exp_not:o { #1 \ctex_ltj_set_alternate_family:nnn {#2} {#3} {#4} } }
+ }
+\cs_new_protected_nopar:Npn \ctex_ltj_set_alternate_family:nnn #1#2#3
+ {
+ \group_begin:
+ \__ctex_ltj_change_encoding:
+ \cs_set_eq:NN \CJKfamily \use_none:n
+ \ctex_ltj_swap_cs:NN
+ \DeclareFontShape@ \ctex_ltj_declare_alternate_shape:nnnnnn
+ \tl_set:Nn \l__ctex_ltj_char_range_clist {#1}
+ \fontspec_set_family:Nnn \l__ctex_ltj_alternate_family_tl {#2} {#3}
+ \group_end:
+ }
+\tl_new:N \l__ctex_ltj_alternate_family_tl
+\cs_new_protected:Npn \ctex_ltj_swap_cs:NN #1#2
+ {
+ \cs_set_eq:NN \__ctex_ltj_tmp:w #1
+ \cs_set_eq:NN #1 #2
+ \cs_set_eq:NN #2 \__ctex_ltj_tmp:w
+ \cs_undefine:N \__ctex_ltj_tmp:w
+ }
+\keys_define:nn { fontspec } { LTJFONTUID .code:n = }
+\cs_new_protected_nopar:Npn \__ctex_ltj_update_family_uid:N #1
+ {
+ \int_gincr:N \g__ctex_ltj_family_int
+ \clist_put_right:Nx #1 { LTJFONTUID = \int_use:N \g__ctex_ltj_family_int }
+ }
+\int_new:N \g__ctex_ltj_family_int
+\cs_new_protected:Npn \ctex_ltj_declare_alternate_shape:nnnnnn #1#2#3#4#5#6
+ {
+ \ctex_ltj_declare_alternate_shape:nnnnnn {#1} {#2} {#3} {#4} {#5} {#6}
+ \ctex_ltj_set_alternate_shape:Nnnnnnn \l__ctex_ltj_char_range_clist
+ { \l__ctex_ltj_base_family_tl } {#3} {#4}
+ { \l_fontspec_family_tl } {#3} {#4}
+ }
+\cs_new_protected_nopar:Npn \ctex_ltj_set_alternate_shape:Nnnnnnn #1#2#3#4#5#6#7
+ {
+ \clist_map_inline:Nn #1
+ {
+ \prop_get:NnNTF \g__ctex_ltj_char_range_prop { ##1 } \l__ctex_ltj_char_range_tl
+ {
+ \ctex_ltj_set_alternate_shape:nnN { #2/#3/#4 } { #5/#6/#7 }
+ \l__ctex_ltj_char_range_tl
+ }
+ { \ctex_ltj_set_alternate_shape:nnn { #2/#3/#4 } { #5/#6/#7 } { ##1 } }
+ }
+ \__ctex_ltj_save_alternate_shape:cnn
+ { \__ctex_ltj_alternate_cs:n { clear / \l__ctex_ltj_base_CJKfamily_tl } }
+ { luatexja.jfont.clear_alt_font_latex }
+ { '\luatexluaescapestring { \CJK@encoding/#2/#3/#4 }' }
+ }
+\NewDocumentCommand \ctex_ltj_set_alternate_shape:nnn
+ { m m > { \SplitArgument { \c_one } { -> } } m }
+ { \ctex_ltj_set_alternate_shape:nnnn {#1} {#2} #3 }
+\cs_new_protected_nopar:Npn \ctex_ltj_set_alternate_shape:nnnn #1#2#3#4
+ {
+ \ctex_ltj_set_alternate_shape:n
+ {
+ \IfNoValueTF {#4}
+ { \int_eval:n {#3} , \int_eval:n {#3} , }
+ {
+ \int_eval:n { \tl_if_blank:nTF {#3} { "80 } {#3} } ,
+ \int_eval:n { \tl_if_blank:nTF {#4} { "10FFFF } {#4} } ,
+ }
+ '\luatexluaescapestring { \CJK@encoding/#2 }' ,
+ '\luatexluaescapestring { \CJK@encoding/#1 }'
+ }
+ }
+\cs_new_protected_nopar:Npn \ctex_ltj_set_alternate_shape:n #1
+ {
+ \ctex_lua_now_x:n { luatexja.jfont.set_alt_font_latex ( #1 ) }
+ \__ctex_ltj_save_alternate_shape:cnn
+ { \__ctex_ltj_alternate_cs:n { reset / \l__ctex_ltj_base_CJKfamily_tl } }
+ { luatexja.jfont.set_alt_font_latex } {#1}
+ }
+\cs_new_protected_nopar:Npn \ctex_ltj_set_alternate_shape:nnN #1#2#3
+ {
+ \tl_map_inline:Nn #3
+ {
+ \ctex_ltj_set_alternate_shape:n
+ {
+ ##1 ,
+ '\luatexluaescapestring { \CJK@encoding/#2 }' ,
+ '\luatexluaescapestring { \CJK@encoding/#1 }'
+ }
+ }
+ }
+\cs_new_protected_nopar:Npn \__ctex_ltj_save_alternate_shape:Nnn #1#2#3
+ {
+ \group_begin:
+ \cs_if_exist:NF #1 { \cs_set_eq:NN #1 \prg_do_nothing: }
+ \cs_set_eq:NN \l__ctex_ltj_base_family_tl \scan_stop:
+ \cs_set_eq:NN \luatexluaescapestring \scan_stop:
+ \cs_gset_protected_nopar:Npx #1
+ { \exp_not:o {#1} \exp_not:N \ctex_lua_now_x:n { #2 ( #3 ) } }
+ \group_end:
+ }
+\cs_generate_variant:Nn \__ctex_ltj_save_alternate_shape:Nnn { c }
+\keys_define:nn { ctex }
+ {
+ clearalternatefont .code:n =
+ { \clist_map_function:xN {#1} \ctex_ltj_clear_alternate_font:n } ,
+ resetalternatefont .code:n =
+ { \clist_map_function:xN {#1} \ctex_ltj_reset_alternate_font:n } ,
+ clearalternatefont .default:n = \l_ctex_ltj_family_tl ,
+ resetalternatefont .default:n = \l_ctex_ltj_family_tl
+ }
+\cs_new_protected_nopar:Npn \ctex_ltj_clear_alternate_font:n #1
+ {
+ \group_begin:
+ \ctex_ltj_family_if_exist:xNTF {#1} \l__ctex_ltj_base_family_tl
+ {
+ \cs_if_exist_use:cT { \__ctex_ltj_alternate_cs:n { clear / #1 } }
+ {
+ \prop_gput:Nno \g__ctex_ltj_reset_alternate_prop
+ {#1} { \l__ctex_ltj_base_family_tl }
+ \tl_set_eq:NN \CJK@family \l__ctex_ltj_base_family_tl
+ \selectfont
+ }
+ }
+ { \__ctex_ltj_family_unknown_warning:n {#1} }
+ \group_end:
+ }
+\cs_new_protected_nopar:Npn \ctex_ltj_reset_alternate_font:n #1
+ {
+ \group_begin:
+ \prop_gpop:NnNT \g__ctex_ltj_reset_alternate_prop {#1} \CJK@family
+ {
+ \tl_set_eq:NN \l__ctex_ltj_base_family_tl \CJK@family
+ \use:c { \__ctex_ltj_alternate_cs:n { reset / #1 } }
+ \selectfont
+ }
+ \group_end:
+ }
+\prop_new:N \g__ctex_ltj_reset_alternate_prop
+\cs_generate_variant:Nn \clist_map_function:nN { x }
+\keys_define:nn { ctex }
+ {
+ declarecharrange .code:n = \ctex_ltj_declare_char_range:x {#1} ,
+ declarecharrange .value_required:
+ }
+\cs_new_protected_nopar:Npn \ctex_ltj_declare_char_range:n #1
+ { \clist_map_inline:nn {#1} { \__ctex_ltj_declare_char_range:nn ##1 } }
+\cs_generate_variant:Nn \ctex_ltj_declare_char_range:n { x }
+\cs_new_protected_nopar:Npn \__ctex_ltj_declare_char_range:nn #1#2
+ { \use:x { \ctex_ltj_declare_char_range:nn { \tl_trim_spaces:n {#1} } } {#2} }
+\cs_new_protected_nopar:Npn \ctex_ltj_declare_char_range:nn #1#2
+ {
+ \tl_clear:N \l__ctex_ltj_char_range_tl
+ \clist_map_function:nN {#2} \ctex_ltj_save_char_range:n
+ \prop_gput:Nno \g__ctex_ltj_char_range_prop {#1} { \l__ctex_ltj_char_range_tl }
+ \ctex_ltj_def_char_range_key:n {#1}
+ \tl_clear:N \l__ctex_ltj_char_range_tl
+ }
+\tl_new:N \l__ctex_ltj_char_range_tl
+\prop_new:N \g__ctex_ltj_char_range_prop
+\NewDocumentCommand \ctex_ltj_save_char_range:n
+ { > { \SplitArgument { \c_one } { -> } } m }
+ { \ctex_ltj_save_char_range:nn #1 }
+\cs_new_protected_nopar:Npn \ctex_ltj_save_char_range:nn #1#2
+ {
+ \tl_put_right:Nx \l__ctex_ltj_char_range_tl
+ { {
+ \IfNoValueTF {#2}
+ { \int_eval:n {#1} , \int_eval:n {#1} }
+ {
+ \int_eval:n { \tl_if_blank:nTF {#1} { "80 } {#1} } ,
+ \int_eval:n { \tl_if_blank:nTF {#2} { "10FFFF } {#2} }
+ }
+ } }
+ }
+\cs_new_protected_nopar:Npn \ctex_ltj_def_char_range_key:n #1
+ {
+ \keys_if_exist:nnF { ctex_ltj / fontspec } {#1}
+ {
+ \keys_define:nn { ctex_ltj / fontspec }
+ { #1 .code:n = \ctex_ltj_char_range_key:nn {#1} { ##1 } }
+ }
+ }
+\cs_new_protected:Npn \ctex_ltj_char_range_key:nn #1#2
+ {
+ \tl_if_blank:nTF {#2}
+ { \tl_set:Nn \l__ctex_ltj_char_range_clist {#1} }
+ {
+ \clist_if_empty:NT \l__ctex_ltj_char_range_clist
+ {
+ \tl_set:Nn \l__ctex_ltj_tmp_tl { {#1} }
+ \__ctex_ltj_char_range_parse_feature:w #2 \q_stop
+ }
+ }
+ }
+\NewDocumentCommand \__ctex_ltj_char_range_parse_feature:w
+ { +o o u { \q_stop } }
+ {
+ \exp_args:NNf \tl_put_right:Nn \l__ctex_ltj_tmp_tl
+ {
+ \IfNoValueTF {#1} { {#3} }
+ {
+ \IfNoValueTF {#2}
+ { \tl_if_blank:nTF {#3} { { [#1] } } { [ {#1} ] {#3} } }
+ { [ {#1} ] { [#2] } }
+ }
+ }
+ \seq_put_right:No \l__ctex_ltj_alternate_seq { \l__ctex_ltj_tmp_tl }
+ }
+\cs_new_protected_nopar:Npn \ctex_ltj_update_xkanjiskip:
+ {
+ \skip_if_eq:nnT
+ { \ltjgetparameter { xkanjiskip } } { \l__ctex_ltj_xkanjiskip_skip }
+ {
+ \skip_set:Nn \l__ctex_ltj_xkanjiskip_skip { .25 \zw plus 1pt minus 1pt }
+ \ltjsetxkanjiskip \l__ctex_ltj_xkanjiskip_skip
+ }
+ }
+\skip_new:N \l__ctex_ltj_xkanjiskip_skip
+\skip_set:Nn \l__ctex_ltj_xkanjiskip_skip { .25 \zw plus 1pt minus 1pt }
+\AtBeginDocument
+ {
+ \ctex_appto_cmd:NnTF \verbatim@font { \CTEX@verbatim@font@hook }
+ { } { \ctex_patch_failure:N \verbatim@font }
+ }
+\cs_new_protected_nopar:Npn \CTEX@verbatim@font@hook
+ { \ltjsetparameter { autospacing = false , autoxspacing = false } }
+\cs_new_protected_nopar:Npn \ctex_update_default_family:
+ {
+ \tl_if_eq:NNT \CJKfamilydefault \l__ctex_family_default_init_tl
+ {
+ \group_begin:
+ \cs_set_eq:NN \__ctex_family_default_wrap:n \exp_not:n
+ \tl_gset:Nx \CJKfamilydefault
+ {
+ \str_case:onF { \familydefault }
+ {
+ { \rmdefault } { \exp_not:N \CJKrmdefault }
+ { \sfdefault } { \exp_not:N \CJKsfdefault }
+ { \ttdefault } { \exp_not:N \CJKttdefault }
+ }
+ { \CJKfamilydefault }
+ }
+ \group_end:
+ }
+ \ctex_ltj_ensure_default_family:
+ }
+\AtEndPreamble { \ctex_update_default_family: }
+\tl_new:N \l__ctex_family_default_init_tl
+\cs_new_eq:NN \__ctex_family_default_wrap:n \use:n
+\tl_set:Nx \l__ctex_family_default_init_tl
+ {
+ \exp_not:N \__ctex_family_default_wrap:n
+ { \exp_not:o { \CJKfamilydefault } }
+ }
+\tl_gset_eq:NN \CJKfamilydefault \l__ctex_family_default_init_tl
+\cs_new_protected_nopar:Npn \ctex_detected_platform:
+ {
+ \tl_gset:Nx \g__ctex_fontset_tl
+ {
+ \ctex_lua_now_x:n
+ {
+ if ~ os.name == 'windows' then ~
+ tex.sprint ( 'windows' )
+ elseif ~ os.name == 'macosx' then ~
+ tex.sprint ( 'mac' )
+ else ~
+ tex.sprint ( 'fandol' )
+ end
+ }
+ }
+ }
+\ctex_hypersetup:n { pdfencoding = unicode }
+\msg_new:nnn { ctex } { fntef-not-available }
+ { Functions~ of~ `CJKfntef'~ is~ not~ available~ in~ LuaLaTeX. }
+\msg_warning:nn { ctex } { fntef-not-available }
+\clist_map_inline:nn
+ { underdot , underline , underdblline , underwave , sout , xout }
+ { \cs_new_eq:cN { CTEX#1 } \use:n }
+\cs_new_eq:NN \CTEXfilltwosides \use_none:n
+\cs_new_eq:NN \endCTEXfilltwosides \prg_do_nothing:
+\cs_new_protected_nopar:Npn \ctex_update_ccwd:
+ { \skip_set:Nn \ccwd { \ltjgetparameter { kanjiskip } + \zw } }
+\dim_new:N \ccwd
+\cs_new_protected_nopar:Npn \ctex_update_ccglue:
+ { \ltjsetkanjiskip \l__ctex_ccglue_skip }
+\skip_new:N \l__ctex_ccglue_skip
+\prg_new_conditional:Npnn \ctex_if_ccglue_touched: { TF }
+ {
+ \skip_if_eq:nnTF { \l__ctex_ccglue_skip } { \ltjgetparameter { kanjiskip } }
+ { \prg_return_false: } { \prg_return_true: }
+ }
+\cs_new_protected_nopar:Npn \ctex_update_em_unit:
+ { \dim_set:Nn \ccwd { \zw } }
+\cs_new_protected:Npn \ctex_add_to_selectfont:n #1
+ {
+ \cs_set_protected_nopar:Npx \CTEX@selectfont@hook
+ { \exp_not:o { \CTEX@selectfont@hook #1 } }
+ }
+\cs_new_eq:NN \CTEX@selectfont@hook \prg_do_nothing:
+\cs_new_eq:Nc \__ctex_save_selectfont: { selectfont ~ }
+\use:n
+ {
+ \ExplSyntaxOff
+ \ctex_preto_cmd:NnTF \selectfont { \CTEX@selectfont@hook }
+ {
+ \tl_put_left:Nn \@EverySelectfont@Init
+ { \cs_set_eq:cN { selectfont ~ } \__ctex_save_selectfont: }
+ }
+ { \ctex_patch_failure:N \selectfont }
+ }
+\ExplSyntaxOn
+\EverySelectfont { \CTEX@selectfont@hook }
+\ctex_add_to_selectfont:n
+ {
+ \ctex_ltj_select_font:
+ \ctex_ltj_select_alternate_font:
+ \ctex_ltj_update_xkanjiskip:
+ }
+\tl_set:Nn \CJK@family { song } \selectfont
+\tl_clear:N \CJK@family
+\keys_define:nn { ctex }
+ {
+ space .code:n =
+ { \msg_warning:nn { ctex } { invalid-option } }
+ }
+\keys_define:nn { ctex }
+ {
+ punct .code:n =
+ {
+ \tl_set:Nx \l__ctex_punct_tl { #1 }
+ \ctex_mono_jfm:o { \l__ctex_punct_tl }
+ } ,
+ punct .default:n = { quanjiao } ,
+ }
+%%
+%%
+%% End of file `ctex-engine-luatex.def'.
diff --git a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-pdftex.def b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-pdftex.def
new file mode 100644
index 00000000000..6371b8a0049
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-pdftex.def
@@ -0,0 +1,349 @@
+%%
+%% This is file `ctex-engine-pdftex.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `pdftex')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {(pdf)LaTeX adapter (CTEX)}
+\ProvidesExplFile{ctex-engine-pdftex.def}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+\if_bool:N \g__ctex_zhmCJK_bool
+ \PassOptionsToPackage { encoding = \l__ctex_encoding_tl } { zhmCJK }
+ \RequirePackage { zhmCJK }
+\else:
+ \str_if_eq:onTF { \l__ctex_encoding_tl } { GBK }
+ { \RequirePackage { CJK } }
+ { \RequirePackage { CJKutf8 } }
+ \RequirePackage { CJKpunct , CJKspace }
+ \cs_new_protected_nopar:Npn \ctex_load_zhmap:nnnn #1#2#3#4
+ {
+ \tl_set:Nn \CJKrmdefault {#1}
+ \tl_set:Nn \CJKsfdefault {#2}
+ \tl_set:Nn \CJKttdefault {#3}
+ \AtBeginDvi { \file_input:n {#4} }
+ \ctex_at_end_package:nn { atbegshi }
+ { \AtBeginShipoutFirst { \file_input:n {#4} } }
+ }
+ \@onlypreamble \ctex_load_zhmap:n
+ \tl_if_exist:NF \CJKfamilydefault
+ { \tl_const:Nn \CJKfamilydefault { \CJKrmdefault } }
+ \tl_if_exist:NF \CJKrmdefault { \tl_new:N \CJKrmdefault }
+ \tl_if_exist:NF \CJKsfdefault { \tl_new:N \CJKsfdefault }
+ \tl_if_exist:NF \CJKttdefault { \tl_new:N \CJKttdefault }
+ \ctex_preto_cmd:NnTF \rmfamily { \CJKfamily { \CJKrmdefault } } { }
+ { \ctex_patch_failure:N \rmfamily }
+ \ctex_preto_cmd:NnTF \sffamily { \CJKfamily { \CJKsfdefault } } { }
+ { \ctex_patch_failure:N \sffamily }
+ \ctex_preto_cmd:NnTF \ttfamily { \CJKfamily { \CJKttdefault } } { }
+ { \ctex_patch_failure:N \ttfamily }
+ \ctex_preto_cmd:NnTF \normalfont { \CJKfamily { \CJKfamilydefault } }
+ { \cs_set_eq:NN \reset@font \normalfont }
+ { \ctex_patch_failure:N \normalfont }
+\fi:
+\cs_new_protected_nopar:Npn \ctex_CJK_input:n #1
+ {
+ \ctex_file_wrapper:nnn
+ {
+ \char_set_catcode_other:n { 60 } % <
+ \char_set_catcode_math_superscript:n { 94 } % ^
+ \int_set_eq:NN \tex_endlinechar:D \c_minus_one
+ }
+ { \file_input:n {#1} }
+ {
+ \char_set_catcode:nn { 60 } { \char_value_catcode:n { 60 } }
+ \char_set_catcode:nn { 94 } { \char_value_catcode:n { 94 } }
+ \int_set:Nn \tex_endlinechar:D { \int_use:N \tex_endlinechar:D }
+ }
+ }
+\cs_set_eq:NN \CJK@input \ctex_CJK_input:n
+\if_cs_exist:N \CJK@surr
+ \cs_new_protected_nopar:Npn \ctex_plane_to_utfxvibe:Nn #1#2
+ {
+ \tl_set:Nx \l__ctex_tmp_tl {#2}
+ \int_set:Nn \l__ctex_tmp_int
+ { \exp_args:No \int_from_hex:n { \l__ctex_tmp_tl } }
+ \int_compare:nNnTF \l__ctex_tmp_int < \c_two_hundred_fifty_six
+ { \tl_gset:Nx #1 { \int_to_Hex:n { \l__ctex_tmp_int } } }
+ {
+ \int_sub:Nn \l__ctex_tmp_int { \c_two_hundred_fifty_six }
+ \tl_gset:Nx #1
+ {
+ \int_to_Hex:n
+ { \int_div_truncate:nn { \l__ctex_tmp_int } { \c_four } + "D800 }
+ \int_to_Hex:n
+ { \int_mod:nn { \l__ctex_tmp_int } { \c_four } + "DC }
+ }
+ }
+ }
+ \cs_set_eq:NN \CJK@surr \ctex_plane_to_utfxvibe:Nn
+\fi:
+\AtBeginDocument
+ {
+ \str_if_eq_x:nnF { \l__ctex_punct_tl } { quanjiao }
+ { \punctstyle { \l__ctex_punct_tl } }
+ }
+\reverse_if:N \if_bool:N \g__ctex_zhmCJK_bool
+ \str_if_eq:onF { \l__ctex_encoding_tl } { UTF8 }
+ {
+ \CJK@makeActive
+ \CJK@loadBinding { standard }
+ }
+ \exp_args:Nx \AtEndPreamble
+ {
+ \exp_not:N \CJK@envStart
+ { } { \l__ctex_encoding_tl } { \exp_not:N \CJKfamilydefault }
+ \exp_not:N \CJKtilde
+ }
+\fi:
+\cs_new_eq:NN \ctex_auto_ignorespaces: \CJK@@ignorespaces
+\cs_new_protected_nopar:Npn \ctex_ignorespaces_case:N #1
+ {
+ \cs_set_protected_nopar:Npn \ctex_set_ignorespaces:
+ { \cs_set_eq:NN \CJK@ignorespaces #1 }
+ \ctex_set_ignorespaces:
+ }
+\cs_new_protected_nopar:Npn \ctex_set_ignorespaces:
+ { \cs_set_eq:NN \CJK@ignorespaces \ctex_auto_ignorespaces: }
+\ctex_add_hook:Nn \CJKhook { \ctex_set_ignorespaces: }
+\cs_new_protected_nopar:Npn \ctex_punct_set:n #1
+ {
+ \clist_map_inline:Nn \c__ctex_punct_family_clist
+ {
+ \cs_if_free:cF { c__ctex_ #1 ##1 _punct_spaces_tl }
+ {
+ \cs_set_eq:cc
+ { CJKpunct@ ##1 @spaces }
+ { c__ctex_ #1 ##1 _punct_spaces_tl }
+ }
+ }
+ }
+\clist_const:Nn \c__ctex_punct_family_clist
+ {
+ zhsong , zhhei , zhfs , zhkai , zhli , zhyou ,
+ zhsongb , zhheil , zhheib , zhyoub , zhyahei , zhyaheib
+ }
+\cs_new_protected_nopar:Npn \ctex_punct_map_family:nn #1#2
+ {
+ \cs_if_free:cF { CJKpunct@ #2 @spaces }
+ { \cs_set_eq:cc { CJKpunct@ #1 @spaces } { CJKpunct@ #2 @spaces } }
+ }
+\cs_new_protected_nopar:Npn \ctex_punct_map_bfseries:nn #1#2
+ {
+ \clist_map_inline:nn {#1}
+ {
+ \ctex_punct_map_series:nnn { ##1 } { b } {#2}
+ \ctex_punct_map_series:nnn { ##1 } { bx } {#2}
+ }
+ }
+\cs_new_protected_nopar:Npn \ctex_punct_map_series:nnn #1#2#3
+ {
+ \CJKpunctmapfamily { C19 } {#1} {#2} { m } {#3}
+ \CJKpunctmapfamily { C19 } {#1} {#2} { it } {#3}
+ \CJKpunctmapfamily { C19 } {#1} {#2} { sl } {#3}
+ \CJKpunctmapfamily { C70 } {#1} {#2} { m } {#3}
+ \CJKpunctmapfamily { C70 } {#1} {#2} { it } {#3}
+ \CJKpunctmapfamily { C70 } {#1} {#2} { sl } {#3}
+ }
+\cs_new_protected_nopar:Npn \ctex_punct_map_itshape:nn #1#2
+ {
+ \CJKpunctmapfamily { C19 } {#1} { m } { it } {#2}
+ \CJKpunctmapfamily { C19 } {#1} { b } { it } {#2}
+ \CJKpunctmapfamily { C19 } {#1} { bx } { it } {#2}
+ \CJKpunctmapfamily { C70 } {#1} { m } { it } {#2}
+ \CJKpunctmapfamily { C70 } {#1} { b } { it } {#2}
+ \CJKpunctmapfamily { C70 } {#1} { bx } { it } {#2}
+ }
+\cs_new_protected_nopar:Npn \ctex_punct_space:nn #1#2
+ { \tl_const:cn { c__ctex_ #1 _punct_spaces_tl } {#2} }
+\cs_new_eq:NN \ctexspadef \ctex_punct_space:nn
+\ctex_file_input:n { ctexspa.def }
+\cs_new_protected_nopar:Npn \ctex_update_default_family:
+ {
+ \tl_if_eq:NNT \CJKfamilydefault \l__ctex_family_default_init_tl
+ {
+ \group_begin:
+ \cs_set_eq:NN \__ctex_family_default_wrap:n \exp_not:n
+ \tl_gset:Nx \CJKfamilydefault
+ {
+ \str_case:onF { \familydefault }
+ {
+ { \rmdefault } { \exp_not:N \CJKrmdefault }
+ { \sfdefault } { \exp_not:N \CJKsfdefault }
+ { \ttdefault } { \exp_not:N \CJKttdefault }
+ }
+ { \CJKfamilydefault }
+ }
+ \group_end:
+ }
+ }
+\AtEndPreamble { \ctex_update_default_family: }
+\tl_new:N \l__ctex_family_default_init_tl
+\cs_new_eq:NN \__ctex_family_default_wrap:n \use:n
+\tl_set:Nx \l__ctex_family_default_init_tl
+ {
+ \exp_not:N \__ctex_family_default_wrap:n
+ { \exp_not:o { \CJKfamilydefault } }
+ }
+\tl_gset_eq:NN \CJKfamilydefault \l__ctex_family_default_init_tl
+\cs_new_protected_nopar:Npn \ctex_detected_platform:
+ {
+ \file_if_exist:nTF { /dev/null }
+ {
+ \file_if_exist:nTF { nul: }
+ {
+ \file_if_exist:nTF { \c__ctex_engine_file_tl }
+ { \ctex_if_macosx:TF { mac } { windows } }
+ { \ctex_if_macosx:TF { mac } { fandol } }
+ }
+ { \ctex_if_macosx:TF { mac } { fandol } }
+ }
+ { \tl_gset:Nn \g__ctex_fontset_tl { windows } }
+ }
+\tex_uppercase:D \exp_after:wN
+ {
+ \exp_after:wN \tl_const:Nn \exp_after:wN \c__ctex_engine_file_tl
+ \exp_after:wN { \g_file_current_name_tl }
+ }
+\cs_new_protected_nopar:Npn \ctex_if_macosx:TF #1#2
+ {
+ \file_if_exist:nTF { \c__ctex_macosx_file_tl }
+ { \tl_gset:Nn \g__ctex_fontset_tl {#1} }
+ { \tl_gset:Nn \g__ctex_fontset_tl {#2} }
+ }
+\tl_const:Nn \c__ctex_macosx_file_tl { /mach_kernel }
+\ctex_hypersetup:n { driverfallback = dvipdfmx }
+\str_if_eq:onTF { \l__ctex_encoding_tl } { GBK }
+ {
+ \ctex_hypersetup:n { CJKbookmarks = true }
+ \ctex_if_pdfmode:TF
+ { \ctex_at_end_package:nn { hyperref } { \RequirePackage { xCJK2uni } } }
+ {
+ \ctex_at_end_package:nn { hyperref }
+ {
+ \str_if_eq:onTF { \Hy@driver } { hdvipdfm }
+ {
+ \AtBeginShipoutFirst
+ { \special { pdf:tounicode~GBK-EUC-UCS2 } }
+ }
+ { \RequirePackage { xCJK2uni } }
+ }
+ }
+ }
+ { \ctex_hypersetup:n { pdfencoding = unicode } }
+\RequirePackage { CJKfntef } \normalem
+\clist_map_inline:nn
+ { underdot , underline , underdblline , underwave , sout , xout }
+ {
+ \tl_clear:c { CJK#1color }
+ \cs_new_protected_nopar:cpx { CTEX#1 }
+ {
+ \msg_warning:nnnn { ctex } { deprecated-command } { \exp_not:c { CTEX#1 } }
+ { You~ can~ use~ the~ command~ with~ prefix~ \exp_not:N \CJK~ instead. }
+ \exp_not:c { CJK#1 }
+ }
+ }
+\cs_new_protected_nopar:Npn { \CTEXfilltwosides }
+ {
+ \msg_warning:nnnn { ctex } { deprecated-environment } { CTEXfilltwosides }
+ { You~ can~ use~ `CJKfilltwosides'~ environment~ instead. }
+ \CJKfilltwosides
+ }
+\cs_new_protected_nopar:Npn { \endCTEXfilltwosides } { \endCJKfilltwosides }
+\clist_map_inline:nn
+ {
+ underdotbasesep , underdotsep , underlinebasesep ,
+ underlinesep , underdbllinesep , underdbllinebasesep ,
+ underwavebasesep , underwavesep , southeight ,
+ underdotcolor , underwavecolor , underlinecolor ,
+ underdbllinecolor , soutcolor , xoutcolor
+ }
+ {
+ \cs_new_eq:cc { CTEX#1 } { CJK#1 }
+ \cs_set_nopar:cpx { CJK#1 } { \exp_not:c { CTEX#1 } }
+ }
+\cs_new_protected_nopar:Npn \ctex_update_ccwd:
+ {
+ \hbox_set:Nn \l__ctex_tmp_box { \CJKglue }
+ \dim_set:Nn \ccwd { \box_wd:N \l__ctex_tmp_box + \f@size \p@ }
+ }
+\dim_new:N \ccwd
+\cs_new_protected_nopar:Npn \ctex_update_ccglue:
+ {
+ \cs_set_protected_nopar:Npn \CJKglue
+ { \skip_horizontal:N \l__ctex_ccglue_skip }
+ }
+\skip_new:N \l__ctex_ccglue_skip
+\prg_new_conditional:Npnn \ctex_if_ccglue_touched: { TF }
+ {
+ \if_meaning:w \CJKglue \__ctex_ccglue:
+ \prg_return_false: \else: \prg_return_true: \fi:
+ }
+\ctex_at_end:n { \cs_new_eq:NN \__ctex_ccglue: \CJKglue }
+\cs_new_protected_nopar:Npn \ctex_update_em_unit:
+ { \dim_set:Nn \ccwd { \f@size \p@ } }
+\cs_new_protected:Npn \ctex_add_to_selectfont:n #1
+ {
+ \cs_set_protected_nopar:Npx \CTEX@selectfont@hook
+ { \exp_not:o { \CTEX@selectfont@hook #1 } }
+ }
+\cs_new_eq:NN \CTEX@selectfont@hook \prg_do_nothing:
+\cs_new_eq:Nc \__ctex_save_selectfont: { selectfont ~ }
+\use:n
+ {
+ \ExplSyntaxOff
+ \ctex_preto_cmd:NnTF \selectfont { \CTEX@selectfont@hook }
+ {
+ \tl_put_left:Nn \@EverySelectfont@Init
+ { \cs_set_eq:cN { selectfont ~ } \__ctex_save_selectfont: }
+ }
+ { \ctex_patch_failure:N \selectfont }
+ }
+\ExplSyntaxOn
+\EverySelectfont { \cs_if_exist:NF \CJK@plane { \CTEX@selectfont@hook } }
+\keys_define:nn { ctex }
+ {
+ space .choice: ,
+ space / true .code:n =
+ { \ctex_ignorespaces_case:N \prg_do_nothing: } ,
+ space / auto .code:n =
+ { \ctex_ignorespaces_case:N \ctex_auto_ignorespaces: } ,
+ space / false .code:n =
+ { \ctex_ignorespaces_case:N \tex_ignorespaces:D } ,
+ space .default:n = { true } ,
+ space .initial:n = { auto }
+ }
+\keys_define:nn { ctex }
+ {
+ punct .code:n =
+ {
+ \tl_set:Nx \l__ctex_punct_tl { #1 }
+ \punctstyle { \l__ctex_punct_tl }
+ } ,
+ punct .default:n = { quanjiao } ,
+ }
+%%
+%%
+%% End of file `ctex-engine-pdftex.def'.
diff --git a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-xetex.def b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-xetex.def
new file mode 100644
index 00000000000..412c0a4c7b7
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-xetex.def
@@ -0,0 +1,147 @@
+%%
+%% This is file `ctex-engine-xetex.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `xetex')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {XeLaTeX adapter (CTEX)}
+\ProvidesExplFile{ctex-engine-xetex.def}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+\RequirePackage { xeCJK }
+\exp_args:Nx \xeCJKsetup
+ {
+ LoadFandol = false ,
+ AutoFakeBold = true ,
+ PunctStyle = \l__ctex_punct_tl
+ }
+\@ifpackagelater { fontspec } { 2014/05/25 } { }
+ { \msg_error:nnn { ctex } { package-too-old } { fontspec } }
+\cs_new_protected_nopar:Npn \ctex_detected_platform:
+ {
+ \file_if_exist:nTF { /dev/null }
+ {
+ \file_if_exist:nTF { nul: }
+ {
+ \file_if_exist:nTF { \c__ctex_engine_file_tl }
+ { \ctex_if_macosx:TF { mac } { windows } }
+ { \ctex_if_macosx:TF { mac } { fandol } }
+ }
+ { \ctex_if_macosx:TF { mac } { fandol } }
+ }
+ { \tl_gset:Nn \g__ctex_fontset_tl { windows } }
+ }
+\tex_uppercase:D \exp_after:wN
+ {
+ \exp_after:wN \tl_const:Nn \exp_after:wN \c__ctex_engine_file_tl
+ \exp_after:wN { \g_file_current_name_tl }
+ }
+\cs_new_protected_nopar:Npn \ctex_if_macosx:TF #1#2
+ {
+ \file_if_exist:nTF { \c__ctex_macosx_file_tl }
+ { \tl_gset:Nn \g__ctex_fontset_tl {#1} }
+ { \tl_gset:Nn \g__ctex_fontset_tl {#2} }
+ }
+\tl_const:Nn \c__ctex_macosx_file_tl { /mach_kernel }
+\ctex_hypersetup:n { pdfencoding = unicode }
+\RequirePackage { xeCJKfntef }
+\clist_map_inline:nn
+ { underdot , underline , underdblline , underwave , sout , xout }
+ {
+ \keys_set:nn { xeCJK / options } { #1 / format = { } }
+ \cs_new_protected_nopar:cpx { CTEX#1 }
+ {
+ \msg_warning:nnnn { ctex } { deprecated-command } { \exp_not:c { CTEX#1 } }
+ { You~ can~ use~ the~ command~ with~ prefix~ \exp_not:N \CJK~ instead. }
+ \exp_not:c { CJK#1 }
+ }
+ }
+\cs_new_protected_nopar:Npn { \CTEXfilltwosides }
+ {
+ \msg_warning:nnnn { ctex } { deprecated-environment } { CTEXfilltwosides }
+ { You~ can~ use~ `CJKfilltwosides'~ environment~ instead. }
+ \CJKfilltwosides
+ }
+\cs_new_protected_nopar:Npn { \endCTEXfilltwosides } { \endCJKfilltwosides }
+\cs_new_protected_nopar:Npn \ctex_update_ccwd:
+ {
+ \hbox_set:Nn \l__ctex_tmp_box { \CJKglue }
+ \dim_set:Nn \ccwd { \box_wd:N \l__ctex_tmp_box + \f@size \p@ }
+ }
+\dim_new:N \ccwd
+\cs_new_protected_nopar:Npn \ctex_update_ccglue:
+ { \xeCJKsetup { CJKglue = { \skip_horizontal:N \l__ctex_ccglue_skip } } }
+\skip_new:N \l__ctex_ccglue_skip
+\prg_new_conditional:Npnn \ctex_if_ccglue_touched: { TF }
+ {
+ \if_meaning:w \CJKglue \__ctex_ccglue:
+ \prg_return_false: \else: \prg_return_true: \fi:
+ }
+\ctex_at_end:n { \cs_new_eq:NN \__ctex_ccglue: \CJKglue }
+\cs_new_protected_nopar:Npn \ctex_update_em_unit:
+ { \dim_set:Nn \ccwd { \f@size \p@ } }
+\cs_new_protected:Npn \ctex_add_to_selectfont:n #1
+ {
+ \cs_set_protected_nopar:Npx \CTEX@selectfont@hook
+ { \exp_not:o { \CTEX@selectfont@hook #1 } }
+ }
+\cs_new_eq:NN \CTEX@selectfont@hook \prg_do_nothing:
+\cs_new_eq:Nc \__ctex_save_selectfont: { selectfont ~ }
+\use:n
+ {
+ \ExplSyntaxOff
+ \ctex_preto_cmd:NnTF \selectfont { \CTEX@selectfont@hook }
+ {
+ \tl_put_left:Nn \@EverySelectfont@Init
+ { \cs_set_eq:cN { selectfont ~ } \__ctex_save_selectfont: }
+ }
+ { \ctex_patch_failure:N \selectfont }
+ }
+\ExplSyntaxOn
+\EverySelectfont { \CTEX@selectfont@hook }
+\keys_define:nn { ctex }
+ {
+ space .choice: ,
+ space / true .code:n =
+ { \xeCJKsetup { CJKspace = true } } ,
+ space / auto .code:n =
+ { \xeCJKsetup { CJKspace = false } } ,
+ space / false .code:n =
+ { \xeCJKsetup { CJKspace = false } } ,
+ space .default:n = { true } ,
+ space .initial:n = { auto }
+ }
+\keys_define:nn { ctex }
+ {
+ punct .code:n =
+ {
+ \tl_set:Nx \l__ctex_punct_tl { #1 }
+ \xeCJKsetup { PunctStyle = \l__ctex_punct_tl }
+ } ,
+ punct .default:n = { quanjiao } ,
+ }
+%%
+%%
+%% End of file `ctex-engine-xetex.def'.
diff --git a/Master/texmf-dist/tex/latex/ctex/engine/ctex-xecjk-engine.def b/Master/texmf-dist/tex/latex/ctex/engine/ctex-xecjk-engine.def
deleted file mode 100644
index ebc344e95a7..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/engine/ctex-xecjk-engine.def
+++ /dev/null
@@ -1,37 +0,0 @@
-% ctex-xecjk-engine.def: for XeTeX engine with xeCJK
-% vim:ft=tex
-
-% compatibility with amssymb.sty etc and xunicode.sty v0.95+
-\RequirePackage{savesym}
-\def\CTEX@save@symlist{hbar,Finv,aleph,beth,gimel,daleth,Game}
-
-\@for \reversed@a:=\CTEX@save@symlist \do{%
- \savesymbol{\reversed@a}}
-
-\RequirePackage[BoldFont,normalindentfirst]{xeCJK}
-\defaultfontfeatures{Ligatures=TeX}
-
-\@for \reversed@a:=\CTEX@save@symlist \do{%
- \restoresymbol{UTF}{\reversed@a}%
- \expandafter\ifx \csname\reversed@a\endcsname \relax
- \expandafter\let \csname\reversed@a\endcsname \CTEX@undefined
- \fi}
-\let\CTEX@save@symlist\CTEX@undefined
-
-\ifCTEX@punct
- \punctstyle{quanjiao}
-\else
- \punctstyle{plain}
-\fi
-
-\input{ctex-cjk-common.def}
-
-\ifCTEX@nofonts\else
- \ifCTEX@winfonts
- \input{ctex-xecjk-winfonts.def}
- \else\ifCTEX@adobefonts
- \input{ctex-xecjk-adobefonts.def}
- \fi\fi
-\fi
-
-\endinput
diff --git a/Master/texmf-dist/tex/latex/ctex/fd/c19gbsn.fd b/Master/texmf-dist/tex/latex/ctex/fd/c19gbsn.fd
deleted file mode 100644
index 290f1c9d1ea..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/fd/c19gbsn.fd
+++ /dev/null
@@ -1,17 +0,0 @@
-%% c19gbsn.fd
-\ProvidesFile{c19gbsn.fd}[2009/05/11 4.8.2]
-
-
-% simplified Chinese characters
-%
-% character set: GBK
-% font encoding: CJK (standard)
-
-% Arphic PL TrueType font AR PL SungtiL GB / BousungEG-Light-GB
-
-\DeclareFontFamily{C10}{gbsn}{\hyphenchar \font\m@ne}
-
-\DeclareFontShape{C10}{gbsn}{m}{n}{<-> CJK * gbsnlp}{\CJKnormal}
-\DeclareFontShape{C10}{gbsn}{bx}{n}{<-> CJKb * gbsnlp}{\CJKbold}
-
-\endinput
diff --git a/Master/texmf-dist/tex/latex/ctex/fd/c19gbsn.fdx b/Master/texmf-dist/tex/latex/ctex/fd/c19gbsn.fdx
deleted file mode 100644
index 25b455d4808..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/fd/c19gbsn.fdx
+++ /dev/null
@@ -1,62 +0,0 @@
-%% c19gbsn.fdx
-\ProvidesFile{c19gbsn.fdx}[2009/05/11 4.8.2]
-
-
-\CJKvdef{fullheight}{1em}
-\CJKvdef{height}{.88em}
-\CJKvdef{offset}{.5em}
-\CJKvdef{simpleoffset}{-.1em}
-
-\CJKvdef{m/n/01/1}{\raise .15em \hbox to 1em {\kern -.15em \CJKsymbol{1}\hss}}
-\CJKvdef{m/n/01/2}{\raise .15em \hbox to 1em {\kern -.15em \CJKsymbol{2}\hss}}
-\CJKvdef{m/n/01/17}{\CJKsymbolsimple{17}}
-\CJKvdef{m/n/01/18}{\CJKsymbolsimple{18}}
-\CJKvdef{m/n/01/19}{\CJKsymbolsimple{19}}
-\CJKvdef{m/n/01/20}{\CJKsymbolsimple{20}}
-\CJKvdef{m/n/01/21}{\CJKsymbolsimple{21}}
-\CJKvdef{m/n/01/22}{\CJKsymbolsimple{22}}
-\CJKvdef{m/n/01/23}{\CJKsymbolsimple{23}}
-\CJKvdef{m/n/01/24}{\CJKsymbolsimple{24}}
-\CJKvdef{m/n/01/25}{\CJKsymbolsimple{25}}
-\CJKvdef{m/n/01/26}{\CJKsymbolsimple{26}}
-\CJKvdef{m/n/01/27}{\CJKsymbolsimple{27}}
-\CJKvdef{m/n/01/28}{\CJKsymbolsimple{28}}
-\CJKvdef{m/n/01/29}{\CJKsymbolsimple{29}}
-\CJKvdef{m/n/01/30}{\CJKsymbolsimple{30}}
-\CJKvdef{m/n/01/195}{\CJKsymbolsimple{195}}
-\CJKvdef{m/n/01/196}{\CJKsymbolsimple{196}}
-\CJKvdef{m/n/01/199}{
- \raise .25em \hbox to 1em {\kern -.35em \CJKsymbol{199}\hss}}
-\CJKvdef{m/n/01/201}{
- \raise .25em \hbox to 1em {\kern -.35em \CJKsymbol{201}\hss}}
-\CJKvdef{m/n/01/246}{\CJKsymbolsimple{246}}
-\CJKvdef{m/n/01/248}{\CJKsymbolsimple{248}}
-\CJKvdef{m/n/02/22}{\CJKsymbolsimple{22}}
-\CJKvdef{m/n/02/24}{\CJKsymbolsimple{24}}
-
-\CJKvlet{bx/n/01/1}{m/n/01/1}
-\CJKvlet{bx/n/01/2}{m/n/01/2}
-\CJKvlet{bx/n/01/17}{m/n/01/17}
-\CJKvlet{bx/n/01/18}{m/n/01/18}
-\CJKvlet{bx/n/01/19}{m/n/01/19}
-\CJKvlet{bx/n/01/20}{m/n/01/20}
-\CJKvlet{bx/n/01/21}{m/n/01/21}
-\CJKvlet{bx/n/01/22}{m/n/01/22}
-\CJKvlet{bx/n/01/23}{m/n/01/23}
-\CJKvlet{bx/n/01/24}{m/n/01/24}
-\CJKvlet{bx/n/01/25}{m/n/01/25}
-\CJKvlet{bx/n/01/26}{m/n/01/26}
-\CJKvlet{bx/n/01/27}{m/n/01/27}
-\CJKvlet{bx/n/01/28}{m/n/01/28}
-\CJKvlet{bx/n/01/29}{m/n/01/29}
-\CJKvlet{bx/n/01/30}{m/n/01/30}
-\CJKvlet{bx/n/01/195}{m/n/01/195}
-\CJKvlet{bx/n/01/196}{m/n/01/196}
-\CJKvlet{bx/n/01/199}{m/n/01/199}
-\CJKvlet{bx/n/01/201}{m/n/01/201}
-\CJKvlet{bx/n/01/246}{m/n/01/246}
-\CJKvlet{bx/n/01/248}{m/n/01/248}
-\CJKvlet{bx/n/02/22}{m/n/02/22}
-\CJKvlet{bx/n/02/24}{m/n/02/24}
-
-\endinput
diff --git a/Master/texmf-dist/tex/latex/ctex/fd/c19gkai.fd b/Master/texmf-dist/tex/latex/ctex/fd/c19gkai.fd
deleted file mode 100644
index 3f579ea4844..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/fd/c19gkai.fd
+++ /dev/null
@@ -1,17 +0,0 @@
-%% c19gkai.fd
-\ProvidesFile{c19gkai.fd}[2009/05/11 4.8.2]
-
-
-% simplified Chinese characters
-%
-% character set: GBK
-% font encoding: CJK (standard)
-
-% Arphic PL TrueType font AR PL KaitiM GB / GBZenKai-Medium
-
-\DeclareFontFamily{C10}{gkai}{\hyphenchar \font\m@ne}
-
-\DeclareFontShape{C10}{gkai}{m}{n}{<-> CJK * gkaimp}{\CJKnormal}
-\DeclareFontShape{C10}{gkai}{bx}{n}{<-> CJKb * gkaimp}{\CJKbold}
-
-\endinput
diff --git a/Master/texmf-dist/tex/latex/ctex/fd/c19gkai.fdx b/Master/texmf-dist/tex/latex/ctex/fd/c19gkai.fdx
deleted file mode 100644
index 9462027bd64..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/fd/c19gkai.fdx
+++ /dev/null
@@ -1,62 +0,0 @@
-%% c19gkai.fdx
-\ProvidesFile{c19gkai.fdx}[2009/05/11 4.8.2]
-
-
-\CJKvdef{fullheight}{1em}
-\CJKvdef{height}{.88em}
-\CJKvdef{offset}{.5em}
-\CJKvdef{simpleoffset}{-.1em}
-
-\CJKvdef{m/n/01/1}{\raise .15em \hbox to 1em {\kern -.15em \CJKsymbol{1}\hss}}
-\CJKvdef{m/n/01/2}{\raise .15em \hbox to 1em {\kern -.15em \CJKsymbol{2}\hss}}
-\CJKvdef{m/n/01/17}{\CJKsymbolsimple{17}}
-\CJKvdef{m/n/01/18}{\CJKsymbolsimple{18}}
-\CJKvdef{m/n/01/19}{\CJKsymbolsimple{19}}
-\CJKvdef{m/n/01/20}{\CJKsymbolsimple{20}}
-\CJKvdef{m/n/01/21}{\CJKsymbolsimple{21}}
-\CJKvdef{m/n/01/22}{\CJKsymbolsimple{22}}
-\CJKvdef{m/n/01/23}{\CJKsymbolsimple{23}}
-\CJKvdef{m/n/01/24}{\CJKsymbolsimple{24}}
-\CJKvdef{m/n/01/25}{\CJKsymbolsimple{25}}
-\CJKvdef{m/n/01/26}{\CJKsymbolsimple{26}}
-\CJKvdef{m/n/01/27}{\CJKsymbolsimple{27}}
-\CJKvdef{m/n/01/28}{\CJKsymbolsimple{28}}
-\CJKvdef{m/n/01/29}{\CJKsymbolsimple{29}}
-\CJKvdef{m/n/01/30}{\CJKsymbolsimple{30}}
-\CJKvdef{m/n/01/195}{\CJKsymbolsimple{195}}
-\CJKvdef{m/n/01/196}{\CJKsymbolsimple{196}}
-\CJKvdef{m/n/01/199}{
- \raise .25em \hbox to 1em {\kern -.35em \CJKsymbol{199}\hss}}
-\CJKvdef{m/n/01/201}{
- \raise .25em \hbox to 1em {\kern -.35em \CJKsymbol{201}\hss}}
-\CJKvdef{m/n/01/246}{\CJKsymbolsimple{246}}
-\CJKvdef{m/n/01/248}{\CJKsymbolsimple{248}}
-\CJKvdef{m/n/02/22}{\CJKsymbolsimple{22}}
-\CJKvdef{m/n/02/24}{\CJKsymbolsimple{24}}
-
-\CJKvlet{bx/n/01/1}{m/n/01/1}
-\CJKvlet{bx/n/01/2}{m/n/01/2}
-\CJKvlet{bx/n/01/17}{m/n/01/17}
-\CJKvlet{bx/n/01/18}{m/n/01/18}
-\CJKvlet{bx/n/01/19}{m/n/01/19}
-\CJKvlet{bx/n/01/20}{m/n/01/20}
-\CJKvlet{bx/n/01/21}{m/n/01/21}
-\CJKvlet{bx/n/01/22}{m/n/01/22}
-\CJKvlet{bx/n/01/23}{m/n/01/23}
-\CJKvlet{bx/n/01/24}{m/n/01/24}
-\CJKvlet{bx/n/01/25}{m/n/01/25}
-\CJKvlet{bx/n/01/26}{m/n/01/26}
-\CJKvlet{bx/n/01/27}{m/n/01/27}
-\CJKvlet{bx/n/01/28}{m/n/01/28}
-\CJKvlet{bx/n/01/29}{m/n/01/29}
-\CJKvlet{bx/n/01/30}{m/n/01/30}
-\CJKvlet{bx/n/01/195}{m/n/01/195}
-\CJKvlet{bx/n/01/196}{m/n/01/196}
-\CJKvlet{bx/n/01/199}{m/n/01/199}
-\CJKvlet{bx/n/01/201}{m/n/01/201}
-\CJKvlet{bx/n/01/246}{m/n/01/246}
-\CJKvlet{bx/n/01/248}{m/n/01/248}
-\CJKvlet{bx/n/02/22}{m/n/02/22}
-\CJKvlet{bx/n/02/24}{m/n/02/24}
-
-\endinput
diff --git a/Master/texmf-dist/tex/latex/ctex/fd/c19rm.fd b/Master/texmf-dist/tex/latex/ctex/fd/c19rm.fd
index 481dd8d23a2..35c7335fa12 100644
--- a/Master/texmf-dist/tex/latex/ctex/fd/c19rm.fd
+++ b/Master/texmf-dist/tex/latex/ctex/fd/c19rm.fd
@@ -1,49 +1,49 @@
-%% c19rm.fd
%%
%% This is file `c19rm.fd',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
-%% ctex.dtx (with options: `fd,rm')
+%% ctex.dtx (with options: `rm,c19')
%%
-%% This is a generated file.
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
%%
-%% Copyright 2003-2006
-%% CTEX.ORG and any individual authors listed elsewhere in this file.
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
%%
-%% This file was generated from file(s) of the ctex package project.
-%% -----------------------------------------------------------------
+%% This work has the LPPL maintenance status `maintained'.
%%
-%% It may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.2
-%% of this license or (at your option) any later version.
-%% The latest version of this license is in
-%% http://www.latex-project.org/lppl.txt
-%% and version 1.2 or later is part of all distributions of LaTeX
-%% version 1999/12/01 or later.
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
%%
-%% This is the font definition file of the ctex package with LaTeX2e.
+%% ------------------------------------------------------------------------------
%%
-\ProvidesFile{c19rm.fd}
- [2007/05/06 v0.8a ctex
- font definition file]
-
-%% Chinese characters (extension of GB 2312)
+\ProvidesFile{c19rm.fd}%
+ [2014/03/08 v2.0 Chinese font definition (CTEX)]
%%
-%% character set: GBK
-%% font encoding: CJK (extended)
-
-\DeclareFontFamily{C19}{rm}{\hyphenchar \font\m@ne}
-\DeclareFontShape{C19}{rm}{m}{n}{<-> CJK * gbksong}{}
-\DeclareFontShape{C19}{rm}{b}{n}{<-> CJK * gbkhei}{}
-\DeclareFontShape{C19}{rm}{bx}{n}{<-> CJK * gbkhei}{}
-\DeclareFontShape{C19}{rm}{m}{sl}{<-> CJK * gbksongsl}{}
-\DeclareFontShape{C19}{rm}{b}{sl}{<-> CJK * gbkheisl}{}
-\DeclareFontShape{C19}{rm}{bx}{sl}{<-> CJK * gbkheisl}{}
-\DeclareFontShape{C19}{rm}{m}{it}{<-> CJK * gbkkai}{}
+%% Chinese characters
+%%
+%% character set: GBK (extension of GB 2312)
+%% font encoding: Unicode
+%%
+\DeclareFontFamily{C19}{rm}{\hyphenchar\font\m@ne}
+\DeclareFontShape{C19}{rm}{m}{n}{<-> CJK * gbksong}{\CJKnormal}
+\DeclareFontShape{C19}{rm}{b}{n}{<-> CJK * gbkhei}{\CJKnormal}
+\DeclareFontShape{C19}{rm}{bx}{n}{<-> CJK * gbkhei}{\CJKnormal}
+\DeclareFontShape{C19}{rm}{m}{sl}{<-> CJK * gbksongsl}{\CJKnormal}
+\DeclareFontShape{C19}{rm}{b}{sl}{<-> CJK * gbkheisl}{\CJKnormal}
+\DeclareFontShape{C19}{rm}{bx}{sl}{<-> CJK * gbkheisl}{\CJKnormal}
+\DeclareFontShape{C19}{rm}{m}{it}{<-> CJK * gbkkai}{\CJKnormal}
\DeclareFontShape{C19}{rm}{b}{it}{<-> CJKb * gbkkai}{\CJKbold}
\DeclareFontShape{C19}{rm}{bx}{it}{<-> CJKb * gbkkai}{\CJKbold}
-\endinput
+%%
%%
%% End of file `c19rm.fd'.
diff --git a/Master/texmf-dist/tex/latex/ctex/fd/c19sf.fd b/Master/texmf-dist/tex/latex/ctex/fd/c19sf.fd
index c3071ff2e87..c183d5126a4 100644
--- a/Master/texmf-dist/tex/latex/ctex/fd/c19sf.fd
+++ b/Master/texmf-dist/tex/latex/ctex/fd/c19sf.fd
@@ -1,49 +1,49 @@
-%% c19sf.fd
%%
%% This is file `c19sf.fd',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
-%% ctex.dtx (with options: `fd,sf')
+%% ctex.dtx (with options: `sf,c19')
%%
-%% This is a generated file.
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
%%
-%% Copyright 2003-2006
-%% CTEX.ORG and any individual authors listed elsewhere in this file.
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
%%
-%% This file was generated from file(s) of the ctex package project.
-%% -----------------------------------------------------------------
+%% This work has the LPPL maintenance status `maintained'.
%%
-%% It may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.2
-%% of this license or (at your option) any later version.
-%% The latest version of this license is in
-%% http://www.latex-project.org/lppl.txt
-%% and version 1.2 or later is part of all distributions of LaTeX
-%% version 1999/12/01 or later.
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
%%
-%% This is the font definition file of the ctex package with LaTeX2e.
+%% ------------------------------------------------------------------------------
%%
-\ProvidesFile{c19sf.fd}
- [2007/05/06 v0.8a ctex
- font definition file]
-
-%% Chinese characters (extension of GB 2312)
+\ProvidesFile{c19sf.fd}%
+ [2014/03/08 v2.0 Chinese font definition (CTEX)]
%%
-%% character set: GBK
-%% font encoding: CJK (extended)
-
-\DeclareFontFamily{C19}{sf}{\hyphenchar \font\m@ne}
-\DeclareFontShape{C19}{sf}{m}{n}{<-> CJK * gbkyou}{}
+%% Chinese characters
+%%
+%% character set: GBK (extension of GB 2312)
+%% font encoding: Unicode
+%%
+\DeclareFontFamily{C19}{sf}{\hyphenchar\font\m@ne}
+\DeclareFontShape{C19}{sf}{m}{n}{<-> CJK * gbkyou}{\CJKnormal}
\DeclareFontShape{C19}{sf}{b}{n}{<-> CJKb * gbkyou}{\CJKbold}
\DeclareFontShape{C19}{sf}{bx}{n}{<-> CJKb * gbkyou}{\CJKbold}
-\DeclareFontShape{C19}{sf}{m}{sl}{<-> CJK * gbkyousl}{}
+\DeclareFontShape{C19}{sf}{m}{sl}{<-> CJK * gbkyousl}{\CJKnormal}
\DeclareFontShape{C19}{sf}{b}{sl}{<-> CJKb * gbkyousl}{\CJKbold}
\DeclareFontShape{C19}{sf}{bx}{sl}{<-> CJKb * gbkyousl}{\CJKbold}
-\DeclareFontShape{C19}{sf}{m}{it}{<-> CJK * gbkyou}{}
+\DeclareFontShape{C19}{sf}{m}{it}{<-> CJK * gbkyou}{\CJKnormal}
\DeclareFontShape{C19}{sf}{b}{it}{<-> CJKb * gbkyou}{\CJKbold}
\DeclareFontShape{C19}{sf}{bx}{it}{<-> CJKb * gbkyou}{\CJKbold}
-\endinput
+%%
%%
%% End of file `c19sf.fd'.
diff --git a/Master/texmf-dist/tex/latex/ctex/fd/c19tt.fd b/Master/texmf-dist/tex/latex/ctex/fd/c19tt.fd
index d02ee63bdd8..62db3c574b6 100644
--- a/Master/texmf-dist/tex/latex/ctex/fd/c19tt.fd
+++ b/Master/texmf-dist/tex/latex/ctex/fd/c19tt.fd
@@ -1,49 +1,49 @@
-%% c19tt.fd
%%
%% This is file `c19tt.fd',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
-%% ctex.dtx (with options: `fd,tt')
+%% ctex.dtx (with options: `tt,c19')
%%
-%% This is a generated file.
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
%%
-%% Copyright 2003-2006
-%% CTEX.ORG and any individual authors listed elsewhere in this file.
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
%%
-%% This file was generated from file(s) of the ctex package project.
-%% -----------------------------------------------------------------
+%% This work has the LPPL maintenance status `maintained'.
%%
-%% It may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.2
-%% of this license or (at your option) any later version.
-%% The latest version of this license is in
-%% http://www.latex-project.org/lppl.txt
-%% and version 1.2 or later is part of all distributions of LaTeX
-%% version 1999/12/01 or later.
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
%%
-%% This is the font definition file of the ctex package with LaTeX2e.
+%% ------------------------------------------------------------------------------
%%
-\ProvidesFile{c19tt.fd}
- [2007/05/06 v0.8a ctex
- font definition file]
-
-%% Chinese characters (extension of GB 2312)
+\ProvidesFile{c19tt.fd}%
+ [2014/03/08 v2.0 Chinese font definition (CTEX)]
%%
-%% character set: GBK
-%% font encoding: CJK (extended)
-
-\DeclareFontFamily{C19}{tt}{\hyphenchar \font\m@ne}
-\DeclareFontShape{C19}{tt}{m}{n}{<-> CJK * gbkfs}{}
+%% Chinese characters
+%%
+%% character set: GBK (extension of GB 2312)
+%% font encoding: Unicode
+%%
+\DeclareFontFamily{C19}{tt}{\hyphenchar\font\m@ne}
+\DeclareFontShape{C19}{tt}{m}{n}{<-> CJK * gbkfs}{\CJKnormal}
\DeclareFontShape{C19}{tt}{b}{n}{<-> CJKb * gbkfs}{\CJKbold}
\DeclareFontShape{C19}{tt}{bx}{n}{<-> CJKb * gbkfs}{\CJKbold}
-\DeclareFontShape{C19}{tt}{m}{sl}{<-> CJK * gbkfssl}{}
+\DeclareFontShape{C19}{tt}{m}{sl}{<-> CJK * gbkfssl}{\CJKnormal}
\DeclareFontShape{C19}{tt}{b}{sl}{<-> CJKb * gbkfssl}{\CJKbold}
\DeclareFontShape{C19}{tt}{bx}{sl}{<-> CJKb * gbkfssl}{\CJKbold}
-\DeclareFontShape{C19}{tt}{m}{it}{<-> CJK * gbkfs}{}
+\DeclareFontShape{C19}{tt}{m}{it}{<-> CJK * gbkfs}{\CJKnormal}
\DeclareFontShape{C19}{tt}{b}{it}{<-> CJKb * gbkfs}{\CJKbold}
\DeclareFontShape{C19}{tt}{bx}{it}{<-> CJKb * gbkfs}{\CJKbold}
-\endinput
+%%
%%
%% End of file `c19tt.fd'.
diff --git a/Master/texmf-dist/tex/latex/ctex/fd/c70rm.fd b/Master/texmf-dist/tex/latex/ctex/fd/c70rm.fd
index 1c0ef069ddf..e7b07baf306 100644
--- a/Master/texmf-dist/tex/latex/ctex/fd/c70rm.fd
+++ b/Master/texmf-dist/tex/latex/ctex/fd/c70rm.fd
@@ -1,49 +1,49 @@
-%% c70rm.fd
%%
%% This is file `c70rm.fd',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
-%% ctex.dtx (with options: `fd,rm')
+%% ctex.dtx (with options: `rm,c70')
%%
-%% This is a generated file.
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
%%
-%% Copyright 2003-2006
-%% CTEX.ORG and any individual authors listed elsewhere in this file.
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
%%
-%% This file was generated from file(s) of the ctex package project.
-%% -----------------------------------------------------------------
+%% This work has the LPPL maintenance status `maintained'.
%%
-%% It may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.2
-%% of this license or (at your option) any later version.
-%% The latest version of this license is in
-%% http://www.latex-project.org/lppl.txt
-%% and version 1.2 or later is part of all distributions of LaTeX
-%% version 1999/12/01 or later.
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
%%
-%% This is the font definition file of the ctex package with LaTeX2e.
+%% ------------------------------------------------------------------------------
%%
-\ProvidesFile{c70rm.fd}
- [2007/05/06 v0.8a ctexutf8
- font definition file]
-
+\ProvidesFile{c70rm.fd}%
+ [2014/03/08 v2.0 Chinese font definition (CTEX)]
+%%
%% Chinese characters
%%
-%% character set: UTF8
-%% font encoding: CJK (extended)
-
-\DeclareFontFamily{C70}{rm}{\hyphenchar \font\m@ne}
-\DeclareFontShape{C70}{rm}{m}{n}{<-> CJK * unisong}{}
-\DeclareFontShape{C70}{rm}{b}{n}{<-> CJK * unihei}{}
-\DeclareFontShape{C70}{rm}{bx}{n}{<-> CJK * unihei}{}
-\DeclareFontShape{C70}{rm}{m}{sl}{<-> CJK * unisongsl}{}
-\DeclareFontShape{C70}{rm}{b}{sl}{<-> CJK * uniheisl}{}
-\DeclareFontShape{C70}{rm}{bx}{sl}{<-> CJK * uniheisl}{}
-\DeclareFontShape{C70}{rm}{m}{it}{<-> CJK * unikai}{}
+%% character set: Unicode
+%% font encoding: Unicode
+%%
+\DeclareFontFamily{C70}{rm}{\hyphenchar\font\m@ne}
+\DeclareFontShape{C70}{rm}{m}{n}{<-> CJK * unisong}{\CJKnormal}
+\DeclareFontShape{C70}{rm}{b}{n}{<-> CJK * unihei}{\CJKnormal}
+\DeclareFontShape{C70}{rm}{bx}{n}{<-> CJK * unihei}{\CJKnormal}
+\DeclareFontShape{C70}{rm}{m}{sl}{<-> CJK * unisongsl}{\CJKnormal}
+\DeclareFontShape{C70}{rm}{b}{sl}{<-> CJK * uniheisl}{\CJKnormal}
+\DeclareFontShape{C70}{rm}{bx}{sl}{<-> CJK * uniheisl}{\CJKnormal}
+\DeclareFontShape{C70}{rm}{m}{it}{<-> CJK * unikai}{\CJKnormal}
\DeclareFontShape{C70}{rm}{b}{it}{<-> CJKb * unikai}{\CJKbold}
\DeclareFontShape{C70}{rm}{bx}{it}{<-> CJKb * unikai}{\CJKbold}
-\endinput
+%%
%%
%% End of file `c70rm.fd'.
diff --git a/Master/texmf-dist/tex/latex/ctex/fd/c70sf.fd b/Master/texmf-dist/tex/latex/ctex/fd/c70sf.fd
index b5f8da3e91c..30f3af37d5e 100644
--- a/Master/texmf-dist/tex/latex/ctex/fd/c70sf.fd
+++ b/Master/texmf-dist/tex/latex/ctex/fd/c70sf.fd
@@ -1,49 +1,49 @@
-%% c70sf.fd
%%
%% This is file `c70sf.fd',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
-%% ctex.dtx (with options: `fd,sf')
+%% ctex.dtx (with options: `sf,c70')
%%
-%% This is a generated file.
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
%%
-%% Copyright 2003-2006
-%% CTEX.ORG and any individual authors listed elsewhere in this file.
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
%%
-%% This file was generated from file(s) of the ctex package project.
-%% -----------------------------------------------------------------
+%% This work has the LPPL maintenance status `maintained'.
%%
-%% It may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.2
-%% of this license or (at your option) any later version.
-%% The latest version of this license is in
-%% http://www.latex-project.org/lppl.txt
-%% and version 1.2 or later is part of all distributions of LaTeX
-%% version 1999/12/01 or later.
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
%%
-%% This is the font definition file of the ctex package with LaTeX2e.
+%% ------------------------------------------------------------------------------
%%
-\ProvidesFile{c70sf.fd}
- [2007/05/06 v0.8a ctexutf8
- font definition file]
-
+\ProvidesFile{c70sf.fd}%
+ [2014/03/08 v2.0 Chinese font definition (CTEX)]
+%%
%% Chinese characters
%%
-%% character set: UTF8
-%% font encoding: CJK (extended)
-
-\DeclareFontFamily{C70}{sf}{\hyphenchar \font\m@ne}
-\DeclareFontShape{C70}{sf}{m}{n}{<-> CJK * uniyou}{}
+%% character set: Unicode
+%% font encoding: Unicode
+%%
+\DeclareFontFamily{C70}{sf}{\hyphenchar\font\m@ne}
+\DeclareFontShape{C70}{sf}{m}{n}{<-> CJK * uniyou}{\CJKnormal}
\DeclareFontShape{C70}{sf}{b}{n}{<-> CJKb * uniyou}{\CJKbold}
\DeclareFontShape{C70}{sf}{bx}{n}{<-> CJKb * uniyou}{\CJKbold}
-\DeclareFontShape{C70}{sf}{m}{sl}{<-> CJK * uniyousl}{}
+\DeclareFontShape{C70}{sf}{m}{sl}{<-> CJK * uniyousl}{\CJKnormal}
\DeclareFontShape{C70}{sf}{b}{sl}{<-> CJKb * uniyousl}{\CJKbold}
\DeclareFontShape{C70}{sf}{bx}{sl}{<-> CJKb * uniyousl}{\CJKbold}
-\DeclareFontShape{C70}{sf}{m}{it}{<-> CJK * uniyou}{}
+\DeclareFontShape{C70}{sf}{m}{it}{<-> CJK * uniyou}{\CJKnormal}
\DeclareFontShape{C70}{sf}{b}{it}{<-> CJKb * uniyou}{\CJKbold}
\DeclareFontShape{C70}{sf}{bx}{it}{<-> CJKb * uniyou}{\CJKbold}
-\endinput
+%%
%%
%% End of file `c70sf.fd'.
diff --git a/Master/texmf-dist/tex/latex/ctex/fd/c70tt.fd b/Master/texmf-dist/tex/latex/ctex/fd/c70tt.fd
index 0e9933d9a9e..16efbbd91b7 100644
--- a/Master/texmf-dist/tex/latex/ctex/fd/c70tt.fd
+++ b/Master/texmf-dist/tex/latex/ctex/fd/c70tt.fd
@@ -1,49 +1,49 @@
-%% c70tt.fd
%%
%% This is file `c70tt.fd',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
-%% ctex.dtx (with options: `fd,tt')
+%% ctex.dtx (with options: `tt,c70')
%%
-%% This is a generated file.
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
%%
-%% Copyright 2003-2006
-%% CTEX.ORG and any individual authors listed elsewhere in this file.
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
%%
-%% This file was generated from file(s) of the ctex package project.
-%% -----------------------------------------------------------------
+%% This work has the LPPL maintenance status `maintained'.
%%
-%% It may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.2
-%% of this license or (at your option) any later version.
-%% The latest version of this license is in
-%% http://www.latex-project.org/lppl.txt
-%% and version 1.2 or later is part of all distributions of LaTeX
-%% version 1999/12/01 or later.
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
%%
-%% This is the font definition file of the ctex package with LaTeX2e.
+%% ------------------------------------------------------------------------------
%%
-\ProvidesFile{c70tt.fd}
- [2007/05/06 v0.8a ctexutf8
- font definition file]
-
+\ProvidesFile{c70tt.fd}%
+ [2014/03/08 v2.0 Chinese font definition (CTEX)]
+%%
%% Chinese characters
%%
-%% character set: UTF8
-%% font encoding: CJK (extended)
-
-\DeclareFontFamily{C70}{tt}{\hyphenchar \font\m@ne}
-\DeclareFontShape{C70}{tt}{m}{n}{<-> CJK * unifs}{}
+%% character set: Unicode
+%% font encoding: Unicode
+%%
+\DeclareFontFamily{C70}{tt}{\hyphenchar\font\m@ne}
+\DeclareFontShape{C70}{tt}{m}{n}{<-> CJK * unifs}{\CJKnormal}
\DeclareFontShape{C70}{tt}{b}{n}{<-> CJKb * unifs}{\CJKbold}
\DeclareFontShape{C70}{tt}{bx}{n}{<-> CJKb * unifs}{\CJKbold}
-\DeclareFontShape{C70}{tt}{m}{sl}{<-> CJK * unifssl}{}
+\DeclareFontShape{C70}{tt}{m}{sl}{<-> CJK * unifssl}{\CJKnormal}
\DeclareFontShape{C70}{tt}{b}{sl}{<-> CJKb * unifssl}{\CJKbold}
\DeclareFontShape{C70}{tt}{bx}{sl}{<-> CJKb * unifssl}{\CJKbold}
-\DeclareFontShape{C70}{tt}{m}{it}{<-> CJK * unifs}{}
+\DeclareFontShape{C70}{tt}{m}{it}{<-> CJK * unifs}{\CJKnormal}
\DeclareFontShape{C70}{tt}{b}{it}{<-> CJKb * unifs}{\CJKbold}
\DeclareFontShape{C70}{tt}{bx}{it}{<-> CJKb * unifs}{\CJKbold}
-\endinput
+%%
%%
%% End of file `c70tt.fd'.
diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-cjk-adobefonts.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-cjk-adobefonts.def
deleted file mode 100644
index 168d4a69d4f..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-cjk-adobefonts.def
+++ /dev/null
@@ -1,7 +0,0 @@
-% ctex-cjk-adobefonts.def: Adobe 的 CJK 字体设置,为 Adobe 的四套字体
-% vim:ft=tex
-
-% 目前不可用
-\input{ctex-cjk-winfonts.def}
-
-\endinput
diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-cjk-winfonts.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-cjk-winfonts.def
deleted file mode 100644
index e79a250b42c..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-cjk-winfonts.def
+++ /dev/null
@@ -1,82 +0,0 @@
-% ctex-cjk-winfonts.def: Windows 的 CJK 字体设置,默认为 CTeX 套装的六种字体
-% vim:ft=tex
-
-\ifCTEX@zhmap
- \AtBeginDvi{\input{zhwinfonts}}
-\fi
-
-\renewcommand*\CTEX@rm@family{rm}
-\renewcommand*\CTEX@sf@family{sf}
-\renewcommand*\CTEX@tt@family{tt}
-
-\ifCTEX@punct
-% see also: c19rm.fd
- \CJKpunctmapfamily{C19}{rm}{m}{n}{zhsong}
- \CJKpunctmapfamily{C19}{rm}{b}{n}{zhhei}
- \CJKpunctmapfamily{C19}{rm}{bx}{n}{zhhei}
- \CJKpunctmapfamily{C19}{rm}{m}{sl}{zhsong}
- \CJKpunctmapfamily{C19}{rm}{b}{sl}{zhhei}
- \CJKpunctmapfamily{C19}{rm}{bx}{sl}{zhhei}
- \CJKpunctmapfamily{C19}{rm}{m}{it}{zhkai}
- \CJKpunctmapfamily{C19}{rm}{b}{it}{zhkei}
- \CJKpunctmapfamily{C19}{rm}{bx}{it}{zhkai}
-% see also: c19sf.fd
- \CJKpunctmapfamily{C19}{sf}{m}{n}{zhyou}
- \CJKpunctmapfamily{C19}{sf}{b}{n}{zhyou}
- \CJKpunctmapfamily{C19}{sf}{bx}{n}{zhyou}
- \CJKpunctmapfamily{C19}{sf}{m}{sl}{zhyou}
- \CJKpunctmapfamily{C19}{sf}{b}{sl}{zhyou}
- \CJKpunctmapfamily{C19}{sf}{bx}{sl}{zhyou}
- \CJKpunctmapfamily{C19}{sf}{m}{it}{zhyou}
- \CJKpunctmapfamily{C19}{sf}{b}{it}{zhyou}
- \CJKpunctmapfamily{C19}{sf}{bx}{it}{zhyou}
-% see also: c19tt.fd
- \CJKpunctmapfamily{C19}{tt}{m}{n}{zhfs}
- \CJKpunctmapfamily{C19}{tt}{b}{n}{zhfs}
- \CJKpunctmapfamily{C19}{tt}{bx}{n}{zhfs}
- \CJKpunctmapfamily{C19}{tt}{m}{sl}{zhfs}
- \CJKpunctmapfamily{C19}{tt}{b}{sl}{zhfs}
- \CJKpunctmapfamily{C19}{tt}{bx}{sl}{zhfs}
- \CJKpunctmapfamily{C19}{tt}{m}{it}{zhfs}
- \CJKpunctmapfamily{C19}{tt}{b}{it}{zhfs}
- \CJKpunctmapfamily{C19}{tt}{bx}{it}{zhfs}
-% see also: c70rm.fd
- \CJKpunctmapfamily{C70}{rm}{m}{n}{zhsong}
- \CJKpunctmapfamily{C70}{rm}{b}{n}{zhhei}
- \CJKpunctmapfamily{C70}{rm}{bx}{n}{zhhei}
- \CJKpunctmapfamily{C70}{rm}{m}{sl}{zhsong}
- \CJKpunctmapfamily{C70}{rm}{b}{sl}{zhhei}
- \CJKpunctmapfamily{C70}{rm}{bx}{sl}{zhhei}
- \CJKpunctmapfamily{C70}{rm}{m}{it}{zhkai}
- \CJKpunctmapfamily{C70}{rm}{b}{it}{zhkei}
- \CJKpunctmapfamily{C70}{rm}{bx}{it}{zhkai}
-% see also: c70sf.fd
- \CJKpunctmapfamily{C70}{sf}{m}{n}{zhyou}
- \CJKpunctmapfamily{C70}{sf}{b}{n}{zhyou}
- \CJKpunctmapfamily{C70}{sf}{bx}{n}{zhyou}
- \CJKpunctmapfamily{C70}{sf}{m}{sl}{zhyou}
- \CJKpunctmapfamily{C70}{sf}{b}{sl}{zhyou}
- \CJKpunctmapfamily{C70}{sf}{bx}{sl}{zhyou}
- \CJKpunctmapfamily{C70}{sf}{m}{it}{zhyou}
- \CJKpunctmapfamily{C70}{sf}{b}{it}{zhyou}
- \CJKpunctmapfamily{C70}{sf}{bx}{it}{zhyou}
-% see also: c70tt.fd
- \CJKpunctmapfamily{C70}{tt}{m}{n}{zhfs}
- \CJKpunctmapfamily{C70}{tt}{b}{n}{zhfs}
- \CJKpunctmapfamily{C70}{tt}{bx}{n}{zhfs}
- \CJKpunctmapfamily{C70}{tt}{m}{sl}{zhfs}
- \CJKpunctmapfamily{C70}{tt}{b}{sl}{zhfs}
- \CJKpunctmapfamily{C70}{tt}{bx}{sl}{zhfs}
- \CJKpunctmapfamily{C70}{tt}{m}{it}{zhfs}
- \CJKpunctmapfamily{C70}{tt}{b}{it}{zhfs}
- \CJKpunctmapfamily{C70}{tt}{bx}{it}{zhfs}
-\fi
-
-\newcommand*{\songti}{\CJKfamily{zhsong}} % 宋体
-\newcommand*{\heiti}{\CJKfamily{zhhei}} % 黑体
-\newcommand*{\kaishu}{\CJKfamily{zhkai}} % 楷书
-\newcommand*{\fangsong}{\CJKfamily{zhfs}} % 仿宋
-\newcommand*{\lishu}{\CJKfamily{zhli}} % 隶书
-\newcommand*{\youyuan}{\CJKfamily{zhyou}} % 幼圆
-
-\endinput
diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-adobe.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-adobe.def
new file mode 100644
index 00000000000..7184629e73e
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-adobe.def
@@ -0,0 +1,92 @@
+%%
+%% This is file `ctex-fontset-adobe.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `fontset,adobe')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {Adobe fonts definition (CTEX)}
+\ProvidesExplFile{ctex-fontset-adobe.def}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+\pdftex_if_engine:TF
+ {
+ \ctex_if_pdfmode:TF
+ { \ctex_fontset_error:n { adobe } }
+ {
+ \ctex_zhmap_case:nnn
+ {
+ \setCJKmainfont
+ [
+ cmap = UniGB-UTF16-H ,
+ BoldFont = AdobeHeitiStd-Regular.otf ,
+ ItalicFont = AdobeKaitiStd-Regular.otf
+ ] { AdobeSongStd-Light.otf }
+ \setCJKsansfont [ cmap = UniGB-UTF16-H ] { AdobeHeitiStd-Regular.otf }
+ \setCJKmonofont [ cmap = UniGB-UTF16-H ] { AdobeFangsongStd-Regular.otf }
+ \setCJKfamilyfont { zhsong }
+ [ cmap = UniGB-UTF16-H ] { AdobeSongStd-Light.otf }
+ \setCJKfamilyfont { zhhei }
+ [ cmap = UniGB-UTF16-H ] { AdobeHeitiStd-Regular.otf }
+ \setCJKfamilyfont { zhkai }
+ [ cmap = UniGB-UTF16-H ] { AdobeKaitiStd-Regular.otf }
+ \setCJKfamilyfont { zhfs }
+ [ cmap = UniGB-UTF16-H ] { AdobeFangsongStd-Regular.otf }
+ \ctex_punct_set:n { adobe }
+ \ctex_punct_map_family:nn { \CJKrmdefault } { zhsong }
+ \ctex_punct_map_family:nn { \CJKsfdefault } { zhhei }
+ \ctex_punct_map_family:nn { \CJKttdefault } { zhfs }
+ \ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai }
+ \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhhei }
+ }
+ {
+ \ctex_load_zhmap:nnnn { rm } { zhhei } { zhfs } { zhadobefonts }
+ \ctex_punct_set:n { adobe }
+ \ctex_punct_map_family:nn { \CJKrmdefault } { zhsong }
+ \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhhei }
+ \ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai }
+ }
+ { \ctex_fontset_error:n { adobe } }
+ }
+ }
+ {
+ \setCJKmainfont
+ [
+ BoldFont = AdobeHeitiStd-Regular ,
+ ItalicFont = AdobeKaitiStd-Regular
+ ] { AdobeSongStd-Light }
+ \setCJKsansfont { AdobeHeitiStd-Regular}
+ \setCJKmonofont { AdobeFangsongStd-Regular}
+ \setCJKfamilyfont { zhsong } { AdobeSongStd-Light }
+ \setCJKfamilyfont { zhhei } { AdobeHeitiStd-Regular }
+ \setCJKfamilyfont { zhfs } { AdobeFangsongStd-Regular }
+ \setCJKfamilyfont { zhkai } { AdobeKaitiStd-Regular }
+ }
+\NewDocumentCommand \songti { } { \CJKfamily { zhsong } }
+\NewDocumentCommand \heiti { } { \CJKfamily { zhhei } }
+\NewDocumentCommand \fangsong { } { \CJKfamily { zhfs } }
+\NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } }
+%%
+%%
+%% End of file `ctex-fontset-adobe.def'.
diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-fandol.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-fandol.def
new file mode 100644
index 00000000000..3b62e2a0065
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-fandol.def
@@ -0,0 +1,103 @@
+%%
+%% This is file `ctex-fontset-fandol.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `fontset,fandol')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {Fandol fonts definition (CTEX)}
+\ProvidesExplFile{ctex-fontset-fandol.def}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+\pdftex_if_engine:TF
+ {
+ \ctex_if_pdfmode:TF
+ { \ctex_fontset_error:n { fandol } }
+ {
+ \ctex_zhmap_case:nnn
+ {
+ \setCJKmainfont
+ [
+ cmap = UniGB-UTF16-H ,
+ BoldFont = FandolSong-Bold.otf ,
+ ItalicFont = FandolKai-Regular.otf
+ ] { FandolSong-Regular.otf }
+ \setCJKsansfont
+ [
+ cmap = UniGB-UTF16-H ,
+ BoldFont = FandolHei-Bold.otf
+ ] { FandolHei-Regular.otf }
+ \setCJKmonofont [ cmap = UniGB-UTF16-H ] { FandolFang-Regular.otf }
+ \setCJKfamilyfont { zhsong }
+ [
+ cmap = UniGB-UTF16-H ,
+ BoldFont = FandolSong-Bold.otf
+ ] { FandolSong-Regular.otf }
+ \setCJKfamilyfont { zhhei }
+ [
+ cmap = UniGB-UTF16-H ,
+ BoldFont = FandolHei-Bold.otf
+ ] { FandolHei-Regular.otf }
+ \setCJKfamilyfont { zhfs }
+ [ cmap = UniGB-UTF16-H ] { FandolFang-Regular.otf }
+ \setCJKfamilyfont { zhkai }
+ [ cmap = UniGB-UTF16-H ] { FandolKai-Regular.otf }
+ \ctex_punct_set:n { fandol }
+ \ctex_punct_map_family:nn { \CJKrmdefault } { zhsong }
+ \ctex_punct_map_family:nn { \CJKsfdefault } { zhhei }
+ \ctex_punct_map_family:nn { \CJKttdefault } { zhfs }
+ \ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai }
+ \ctex_punct_map_bfseries:nn { \CJKrmdefault , zhsong } { zhsongb }
+ \ctex_punct_map_bfseries:nn { \CJKsfdefault , zhhei } { zhheib }
+ }
+ {
+ \ctex_load_zhmap:nnnn { rm } { zhhei } { zhfs } { zhfandolfonts }
+ \ctex_punct_set:n { fandol }
+ \ctex_punct_map_family:nn { \CJKrmdefault } { zhsong }
+ \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhhei }
+ \ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai }
+ }
+ { \ctex_fontset_error:n { fandol } }
+ }
+ }
+ {
+ \setCJKmainfont
+ [ Extension = .otf , BoldFont = FandolSong-Bold , ItalicFont = FandolKai-Regular ]
+ { FandolSong-Regular }
+ \setCJKsansfont [ Extension = .otf , BoldFont = FandolHei-Bold ] { FandolHei-Regular }
+ \setCJKmonofont [ Extension = .otf ] { FandolFang-Regular }
+ \setCJKfamilyfont { zhsong }
+ [ Extension = .otf , BoldFont = FandolSong-Bold ] { FandolSong-Regular }
+ \setCJKfamilyfont { zhhei }
+ [ Extension = .otf , BoldFont = FandolHei-Bold ] { FandolHei-Regular }
+ \setCJKfamilyfont { zhfs } [ Extension = .otf ] { FandolFang-Regular }
+ \setCJKfamilyfont { zhkai } [ Extension = .otf ] { FandolKai-Regular }
+ }
+\NewDocumentCommand \songti { } { \CJKfamily { zhsong } }
+\NewDocumentCommand \heiti { } { \CJKfamily { zhhei } }
+\NewDocumentCommand \fangsong { } { \CJKfamily { zhfs } }
+\NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } }
+%%
+%%
+%% End of file `ctex-fontset-fandol.def'.
diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-founder.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-founder.def
new file mode 100644
index 00000000000..3070d245ad9
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-founder.def
@@ -0,0 +1,86 @@
+%%
+%% This is file `ctex-fontset-founder.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `fontset,founder')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {Founder fonts definition (CTEX)}
+\ProvidesExplFile{ctex-fontset-founder.def}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+\pdftex_if_engine:TF
+ {
+ \ctex_zhmap_case:nnn
+ {
+ \setCJKmainfont
+ [ BoldFont = FZXBSK.TTF , ItalicFont = FZKTK.TTF ] { FZSSK.TTF }
+ \setCJKsansfont [ BoldFont = FZHTK.TTF ] { FZXH1K.TTF }
+ \setCJKmonofont { FZFSK.TTF }
+ \setCJKfamilyfont { zhsong } [ BoldFont = FZXBSK.TTF ] { FZSSK.TTF }
+ \setCJKfamilyfont { zhhei } { FZHTK.TTF }
+ \setCJKfamilyfont { zhkai } { FZKTK.TTF }
+ \setCJKfamilyfont { zhfs } { FZFSK.TTF }
+ \setCJKfamilyfont { zhli } { FZLSK.TTF }
+ \setCJKfamilyfont { zhyou } [ BoldFont = FZY3K.TTF ] { FZY1K.TTF }
+ \ctex_punct_set:n { founder }
+ \ctex_punct_map_family:nn { \CJKrmdefault } { zhsong }
+ \ctex_punct_map_family:nn { \CJKsfdefault } { zhheil }
+ \ctex_punct_map_family:nn { \CJKttdefault } { zhfs }
+ \ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai }
+ \ctex_punct_map_bfseries:nn { \CJKrmdefault , zhsong } { zhsongb }
+ \ctex_punct_map_bfseries:nn { \CJKsfdefault } { zhhei }
+ \ctex_punct_map_bfseries:nn { zhyou } { zhyoub }
+ }
+ {
+ \ctex_load_zhmap:nnnn { rm } { zhhei } { zhfs } { zhfounderfonts }
+ \ctex_punct_set:n { founder }
+ \ctex_punct_map_family:nn { \CJKrmdefault } { zhsong }
+ \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhhei }
+ \ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai }
+ }
+ { \ctex_fontset_error:n { founder } }
+ }
+ {
+ \setCJKmainfont
+ [ BoldFont = FZXiaoBiaoSong-B05 , ItalicFont = FZKai-Z03 ] { FZShuSong-Z01 }
+ \setCJKsansfont [ BoldFont = FZHei-B01 ]
+ { \xetex_if_engine:TF { 方正细黑一_GBK } { FZXH1K--GBK1-0 } }
+ \setCJKmonofont { FZFangSong-Z02 }
+ \setCJKfamilyfont { zhsong } [ BoldFont = FZXiaoBiaoSong-B05 ] { FZShuSong-Z01 }
+ \setCJKfamilyfont { zhhei } { FZHei-B01 }
+ \setCJKfamilyfont { zhkai } { FZKai-Z03 }
+ \setCJKfamilyfont { zhfs } { FZFangSong-Z02 }
+ \setCJKfamilyfont { zhli } { FZLiShu-S01 }
+ \setCJKfamilyfont { zhyou } [ BoldFont = FZZhunYuan-M02 ] { FZXiYuan-M01 }
+ }
+\NewDocumentCommand \songti { } { \CJKfamily { zhsong } }
+\NewDocumentCommand \heiti { } { \CJKfamily { zhhei } }
+\NewDocumentCommand \fangsong { } { \CJKfamily { zhfs } }
+\NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } }
+\NewDocumentCommand \lishu { } { \CJKfamily { zhli } }
+\NewDocumentCommand \youyuan { } { \CJKfamily { zhyou } }
+%%
+%%
+%% End of file `ctex-fontset-founder.def'.
diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-mac.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-mac.def
new file mode 100644
index 00000000000..09ae5d7df74
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-mac.def
@@ -0,0 +1,50 @@
+%%
+%% This is file `ctex-fontset-mac.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `fontset,mac')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {Mac OS X fonts definition (CTEX)}
+\ProvidesExplFile{ctex-fontset-mac.def}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+\pdftex_if_engine:TF
+ { \ctex_fontset_error:n { mac } }
+ {
+ \setCJKmainfont [ BoldFont = STHeiti , ItalicFont = STKaiti ] { STSong }
+ \setCJKsansfont [ BoldFont = STHeiti ] { STXihei }
+ \setCJKmonofont { STFangsong }
+ \setCJKfamilyfont { zhsong } { STSong }
+ \setCJKfamilyfont { zhhei } { STHeiti }
+ \setCJKfamilyfont { zhfs } { STFangsong }
+ \setCJKfamilyfont { zhkai } { STKaiti }
+ }
+\NewDocumentCommand \songti { } { \CJKfamily { zhsong } }
+\NewDocumentCommand \heiti { } { \CJKfamily { zhhei } }
+\NewDocumentCommand \fangsong { } { \CJKfamily { zhfs } }
+\NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } }
+%%
+%%
+%% End of file `ctex-fontset-mac.def'.
diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-ubuntu.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-ubuntu.def
new file mode 100644
index 00000000000..f80f504e099
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-ubuntu.def
@@ -0,0 +1,73 @@
+%%
+%% This is file `ctex-fontset-ubuntu.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `fontset,ubuntu')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {Ubuntu fonts definition (CTEX)}
+\ProvidesExplFile{ctex-fontset-ubuntu.def}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+\pdftex_if_engine:TF
+ {
+ \ctex_zhmap_case:nnn
+ {
+ \setCJKmainfont
+ [ BoldFont = wqy-zenhei.ttc , ItalicFont = ukai.ttc ] { uming.ttc }
+ \setCJKsansfont { wqy-zenhei.ttc }
+ \setCJKmonofont { uming.ttc }
+ \setCJKfamilyfont { zhsong } { uming.ttc }
+ \setCJKfamilyfont { zhhei } { wqy-zenhei.ttc }
+ \setCJKfamilyfont { zhkai } { ukai.ttc }
+ \ctex_punct_set:n { ubuntu }
+ \ctex_punct_map_family:nn { \CJKrmdefault } { zhsong }
+ \ctex_punct_map_family:nn { \CJKsfdefault } { zhhei }
+ \ctex_punct_map_family:nn { \CJKttdefault } { zhsong }
+ \ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai }
+ \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhhei }
+ }
+ {
+ \ctex_load_zhmap:nnnn { rm } { zhhei } { zhsong } { zhubuntufonts }
+ \ctex_punct_set:n { ubuntu }
+ \ctex_punct_map_family:nn { \CJKrmdefault } { zhsong }
+ \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhhei }
+ \ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai }
+ }
+ { \ctex_fontset_error:n { ubuntu } }
+ }
+ {
+ \setCJKmainfont [ ItalicFont = AR~PL~UKai~CN ] { AR~PL~UMing~CN }
+ \setCJKsansfont { WenQuanYi~Zen~Hei }
+ \setCJKmonofont { AR~PL~UMing~CN }
+ \setCJKfamilyfont { zhsong } { AR~PL~UMing~CN }
+ \setCJKfamilyfont { zhhei } { WenQuanYi~Zen~Hei }
+ \setCJKfamilyfont { zhkai } { AR~PL~UKai~CN }
+ }
+\NewDocumentCommand \songti { } { \CJKfamily { zhsong } }
+\NewDocumentCommand \heiti { } { \CJKfamily { zhhei } }
+\NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } }
+%%
+%%
+%% End of file `ctex-fontset-ubuntu.def'.
diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windows.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windows.def
new file mode 100644
index 00000000000..f12d3900a08
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windows.def
@@ -0,0 +1,38 @@
+%%
+%% This is file `ctex-fontset-windows.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `fontset,windows')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {Windows fonts definition (CTEX)}
+\ProvidesExplFile{ctex-fontset-windows.def}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+\file_if_exist:nTF { C:/boot.ini }
+ { \ctex_file_input:n { ctex-fontset-windowsold.def } }
+ { \ctex_file_input:n { ctex-fontset-windowsnew.def } }
+%%
+%%
+%% End of file `ctex-fontset-windows.def'.
diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsnew.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsnew.def
new file mode 100644
index 00000000000..6bb86a25055
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsnew.def
@@ -0,0 +1,102 @@
+%%
+%% This is file `ctex-fontset-windowsnew.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `fontset,windowsnew')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {Windows fonts definition for Vista or later version (CTEX)}
+\ProvidesExplFile{ctex-fontset-windowsnew.def}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+\pdftex_if_engine:TF
+ {
+ \ctex_zhmap_case:nnn
+ {
+ \ctex_punct_set:n { windows }
+ \setCJKmainfont
+ [ BoldFont = simhei.ttf , ItalicFont = simkai.ttf ] { simsun.ttc }
+ \file_if_exist:nTF { C:/Windows/Fonts/msyh.ttc }
+ {
+ \setCJKsansfont [ BoldFont = msyhbd.ttc ] { msyh.ttc }
+ \setCJKfamilyfont { zhyahei }
+ [ BoldFont = msyhbd.ttc ] { msyh.ttc }
+ }
+ {
+ \setCJKsansfont [ BoldFont = msyhbd.ttf ] { msyh.ttf }
+ \setCJKfamilyfont { zhyahei }
+ [ BoldFont = msyhbd.ttf ] { msyh.ttf }
+ }
+ \ctex_punct_map_family:nn { \CJKsfdefault } { zhyahei }
+ \ctex_punct_map_bfseries:nn { \CJKsfdefault , zhyahei } { zhyaheib }
+ \setCJKmonofont { simfang.ttf }
+ \setCJKfamilyfont { zhkai } { simkai.ttf }
+ \setCJKfamilyfont { zhfs } { simfang.ttf }
+ \setCJKfamilyfont { zhsong } { simsun.ttc }
+ \setCJKfamilyfont { zhhei } { simhei.ttf }
+ \setCJKfamilyfont { zhli } { simli.ttf }
+ \setCJKfamilyfont { zhyou } { simyou.ttf }
+ \ctex_punct_map_family:nn { \CJKrmdefault } { zhsong }
+ \ctex_punct_map_family:nn { \CJKttdefault } { zhfs }
+ \ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai }
+ \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhhei }
+ }
+ {
+ \ctex_load_zhmap:nnnn { rm } { zhhei } { zhfs } { zhwindowsfonts }
+ \ctex_punct_set:n { windows }
+ \ctex_punct_map_family:nn { \CJKrmdefault } { zhsong }
+ \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhhei }
+ \ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai }
+ }
+ {
+ \tl_set:Nn \CJKrmdefault { rm }
+ \tl_set:Nn \CJKsfdefault { sf }
+ \tl_set:Nn \CJKttdefault { tt }
+ }
+ }
+ {
+ \setCJKmainfont
+ [ BoldFont = SimHei , ItalicFont = KaiTi ] { SimSun }
+ \setCJKsansfont
+ [ BoldFont = { *~Bold } ] { Microsoft~YaHei }
+ \setCJKmonofont { FangSong }
+ \setCJKfamilyfont { zhkai } { KaiTi }
+ \setCJKfamilyfont { zhfs } { FangSong }
+ \setCJKfamilyfont { zhsong } { SimSun }
+ \setCJKfamilyfont { zhhei } { SimHei }
+ \setCJKfamilyfont { zhli } { LiSu }
+ \setCJKfamilyfont { zhyou } { YouYuan }
+ \setCJKfamilyfont { zhyahei }
+ [ BoldFont = { *~Bold } ] { Microsoft~YaHei }
+ }
+\NewDocumentCommand \songti { } { \CJKfamily { zhsong } }
+\NewDocumentCommand \heiti { } { \CJKfamily { zhhei } }
+\NewDocumentCommand \fangsong { } { \CJKfamily { zhfs } }
+\NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } }
+\NewDocumentCommand \lishu { } { \CJKfamily { zhli } }
+\NewDocumentCommand \youyuan { } { \CJKfamily { zhyou } }
+\NewDocumentCommand \yahei { } { \CJKfamily { zhyahei } }
+%%
+%%
+%% End of file `ctex-fontset-windowsnew.def'.
diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsold.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsold.def
new file mode 100644
index 00000000000..f54ba84976a
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsold.def
@@ -0,0 +1,87 @@
+%%
+%% This is file `ctex-fontset-windowsold.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `fontset,windowsold')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {Windows fonts definition for XP or earlier version (CTEX)}
+\ProvidesExplFile{ctex-fontset-windowsold.def}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+\pdftex_if_engine:TF
+ {
+ \ctex_zhmap_case:nnn
+ {
+ \ctex_punct_set:n { windows }
+ \setCJKmainfont
+ [ BoldFont = simhei.ttf , ItalicFont = simkai.ttf ] { simsun.ttc }
+ \setCJKsansfont { simhei.ttf }
+ \ctex_punct_map_family:nn { \CJKsfdefault } { zhhei }
+ \setCJKmonofont { simfang.ttf }
+ \setCJKfamilyfont { zhkai } { simkai.ttf }
+ \setCJKfamilyfont { zhfs } { simfang.ttf }
+ \setCJKfamilyfont { zhsong } { simsun.ttc }
+ \setCJKfamilyfont { zhhei } { simhei.ttf }
+ \setCJKfamilyfont { zhli } { simli.ttf }
+ \setCJKfamilyfont { zhyou } { simyou.ttf }
+ \ctex_punct_map_family:nn { \CJKrmdefault } { zhsong }
+ \ctex_punct_map_family:nn { \CJKttdefault } { zhfs }
+ \ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai }
+ \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhhei }
+ }
+ {
+ \ctex_load_zhmap:nnnn { rm } { zhhei } { zhfs } { zhwindowsfonts }
+ \ctex_punct_set:n { windows }
+ \ctex_punct_map_family:nn { \CJKrmdefault } { zhsong }
+ \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhhei }
+ \ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai }
+ }
+ {
+ \tl_set:Nn \CJKrmdefault { rm }
+ \tl_set:Nn \CJKsfdefault { sf }
+ \tl_set:Nn \CJKttdefault { tt }
+ }
+ }
+ {
+ \setCJKmainfont
+ [ BoldFont = SimHei , ItalicFont = KaiTi_GB2312 ] { SimSun }
+ \setCJKsansfont { SimHei }
+ \setCJKmonofont { FangSong_GB2312 }
+ \setCJKfamilyfont { zhkai } { KaiTi_GB2312 }
+ \setCJKfamilyfont { zhfs } { FangSong_GB2312 }
+ \setCJKfamilyfont { zhsong } { SimSun }
+ \setCJKfamilyfont { zhhei } { SimHei }
+ \setCJKfamilyfont { zhli } { LiSu }
+ \setCJKfamilyfont { zhyou } { YouYuan }
+ }
+\NewDocumentCommand \songti { } { \CJKfamily { zhsong } }
+\NewDocumentCommand \heiti { } { \CJKfamily { zhhei } }
+\NewDocumentCommand \fangsong { } { \CJKfamily { zhfs } }
+\NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } }
+\NewDocumentCommand \lishu { } { \CJKfamily { zhli } }
+\NewDocumentCommand \youyuan { } { \CJKfamily { zhyou } }
+%%
+%%
+%% End of file `ctex-fontset-windowsold.def'.
diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-xecjk-adobefonts.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-xecjk-adobefonts.def
deleted file mode 100644
index bb2a03bed92..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-xecjk-adobefonts.def
+++ /dev/null
@@ -1,21 +0,0 @@
-% ctex-xecjk-adobefonts.def: Adobe 的 xeCJK 字体设置,为 Adobe 的四套字体
-% vim:ft=tex
-
-\setCJKmainfont[BoldFont=Adobe Heiti Std,ItalicFont=Adobe Kaiti Std]
- {Adobe Song Std}
-\setCJKsansfont{Adobe Heiti Std}
-\setCJKmonofont{Adobe Fangsong Std}
-
-\setCJKfamilyfont{zhsong}{Adobe Song Std}
-\setCJKfamilyfont{zhhei}{Adobe Heiti Std}
-\setCJKfamilyfont{zhfs}{Adobe Fangsong Std}
-\setCJKfamilyfont{zhkai}{Adobe Kaiti Std}
-
-\newcommand*{\songti}{\CJKfamily{zhsong}} % 宋体
-\newcommand*{\heiti}{\CJKfamily{zhhei}} % 黑体
-\newcommand*{\kaishu}{\CJKfamily{zhkai}} % 楷书
-\newcommand*{\fangsong}{\CJKfamily{zhfs}} % 仿宋
-\newcommand*{\lishu}{\CJKfamily{zhli}} % 隶书
-\newcommand*{\youyuan}{\CJKfamily{zhyou}} % 幼圆
-
-\endinput
diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-xecjk-winfonts.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-xecjk-winfonts.def
deleted file mode 100644
index a4eaeed7621..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-xecjk-winfonts.def
+++ /dev/null
@@ -1,23 +0,0 @@
-% ctex-xecjk-winfonts.def: Windows 的 xeCJK 字体设置,默认为六种中易字体
-% vim:ft=tex
-
-\setCJKmainfont[BoldFont={SimHei},ItalicFont={[SIMKAI.TTF]}]
- {SimSun}
-\setCJKsansfont{SimHei}
-\setCJKmonofont{[SIMFANG.TTF]}
-
-\setCJKfamilyfont{zhsong}{SimSun}
-\setCJKfamilyfont{zhhei}{SimHei}
-\setCJKfamilyfont{zhkai}{[SIMKAI.TTF]}
-\setCJKfamilyfont{zhfs}{[SIMFANG.TTF]}
-% \setCJKfamilyfont{zhli}{LiSu}
-% \setCJKfamilyfont{zhyou}{YouYuan}
-
-\newcommand*{\songti}{\CJKfamily{zhsong}} % 宋体
-\newcommand*{\heiti}{\CJKfamily{zhhei}} % 黑体
-\newcommand*{\kaishu}{\CJKfamily{zhkai}} % 楷书
-\newcommand*{\fangsong}{\CJKfamily{zhfs}} % 仿宋
-% \newcommand*{\lishu}{\CJKfamily{zhli}} % 隶书
-% \newcommand*{\youyuan}{\CJKfamily{zhyou}} % 幼圆
-
-\endinput
diff --git a/Master/texmf-dist/tex/latex/ctex/opt/ctex-caption-opts.def b/Master/texmf-dist/tex/latex/ctex/opt/ctex-caption-opts.def
deleted file mode 100644
index 4f91d9ac8b7..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/opt/ctex-caption-opts.def
+++ /dev/null
@@ -1,11 +0,0 @@
-% ctex-caption.opt: options just for ctexcap.sty and document classes
-% vim:ft=tex
-
-% section depths
-
-\newcounter{CTEX@sectiondepth}
-\setcounter{CTEX@sectiondepth}{2}
-\DeclareOption{sub3section}{\setcounter{CTEX@sectiondepth}{3}}
-\DeclareOption{sub4section}{\setcounter{CTEX@sectiondepth}{4}}
-
-\endinput
diff --git a/Master/texmf-dist/tex/latex/ctex/opt/ctex-class-opts.def b/Master/texmf-dist/tex/latex/ctex/opt/ctex-class-opts.def
deleted file mode 100644
index 7e43247b92e..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/opt/ctex-class-opts.def
+++ /dev/null
@@ -1,26 +0,0 @@
-% ctex-class.opt: options for ctex class files
-% vim:ft=tex
-
-% font size
-
-\newif\ifCTEX@sfoursize \CTEX@sfoursizefalse
-\DeclareOption{cs4size}{\CTEX@sfoursizetrue\CTEX@fivesizefalse}
-\newif\ifCTEX@fivesize \CTEX@fivesizetrue
-\DeclareOption{c5size}{\CTEX@fivesizetrue\CTEX@sfoursizefalse}
-
-\DeclareOption{10pt}{%
- \CTEX@sfoursizefalse\CTEX@fivesizefalse%
- \PassOptionsToClass{\CurrentOption}%
- {\CTEX@classtoload}}
-\DeclareOption{11pt}{%
- \CTEX@sfoursizefalse\CTEX@fivesizefalse%
- \PassOptionsToClass{\CurrentOption}%
- {\CTEX@classtoload}}
-\DeclareOption{12pt}{%
- \CTEX@sfoursizefalse\CTEX@fivesizefalse%
- \PassOptionsToClass{\CurrentOption}%
- {\CTEX@classtoload}}
-\DeclareOption*{\PassOptionsToClass{\CurrentOption}%
- {\CTEX@classtoload}}
-
-\endinput
diff --git a/Master/texmf-dist/tex/latex/ctex/opt/ctex-common-opts.def b/Master/texmf-dist/tex/latex/ctex/opt/ctex-common-opts.def
deleted file mode 100644
index 612935da8b6..00000000000
--- a/Master/texmf-dist/tex/latex/ctex/opt/ctex-common-opts.def
+++ /dev/null
@@ -1,58 +0,0 @@
-% ctex-common.opt: options for all ctex packages/classes
-% vim:ft=tex
-
-% encoding
-\newif\ifCTEX@GBK \CTEX@GBKtrue
-\DeclareOption{GBK}{\CTEX@GBKtrue}
-\DeclareOption{UTF8}{\CTEX@GBKfalse}
-
-% fonts
-\newif\ifCTEX@nofonts \CTEX@nofontsfalse
-\newif\ifCTEX@winfonts \CTEX@winfontstrue
-\newif\ifCTEX@adobefonts \CTEX@adobefontsfalse
-\DeclareOption{nofonts}{\CTEX@nofontstrue
- \CTEX@winfontsfalse
- \CTEX@adobefontsfalse}
-\DeclareOption{winfonts}{\CTEX@winfontstrue
- \CTEX@nofontsfalse
- \CTEX@adobefontsfalse}
-\DeclareOption{adobefonts}{\CTEX@adobefontstrue
- \CTEX@nofontsfalse
- \CTEX@winfontsfalse}
-
-\newif\ifCTEX@zhmap \CTEX@zhmaptrue
-\DeclareOption{zhmap}{\CTEX@zhmaptrue}
-\DeclareOption{nozhmap}{\CTEX@zhmapfalse}
-
-\newif\ifCTEX@cct \CTEX@cctfalse
-\DeclareOption{CCT}{\CTEX@ccttrue}
-
-\newif\ifCTEX@cctfont \CTEX@cctfontfalse
-\DeclareOption{CCTfont}{\CTEX@ccttrue\CTEX@cctfonttrue}
-
-\newif\ifCTEX@punct \CTEX@puncttrue
-\DeclareOption{punct}{\CTEX@puncttrue}
-\DeclareOption{nopunct}{\CTEX@punctfalse}
-
-\newif\ifCTEX@space \CTEX@spacefalse
-\DeclareOption{space}{\CTEX@spacetrue}
-\DeclareOption{nospace}{\CTEX@spacefalse}
-
-\newif\ifCTEX@caption \CTEX@captiontrue
-\DeclareOption{nocap}{\CTEX@captionfalse}
-\DeclareOption{cap}{\CTEX@captiontrue}
-
-\newif\ifCTEX@indent \CTEX@indenttrue
-\DeclareOption{noindent}{\CTEX@indentfalse}
-\DeclareOption{indent}{\CTEX@indenttrue}
-
-\newif\ifCTEX@fancyhdr \CTEX@fancyhdrfalse
-\DeclareOption{fancyhdr}{\CTEX@fancyhdrtrue}
-
-\newif\ifCTEX@fntef \CTEX@fnteffalse
-\DeclareOption{fntef}{\CTEX@fnteftrue}
-
-\newif\ifCTEX@hyperref \CTEX@hyperreffalse
-\DeclareOption{hyperref}{\CTEX@hyperreftrue}
-
-\endinput
diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-article.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-article.def
new file mode 100644
index 00000000000..092ed5c4309
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-article.def
@@ -0,0 +1,130 @@
+%%
+%% This is file `ctex-scheme-chinese-article.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `scheme,article,chinese')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {Chinese scheme for article (CTEX)}
+\ProvidesExplFile{ctex-scheme-chinese-article.def}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+\keys_set:nn { ctex / part }
+ {
+ nameformat = \Large \bfseries ,
+ afterskip = 3ex ,
+ number = \chinese { part } ,
+ format = \centering ,
+ aftername = \quad ,
+ titleformat = \Large \bfseries ,
+ beforeskip = 4ex
+ }
+\keys_set:nn { ctex / section }
+ {
+ number = \thesection ,
+ aftername = \quad ,
+ afterskip = 2.3ex \@plus .2ex ,
+ format = \Large \bfseries \centering ,
+ beforeskip = 3.5ex \@plus 1ex \@minus .2ex
+ }
+\keys_set:nn { ctex / subsection }
+ {
+ number = \thesubsection ,
+ format = \large \bfseries ,
+ aftername = \quad ,
+ afterskip = 1.5ex \@plus .2ex ,
+ beforeskip = 3.25ex \@plus 1ex \@minus .2ex
+ }
+\keys_set:nn { ctex / subsubsection }
+ {
+ number = \thesubsubsection ,
+ format = \normalsize \bfseries ,
+ aftername = \quad ,
+ afterskip = 1.5ex \@plus .2ex ,
+ beforeskip = 3.25ex \@plus 1ex \@minus .2ex
+ }
+\keys_set:nn { ctex / paragraph }
+ {
+ number = \theparagraph ,
+ format = \normalsize \bfseries ,
+ aftername = \quad
+ }
+\keys_set:nn { ctex / subparagraph }
+ {
+ number = \thesubparagraph ,
+ format = \normalsize \bfseries ,
+ aftername = \quad
+ }
+\int_compare:nNnTF \g__ctex_section_depth_flag > \c_two
+ {
+ \keys_set:nn { ctex / paragraph }
+ {
+ beforeskip = 3.25ex \@plus 1ex \@minus .2ex ,
+ afterskip = 1ex \@plus .2ex
+ }
+ }
+ {
+ \keys_set:nn { ctex / paragraph }
+ {
+ beforeskip = 3.25ex \@plus 1ex \@minus .2ex ,
+ afterskip = -1em
+ }
+ }
+\int_compare:nNnTF \g__ctex_section_depth_flag > \c_three
+ {
+ \keys_set:nn { ctex / subparagraph }
+ {
+ beforeskip = 3.25ex \@plus 1ex \@minus .2ex ,
+ afterskip = 1ex \@plus .2ex
+ }
+ }
+ {
+ \keys_set:nn { ctex / subparagraph }
+ {
+ beforeskip = 3.25ex \@plus 1ex \@minus .2ex ,
+ afterskip = -1em
+ }
+ }
+\int_compare:nNnTF \g__ctex_section_depth_flag > \c_two
+ { \keys_set:nn { ctex / subparagraph } { indent = \c_zero_dim } }
+ { \keys_set:nn { ctex / subparagraph } { indent = \parindent } }
+\keys_set:nn { ctex / appendix }
+ { number = \@Alph \c@section }
+\pagestyle { headings }
+\str_if_eq:onTF { \l__ctex_encoding_tl } { GBK }
+ { \ctex_file_input:n { ctex-name-gbk.cfg } }
+ { \ctex_file_input:n { ctex-name-utf8.cfg } }
+\keys_set:nn { ctex } { today = small }
+\int_compare:nNnF \g__ctex_font_size_flag > \c_minus_one
+ { \cs_gset_eq:NN \g__ctex_font_size_flag \c_zero }
+\fp_compare:nNnT { \l__ctex_line_spread_fp } ? { \c_zero_fp }
+ { \keys_set:nn { ctex / option } { linespread = 1.3 } }
+\ctex_if_autoindent_touched:F
+ { \keys_set:nn { ctex } { autoindent = true } }
+\ctex_patch_cmd:Nnn \verse { -1.5em } { -2 \ccwd }
+\ctex_patch_cmd:Nnn \verse { 1.5em } { 2 \ccwd }
+\ctex_patch_cmd:Nnn \quotation { 1.5em } { 2 \ccwd }
+%%
+%%
+%% End of file `ctex-scheme-chinese-article.def'.
diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-book.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-book.def
new file mode 100644
index 00000000000..b0211ba9d30
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-book.def
@@ -0,0 +1,142 @@
+%%
+%% This is file `ctex-scheme-chinese-book.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `scheme,book,chinese')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {Chinese scheme for book (CTEX)}
+\ProvidesExplFile{ctex-scheme-chinese-book.def}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+\keys_set:nn { ctex / part }
+ {
+ format = \centering ,
+ nameformat = \huge \bfseries ,
+ aftername = \par \vskip 20 \p@ ,
+ pagestyle = plain ,
+ titleformat = \huge \bfseries
+ }
+\keys_set:nn { ctex / chapter }
+ {
+ pagestyle = plain ,
+ nameformat = \huge \bfseries ,
+ afterskip = 40 \p@ ,
+ number = \chinese { chapter } ,
+ format = \centering ,
+ aftername = \quad ,
+ titleformat = \huge \bfseries ,
+ beforeskip = 50 \p@
+ }
+\keys_set:nn { ctex / section }
+ {
+ number = \thesection ,
+ aftername = \quad ,
+ afterskip = 2.3ex \@plus .2ex ,
+ format = \Large \bfseries \centering ,
+ beforeskip = 3.5ex \@plus 1ex \@minus .2ex
+ }
+\keys_set:nn { ctex / subsection }
+ {
+ number = \thesubsection ,
+ format = \large \bfseries ,
+ aftername = \quad ,
+ afterskip = 1.5ex \@plus .2ex ,
+ beforeskip = 3.25ex \@plus 1ex \@minus .2ex
+ }
+\keys_set:nn { ctex / subsubsection }
+ {
+ number = \thesubsubsection ,
+ format = \normalsize \bfseries ,
+ aftername = \quad ,
+ afterskip = 1.5ex \@plus .2ex ,
+ beforeskip = 3.25ex \@plus 1ex \@minus .2ex
+ }
+\keys_set:nn { ctex / paragraph }
+ {
+ number = \theparagraph ,
+ format = \normalsize \bfseries ,
+ aftername = \quad
+ }
+\keys_set:nn { ctex / subparagraph }
+ {
+ number = \thesubparagraph ,
+ format = \normalsize \bfseries ,
+ aftername = \quad
+ }
+\int_compare:nNnTF \g__ctex_section_depth_flag > \c_two
+ {
+ \keys_set:nn { ctex / paragraph }
+ {
+ beforeskip = 3.25ex \@plus 1ex \@minus .2ex ,
+ afterskip = 1ex \@plus .2ex
+ }
+ }
+ {
+ \keys_set:nn { ctex / paragraph }
+ {
+ beforeskip = 3.25ex \@plus 1ex \@minus .2ex ,
+ afterskip = -1em
+ }
+ }
+\int_compare:nNnTF \g__ctex_section_depth_flag > \c_three
+ {
+ \keys_set:nn { ctex / subparagraph }
+ {
+ beforeskip = 3.25ex \@plus 1ex \@minus .2ex ,
+ afterskip = 1ex \@plus .2ex
+ }
+ }
+ {
+ \keys_set:nn { ctex / subparagraph }
+ {
+ beforeskip = 3.25ex \@plus 1ex \@minus .2ex ,
+ afterskip = -1em
+ }
+ }
+\int_compare:nNnTF \g__ctex_section_depth_flag > \c_two
+ { \keys_set:nn { ctex / subparagraph } { indent = \c_zero_dim } }
+ { \keys_set:nn { ctex / subparagraph } { indent = \parindent } }
+\keys_set:nn { ctex / appendix }
+ {
+ name = \appendixname \space ,
+ number = \@Alph \c@chapter
+ }
+\pagestyle { headings }
+\str_if_eq:onTF { \l__ctex_encoding_tl } { GBK }
+ { \ctex_file_input:n { ctex-name-gbk.cfg } }
+ { \ctex_file_input:n { ctex-name-utf8.cfg } }
+\keys_set:nn { ctex } { today = small }
+\int_compare:nNnF \g__ctex_font_size_flag > \c_minus_one
+ { \cs_gset_eq:NN \g__ctex_font_size_flag \c_zero }
+\fp_compare:nNnT { \l__ctex_line_spread_fp } ? { \c_zero_fp }
+ { \keys_set:nn { ctex / option } { linespread = 1.3 } }
+\ctex_if_autoindent_touched:F
+ { \keys_set:nn { ctex } { autoindent = true } }
+\ctex_patch_cmd:Nnn \verse { -1.5em } { -2 \ccwd }
+\ctex_patch_cmd:Nnn \verse { 1.5em } { 2 \ccwd }
+\ctex_patch_cmd:Nnn \quotation { 1.5em } { 2 \ccwd }
+%%
+%%
+%% End of file `ctex-scheme-chinese-book.def'.
diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-report.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-report.def
new file mode 100644
index 00000000000..72f907df5d3
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-report.def
@@ -0,0 +1,142 @@
+%%
+%% This is file `ctex-scheme-chinese-report.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `scheme,report,chinese')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {Chinese scheme for report (CTEX)}
+\ProvidesExplFile{ctex-scheme-chinese-report.def}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+\keys_set:nn { ctex / part }
+ {
+ format = \centering ,
+ nameformat = \huge \bfseries ,
+ aftername = \par \vskip 20 \p@ ,
+ pagestyle = plain ,
+ titleformat = \huge \bfseries
+ }
+\keys_set:nn { ctex / chapter }
+ {
+ pagestyle = plain ,
+ nameformat = \huge \bfseries ,
+ afterskip = 40 \p@ ,
+ number = \chinese { chapter } ,
+ format = \centering ,
+ aftername = \quad ,
+ titleformat = \huge \bfseries ,
+ beforeskip = 50 \p@
+ }
+\keys_set:nn { ctex / section }
+ {
+ number = \thesection ,
+ aftername = \quad ,
+ afterskip = 2.3ex \@plus .2ex ,
+ format = \Large \bfseries \centering ,
+ beforeskip = 3.5ex \@plus 1ex \@minus .2ex
+ }
+\keys_set:nn { ctex / subsection }
+ {
+ number = \thesubsection ,
+ format = \large \bfseries ,
+ aftername = \quad ,
+ afterskip = 1.5ex \@plus .2ex ,
+ beforeskip = 3.25ex \@plus 1ex \@minus .2ex
+ }
+\keys_set:nn { ctex / subsubsection }
+ {
+ number = \thesubsubsection ,
+ format = \normalsize \bfseries ,
+ aftername = \quad ,
+ afterskip = 1.5ex \@plus .2ex ,
+ beforeskip = 3.25ex \@plus 1ex \@minus .2ex
+ }
+\keys_set:nn { ctex / paragraph }
+ {
+ number = \theparagraph ,
+ format = \normalsize \bfseries ,
+ aftername = \quad
+ }
+\keys_set:nn { ctex / subparagraph }
+ {
+ number = \thesubparagraph ,
+ format = \normalsize \bfseries ,
+ aftername = \quad
+ }
+\int_compare:nNnTF \g__ctex_section_depth_flag > \c_two
+ {
+ \keys_set:nn { ctex / paragraph }
+ {
+ beforeskip = 3.25ex \@plus 1ex \@minus .2ex ,
+ afterskip = 1ex \@plus .2ex
+ }
+ }
+ {
+ \keys_set:nn { ctex / paragraph }
+ {
+ beforeskip = 3.25ex \@plus 1ex \@minus .2ex ,
+ afterskip = -1em
+ }
+ }
+\int_compare:nNnTF \g__ctex_section_depth_flag > \c_three
+ {
+ \keys_set:nn { ctex / subparagraph }
+ {
+ beforeskip = 3.25ex \@plus 1ex \@minus .2ex ,
+ afterskip = 1ex \@plus .2ex
+ }
+ }
+ {
+ \keys_set:nn { ctex / subparagraph }
+ {
+ beforeskip = 3.25ex \@plus 1ex \@minus .2ex ,
+ afterskip = -1em
+ }
+ }
+\int_compare:nNnTF \g__ctex_section_depth_flag > \c_two
+ { \keys_set:nn { ctex / subparagraph } { indent = \c_zero_dim } }
+ { \keys_set:nn { ctex / subparagraph } { indent = \parindent } }
+\keys_set:nn { ctex / appendix }
+ {
+ name = \appendixname \space ,
+ number = \@Alph \c@chapter
+ }
+\pagestyle { headings }
+\str_if_eq:onTF { \l__ctex_encoding_tl } { GBK }
+ { \ctex_file_input:n { ctex-name-gbk.cfg } }
+ { \ctex_file_input:n { ctex-name-utf8.cfg } }
+\keys_set:nn { ctex } { today = small }
+\int_compare:nNnF \g__ctex_font_size_flag > \c_minus_one
+ { \cs_gset_eq:NN \g__ctex_font_size_flag \c_zero }
+\fp_compare:nNnT { \l__ctex_line_spread_fp } ? { \c_zero_fp }
+ { \keys_set:nn { ctex / option } { linespread = 1.3 } }
+\ctex_if_autoindent_touched:F
+ { \keys_set:nn { ctex } { autoindent = true } }
+\ctex_patch_cmd:Nnn \verse { -1.5em } { -2 \ccwd }
+\ctex_patch_cmd:Nnn \verse { 1.5em } { 2 \ccwd }
+\ctex_patch_cmd:Nnn \quotation { 1.5em } { 2 \ccwd }
+%%
+%%
+%% End of file `ctex-scheme-chinese-report.def'.
diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese.def
new file mode 100644
index 00000000000..5ca50f679bf
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese.def
@@ -0,0 +1,45 @@
+%%
+%% This is file `ctex-scheme-chinese.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `scheme,generic,chinese')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {Chinese scheme for generic (CTEX)}
+\ProvidesExplFile{ctex-scheme-chinese.def}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+\str_if_eq:onTF { \l__ctex_encoding_tl } { GBK }
+ { \ctex_file_input:n { ctex-name-gbk.cfg } }
+ { \ctex_file_input:n { ctex-name-utf8.cfg } }
+\keys_set:nn { ctex } { today = small }
+\int_compare:nNnF \g__ctex_font_size_flag > \c_minus_one
+ { \cs_gset_eq:NN \g__ctex_font_size_flag \c_zero }
+\fp_compare:nNnT { \l__ctex_line_spread_fp } ? { \c_zero_fp }
+ { \keys_set:nn { ctex / option } { linespread = 1.3 } }
+\ctex_if_autoindent_touched:F
+ { \keys_set:nn { ctex } { autoindent = true } }
+%%
+%%
+%% End of file `ctex-scheme-chinese.def'.
diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-article.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-article.def
new file mode 100644
index 00000000000..6667827ce7f
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-article.def
@@ -0,0 +1,117 @@
+%%
+%% This is file `ctex-scheme-plain-article.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `scheme,article,plain')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {Plain scheme for article (CTEX)}
+\ProvidesExplFile{ctex-scheme-plain-article.def}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+\keys_set:nn { ctex / part }
+ {
+ name = \partname \space ,
+ number = \thepart ,
+ nameformat = \Large \bfseries ,
+ afterskip = 3ex ,
+ format = \raggedright ,
+ aftername = \par \nobreak ,
+ titleformat = \huge \bfseries ,
+ beforeskip = -4ex
+ }
+\keys_set:nn { ctex / section }
+ {
+ number = \thesection ,
+ aftername = \quad ,
+ afterskip = 2.3ex \@plus .2ex ,
+ format = \Large \bfseries ,
+ beforeskip = -3.5ex \@plus -1ex \@minus -.2ex
+ }
+\keys_set:nn { ctex / subsection }
+ {
+ number = \thesubsection ,
+ format = \large \bfseries ,
+ aftername = \quad ,
+ afterskip = 1.5ex \@plus .2ex ,
+ beforeskip = -3.25ex \@plus -1ex \@minus -.2ex
+ }
+\keys_set:nn { ctex / subsubsection }
+ {
+ number = \thesubsubsection ,
+ format = \normalsize \bfseries ,
+ aftername = \quad ,
+ afterskip = 1.5ex \@plus .2ex ,
+ beforeskip = -3.25ex \@plus -1ex \@minus -.2ex
+ }
+\keys_set:nn { ctex / paragraph }
+ {
+ number = \theparagraph ,
+ format = \normalsize \bfseries ,
+ aftername = \quad
+ }
+\keys_set:nn { ctex / subparagraph }
+ {
+ number = \thesubparagraph ,
+ format = \normalsize \bfseries ,
+ aftername = \quad
+ }
+\int_compare:nNnTF \g__ctex_section_depth_flag > \c_two
+ {
+ \keys_set:nn { ctex / paragraph }
+ {
+ beforeskip = -3.25ex \@plus -1ex \@minus -.2ex ,
+ afterskip = 1ex \@plus .2ex
+ }
+ }
+ {
+ \keys_set:nn { ctex / paragraph }
+ {
+ beforeskip = 3.25ex \@plus 1ex \@minus .2ex ,
+ afterskip = -1em
+ }
+ }
+\int_compare:nNnTF \g__ctex_section_depth_flag > \c_three
+ {
+ \keys_set:nn { ctex / subparagraph }
+ {
+ beforeskip = -3.25ex \@plus -1ex \@minus -.2ex ,
+ afterskip = 1ex \@plus .2ex
+ }
+ }
+ {
+ \keys_set:nn { ctex / subparagraph }
+ {
+ beforeskip = 3.25ex \@plus 1ex \@minus .2ex ,
+ afterskip = -1em
+ }
+ }
+\int_compare:nNnTF \g__ctex_section_depth_flag > \c_two
+ { \keys_set:nn { ctex / subparagraph } { indent = \c_zero_dim } }
+ { \keys_set:nn { ctex / subparagraph } { indent = \parindent } }
+\keys_set:nn { ctex / appendix }
+ { number = \@Alph \c@section }
+%%
+%%
+%% End of file `ctex-scheme-plain-article.def'.
diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-book.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-book.def
new file mode 100644
index 00000000000..d93c10ca586
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-book.def
@@ -0,0 +1,131 @@
+%%
+%% This is file `ctex-scheme-plain-book.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `scheme,book,plain')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {Plain scheme for book (CTEX)}
+\ProvidesExplFile{ctex-scheme-plain-book.def}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+\keys_set:nn { ctex / part }
+ {
+ name = \partname \space ,
+ number = \thepart ,
+ format = \centering ,
+ nameformat = \huge \bfseries ,
+ aftername = \par \vskip 20 \p@ ,
+ pagestyle = plain ,
+ titleformat = \Huge \bfseries
+ }
+\keys_set:nn { ctex / chapter }
+ {
+ pagestyle = plain ,
+ nameformat = \huge \bfseries ,
+ afterskip = 40 \p@ ,
+ name = \chaptername \space ,
+ number = \thechapter ,
+ format = \raggedright ,
+ aftername = \par \nobreak \vskip 20 \p@ ,
+ titleformat = \Huge \bfseries ,
+ beforeskip = -50 \p@
+ }
+\keys_set:nn { ctex / section }
+ {
+ number = \thesection ,
+ aftername = \quad ,
+ afterskip = 2.3ex \@plus .2ex ,
+ format = \Large \bfseries ,
+ beforeskip = -3.5ex \@plus -1ex \@minus -.2ex
+ }
+\keys_set:nn { ctex / subsection }
+ {
+ number = \thesubsection ,
+ format = \large \bfseries ,
+ aftername = \quad ,
+ afterskip = 1.5ex \@plus .2ex ,
+ beforeskip = -3.25ex \@plus -1ex \@minus -.2ex
+ }
+\keys_set:nn { ctex / subsubsection }
+ {
+ number = \thesubsubsection ,
+ format = \normalsize \bfseries ,
+ aftername = \quad ,
+ afterskip = 1.5ex \@plus .2ex ,
+ beforeskip = -3.25ex \@plus -1ex \@minus -.2ex
+ }
+\keys_set:nn { ctex / paragraph }
+ {
+ number = \theparagraph ,
+ format = \normalsize \bfseries ,
+ aftername = \quad
+ }
+\keys_set:nn { ctex / subparagraph }
+ {
+ number = \thesubparagraph ,
+ format = \normalsize \bfseries ,
+ aftername = \quad
+ }
+\int_compare:nNnTF \g__ctex_section_depth_flag > \c_two
+ {
+ \keys_set:nn { ctex / paragraph }
+ {
+ beforeskip = -3.25ex \@plus -1ex \@minus -.2ex ,
+ afterskip = 1ex \@plus .2ex
+ }
+ }
+ {
+ \keys_set:nn { ctex / paragraph }
+ {
+ beforeskip = 3.25ex \@plus 1ex \@minus .2ex ,
+ afterskip = -1em
+ }
+ }
+\int_compare:nNnTF \g__ctex_section_depth_flag > \c_three
+ {
+ \keys_set:nn { ctex / subparagraph }
+ {
+ beforeskip = -3.25ex \@plus -1ex \@minus -.2ex ,
+ afterskip = 1ex \@plus .2ex
+ }
+ }
+ {
+ \keys_set:nn { ctex / subparagraph }
+ {
+ beforeskip = 3.25ex \@plus 1ex \@minus .2ex ,
+ afterskip = -1em
+ }
+ }
+\int_compare:nNnTF \g__ctex_section_depth_flag > \c_two
+ { \keys_set:nn { ctex / subparagraph } { indent = \c_zero_dim } }
+ { \keys_set:nn { ctex / subparagraph } { indent = \parindent } }
+\keys_set:nn { ctex / appendix }
+ {
+ name = \appendixname \space ,
+ number = \@Alph \c@chapter
+ }
+%%
+%%
+%% End of file `ctex-scheme-plain-book.def'.
diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-report.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-report.def
new file mode 100644
index 00000000000..5bc5214e512
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-report.def
@@ -0,0 +1,131 @@
+%%
+%% This is file `ctex-scheme-plain-report.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `scheme,report,plain')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {Plain scheme for report (CTEX)}
+\ProvidesExplFile{ctex-scheme-plain-report.def}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+\keys_set:nn { ctex / part }
+ {
+ name = \partname \space ,
+ number = \thepart ,
+ format = \centering ,
+ nameformat = \huge \bfseries ,
+ aftername = \par \vskip 20 \p@ ,
+ pagestyle = plain ,
+ titleformat = \Huge \bfseries
+ }
+\keys_set:nn { ctex / chapter }
+ {
+ pagestyle = plain ,
+ nameformat = \huge \bfseries ,
+ afterskip = 40 \p@ ,
+ name = \chaptername \space ,
+ number = \thechapter ,
+ format = \raggedright ,
+ aftername = \par \nobreak \vskip 20 \p@ ,
+ titleformat = \Huge \bfseries ,
+ beforeskip = -50 \p@
+ }
+\keys_set:nn { ctex / section }
+ {
+ number = \thesection ,
+ aftername = \quad ,
+ afterskip = 2.3ex \@plus .2ex ,
+ format = \Large \bfseries ,
+ beforeskip = -3.5ex \@plus -1ex \@minus -.2ex
+ }
+\keys_set:nn { ctex / subsection }
+ {
+ number = \thesubsection ,
+ format = \large \bfseries ,
+ aftername = \quad ,
+ afterskip = 1.5ex \@plus .2ex ,
+ beforeskip = -3.25ex \@plus -1ex \@minus -.2ex
+ }
+\keys_set:nn { ctex / subsubsection }
+ {
+ number = \thesubsubsection ,
+ format = \normalsize \bfseries ,
+ aftername = \quad ,
+ afterskip = 1.5ex \@plus .2ex ,
+ beforeskip = -3.25ex \@plus -1ex \@minus -.2ex
+ }
+\keys_set:nn { ctex / paragraph }
+ {
+ number = \theparagraph ,
+ format = \normalsize \bfseries ,
+ aftername = \quad
+ }
+\keys_set:nn { ctex / subparagraph }
+ {
+ number = \thesubparagraph ,
+ format = \normalsize \bfseries ,
+ aftername = \quad
+ }
+\int_compare:nNnTF \g__ctex_section_depth_flag > \c_two
+ {
+ \keys_set:nn { ctex / paragraph }
+ {
+ beforeskip = -3.25ex \@plus -1ex \@minus -.2ex ,
+ afterskip = 1ex \@plus .2ex
+ }
+ }
+ {
+ \keys_set:nn { ctex / paragraph }
+ {
+ beforeskip = 3.25ex \@plus 1ex \@minus .2ex ,
+ afterskip = -1em
+ }
+ }
+\int_compare:nNnTF \g__ctex_section_depth_flag > \c_three
+ {
+ \keys_set:nn { ctex / subparagraph }
+ {
+ beforeskip = -3.25ex \@plus -1ex \@minus -.2ex ,
+ afterskip = 1ex \@plus .2ex
+ }
+ }
+ {
+ \keys_set:nn { ctex / subparagraph }
+ {
+ beforeskip = 3.25ex \@plus 1ex \@minus .2ex ,
+ afterskip = -1em
+ }
+ }
+\int_compare:nNnTF \g__ctex_section_depth_flag > \c_two
+ { \keys_set:nn { ctex / subparagraph } { indent = \c_zero_dim } }
+ { \keys_set:nn { ctex / subparagraph } { indent = \parindent } }
+\keys_set:nn { ctex / appendix }
+ {
+ name = \appendixname \space ,
+ number = \@Alph \c@chapter
+ }
+%%
+%%
+%% End of file `ctex-scheme-plain-report.def'.
diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain.def
new file mode 100644
index 00000000000..ba19c5b83bc
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain.def
@@ -0,0 +1,35 @@
+%%
+%% This is file `ctex-scheme-plain.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `scheme,generic,plain')
+%%
+%% Copyright (C) 2003--2015
+%% CTEX.ORG and any individual authors listed in the documentation.
+%% ------------------------------------------------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%%
+%% ------------------------------------------------------------------------------
+%%
+\GetIdInfo$Id: ctex.dtx 3d246c0 2015-05-11 23:20:45 +0800 Qing Lee <sobenlee@gmail.com> $
+ {Plain scheme for generic (CTEX)}
+\ProvidesExplFile{ctex-scheme-plain.def}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+%%
+%%
+%% End of file `ctex-scheme-plain.def'.