summaryrefslogtreecommitdiff
path: root/Master
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
parent99d7ad5df8ac48132b622ee369d7493853592a61 (diff)
ctex (14may15)
git-svn-id: svn://tug.org/texlive/trunk@37393 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/latex/ctex/README65
-rw-r--r--Master/texmf-dist/doc/latex/ctex/ctex.pdfbin226095 -> 890109 bytes
-rw-r--r--Master/texmf-dist/doc/latex/ctex/ctex.tex1036
-rw-r--r--Master/texmf-dist/doc/latex/ctex/test/test-cjk.tex817
-rw-r--r--Master/texmf-dist/doc/latex/ctex/test/test-cjkutf8.tex820
-rw-r--r--Master/texmf-dist/doc/latex/ctex/test/test-xetex.tex817
-rw-r--r--Master/texmf-dist/doc/latex/ctex/test/test-xetexgbk.tex819
-rw-r--r--Master/texmf-dist/source/latex/ctex/ctex.dtx8645
-rw-r--r--Master/texmf-dist/source/latex/ctex/ctexpunct.spa30
-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
-rwxr-xr-xMaster/tlpkg/bin/tlpkginfo2
-rwxr-xr-xMaster/tlpkg/libexec/ctan2tds1
93 files changed, 19246 insertions, 7008 deletions
diff --git a/Master/texmf-dist/doc/latex/ctex/README b/Master/texmf-dist/doc/latex/ctex/README
index 6efe927ed52..abf637a8f09 100644
--- a/Master/texmf-dist/doc/latex/ctex/README
+++ b/Master/texmf-dist/doc/latex/ctex/README
@@ -9,14 +9,71 @@ The authors and contributors of this package are:
* Jiang Jiang <gzjjgod@gmail.com>
* Wang Yue <yuleopen@gmail.com>
* Liu Haiyang <leoliu.pku@gmail.com>
- * Li Yanrui
- * Chen Zhichu
+ * Li Yanrui <liyanrui.m2@gmail.com>
+ * Chen Zhichu <zhichu.chen@gmail.com>
+ * Li Qing <sobenlee@gmail.com>
+ * Liam Huang <liamhuang0205@gmail.com>
If you are interested in the process of development you
may observe
- http://code.google.com/p/ctex-kit/updates/list
+ https://github.com/CTeX-org/ctex-kit
Report feedback in the Issues section of ctex-kit project,
-or in http://bbs.ctex.org forum.
+or in [ctex](http://bbs.ctex.org) forum.
+
+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 (this file).
diff --git a/Master/texmf-dist/doc/latex/ctex/ctex.pdf b/Master/texmf-dist/doc/latex/ctex/ctex.pdf
index b939c41674b..3fe787fbbd5 100644
--- a/Master/texmf-dist/doc/latex/ctex/ctex.pdf
+++ b/Master/texmf-dist/doc/latex/ctex/ctex.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/ctex/ctex.tex b/Master/texmf-dist/doc/latex/ctex/ctex.tex
deleted file mode 100644
index 6e3184c04eb..00000000000
--- a/Master/texmf-dist/doc/latex/ctex/ctex.tex
+++ /dev/null
@@ -1,1036 +0,0 @@
-%# -*- coding: utf-8 -*-
-% ctex.tex: manual of ctex package
-
-\documentclass[a4paper]{ltxdoc}
-\usepackage[fntef,hyperref,UTF8]{ctexcap}
-\hypersetup{pdfstartview=FitH,bookmarksnumbered}
-\usepackage{texnames}
- \topmargin 0.5 true cm
- \oddsidemargin 1 true cm
- \evensidemargin 1 true cm
- \textheight 21 true cm
- \textwidth 14 true cm
-
-\MakeShortVerb{\|}
-\setcounter{StandardModuleDepth}{1}
-
-\def\email#1{\href{mailto:#1}{\path{#1}}}
-
-\newcommand{\ctex}{\texttt{ctex}}
-\newcommand{\ctexorg}{\texttt{ctex.org}}
-
-\newcommand{\ctexdefault}{\emph{这个是 \ctex{} 宏包的缺省模式。}}
-
-\setlength{\parskip}{0.75ex plus .2ex minus .5ex}
-\linespread{1.2}
-
-\makeatletter
-\def\parg#1{\mbox{$\langle${\it #1\/}$\rangle$}}
-\def\@smarg#1{{\tt\string{}\parg{#1}{\tt\string}}}
-\def\@marg#1{{\tt\string{}{\rm #1}{\tt\string}}}
-\def\marg{\@ifstar\@smarg\@marg}
-\def\@soarg#1{{\tt[}\parg{#1}{\tt]}}
-\def\@oarg#1{{\tt[}{\rm #1}{\tt]}}
-\def\oarg{\@ifstar\@soarg\@oarg}
-\makeatother
-
-\begin{document}
-
-\title{\bf \ctex{} 宏包说明}
-\author{\it \ctexorg\thanks{\url{http://www.ctex.org}}}
-\date{\small 版本号:v1.02d \hskip 2\ccwd 修改日期:2014/06/09}
-\maketitle
-
-
-\begin{abstract}
-\ctex{} 宏包提供了一个统一的中文 \LaTeX{} 文档框架,底层支持 CCT、CJK 和
- xeCJK 三种中文 \LaTeX{} 系统。\ctex{} 宏包提供了编写中文 \LaTeX{} 文档
-常用的一些宏定义和命令。
-
-\ctex{} 宏包需要 CCT 系统或者 CJK 宏包或者 xeCJK 宏包的支持。主要文件包括
- \texttt{ctexart.cls}、\texttt{ctexrep.cls}、\texttt{ctexbook.cls} 和
- \texttt{ctex.sty}、\texttt{ctexcap.sty}。
-
-\ctex{} 宏包由 \ctexorg{} 制作并负责维护。
-\end{abstract}
-
-\tableofcontents
-
-\section{简介}
-
-这个宏包的部分原始代码来自于由王磊编写 \texttt{cjkbook.cls} 文档类,
-还有一小部分原始代码来自于吴凌云编写的 \texttt{GB.cap} 文件。
-原来的这些工作都是零零碎碎编写的,没有认真、系统的设计,
-也没有用户文档,非常不利于维护和改进。2003 年,吴凌云用 \texttt{doc}
-和 \texttt{docstrip} 工具重新编写了整个文档,并增加了许多新的功能。
-2007 年,oseen 和王越在 \ctex{} 宏包基础上增加了对 UTF-8 编码的支持,
-开发出了 \texttt{ctexutf8} 宏包。
-2009 年 5 月,我们在 Google Code 建立了 ctex-kit 项目\footnote{\url{http://code.google.com/p/ctex-kit/}},
-对 \ctex{} 宏包及相关宏包和脚本进行了整合,并加入了对 Xe\TeX{} 的支持。
-该项目由 \ctexorg{} 社区的开发者共同维护,新版本号为 v0.9。
-在开发新版本时,考虑到合作开发和调试的方便,
-我们不再使用 \texttt{doc} 和 \texttt{docstrip} 工具,改为直接编写宏包文件。
-
-最初 Knuth 设计开发 \TeX{} 的时候没有考虑到支持多国语言,
-特别是多字节的中日韩语言。这使得 \TeX{} 以至后来的
-\LaTeX{} 对中文的支持一直不是很好。即使在 CJK 解决了中文字符
-处理的问题以后,中文用户使用 \LaTeX{} 仍然要面对许多困难。
-最常见的就是中文化的标题。由于中文习惯和西方语言的不同,
-使得很难直接使用原有的标题结构来表示中文标题。因此需要对
-标准 \LaTeX{} 宏包做较大的修改。此外,还有诸如中文字号的对应
-关系等等。\ctex{} 宏包正是尝试着解决这些问题。中间很多地方
-用到了在 \ctexorg{} 论坛上的讨论结果,在此对参与讨论的
-朋友们表示感谢。
-
-\ctex{} 宏包由五个主要文件构成:\texttt{ctexart.cls}、\texttt{ctexrep.cls}、\texttt{ctexbook.cls}
-和 \texttt{ctex.sty}、\texttt{ctexcap.sty}。\texttt{ctex.sty} 主要是提供整合的中文环境,可以配合大多数文档类使用。而
-\texttt{ctexcap.sty} 则是在 \texttt{ctex.sty} 的基础上对 \LaTeX{} 的三个标准文档类的格式进行修改以符合中文习惯,该宏包只能配合这三个
-标准文档类使用。\texttt{ctexart.cls}、\texttt{ctexrep.cls}、\texttt{ctexbook.cls}
-则是 \texttt{ctex.sty}、\texttt{ctexcap.sty} 分别和三个标准文档类
-结合产生的新文档类,除了包含 \texttt{ctex.sty}、\texttt{ctexcap.sty}
-的所有功能,还加入了一些修改文档类缺省设置的内容(如使用五号字体为缺
-省字体)。
-
-\vskip 10pt
-\emph{这份说明文档可以通过用 Xe\LaTeX{} 编译 \texttt{ctex.tex} 文件来得到。
-编译说明文档需要先安装 \ctex{} 宏包。}
-
-
-\section{使用帮助}
-
-\ctex{} 宏包的使用十分简单。如果是使用 \ctex{} 的文档类,只需用
-\texttt{ctexart}、\texttt{ctexrep} 或者 \texttt{ctexbook} 替换原来的
-文档类就可以了。你也可以继续使用原来的文档类,而用 \texttt{ctex.sty} 或者
-\texttt{ctexcap.sty} 宏包来配合使用,两者的效果是一样的
-(除了不能修改一些文档设置如缺省字体大小)。
-
-\subsection{使用 CJK 或 xeCJK}
-
-这是 \ctex{} 宏包的缺省设置。\ctex{} 宏包会自动根据使用的 \TeX{} 引擎
-调用 CJK 或者 xeCJK 宏包,你无需再自己调用。
-
-此外,\ctex{} 宏包会在 |\begin{document}| 和 |\end{document}|
-之间自动加入一个 CJK 环境,你无需再添加 CJK 环境。CJK 宏包的命令都可以
-在 |\begin{document}| 和 |\end{document}| 之间正常使用。
-
-例子1:使用文档类宏包
-\begin{verbatim}
-\documentclass{ctexart}
-\begin{document}
-中文宏包测试
-\end{document}
-\end{verbatim}
-
-例子2:使用普通宏包
-\begin{verbatim}
-\documentclass{article}
-\usepackage{ctex}
-\begin{document}
-中文宏包测试
-\end{document}
-\end{verbatim}
-
-\subsection{使用 CCT}
-
-注:CCT 方式\emph{不再建议}使用。
-
-\ctex{} 宏包也可以配合新版的 CCT 使用,只需在使用 \ctex{} 宏包时加上 CCT 选项即可。
-缺省 CCT 会使用 CJK 字库,因为这种字库方式比传统 CCT 字库更方便,兼容性也更好。
-如果要使用传统 CCT 字库,则还要加上 CCTfont 选项。
-
-例子3:使用 CJK 方式字库
-\begin{verbatim}
-\documentclass[CCT]{ctexart}
-\begin{document}
-中文宏包测试
-\end{document}
-\end{verbatim}
-
-例子2:使用 CCT 方式字库
-\begin{verbatim}
-\documentclass[CCT,CCTfont]{ctexart}
-\begin{document}
-中文宏包测试
-\end{document}
-\end{verbatim}
-
-
-\subsection{选项}
-
-宏包的选项用于改变一些缺省风格的设置。缺省的设置已经针对中文
-的习惯进行了尽量的修改,所以一般用户无需使用这些选项。
-如果你觉得某些设置不合适,可以向作者反映。我们会考虑在后面的
-版本中予以改进。我们也欢迎关于增加或者删减选项的建议。
-
-\emph{除了 \ref{class-opts} 和 \ref{caption-opts} 的选项,
-其余的选项都可以在所有文档类宏包和普通宏包上使用。}
-
-\subsubsection{只能用于文档类的选项} \label{class-opts}
-
-下面的选项可能会是最经常使用的。但是它们只能用于文档类
-(\texttt{ctexart}、 \texttt{ctexrep} 和 \texttt{ctexbook})。
-\begin{description}
-\item[cs4size] 使用小四字号为缺省字体大小。
-\item[c5size] 使用五号字为缺省字体大小。\ctexdefault
-\end{description}
-
-\subsubsection{只能用于文档类和 \texttt{ctexcap.sty} 的选项} \label{caption-opts}
-
-下面这些则只可以在文档类宏包和 \texttt{ctexcap.sty} 上使用。
-\begin{description}
-\item[sub3section] 将 |\paragraph| 命令产生的标题改为 section 类格式。
-此时 |\subparagraph| 命令产生的标题会具有原来 |\paragraph| 的格式。
-
-\item[sub4section] 将 |\paragraph| 和 |\subparagraph| 命令产生的标题
-都改为 section 类格式。
-\end{description}
-
-\subsubsection{中文编码选项}
-
-下面的选项用于选择 ctex 宏包的内部编码。
-
-\begin{description}
-\item[GBK] 使用 GBK 编码。\ctexdefault
-
-\item[UTF8] 使用 UTF-8 编码。
-\end{description}
-
-\emph{注意使用 Xe\TeX{} 引擎的情况下总是内部使用 UTF-8 编码,所以不必使用
-这个选项,但这并不妨碍编写 GBK 编码的文档。}
-
-\subsubsection{中文字库选项} \label{fontset}
-
-下面的选项用于选择可用的中文字库。设置这些选项是考虑到不同的操作系统平台
-提供的中文字库是不同的。不同的 \TeX{} 发行版可以根据目标操作系统平台和
-提供的中文字库在 \texttt{ctexfonts.cfg} 文件中修改这些选项之一为缺省设置。
-\begin{description}
-\item[nofonts] 没有中文字库,此时没有中文字体命令可用。
-
-\item[winfonts] 使用 Windows 的字体设置,默认为六种中易字体:宋体、仿宋、黑体、
-楷体、隶书、幼圆(在使用 Xe\TeX{} 时只有前四种)。该选项的结果将和老版本
-\ctex{} 宏包完全一致。这是默认设置。
-
-\item[adobefonts] 在 xeCJK 模式中使用 Adobe 的四套字体:宋体、仿宋、黑体、楷体。
-在 CJK 模式(即不使用 Xe\TeX{} 时)下,该选项将使用 winfonts 选项的设置。
-
-\item[zhmap] 仅在 winfonts 模式下有效。使用 zhmetrics 宏包提供的字体文件映射,
-将中文字库映射到相应的 ttf 字库文件。\ctexdefault
-
-\item[nozhmap] 仅在 winfonts 模式下有效。使用系统提供的字体文件映射方式。
-如果需要使用自定义的字体映射或者使用 Type1 字库,请使用该选项。
-\end{description}
-
-\subsubsection{CCT 引擎选项}
-
-下面的选项用于选择底层的中文系统。缺省情况下,宏包会根据编译方式自动选择 CJK
-或者 xeCJK 引擎。
-\begin{description}
-\item[CCT] 使用 CCT 代替 CJK 做为底层的中文支持系统。
-
-\item[CCTfont] 使用传统的 CCT 字库方式,该选项会自动激活 CCT 选项。
-\end{description}
-
-\subsubsection{排版风格选项}
-
-\begin{description}
-\item[cap] 使用中文的标题样式,缺省格式由 \texttt{ctexcap.cfg} 配置文件
-内的定义给出。对于 \texttt{ctex.sty},该选项只影响交叉引用中的数字和日期格式。
-\ctexdefault
-
-\item[nocap] 保留使用英文的标题样式。
-
-\item[punct] 对中文标点的位置(宽度)进行调整。\ctexdefault
-
-\item[nopunct] 不对中文标点的位置进行调整(每个标点占有相同的宽度)。
-
-\item[space] 使用 CJK 的保留空格模式,保留中文字符间的空格(类似英文的
-习惯)。你需要自己处理中文字符间的空格以及换行产生的空格(在行尾加上
- \% 符号可以避免),否则排版结果可能不符合中文习惯。这种模式可以通过
- |\CTEXnospace| 转换到 nospace 模式。
-
-\item[nospace] 使用 CJK 的忽略空格模式,也就是 CJK* 环境的模式。
- CJK 会自动忽略中文字符间的空格,比较符合中文习惯。在这种模式下,
-可以使用 \textasciitilde 来分隔中英文字符,产生的间距稍小于普通空格,
-排版效果比较美观。这种模式可以通过 |\CTEXspace| 命令转换到 space 模式。
-\ctexdefault
-
-\item[indent] 使用中文的段首缩进模式,即缩进两个汉字宽度,同时每个段落
-都缩进。\ctexdefault
-
-\item[noindent] 使用原来的段首缩进模式,章节标题后的第一段不缩进。
-\end{description}
-
-\subsubsection{宏包兼容选项}
-
-\begin{description}
-\item[fancyhdr] 保持和 \texttt{fancyhdr} 宏包的兼容性。该选项将使得
- \texttt{fancyhdr} 宏包被自动调用。
-
-\item[hyperref] 自动判断 \texttt{hyperref} 宏包的正确参数以避免产生乱码。如果在
- 导言区用户没有自己调用 \texttt{hyperref},则该选项将使得 \texttt{hyperref} 宏
- 包在导言区末尾被自动调用;如果需要对 \texttt{hyperref} 宏包做进一步的设置,则
- 用户可以自己在 \texttt{ctex} 宏包后调用 \texttt{hyperref},并使用适当的选项或
- 设置。
-
-\item[fntef] 为 \texttt{CJKfntef} 宏包和 \texttt{CCTfntef} 宏包提供统一接口。
-该选项将使得 \texttt{CJKfntef} 宏包或者 \texttt{CCTfntef} 宏包被自动调用。
-\end{description}
-
-\subsubsection{缺省选项}
-
-总结一下:\ctex{} 宏包的缺省选项是 GBK zhmap nospace cap punct indent,\ctex{} 文档类
-的缺省选项是 GBK zhmap nospace cap punct indent c5size。
-
-
-\subsection{基本命令}
-
-\ctex{} 宏包给用户提供一个通用的文档框架,使得用户可以自由地在不同的
-底层中文系统间切换。为此,我们为 CJK 定制了一些模拟 CCT 的命令,
-也对部分 CCT 命令进行了修改,使得两者保持一致。
-此外,我们还定义了用于设置文档参数的高级设置命令。
-
-\subsubsection{字体设置}
-
-中文字体很多,但是常用的就那么几个。我们为 CJK 常用的六种中文
-字体定义了简单易用的命令。它们是:
-
-\DescribeMacro{\songti}
-宋体: |\songti|, CJK 等价命令 |\CJKfamily{song}|
-
-\DescribeMacro{\heiti}
-黑体: |\heiti|, CJK 等价命令 |\CJKfamily{hei}|
-
-\DescribeMacro{\fangsong}
-仿宋: |\fangsong|, CJK 等价命令 |\CJKfamily{fs}|
-
-\DescribeMacro{\kaishu}
-楷书: |\kaishu|, CJK 等价命令 |\CJKfamily{kai}|
-
-\DescribeMacro{\lishu}
-隶书: |\lishu|, CJK 等价命令 |\CJKfamily{li}|
-
-\DescribeMacro{\youyuan}
-幼圆: |\youyuan|, CJK 等价命令 |\CJKfamily{you}|
-
-\vskip 10pt
-{\kaishu \TeX{} 系统中必须已经定义好这六种中文字体,并且使用和 \CTeX{} 套装中
-一致的字体名称。(参见上面 CJK 等价命令的参数)
-
-可用的字体命令还取决于使用的中文字库选项,参见 \ref{fontset} 一节的介绍。
-
-上面的字体命令和 CCT 中的一致,但传统的 CCT 字库中没有隶书和
-仿宋两种字体,需要用户自行安装定义。如果使用 CCT 时选择 CJK 字库方式,
-则可以使用这两种中文字体。
-
-上面的字体在不同的字体选项下有不同的设置,不一定都有定义。}
-
-\subsubsection{字号、字距、字宽和缩进}
-
-\DescribeMacro{\zihao}
-中文字号的设置命令是 |\zihao|\marg*{字号},例如 |\zihao{3}|。
-可以使用的参数有 16 个,小号字体在前面加负号表示,从大到小依次为
-\begin{center}
-\begin{tabular}{cccccccc}
-\hline
-初号 & 小初 & 一号 & 小一 & 二号 & 小二 & 三号 & 小三 \\
-0 & -0 & 1 & -1 & 2 & -2 & 3 & -3 \\
-\hline
-四号 & 小四 & 五号 & 小五 & 六号 & 小六 & 七号 & 八号 \\
-4 & -4 & 5 & -5 & 6 & -6 & 7 & 8 \\
-\hline
-\end{tabular}
-\end{center}
-\noindent 英文字体大小会始终保持和中文字体一致。
-
-\DescribeMacro{\ziju}
-汉字字距的调整使用命令 |\ziju|\marg*{字宽的倍数}。参数可以是任意的数字,
-例如 |\ziju{5}| 设置汉字字距为当前汉字字宽的 5 倍, |\ziju{0.5}| 设置汉字
-字距为当前汉字字宽的一半。这里的汉字字宽指的是实际汉字的宽度,
-不包含当前字距。该命令不影响英文字距。
-
-\DescribeMacro{\ccwd}
-当前汉字的字宽保存在宏 |\ccwd| 中。字宽是相邻两个汉字中心的距离,
-也就是说字距会被计算在内。
-
-\DescribeMacro{\CTEXindent}
-正常的缩进两个汉字字宽的距离,同时在汉字大小和字距改变的
-情况都可以自动修改缩进距离。
-
-\DescribeMacro{\CTEXnoindent}
-取消缩进。
-
-\DescribeMacro{\CTEXsetfont}
-|\CTEXsetfont| 命令用于更新当前的中文字体信息,包括当前字距和缩进
-距离。一般来说,用户无需使用这个命令。
-
-
-\subsubsection{中文数字转换}
-
-\DescribeMacro{\CTEXnumber}
-使用 CJK 提供的 |\CJKnumber| 命令可以将阿拉伯数字转换为中文数字。
-由于 \LaTeX{} 臭名昭著的脆弱命令的原因,当 |\CJKnumber| 被用在
-章节标题等地方的时候,要么出现错误无法使用,要么无法达到预期目的,
-例如在产生 PDF 书签的时候。于是我们定义了一个 |\CTEXnumber| 命令,
-可以将产生的中文数字保存下来。该命令的格式为
-\begin{quote}
-|\CTEXnumber|\marg*{result}\marg*{number}
-\end{quote}
-其中 \parg{result} 必须是一个 \TeX{} 宏的名字,不需要预先定义。
-例如
-\begin{quote}
-|\CTEXnumber{\test}{100002005}|
-\end{quote}
-则 |\test| 中的内容就是“一亿零二千零五”(不包括引号)。
-
-\DescribeMacro{\CTEXdigits}
-|\CTEXdigits| 命令和 |\CTEXnumber| 命令类似,用于代替 CJK 提供的
- |\CJKdigits| 命令。它和 |\CTEXnumber| 命令的不同之处在于转换后
-结果是中文数字串,而不是按照中文习惯的数字。该命令的格式为
-\begin{quote}
-|\CTEXdigits|\marg*{result}\marg*{number}
-\end{quote}
-其中 \parg{result} 必须是一个 \TeX{} 宏的名字,不需要预先定义。
-例如
-\begin{quote}
-|\CTEXdigits{\test}{100002005}|
-\end{quote}
-\CTEXdigits{\test}{100002005}
-则 |\test| 中的内容就是“\test{}”(不包括引号)。
-
-\DescribeMacro{\chinese}
-对于经常需要转换的计数器,我们特别定义了一个 |\chinese| 命令。
-该命令可以象罗马数字转换命令 |\roman|、 |\Roman| 一样使用。
-具体格式是
-\begin{quote}
-|\chinese|\marg*{counter}
-\end{quote}
-其中 \parg{counter} 是一个 \LaTeX{} 计数器(counter),即由
- |\newcounter| 命令产生的,例如 |section|, |figure| 等。
-
-\DescribeMacro{\Chinese}
-\ctex{} 宏包会在每次使用 |\setcounter|, |\stepcounter| 或
-|\addtocounter| 时利用 |\CTEXcounter{|\parg{counter}|}|
-更新 |\chinese| 命令产生的汉字,如果计数器的修改没有用到上述命令
-(如页码),就需要在 |\chinese| 前手工使用 |\CTEXcounter| 命令
-更新。为此,\ctex{} 宏包提供了大写的 |\Chinese| 命令,作为
-上述过程的简写。例如 |\Chinese{page}| 产生“\Chinese{page}”。
-该命令不宜用在 |\section| 等命令的参数中。
-
-\subsection{高级设置}
-
-\DescribeMacro{\CTEXoptions}
-\ctex{} 宏包中一般的设置通过 |\CTEXoptions| 命令完成。
-这个命令的基本格式是
-\begin{quote}
-|\CTEXoptions|\oarg{\parg{key1}={\parg{val1}},
- \parg{key2}={\parg{val2}}, ...}
-\end{quote}
-其中 \parg{key1}, \parg{key2} 是设置选项,
- \parg{val1}, \parg{val2} 则是对应选项的设置内容。
-多个选项可以在一个语句中完成设置。
-
-\DescribeMacro{\CTEXsetup}
-部分设置如章节标题则通过 |\CTEXsetup| 命令完成。这个命令比
- |\CTEXoptions| 多一个参数,用于指定设置对象。
-基本格式是
-\begin{quote}
-|\CTEXsetup|\oarg{\parg{key1}={\parg{val1}},
- \parg{key2}={\parg{val2}}, ...}\marg*{type}
-\end{quote}
-其中 \parg{type} 是设置的对象类型,如 |part|, |chapter|, |section|,
-|subsection|, |subsubsection|, |paragraph|, |subparagraph| 等。
- \parg{key1}, \parg{key2} 是设置选项,如 |name|, |number|, |format|,
-|nameformat|, |numberformat|, |aftername|, |titleformat| 等。
- \parg{val1}, \parg{val2} 则是对应选项的设置内容。
-同一个目标类型的多个选项可以在一个语句中完成设置。
-
-{\kaishu
-在 v0.7 版本之前,如果以上命令的参数中包含中文字符,则命令必须放在
-|\begin{document}| 之后才能正常工作。从 v0.7 版本开始支持在导言区使用中文。
-}
-
-\subsubsection{章节标题设置}
-
-普通章节标题的格式全部通过 |\CTEXsetup| 命令完成。
-章节类型在 |\CTEXsetup| 命令的第二个参数中指定。
-
-{\kaishu 在 v0.7 版本之前,如果使用了宏包选项 cap (缺省情况即是如此),则所有
-对章节标题的修改必须在 |\begin{document}| 以后进行。原因是
-缺省的中文标题设置文件 \texttt{ctexcap.cfg} 文件是在
- |\begin{document}| 之后才会自动装入,因而之前的修改都
-会被覆盖而无效。这一限制对后面的附录标题以及其他标题设置
-一样有效。从 v0.7 版本开始,\texttt{ctexcap.cfg} 文件
-在宏包文件结束时就已经被装入,因此可以在导言区使用设置命令。}
-
-\begin{description}
-
-\item[name=\{\parg{prename},\parg{postname}\}]
-该选项用于设置章节的名字,包括章节编号前后的词语,两个之间用逗号分开。
-例如
-\begin{quote}
-|\CTEXsetup[name={第,节}]{section}|
-\end{quote}
-会使得 section 的标题使用形如“第1节”的名字。注意{\bf 不要}使用中文
-的逗号。
-
-该选项的缺省设置是
-\begin{center}
-\begin{tabular}{lll}
-\hline\hline
- & 使用宏包选项 cap & 使用宏包选项 nocap \\
-\hline
-part & \{第,部分\} & \{Part\cs{space},\} \\
-chapter & \{第,章\} & \{Chapter\cs{space},\} \\
-section & 同右 & \{,\} \\
-subsection & 同右 & \{,\} \\
-subsubsection & 同右 & \{,\} \\
-paragraph & 同右 & \{,\} \\
-subparagraph & 同右 & \{,\} \\
-\hline\hline
-\end{tabular}
-\end{center}
-
-\item[number=\{\parg{number}\}]
-该选项用于设置章节编号的数字样式。例如
-\begin{quote}
-|\CTEXsetup[number={\roman{section}}]{section}|
-\end{quote}
-会使得 section 的标题使用小写罗马数字作为编号。常用的数字样式命令有
-\begin{description}
-\item \cs{chinese}\marg*{counter}: 一, 二, 三, ...
-\item \cs{arabic}\marg*{counter}: 1, 2, 3, ...
-\item \cs{roman}\marg*{counter}: i, ii, iii, ...
-\item \cs{Roman}\marg*{counter}: I, II, III, ...
-\item \cs{alph}\marg*{counter}: a, b, c, ...
-\item \cs{Alph}\marg*{counter}: A, B, C, ...
-\end{description}
-
-该选项的缺省设置是
-\begin{center}
-\begin{tabular}{lll}
-\hline\hline
- & 使用宏包选项 cap & 使用宏包选项 nocap \\
-\hline
-part & \{\cs{chinese}\marg{part}\} & \{\cs{Roman}\marg{part}\} \\
-chapter & \{\cs{chinese}\marg{chapter}\} & \{\cs{arabic}\marg{chapter}\} \\
-section & 同右 & \{\cs{thesection}\} \\
-subsection & 同右 & \{\cs{thesubsection}\} \\
-subsubsection & 同右 & \{\cs{thesubsubsection}\} \\
-paragraph & 同右 & \{\cs{theparagraph}\} \\
-subparagraph & 同右 & \{\cs{thesubparagraph}\} \\
-\hline\hline
-\end{tabular}
-\end{center}
-
-\item[format=\{\parg{format}\}]
-用于控制章节标题的全局格式,作用域为章节名字和随后的标题内容。
-常用于控制章节标题的对齐方式。
-
-该选项的缺省设置是
-\begin{center} \small
-\begin{tabular}{lll}
-\hline\hline
- & 使用宏包选项 cap & 使用宏包选项 nocap \\
-\hline
-part (article) & \{\cs{centering}\} & \{\cs{raggedright}\} \\
-part & \{\cs{centering}\} & \{\cs{centering}\} \\
-chapter & \{\cs{centering}\} & \{\cs{raggedright}\} \\
-section & \{\cs{Large}\cs{bfseries}\cs{centering}\} & \{\cs{Large}\cs{bfseries}\} \\
-subsection & 同右 & \{\cs{large}\cs{bfseries}\} \\
-subsubsection & 同右 & \{\cs{normalsize}\cs{bfseries}\} \\
-paragraph & 同右 & \{\cs{normalsize}\cs{bfseries}\} \\
-subparagraph & 同右 & \{\cs{normalsize}\cs{bfseries}\} \\
-\hline\hline
-\end{tabular}
-\end{center}
-
-\item[nameformat=\{\parg{nameformat}\}]
-用于控制章节名字的格式,作用域为章节名字,包括编号。
-
-该选项的缺省设置是
-\begin{center}
-\begin{tabular}{lll}
-\hline\hline
- & 使用宏包选项 cap & 使用宏包选项 nocap \\
-\hline
-part (article) & 同右 & \{\cs{Large}\cs{bfseries}\} \\
-part & 同右 & \{\cs{huge}\cs{bfseries}\} \\
-chapter & 同右 & \{\cs{huge}\cs{bfseries}\} \\
-section & 同右 & \{\} \\
-subsection & 同右 & \{\} \\
-subsubsection & 同右 & \{\} \\
-paragraph & 同右 & \{\} \\
-subparagraph & 同右 & \{\} \\
-\hline\hline
-\end{tabular}
-\end{center}
-
-\item[numberformat=\{\parg{numberformat}\}]
-用于控制章节编号的格式。一般为空,当你需要编号的格式和前后的章节名字
-不一样时使用。
-
-\item[aftername=\{\parg{aftername}\}]
-用于控制章节标题中章节名字和随后的标题内容之间的格式变换。
-常用于控制标题内容是否另起一行。
-
-该选项的缺省设置是
-\begin{center}
-\begin{tabular}{lll}
-\hline\hline
- & 使用宏包选项 cap & 使用宏包选项 nocap \\
-\hline
-part (article) & \{\cs{quad}\} & \{\cs{par}\cs{nobreak}\} \\
-part & 同右 & \{\cs{par}\cs{vskip} 20pt\} \\
-chapter & \{\cs{quad}\} & \{\cs{par}\cs{vskip} 20pt\} \\
-section & 同右 & \{\} \\
-subsection & 同右 & \{\} \\
-subsubsection & 同右 & \{\} \\
-paragraph & 同右 & \{\} \\
-subparagraph & 同右 & \{\} \\
-\hline\hline
-\end{tabular}
-\end{center}
-
-\item[titleformat=\{\parg{titleformat}\}]
-用于控制标题内容的格式,作用域为章节标题内容。
-
-该选项的缺省设置是
-\begin{center}
-\begin{tabular}{lll}
-\hline\hline
- & 使用宏包选项 cap & 使用宏包选项 nocap \\
-\hline
-part (article) & \{\cs{Large}\cs{bfseries}\} & \{\cs{huge}\cs{bfseries}\} \\
-part & \{\cs{huge}\cs{bfseries}\} & \{\cs{Huge}\cs{bfseries}\} \\
-chapter & \{\cs{huge}\cs{bfseries}\} & \{\cs{Huge}\cs{bfseries}\} \\
-section & 同右 & \{\} \\
-subsection & 同右 & \{\} \\
-subsubsection & 同右 & \{\} \\
-paragraph & 同右 & \{\} \\
-subparagraph & 同右 & \{\} \\
-\hline\hline
-\end{tabular}
-\end{center}
-
-\item[beforeskip=\{\parg{beforeskip}\}]
-用于控制章节标题前的空距。
-
-该选项的缺省设置是
-\begin{center}
-\begin{tabular}{lll}
-\hline\hline
- & 使用宏包选项 cap & 使用宏包选项 nocap \\
-\hline
-part (article) & 同右 & \{4ex\} \\
-part & 无效 & 无效 \\
-chapter & 同右 & \{50pt\} \\
-section & 同右 & \{-3.5ex plus -1ex minus -.2ex\} \\
-subsection & 同右 & \{-3.25ex plus -1ex minus -.2ex\} \\
-subsubsection & 同右 & \{-3.25ex plus -1ex minus -.2ex\} \\
-paragraph & 同右 & \{3.25ex plus 1ex minus .2ex\} \\
-subparagraph & 同右 & \{3.25ex plus 1ex minus .2ex\} \\
-\hline\hline
-\end{tabular}
-\end{center}
-
-在 section 及以下的标题中,使用负的距离表示标题后的段落不缩进
-(如标准的英文 LaTeX 文档),否则缩进。标题上方真正的空距是该参数的绝对值。
-
-\item[afterskip=\{\parg{afterskip}\}]
-用于控制章节标题后的空距。
-
-该选项的缺省设置是
-\begin{center}
-\begin{tabular}{lll}
-\hline\hline
- & 使用宏包选项 cap & 使用宏包选项 nocap \\
-\hline
-part (article) & 同右 & \{3ex\} \\
-part & 无效 & 无效 \\
-chapter & 同右 & \{40pt\} \\
-section & 同右 & \{2.3ex plus .2ex\} \\
-subsection & 同右 & \{1.5ex plus .2ex\} \\
-subsubsection & 同右 & \{1.5ex plus .2ex\} \\
-paragraph & 同右 & \{-1em\} \\
-subparagraph & 同右 & \{-1em\} \\
-\hline\hline
-\end{tabular}
-\end{center}
-
-在 section 及以下的标题中,正的距离表示向下留出的空距(如标准的 section 标题),
-使用负的距离则表示向右留出的空距的负值(如标准的 paragraph 标题)。
-
-\item[indent=\{\parg{indent}\}]
-用于控制章节标题本身的缩进。
-
-该选项的缺省设置是
-\begin{center}
-\begin{tabular}{lll}
-\hline\hline
- & 使用宏包选项 cap & 使用宏包选项 nocap \\
-\hline
-part (article) & 同右 & \{0pt\} \\
-part & 无效 & 无效 \\
-chapter & 同右 & \{0pt\} \\
-section & 同右 & \{0pt\} \\
-subsection & 同右 & \{0pt\} \\
-subsubsection & 同右 & \{0pt\} \\
-paragraph & 同右 & \{0pt\} \\
-subparagraph & 同右 & \{\cs{parindent}\} \\
-\hline\hline
-\end{tabular}
-\end{center}
-
-\end{description}
-
-
-\subsubsection{部分修改标题格式}
-
-如果只想修改标题格式中的某些参数而不是完全重新设置,可以使用带 + 号的
-设置选项。例如
-\begin{quote}
-|\CTEXsetup[format+={\zihao{1}}]{section}|
-\end{quote}
-则 section 的标题使用一号字体,而其他格式设置保持不变。
-
-标题格式相关的选项都支持这一功能,包括 |format|, |nameformat|, |numberformat|,
-|aftername| 和 |titleformat|,而且对所有文档类型都有效。
-
-\subsubsection{附录标题设置}
-
-附录(appendix)的标题也使用 |\CTEXsetup| 命令进行设置,
-第二个参数设为 |appendix|。但是只能使用 |name| 和 |number|
-两个设置选项。在使用了 |\appendix| 命令之后,附录
-的名字和编号会被自动使用。{\bf 附录的名字和前面的章节不同,
-它只有一个部分,放在编号之前。}在 article 类文档中,
-附录是用 section 实现的,而在 report 和 book 类文档中附录
-使用的是 chapter 的设置。因此在设置附录的编号的时候要注意
-使用正确的计数器。如果你要设置其他格式的附录标题,
-可以根据使用的文档类直接用 section 或者 chapter 的设置命令来控制,
-但是要记住把设置命令放在 |\appendix| (如果有的话)的后面,
-否则会被 |\appendix| 命令的设置覆盖。
-
-附录的缺省设置是
-\begin{center}
-\begin{tabular}{lll}
-\hline\hline
- & 使用宏包选项 cap & 使用宏包选项 nocap \\
-\hline
-name (article) & 同右 & \{\} \\
-name & \{附录\textasciitilde\} & \{Appendix\cs{space}\} \\
-number (article) & 同右 & \{\cs{Alph}\marg{section}\} \\
-number & 同右 & \{\cs{Alph}\marg{chapter}\} \\
-\hline\hline
-\end{tabular}
-\end{center}
-
-
-\subsubsection{其他标题设置}
-
-除章节标题外其他标题的设置通过 |\CTEXoptions| 设置。包括
-
-\begin{description}
-\item[contentsname] 目录名
-\item[listfigurename] 表格目录
-\item[listtablename] 插图目录
-\item[figurename] 图
-\item[tablename] 表
-\item[abstractname] 摘要
-\item[indexname] 索引
-\item[bibname] 参考文献
-\end{description}
-
-例如
-\begin{quote}
-|\CTEXoptions[indexname={总索引}]|
-\end{quote}
-把索引的名字改为“总索引”。
-
-
-\subsubsection{其他设置}
-
-\paragraph{设置 \cs{today} 的日期格式}
-使用 |\CTEXoptions| 可以设置 |\today| 命令产生的日期格式。
-支持的格式包括
-
-\begin{enumerate}
-
-\item 阿拉伯数字加中文年月日
-\begin{quote}
-|\CTEXoptions[today=small]|
-\end{quote}
-\CTEXoptions[today=small]
-|\today| 生成的日期例子为“\today{}”。
-
-\item 中文数字加中文年月日
-\begin{quote}
-|\CTEXoptions[today=big]|
-\end{quote}
-\CTEXoptions[today=big]
-|\today| 生成的日期例子为“\today{}”。
-
-\item \LaTeX{} 标准格式
-\begin{quote}
-|\CTEXoptions[today=old]|
-\end{quote}
-\CTEXoptions[today=old]
-|\today| 生成的日期例子为“\today{}”。
-
-\end{enumerate}
-
-
-\paragraph{设置图表标题的分隔符}
-使用 |\CTEXoptions| 可以设置 |\caption| 命令产生的图表标题的分隔符。
-这个分隔符缺省是使用冒号 : 。可以通过命令
-\begin{quote}
-|\CTEXoptions[captiondelimiter={|\parg{string}|}]|
-\end{quote}
-设置为任意的单个字符或者字符串 \parg{string}。
-
-
-\subsection{配置文件}
-
-主要的配置文件有:
-\begin{itemize}
-\item \texttt{ctexopts.cfg}
-\item \texttt{ctexcap.cfg}, \texttt{ctexcap-gbk.cfg}, \texttt{ctexcap-utf8.cfg}
-\item \texttt{ctex.cfg}
-\end{itemize}
-
-\texttt{ctexopts.cfg} 用于设置缺省选项。例如可以根据系统中的可用中文字库,
-设置 \ref{fontset} 一节中的几个选项之一为缺省选项。
-该文件会在处理宏包选项之前装入。
-
-\texttt{ctexcap.cfg} 是缺省中文标题格式的定义,当你使用 \texttt{cap}
-选项时就会使用这里的定义。你可以把它改为你经常使用的格式,这样就不用
-每次都在正文中修改了。 \texttt{ctexcap.cfg} 中的设置都可以通过宏包提供
-的设置命令在正文中进行修改。与中文编码有关的定义分别在
- \texttt{ctexcap-gbk.cfg} 和 \texttt{ctexcap-utf8.cfg} 文件中。
-
-最后,宏包还将读入 \texttt{ctex.cfg} 文件,该文件中的设置将覆盖其他配置
-文件中的设置。用户可以在该文件中加入自己的定义。
-
-在修改这些配置文件的时候,你可以修改系统目录中的文件,也可以拷贝一份放到
-当前目录下,然后修改。TeX 会优先使用当前目录下的同名文件。这样你可以针对
-不同的应用设置不同的缺省配置文件。
-
-
-\section{版本更新}
-
-\begin{description}
-
-\item[v1.02d 2014/06/09]
-处理修改 |\set@fontsize| 造成的一个 BUG。
-
-处理与 |fontspec| v2.4 的兼容问题。
-
-\item[v1.02c 2011/03/11]
-修改 \texttt{hyperref} 选项的行为,使 \texttt{hyperref} 宏包可以在用户指定的位
-置被调用,以解决个别兼容性问题。修正 XeTeX 编译书签中百分号出错的 BUG。
-
-\item[v1.02b 2011/01/21]
-修正使用一个中文书签 BUG,恢复依赖 expl3。
-
-\item[v1.02 2010/10/17]
-采用新的 hook 机制,去掉对 expl3 宏包的依赖性
-
-\item[v1.01 2010/09/27]
-处理 |format| 选项默认值的 BUG,将 |\subsection| 以下改为西文默认的两端对齐。
-
-处理 |xunicode.sty| v0.95 版本导致 |\beth| 等数学符号在数学字体包中重定义的问题。
-
-\item[v1.00 2010/09/18]
-处理在一些系统中 |zhwinfonts.tex| 的 map 在浮动体中失效的问题。
-
-\item[v0.99b 2010/07/11]
-发现 BUG,把 |\chinese*| 改为 |\Chinese|。
-
-\item[v0.99a 2010/07/11]
-增加 |\chinese*| 命令,作为 |\CTEXcounter| 和 |\chinese| 混合体的
-简写形式。
-
-\item[v0.99 2010/07/08]
-提早引入 expl3 宏包,解决 |\chinese| 命令在 expl3 下的不能正确使用的问题。
-
-\item[v0.98 2010/06/19]
-解决 xeCJK 默认代替 indentfirst 功能的问题。修正 xeCJK 模式下 winfonts
-的中文字体。
-
-\item[v0.97 2010/01/22]
-修正 pdf\LaTeX{} 与 Xe\LaTeX{} 中生成 PDF 书签的问题。
-
-\item[v0.96 2009/11/24]
-添加 zhmap 与 nozhmap 选项控制 zhwinfonts 的载入。
-
-\item[v0.95 2009/10/20]
-移除对 CJKnumb 宏包的依赖。去除无用的 cjkfonts 选项,以 winfonts
-作为默认值。
-
-\item[v0.94 2009/09/13]
-改进 hyperref 选项的支持
-
-\item[v0.93 2009/07/10]
-加入选项 hyperref 以支持自动用合适的参数调用 hyperref 宏包
-
-\item[v0.92 2009/06/25]
-Add backward compatibility to old ctexutf8 packages
-
-\item[v0.91 2009/05/23]
-调整宏包结构,增加对各种系统中文字库的支持选项:cjkfonts, winfonts,
-adobefonts
-
-\item[v0.9 2009/05/05]
-整合 ctexutf8 宏包,增加对 UTF-8 编码的支持;
-开始支持 Xe\TeX{} 中文系统(使用 xeCJK 宏包)
-
-\item[v0.8a 2007/05/06]
-增加 bold 字体的定义
-
-\item[v0.8 2006/06/09]
-将 ctex.sty 文件分割为 ctex.sty 和 ctexcap.sty,
-后者只支持标准文档类增加对 |\stepcounter| 的重定义,以和 calc 宏包兼容
-
-\item[v0.7f 2006/04/12]
-采用修改 |\AtBeginDocument| 和 |\AtEndDocument| 命令的方式
-来设置 CJK 环境,以减少宏包冲突
-
-\item[v0.7e 2006/03/22]
-改用 |\DeclareRobustCommand| 定义 |\CTEXnumber| 和 |\CTEXcounter|;
-除去 |\CTEXdigits| 和 |\CTEX@getdigit| 命令带来的多余空格
-
-\item[v0.7d 2005/12/28]
-在 fntef 类宏包后使用 |\normalem| 恢复 |\em| 宏的缺省定义
-
-\item[v0.7c 2005/12/20]
-增加对 |\if@mainmatter| 的判断,以兼容 amsbook 宏包
-
-\item[v0.7b 2005/12/09]
-调整宏包导入位置,解决 fntef 类宏包早于相应中文宏包导入的问题
-
-\item[v0.7a 2005/11/28]
-将 ctex.cfg 文件的读取时间前移,使得导言中的设置命令优先
-
-\item[v0.7 2005/11/25]
-支持在导言区中使用中文和章节标题设置命令(感谢 tercelxy 的建议);
-增加 CJKfntef 宏包和 CCTfntef 宏包的统一接口(感谢 chenyu\_21cn 的建议)
-
-\item[v0.6b 2005/11/07]
-将节以下编号和标题之间的空距定义转移到相应的 aftername 变量中
-
-\item[v0.6a 2005/09/30]
-增加对 |\CCT@set@fontsize| 的判断
-
-\item[v0.6 2005/09/24]
-针对 cct 0.6180 的修改,
-|\set@fontsize|: cct 从 0.6180 开始将宏 |\oset@fontsize| 改为 |\CCT@set@fontsize|
-
-\item[v0.5c 2004/09/29]
-避免重复执行设置 CJK 环境结束语句
-
-\item[v0.5b 2004/09/29]
-改变设置 CJK 环境结束语句的 |\AtEndDocument| 执行的位置,以减少宏包冲突
-
-\item[v0.5a 2004/09/06]
-修改图表标题分隔符设置中的错误
-
-\item[v0.5 2004/08/23]
-General: Move Chinese definitions from ctex.cfg to ctex.def
-
-\item[v0.4d 2004/08/14]
-|\ps@fancy|: 增加对 mainmatter 的判断;
-|\refstepcounter|: 修改 |\ref| 命令,不再包含除编号外的内容
-
-\item[v0.4c 2004/07/26]
-增加判断以避免嵌套定义 |\setcounter| 和 |\addtocounter|
-
-\item[v0.4b 2004/07/13]
-|\baselinestretch|: 把 |\baselinestretch| 从 1.2 改为 1.3
-
-\item[v0.4a 2004/05/15]
-|\CTEXdigits|: 增加 |\CTEXdigits| 命令;
-|\ziju|: 修改 CCT 的字距命令使得缩进保持一致
-
-\item[v0.4 2004/05/13]
-General: 如果指定了标准的 \LaTeX{} 字体大小,则不使用中文字号;
-中文字号定义改为直接使用 pt 为单位;
-|\zihao|: 删除 |\CTEX@fontsize| 命令,改为直接使用 |\fontsize| 命令
-
-\item[v0.3b 2004/05/11]
-General: 增加 fancyhdr 选项
-
-\item[v0.3a 2004/04/30]
-General: 修改命令 |\CCTpuncttrue| 的拼写错误
-
-\item[v0.3 2004/04/24]
-General: 对页眉设置进行微调;
-对中文标题的章节编号格式进行调整,去掉 |\S|;
-修改为使用 |\chinese| 命令以避免产生错误;
-修正 sub3section 和 sub4section 选项无效的问题;
-增加对图表标题分隔符的设置;
-|\ps@fancy|: 解决与 fancyhdr 的冲突
-
-\item[v0.2d 2004/04/23]
-General: Change option c5size to base on 10pt basic class;
-补上字号定义中行间距参数中缺少的 |\CTEX@bp|;
-修改缺省的字号大小
-
-\item[v0.2c 2004/02/13]
-General: Add CJKpunct as standard configuration;
-|\ifCTEX@punct|: 增加判断是否调整中文标点宽度的选项
-
-\item[v0.2b 2004/02/13]
-General: 修改缺省的行距;
-修改缺省的字号大小
-
-\item[v0.2a 2004/02/11]
-|\baselinestretch|: 增加对行距的设置;
-|\CTEX@spaceChar|: 加快处理速度,改善和 CJKpunct 的兼容性
-
-\item[v0.2 2004/01/16]
-General: Add support for CCT;
-增加部分修改标题格式设置的选项;
-增加修改标题前后空距设置的选项;
-|\CTEXsetfont|: |\CTEXfontinfo| 命令改为 |\CTEXsetfont|;
-|\ziju|: 参数的单位由绝对距离改为相对于当前汉字大小的倍数
-
-\item[v0.1f 2003/12/24]
-|\refname|: 修正 article 类中参考文献标题没有使用中文的问题
-
-\item[v0.1e 2003/11/05]
-|\refstepcounter|: 修正 |\ref| 命令后多出空格的问题
-
-\item[v0.1d 2003/09/27]
-|\addtocounter|: 将对 |\setcounter| 和 |\addtocounter| 的修改放到导言的最后以和其他宏包兼容
-
-\item[v0.1c 2003/08/19]
-General: 去掉生成的 .out 文件里章的标题前的多余空格
-
-\item[v0.1b 2003/08/17]
-|\zihao|: 删除多余的 |\newcount| 命令
-
-\item[v0.1a 2003/08/15]
-General: 修正 ctex.sty 中无法使用 sub3section 和 sub4section 选项的问题
-
-\item[v0.1 2003/08/15]
-General: First beta release
-
-\item[v0.0 2003/04/26] General: Initial version
-
-\end{description}
-
-
-\section{开发人员}
-
-\begin{itemize}
-
-\item 吴凌云 (\email{aloft@ctex.org})
-\item 江疆 (\email{gzjjgod@gmail.com})
-\item 王越 (\email{yuleopen@gmail.com})
-\item 刘海洋 (\email{LeoLiu.PKU@gmail.com})
-\item LiYanrui.m2 (LiYanrui)
-\item 陈之初 (Neals)
-
-\end{itemize}
-
-\end{document}
-
diff --git a/Master/texmf-dist/doc/latex/ctex/test/test-cjk.tex b/Master/texmf-dist/doc/latex/ctex/test/test-cjk.tex
deleted file mode 100644
index aea2f4e9fa3..00000000000
--- a/Master/texmf-dist/doc/latex/ctex/test/test-cjk.tex
+++ /dev/null
@@ -1,817 +0,0 @@
-%# -*- coding: gbk -*-
-% $Id: test-cjk.tex 257 2011-03-11 04:56:11Z leoliu.pku@gmail.com $
-\documentclass[cs4size,a4paper,fancyhdr,fntef,winfonts,hyperref]{ctexbook}
-\usepackage{shortvrb, makeidx}
-
- \makeindex
-
- \MakeShortVerb{\|}
-
- \topmargin -0.5 true cm
- \oddsidemargin 0 true cm
- \evensidemargin 0 true cm
- \textheight 23 true cm
- \textwidth 16.5 true cm
-
- \setlength{\parskip}{0.75ex plus .2ex minus .5ex}
- \renewcommand{\baselinestretch}{1.2}
-
-
- \pagestyle{fancy}
-
-
- \newcommand{\ctex}{\texttt{ctex}}
- \newcommand{\ctexorg}{\texttt{ctex.org}}
-
- \newcommand{\TestFile}{ļ}
-
-
- \CTEXoptions[today=big]
- \CTEXsetup[name={,},number={\chinese{section}},format+={\bfseries},beforeskip={-10ex plus -.1ex minus -.1ex},afterskip={1ex plus .1ex minus .1ex}]{section}
- \CTEXsetup[name={},number={\chinese{chapter}}]{appendix}
-
- \CTEXsetup[name={,ƪ},nameformat={\centering\bfseries},titleformat={\zihao{0}\bfseries}]{part}
-
- \setcounter{secnumdepth}{4}
- \CTEXsetup[name={(,)},number={\arabic{paragraph}}]{paragraph}
-
-
-\begin{document}
-
-\title{~ctex~\TestFile\thanks{just test}}
-\author{}
-
-\maketitle
-
-\tableofcontents
-
-
-\part{ǰ}
-
-\chapter{} \label{chapter:intro}
-
-
-
-\section{˵}
-
-\ctex{}~ṩ˱д~\LaTeX{}~ĵõһЩ궨
-Ҫ~CJK~֧֣~\ctexorg{}~ά
-
-ļڲ~\ctex{}~͹ܡ
-
-
-\part{}
-
-\chapter{}
-
-
-
-
-\section{ֺ}
-|\zihao| \index{zihao}
-
-\begin{tabular}{l}
-\zihao{0} English \\
-\zihao{-0} С English \\
-\zihao{1} һ English \\
-\zihao{-1} Сһ English \\
-\zihao{2} English \\
-\zihao{-2} С English \\
-\zihao{3} English \\
-\zihao{-3} С English \\
-\zihao{4} ĺ English \\
-\zihao{-4} Сĺ English \\
-\zihao{5} English \\
-\zihao{-5} С English \\
-\zihao{6} English \\
-\zihao{-6} С English \\
-\zihao{7} ߺ English \\
-\zihao{8} ˺ English \\
-\end{tabular}
-
-\zihao{0}
-ֳֳֳֳֳֳֳֳֳ
-ֳֳֳֳֳֳֳֳֳ
-ֳֳֳֳֳֳֳֳֳ
-
-\zihao{-0}
-СССССССССС
-СССССССССС
-СССССССССС
-
-\zihao{1}
-һһһһһһһһһһ
-һһһһһһһһһһ
-һһһһһһһһһһ
-
-\zihao{-1}
-СһСһСһСһСһСһСһСһСһСһ
-СһСһСһСһСһСһСһСһСһСһ
-СһСһСһСһСһСһСһСһСһСһ
-
-\zihao{2}
-ֶֶֶֶֶֶֶֶֶ
-ֶֶֶֶֶֶֶֶֶ
-ֶֶֶֶֶֶֶֶֶ
-
-\zihao{-2}
-СССССССССС
-СССССССССС
-СССССССССС
-
-\zihao{3}
-
-
-
-
-\zihao{-3}
-СССССССССС
-СССССССССС
-СССССССССС
-
-\zihao{4}
-ĺĺĺĺĺĺĺĺĺĺ
-ĺĺĺĺĺĺĺĺĺĺ
-ĺĺĺĺĺĺĺĺĺĺ
-ĺĺĺĺĺĺĺĺĺĺ
-ĺĺĺĺĺĺĺĺĺĺ
-
-\zihao{-4}
-СĺСĺСĺСĺСĺСĺСĺСĺСĺСĺ
-СĺСĺСĺСĺСĺСĺСĺСĺСĺСĺ
-СĺСĺСĺСĺСĺСĺСĺСĺСĺСĺ
-СĺСĺСĺСĺСĺСĺСĺСĺСĺСĺ
-СĺСĺСĺСĺСĺСĺСĺСĺСĺСĺ
-
-\zihao{5}
-
-
-
-
-
-
-\zihao{-5}
-СССССССССС
-СССССССССС
-СССССССССС
-СССССССССС
-СССССССССС
-
-\zihao{6}
-
-
-
-
-
-
-\zihao{-6}
-СССССССССС
-СССССССССС
-СССССССССС
-СССССССССС
-СССССССССС
-
-\zihao{7}
-ߺߺߺߺߺߺߺߺߺߺ
-ߺߺߺߺߺߺߺߺߺߺ
-ߺߺߺߺߺߺߺߺߺߺ
-ߺߺߺߺߺߺߺߺߺߺ
-ߺߺߺߺߺߺߺߺߺߺ
-
-\zihao{8}
-˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺
-˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺
-˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺
-˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺
-˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺
-
-\normalsize
-
-\section{־}
-
-|\ziju| \index{ziju}
-
-׼־Ϊ㣬ı־|\ziju{1}|
-
-{\ziju{1}
-ڵ־Ϊ~1~֣ӢIJӰ죺\\
-This is an English example
-}
-
-\section{ֿ}
-
-|\ccwd| \index{ccwd}
-
-ǰֿ~\the\ccwd~\framebox[\ccwd]{\ }~Ŀȡ
-
-ıֺŴС|\zihao{3}|
-
-{\zihao{3}
-ǰֿ~\the\ccwd~\framebox[\ccwd]{\ }~Ŀȡ
-}
-
-ı־|\ziju{1}|
-
-{\ziju{1}
-ǰֿ~\the\ccwd~\framebox[\ccwd]{\ }~Ŀȡ
-}
-
-\section{}
-
-|\CTEXindent| \index{CTEXindent}
-
-׼Ķ֣
-
-
-\noindent ûС
-
-ıֺŴС|\zihao{3}|
-
-{\zihao{3}
-
-\noindent ûС
-}
-
-ı־|\ziju{1}|
-
-{\ziju{1}
-
-\noindent ûС
-}
-
-\section{}
-
-\begin{tabular}{ll}
- |\songti| & {\songti } \\
- |\heiti| & {\heiti } \\
- |\fangsong| & {\fangsong } \\
- |\kaishu| & {\kaishu } \\
- |\lishu| & {\lishu } \\
- |\youyuan| & {\youyuan Բ}
-\end{tabular}
-
-\index{songti} \index{heiti} \index{fangsong} \index{kaishu} \index{lishu} \index{youyuan}
-
-\section{}
-
-\begin{center}
-\begin{tabular}{lllll}
-
-\hline
- Family & Series & Shape & & \\ \hline
- {\bf rm} & & & |\rmfamily| &
- {\rmfamily English } \\
- & & it & |\rmfamily\itshape| &
- {\rmfamily\itshape English } \\
- & & sl & |\rmfamily\slshape| &
- {\rmfamily\slshape English } \\ \cline{2-5}
- & bf & & |\rmfamily\bfseries| &
- {\rmfamily\bfseries English } \\
- & bf & it & |\rmfamily\bfseries\itshape| &
- {\rmfamily\bfseries\itshape English } \\
- & bf & sl & |\rmfamily\bfseries\slshape| &
- {\rmfamily\bfseries\slshape English } \\ \hline
-
- {\bf sf} & & & |\sffamily| &
- {\sffamily English } \\
- & & it & |\sffamily\itshape| &
- {\sffamily\itshape English } \\
- & & sl & |\sffamily\slshape| &
- {\sffamily\slshape English } \\ \cline{2-5}
- & bf & & |\sffamily\bfseries| &
- {\sffamily\bfseries English } \\
- & bf & it & |\sffamily\bfseries\itshape| &
- {\sffamily\bfseries\itshape English } \\
- & bf & sl & |\sffamily\bfseries\slshape| &
- {\sffamily\bfseries\slshape English } \\ \hline
-
- {\bf tt} & & & |\ttfamily| &
- {\ttfamily English } \\
- & & it & |\ttfamily\itshape| &
- {\ttfamily\itshape English } \\
- & & sl & |\ttfamily\slshape| &
- {\ttfamily\slshape English } \\ \cline{2-5}
- & bf & & |\ttfamily\bfseries| &
- {\ttfamily\bfseries English } \\
- & bf & it & |\ttfamily\bfseries\itshape| &
- {\ttfamily\bfseries\itshape English } \\
- & bf & sl & |\ttfamily\bfseries\slshape| &
- {\ttfamily\bfseries\slshape English } \\ \hline
-\end{tabular}
-\end{center}
-
-
-\chapter{߼}
-
-\section{}
-
-|\CTEXnumber| |\CTEXdigits| \index{CTEXnumber} \index{CTEXdigits}
-
-\CTEXnumber{\test}{100002005}
-\typeout{\test}
-\test
-
-\CTEXdigits{\test}{100002005}
-\typeout{\test}
-\test
-
-\section{}
-
-|\ref| |\ref*| \index{ref} \index{ref*}
-
-õǣ\ref{chapter:intro}
-
-õǣ\ref*{chapter:intro}ӣ
-
-\section{}
-
-|\index| \index{index}
-
-\index{test1}
-\index{test2}
-\index{test3}
-\index{test4}
-\index{test5}
-\index{test6}
-\index{test7}
-\index{test8}
-\index{test9}
-\index{test10}
-\index{test11}
-\index{test12}
-\index{test13}
-\index{test14}
-\index{test15}
-\index{test16}
-\index{test17}
-\index{test18}
-\index{test19}
-\index{test20}
-\index{test21}
-\index{test22}
-\index{test23}
-\index{test24}
-\index{test25}
-\index{test26}
-\index{test27}
-\index{test28}
-\index{test29}
-\index{test30}
-\index{test31}
-\index{test32}
-\index{test33}
-\index{test34}
-\index{test35}
-\index{test36}
-\index{test37}
-\index{test38}
-\index{test39}
-\index{test40}
-\index{test41}
-\index{test42}
-\index{test43}
-\index{test44}
-\index{test45}
-\index{test46}
-\index{test47}
-\index{test48}
-\index{test49}
-\index{test50}
-
-
-\chapter{ı}
-
-һǧŰٰʮ䣬׮£ϵѣһջ÷ȥ
-ƹ񻷵Ĺƾ˶ץһЯڻɻѯ
-ˣ֪Ǿˣûȥ뻨裬ʮޡҲ
-࣬°أװһֻղ˶ĺֻ˺õĻ֡û룬
-֮أѿڳ󣬾һԣľرʶ
-Ʒࡣȥµϻ̣ҲDzʶǡʦ̴
-ʦʦҡͷһȴ˵ŴʦܲԤ⣬ռ⻨ܿ
-֦ʦһȡһʳֻļ֣˵֡
-ʦ˵滨֦侰ãΪҲ󻨿Ȼ
-״ĵõ塣һ֦Ϊɫһ֦Ϊɫһ֦Ϊɫһ֦Ϊ
-ɫһʱϢÿ߲Ī̾ΪֹȻ⣬
-һϧͷԽˮʩʣŪijƣҹ
-øȥ࣬ѳ¯ϵˮȥ˻ں޲ѣ
-Ҳˤ裬˯һ²
-
-\paragraph{һ}
-죬ϾΪһ軨ѣ֪֮˻󣬹Ҳˡû뵽죬
-ȴַһ׮˶¡³ߵ磬̫
-õţ̫ĺô̫Ŷȴ˻̫ţ
-˭ҲûȥơмԳԳû
-ģеǮ㲻ԸǹˣƱȥ⳵ƫƫʲôҪ
-ٵľľѾͳ۵غеԳ
-⳵ֻÿУгӵĽࡣֻͽֻͽ
-ҵӰӣҲӰӣӰDzʹġͻȻӰӵɫdz
-dẓһ˲ȫȻʧûӰţƺ˲ˣƨɺ
-һɻ˾żһĸ̫ˣȫ
-ͷϿϹȻĸ̫ĸ̫Сһ㣬ֲ¾ɴۣ
-ǾһģɸΡȥľй¿ʴģͬʱ
-̫ȴûΪ۾ˣϿ̫Ͳٷ죬ǰ׵ģ
-纸һİף׵ûʲôʲôҲˣȫĺڰǿʲ
-ôģȫĹ˾Ҳǿʲô𣿴Сijٲҷˣֻȣ
-ȴ̤͸оѲڽˣڿӰɣӳͻȻϣ
-Ļϵͼʧˣ컹ڽšһôоˣе˲Ҳ
-ôоˣǼžΨгǽͷ˴Ҫٴ
-һûд꣬ײǽǣһ£ʧˡƺ
-ˣЦһ£͵ؾʵͬʱž־壬۾У
-ࡣ
-
-\paragraph{ڶ}
-Ĺ˽Сʱϵָֻ̫һǵ۾𽥿
-ԼӰӣ֮Ϊ˵DZͻŲ·ɢһ
-ʱϣȴָӽͨľ졣ȫϣȻľһͷ
-ͷ׹棬ȴһ˫üۣؿ˵ææʹЩܲã
-վͷŭˣ캰أĶյľһһߴͷϵӲñӣ
-Ͻлӣpipi׵ͷˣ
-ָڰȫддȴһŵϹŴʣܣЦˡЦ
-һƬΪͷ°ȫʱ򡢱¶ϵ·ԭ;
-ơǰӡš֣˫ȲɴǴֲڵĴһֱ˺
-ƨɵ߾Ǹء֣ұ߾ǸӦ֣ͷ֪ܣȴڳ£˵
-һҥҥȫǣǣһǹͣ߸帣
-ٵͶ˱˸аԺζȫޣ
-ڼ˴ñԭԱ档ﴧֽ
-˵ԱŤŤƨɾ׬Ǯ˸ΪԱɽ
-亣ζϲȫʮ̣ʵʵѧ׷档
-
-ҥ˷ͷǸؤ˵ǸʦΪֻн
-ʦܱҥǣҥжǰ˶ָΨΪʦһ˺
-ͷʲôˣ׷һǡһλг
-ԭϺȴʮÿгųǽ
-ҵȴȫǼڣɫ΢ӪˮĹȥˡµг䲻
-ǰְ;ȫȻɲԼκͷѸôӺδٸ
-ĿټΪʲıһ˽л
-¸ģ˵һνʮŶĻʱҲǸ
-ɲȺ˼άڱأʳ÷չغʡԶԶǰε
-ץҵϻǽǷʴࡢþʮֻЧ
-ְؾ͵õԶ滮ɱ¸£
-ץ˲ץ֮ҵ緢չĻΣڵ֡г
-ʣ̸ҹֽԭְѧУи顣һ
-ʱ䣬ϾҪĴʣһǧŲ֮ҵ޸ǽ
-ͨ˳ǺӣسǺӱ߽ɼطɫֳָĽ֣һΪƽ
-֣ר黭һΪν֣רӪȫȫʡСԣһ
-彨֣乤ƷزǣĻҵĴչʹ
-еԱȻ࣬ͳΰıײһʱDZ˳ǡ
-̳ǡ潳ǡҲʼһֵIJλ׹ͷڽͷ˵
-ҥ˸һкµһΣһΣͷ˵
-䣺˵УУҲС˵УͲУҲСкˣһ
-ơͷû˵ҥָˣкȴԺҥ÷죬ȻƵ
-Ҳˣֲ˵绰˵ͷɢгҥԣӦֹ
-ͷһ飬ԭһλʮϷƦӡΪϷƦӣǴʮǰ
-ʦתʦʱܵ˾ݺδתɣϷʡδܳɹdzס
-ȥʡſ״飬ˣû·
-̨ף̬ҲԲϷá಻磬ڽͷ
-ʮ졢޴ַųóһط¡ûͷֳ
-ڽͷȴһӳؽִʰˡһкȻӵʹ˵ҥ
-ͷȴ˿ֻܸ࣬ߺܳġඣаãඣÿ
-ڽСҲڳǽͷϴһǺһӦ
-¥¥ϵijɰǧֻһƬˡ
-
-
-\chapter{CJKfntef~~CCTfntef}
-
-\CTEXunderdot{ҥ}
-
-\CTEXunderline{ҥ}
-
-\CTEXunderdblline{ҥ}
-
-\CTEXunderwave{ҥ}
-
-\CTEXsout{ҥ}
-
-\CTEXxout{ҥ}
-
-
-\begin{CTEXfilltwosides}{3cm}
-ҥ \\
- \\
- \\
-
-\end{CTEXfilltwosides}
-
-
-\chapter{⺺\%ٷֺ\%}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-
-\appendix
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-
-\printindex
-
-\end{document}
diff --git a/Master/texmf-dist/doc/latex/ctex/test/test-cjkutf8.tex b/Master/texmf-dist/doc/latex/ctex/test/test-cjkutf8.tex
deleted file mode 100644
index 4e80b7a4100..00000000000
--- a/Master/texmf-dist/doc/latex/ctex/test/test-cjkutf8.tex
+++ /dev/null
@@ -1,820 +0,0 @@
-%# -*- coding: utf-8 -*-
-% $Id: test-cjkutf8.tex 257 2011-03-11 04:56:11Z leoliu.pku@gmail.com $
-\documentclass[cs4size,a4paper,fancyhdr,fntef,UTF8,winfonts,hyperref]{ctexbook}
-
-\usepackage{hyperref}
-
-\usepackage{shortvrb, makeidx}
-
- \makeindex
-
- \MakeShortVerb{\|}
-
- \topmargin -0.5 true cm
- \oddsidemargin 0 true cm
- \evensidemargin 0 true cm
- \textheight 23 true cm
- \textwidth 16.5 true cm
-
- \setlength{\parskip}{0.75ex plus .2ex minus .5ex}
- \renewcommand{\baselinestretch}{1.2}
-
-
- \pagestyle{fancy}
-
-
- \newcommand{\ctex}{\texttt{ctex}}
- \newcommand{\ctexorg}{\texttt{ctex.org}}
-
- \newcommand{\TestFile}{测试文件}
-
-
- \CTEXoptions[today=big]
- \CTEXsetup[name={第,节},number={\chinese{section}},format+={\bfseries},beforeskip={-10ex plus -.1ex minus -.1ex},afterskip={1ex plus .1ex minus .1ex}]{section}
- \CTEXsetup[name={附件},number={\chinese{chapter}}]{appendix}
-
- \CTEXsetup[name={第,篇},nameformat={\centering\bfseries},titleformat={\zihao{0}\bfseries}]{part}
-
- \setcounter{secnumdepth}{4}
- \CTEXsetup[name={(,)},number={\arabic{paragraph}}]{paragraph}
-
-
-\begin{document}
-
-\title{宏包~ctex~\TestFile\thanks{just test}}
-\author{吴凌云}
-
-\maketitle
-
-\tableofcontents
-
-
-\part{前言}
-
-\chapter{简介} \label{chapter:intro}
-
-简介
-
-\section{说明}
-
-\ctex{}~宏包提供了编写中文~\LaTeX{}~文档常用的一些宏定义和命令。
-需要~CJK~宏包的支持,由~\ctexorg{}~制作并负责维护。
-
-本文件用于测试~\ctex{}~宏包的命令和功能。
-
-
-\part{正文}
-
-\chapter{基本命令}
-
-基本命令
-
-
-\section{字号}
-测试命令:|\zihao| \index{zihao}
-
-\begin{tabular}{l}
-\zihao{0} 初号字 English \\
-\zihao{-0} 小初号 English \\
-\zihao{1} 一号字 English \\
-\zihao{-1} 小一号 English \\
-\zihao{2} 二号字 English \\
-\zihao{-2} 小二号 English \\
-\zihao{3} 三号字 English \\
-\zihao{-3} 小三号 English \\
-\zihao{4} 四号字 English \\
-\zihao{-4} 小四号 English \\
-\zihao{5} 五号字 English \\
-\zihao{-5} 小五号 English \\
-\zihao{6} 六号字 English \\
-\zihao{-6} 小六号 English \\
-\zihao{7} 七号字 English \\
-\zihao{8} 八号字 English \\
-\end{tabular}
-
-\zihao{0}
-初号字初号字初号字初号字初号字初号字初号字初号字初号字初号字
-初号字初号字初号字初号字初号字初号字初号字初号字初号字初号字
-初号字初号字初号字初号字初号字初号字初号字初号字初号字初号字
-
-\zihao{-0}
-小初号小初号小初号小初号小初号小初号小初号小初号小初号小初号
-小初号小初号小初号小初号小初号小初号小初号小初号小初号小初号
-小初号小初号小初号小初号小初号小初号小初号小初号小初号小初号
-
-\zihao{1}
-一号字一号字一号字一号字一号字一号字一号字一号字一号字一号字
-一号字一号字一号字一号字一号字一号字一号字一号字一号字一号字
-一号字一号字一号字一号字一号字一号字一号字一号字一号字一号字
-
-\zihao{-1}
-小一号小一号小一号小一号小一号小一号小一号小一号小一号小一号
-小一号小一号小一号小一号小一号小一号小一号小一号小一号小一号
-小一号小一号小一号小一号小一号小一号小一号小一号小一号小一号
-
-\zihao{2}
-二号字二号字二号字二号字二号字二号字二号字二号字二号字二号字
-二号字二号字二号字二号字二号字二号字二号字二号字二号字二号字
-二号字二号字二号字二号字二号字二号字二号字二号字二号字二号字
-
-\zihao{-2}
-小二号小二号小二号小二号小二号小二号小二号小二号小二号小二号
-小二号小二号小二号小二号小二号小二号小二号小二号小二号小二号
-小二号小二号小二号小二号小二号小二号小二号小二号小二号小二号
-
-\zihao{3}
-三号字三号字三号字三号字三号字三号字三号字三号字三号字三号字
-三号字三号字三号字三号字三号字三号字三号字三号字三号字三号字
-三号字三号字三号字三号字三号字三号字三号字三号字三号字三号字
-
-\zihao{-3}
-小三号小三号小三号小三号小三号小三号小三号小三号小三号小三号
-小三号小三号小三号小三号小三号小三号小三号小三号小三号小三号
-小三号小三号小三号小三号小三号小三号小三号小三号小三号小三号
-
-\zihao{4}
-四号字四号字四号字四号字四号字四号字四号字四号字四号字四号字
-四号字四号字四号字四号字四号字四号字四号字四号字四号字四号字
-四号字四号字四号字四号字四号字四号字四号字四号字四号字四号字
-四号字四号字四号字四号字四号字四号字四号字四号字四号字四号字
-四号字四号字四号字四号字四号字四号字四号字四号字四号字四号字
-
-\zihao{-4}
-小四号小四号小四号小四号小四号小四号小四号小四号小四号小四号
-小四号小四号小四号小四号小四号小四号小四号小四号小四号小四号
-小四号小四号小四号小四号小四号小四号小四号小四号小四号小四号
-小四号小四号小四号小四号小四号小四号小四号小四号小四号小四号
-小四号小四号小四号小四号小四号小四号小四号小四号小四号小四号
-
-\zihao{5}
-五号字五号字五号字五号字五号字五号字五号字五号字五号字五号字
-五号字五号字五号字五号字五号字五号字五号字五号字五号字五号字
-五号字五号字五号字五号字五号字五号字五号字五号字五号字五号字
-五号字五号字五号字五号字五号字五号字五号字五号字五号字五号字
-五号字五号字五号字五号字五号字五号字五号字五号字五号字五号字
-
-\zihao{-5}
-小五号小五号小五号小五号小五号小五号小五号小五号小五号小五号
-小五号小五号小五号小五号小五号小五号小五号小五号小五号小五号
-小五号小五号小五号小五号小五号小五号小五号小五号小五号小五号
-小五号小五号小五号小五号小五号小五号小五号小五号小五号小五号
-小五号小五号小五号小五号小五号小五号小五号小五号小五号小五号
-
-\zihao{6}
-六号字六号字六号字六号字六号字六号字六号字六号字六号字六号字
-六号字六号字六号字六号字六号字六号字六号字六号字六号字六号字
-六号字六号字六号字六号字六号字六号字六号字六号字六号字六号字
-六号字六号字六号字六号字六号字六号字六号字六号字六号字六号字
-六号字六号字六号字六号字六号字六号字六号字六号字六号字六号字
-
-\zihao{-6}
-小六号小六号小六号小六号小六号小六号小六号小六号小六号小六号
-小六号小六号小六号小六号小六号小六号小六号小六号小六号小六号
-小六号小六号小六号小六号小六号小六号小六号小六号小六号小六号
-小六号小六号小六号小六号小六号小六号小六号小六号小六号小六号
-小六号小六号小六号小六号小六号小六号小六号小六号小六号小六号
-
-\zihao{7}
-七号字七号字七号字七号字七号字七号字七号字七号字七号字七号字
-七号字七号字七号字七号字七号字七号字七号字七号字七号字七号字
-七号字七号字七号字七号字七号字七号字七号字七号字七号字七号字
-七号字七号字七号字七号字七号字七号字七号字七号字七号字七号字
-七号字七号字七号字七号字七号字七号字七号字七号字七号字七号字
-
-\zihao{8}
-八号字八号字八号字八号字八号字八号字八号字八号字八号字八号字
-八号字八号字八号字八号字八号字八号字八号字八号字八号字八号字
-八号字八号字八号字八号字八号字八号字八号字八号字八号字八号字
-八号字八号字八号字八号字八号字八号字八号字八号字八号字八号字
-八号字八号字八号字八号字八号字八号字八号字八号字八号字八号字
-
-\normalsize
-
-\section{字距}
-
-测试命令:|\ziju| \index{ziju}
-
-标准字距为零,改变字距后:|\ziju{1}|
-
-{\ziju{1}
-现在的字距为~1~个字,英文不受影响:\\
-This is an English example。
-}
-
-\section{字宽}
-
-测试命令:|\ccwd| \index{ccwd}
-
-当前汉字字宽是~\the\ccwd,即盒子~\framebox[\ccwd]{\ }~的宽度。
-
-改变字号大小后:|\zihao{3}|
-
-{\zihao{3}
-当前汉字字宽是~\the\ccwd,即盒子~\framebox[\ccwd]{\ }~的宽度。
-}
-
-改变字距后:|\ziju{1}|
-
-{\ziju{1}
-当前汉字字宽是~\the\ccwd,即盒子~\framebox[\ccwd]{\ }~的宽度。
-}
-
-\section{段首缩进}
-
-测试命令:|\CTEXindent| \index{CTEXindent}
-
-标准的中文段首缩进是两个汉字:
-
-这是缩进的行。
-
-\noindent 这是没有缩进的行。
-
-改变字号大小后:|\zihao{3}|
-
-{\zihao{3}
-这是缩进的行。
-
-\noindent 这是没有缩进的行。
-}
-
-改变字距后:|\ziju{1}|
-
-{\ziju{1}
-这是缩进的行。
-
-\noindent 这是没有缩进的行。
-}
-
-\section{字体命令}
-
-\begin{tabular}{ll}
- |\songti| & {\songti 宋体} \\
- |\heiti| & {\heiti 黑体} \\
- |\fangsong| & {\fangsong 仿宋} \\
- |\kaishu| & {\kaishu 楷书} \\
- |\lishu| & {\lishu 隶书} \\
- |\youyuan| & {\youyuan 幼圆}
-\end{tabular}
-
-\index{songti} \index{heiti} \index{fangsong} \index{kaishu} \index{lishu} \index{youyuan}
-
-\section{字体框架}
-
-\begin{center}
-\begin{tabular}{lllll}
-
-\hline
- Family & Series & Shape & 命令 & 例子 \\ \hline
- {\bf rm} & & & |\rmfamily| &
- {\rmfamily English 中文字体} \\
- & & it & |\rmfamily\itshape| &
- {\rmfamily\itshape English 中文字体} \\
- & & sl & |\rmfamily\slshape| &
- {\rmfamily\slshape English 中文字体} \\ \cline{2-5}
- & bf & & |\rmfamily\bfseries| &
- {\rmfamily\bfseries English 中文字体} \\
- & bf & it & |\rmfamily\bfseries\itshape| &
- {\rmfamily\bfseries\itshape English 中文字体} \\
- & bf & sl & |\rmfamily\bfseries\slshape| &
- {\rmfamily\bfseries\slshape English 中文字体} \\ \hline
-
- {\bf sf} & & & |\sffamily| &
- {\sffamily English 中文字体} \\
- & & it & |\sffamily\itshape| &
- {\sffamily\itshape English 中文字体} \\
- & & sl & |\sffamily\slshape| &
- {\sffamily\slshape English 中文字体} \\ \cline{2-5}
- & bf & & |\sffamily\bfseries| &
- {\sffamily\bfseries English 中文字体} \\
- & bf & it & |\sffamily\bfseries\itshape| &
- {\sffamily\bfseries\itshape English 中文字体} \\
- & bf & sl & |\sffamily\bfseries\slshape| &
- {\sffamily\bfseries\slshape English 中文字体} \\ \hline
-
- {\bf tt} & & & |\ttfamily| &
- {\ttfamily English 中文字体} \\
- & & it & |\ttfamily\itshape| &
- {\ttfamily\itshape English 中文字体} \\
- & & sl & |\ttfamily\slshape| &
- {\ttfamily\slshape English 中文字体} \\ \cline{2-5}
- & bf & & |\ttfamily\bfseries| &
- {\ttfamily\bfseries English 中文字体} \\
- & bf & it & |\ttfamily\bfseries\itshape| &
- {\ttfamily\bfseries\itshape English 中文字体} \\
- & bf & sl & |\ttfamily\bfseries\slshape| &
- {\ttfamily\bfseries\slshape English 中文字体} \\ \hline
-\end{tabular}
-\end{center}
-
-
-\chapter{高级命令}
-
-\section{中文数字}
-
-测试命令:|\CTEXnumber| |\CTEXdigits| \index{CTEXnumber} \index{CTEXdigits}
-
-\CTEXnumber{\test}{100002005}
-\typeout{\test}
-\test
-
-\CTEXdigits{\test}{100002005}
-\typeout{\test}
-\test
-
-\section{中文引用}
-
-测试命令:|\ref| |\ref*| \index{ref} \index{ref*}
-
-我们引用的是:\ref{chapter:intro}。
-
-我们引用的是:\ref*{chapter:intro}。(不带超链接)
-
-\section{索引}
-
-测试命令:|\index| \index{index}
-
-\index{test1}
-\index{test2}
-\index{test3}
-\index{test4}
-\index{test5}
-\index{test6}
-\index{test7}
-\index{test8}
-\index{test9}
-\index{test10}
-\index{test11}
-\index{test12}
-\index{test13}
-\index{test14}
-\index{test15}
-\index{test16}
-\index{test17}
-\index{test18}
-\index{test19}
-\index{test20}
-\index{test21}
-\index{test22}
-\index{test23}
-\index{test24}
-\index{test25}
-\index{test26}
-\index{test27}
-\index{test28}
-\index{test29}
-\index{test30}
-\index{test31}
-\index{test32}
-\index{test33}
-\index{test34}
-\index{test35}
-\index{test36}
-\index{test37}
-\index{test38}
-\index{test39}
-\index{test40}
-\index{test41}
-\index{test42}
-\index{test43}
-\index{test44}
-\index{test45}
-\index{test46}
-\index{test47}
-\index{test48}
-\index{test49}
-\index{test50}
-
-
-\chapter{中文标点}
-
-一千九百八十年间,西京城里出了桩异事,两个关系是死死的朋友,一日活得泼烦,去
-了唐贵妃杨玉环的墓地凭吊,见许多游人都抓了一包坟丘的土携在怀里,甚感疑惑,询
-问了,才知贵妃是绝代佳人,这土拿回去撒入花盆,花就十分鲜艳。这二人遂也刨了许
-多,用衣包回,装在一只收藏了多年的黑陶盆里,只待有了好的花籽来种。没想,数天
-之后,盆里兀自生出绿芽,月内长大,竟蓬蓬勃勃了一丛,但这草木特别,无人能识得
-品类。抱了去城中孕璜寺的老花工请教,花工也是不识。恰有智祥大师经过,又请教大
-师,大师还是摇头。其中一人却说:“常闻大师能卜卦预测,不妨占这花将来能开几
-枝?”大师命另一人取一个字来,那人适持花工的剪刀在手,随口说出个“耳”字。大
-师说:“花是奇花,当开四枝,但其景不久,必为尔所残也。”后花开果然如数,但形
-状类似牡丹,又类似玫瑰。且一枝蕊为红色,一枝蕊为黄色,一枝蕊为白色,一枝蕊为
-紫色,极尽娇美。一时消息传开每日欣赏者不绝,莫不叹为观止。两个朋友自然得意,
-尤其一个更是珍惜,供养案头,亲自浇水施肥,殷勤务弄。不料某日醉酒,夜半醒来忽
-觉得该去浇灌,竟误把厨房炉子上的热水壶提去,结果花被浇死。此人悔恨不已,索性
-也摔了陶盆,生病睡倒一月不起。
-
-\paragraph{第一段}
-此事虽异,毕竟为一盆花而已,知道之人还并不广大,过后也便罢了。没想到了夏天,
-西京城却又发生了一桩更大的人人都经历的异事。是这古历六月初七的晌午,先是太阳
-还红堂堂地照着,太阳的好处是太阳照着而人却忘记了还有太阳在照着,所以这个城里
-的人谁也没有往天上去看。街面的形势依旧是往日形势。有级别坐卧车的坐着卧车。没
-级别的,但有的是钱,便不愿挤那公共车了,抖着票子去搭出租车。偏偏有了什么重要
-的人物亲临到这里,数辆的警车护卫开道,尖锐的警笛就长声儿价地吼,所有的卧车,
-出租车、公共车只得靠边慢行,扰乱了自行车长河的节奏。只有徒步的人只管徒步,你
-踩着我的影子,我踩着他的影子,影子是不痛不痒的。突然。影子的颜色由深而浅,愈
-浅愈短,一瞬间全然消失。人没有了阴影拖着,似乎人不是了人,用手在屁股后摸摸,
-摸得一脸的疑惑。有人就偶尔往天上一瞅,立即欢呼:“天上有四个太阳了!”人们全
-举了头往天上看,天上果然出现了四个太阳。四个太阳大小一般,分不清了新旧雌雄,
-是聚在一起的,组成个丁字形。过去的经验里,天上是有过月亏和日蚀的,但同时有四
-个太阳却没有遇过,以为是眼睛看错了;再往天上看,那太阳就不再发红,是白的,白
-得像电焊光一样的白,白得还像什么?什么就也看不见了,完全的黑暗人是看不见了什
-么的,完全的光明人竟也是看不见了什么吗?大小的车辆再不敢发动了,只鸣喇叭,人
-却胡扑乱踏,恍惚里甚或就感觉身已不在街上了,是在看电影吧?放映机突然发生故障,
-银幕上的图象消失了,而音响还在进行着。一个人这么感觉了,所有的人差不多也都这
-么感觉了,于是寂静下来,竟静得死气沉沉,唯有城墙头上有人吹动的埙音最后要再吹
-一声,但没有吹起,是力气用完,像风撞在墙角,拐了一下,消失了。人们似乎看不起
-吹埙的人,笑了一下,猛地惊醒身处的现实,同时被寂静所恐惧,哇哇惊叫,各处便疯
-倒了许多。
-
-\paragraph{第二段}
-这样的怪异持续了近半个小时,天上的太阳又恢复成了一个。待人们的眼睛逐渐看见地
-上有了自己的影子,皆面面相觑,随之倒为人的狼狈有了羞愧,就慌不择路地四散。一
-时又是人乱如蚁,却不见了指挥交通的警察。安全岛上,悠然独坐的竟是一个老头。老
-头囚首垢面,却有一双极长的眉眼,冷冷地看着人的忙忙。这眼神使大家有些受不得,
-终就愤怒了,遂喊警察呢?警察在哪儿,姓苏的警察就一边跑一边戴头上的硬壳帽子,
-骂着老叫花子:“pi!”“pi”是西京城里骂“滚”的最粗俗的土话。老头听了,
-拿手指在安全岛上写,写出来却是一个极文雅的上古词:避,就慢慢地笑了。随着笑起
-来的是一大片,因为老头走下安全岛的时候、暴露了身上的衣服原是孕璜寺香客敬奉的
-锦旗所制。前心印着“有求”两字,那双腿岔开,裤裆处是粗糙的大针脚一直到了后腰,
-屁股蛋上左边就是个“必”字,右边就是个“应”字,老头并不知耻,却出口成章;说
-出了一段谣儿来。这谣儿后来流传全城,其辞是:一类人是公仆,高高在上享清福。二
-类人作“官倒”,投机倒把有人保。三类人搞承包,吃喝嫖赌全报销。四类人来租赁,
-坐在家里拿利润。五类人大盖帽,吃了原告吃被告。六类人手术刀,腰里揣满红纸包。
-七类人当演员,扭扭屁股就赚钱。八类人搞宣传,隔三岔五解个馋。九类人为教员,山
-珍海味认不全。十类人主人翁,老老实实学雷锋。
-
-此谣儿流传开来后,有人分析老头并不是个乞丐,或者说他起码是个教师,因为只有教
-师才能编出这样的谣辞,且谣辞中对前几类人都横加指责,唯独为教师一类人喊苦叫屈。
-但到底老头是什么人,无人再作追究。这一年里,恰是西京城里新任了一位市长,这市
-长原籍上海,夫人却是西京土著,十数春秋,西京的每任市长都有心在这座古城建功立
-业,但却差不多全是几经折腾,起色甚微,便铁打的营盘流水的官去了。新的市长虽不
-悦意在岳父门前任职,苦于身在仕途,全然由不得自己,到任后就犯难该从何处举纲张
-目。夫人属于贤内助,便召集了许多亲朋好友为其夫顾问参谋,就有了一个年轻人叫黄
-德复的,说出了一段建议来:西京是十二朝古都,文化积淀深厚是资本也是负担。各层
-干部和群众思维趋于保守,故长期以来经济发展比沿海省市远远落后,若如前几任的市
-长那样面面俱抓,常因企业老化,城建欠帐大多、用尽十分力,往往只有三分效果,且
-当今任职总是三年或五载就得调动,长远规划难以完成便又人事更新;与其这样,倒不
-如抓别人不抓之业,如发展文化和旅游,短期内倒有政绩出现。市长大受启发,不耻下
-问,竟邀这年轻人谈了三天三夜,又将其调离原来任职的学校来市府作了身边秘书。一
-时间,上京索要拨款,在下四处集资,干了一宗千古不朽之宏业,即修复了西京城墙,
-疏通了城河,沿城河边建成极富地方特色的娱乐场。又改建了三条大街:一条为仿唐建
-筑街,专售书画、瓷器;一条为仿宋建筑街,专营全市乃至全省民间小吃;一条仿明、
-清建筑街,集中了所有民间工艺品、土特产。但是,城市文化旅游业的大力发展,使城
-市的流动人员骤然增多,就出现了许多治安方面的弊病,一时西京城被外地人称作贼城、
-烟城、暗娼城。市民也开始滋生另一种的不满情绪。当那位囚首垢面的老头又在街头说
-他的谣儿,身后总是厮跟了一帮闲汉,嚷道:“来一段,再来一段!”,老头就说了两
-句:“说你行,你就行,不行也行。说不行,就不行,行也不行。”闲汉们听了,一齐
-鼓掌。老头并没说这谣儿所指何人,闲汉们却对号入座,将这谣儿传得风快,自然黄德
-复不久也听到了,便给公安局拨了电话,说老头散布市长的谣言,应予制止。公安局收
-留了老头,一查,原是一位十多年上访痞子。为何是上访痞子?因是此人十多年前任民
-办教师,转公办教师时受到上司陷害未能转成,就上访省府,仍未能成功,于是长住西
-京,隔三间五去省府门口提意见,递状书,静坐耍赖,慢慢地欲进没有门路,欲退又无
-台阶,精神变态,后来也索性不再上访。亦不返乡,就在街头流浪起来。公安局收审了
-十天、查无大罪,又放出来,用车一气拉出城三百里地放下。没想这老头几天后又出现
-在街头,却拉动了一辆架子车,沿街穿巷收拾破烂了。一帮闲汉自然拥他,唆使再说谣
-儿,老头却吝啬了口舌,只吼很高很长的“破烂喽-!承包破烂-喽!”这叫声每日
-早晚在街巷吼叫。常也有人在城墙头上吹埙,一个如狼嚎,一个鸣咽如鬼,两厢呼应,
-钟楼鼓楼上的成百上千只鸟类就聒噪一片了。
-
-
-\chapter{CJKfntef~和~CCTfntef}
-
-\CTEXunderdot{此谣儿流传开来后}
-
-\CTEXunderline{此谣儿流传开来后}
-
-\CTEXunderdblline{此谣儿流传开来后}
-
-\CTEXunderwave{此谣儿流传开来后}
-
-\CTEXsout{此谣儿流传开来后}
-
-\CTEXxout{此谣儿流传开来后}
-
-
-\begin{CTEXfilltwosides}{3cm}
-此谣 \\
-儿流 \\
-传开 \\
-来后
-\end{CTEXfilltwosides}
-
-
-\chapter{标题汉字与\%百分号\%}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-
-\appendix
-
-\chapter{测试}
-
-测试
-
-\chapter{测试}
-
-测试
-
-\chapter{测试}
-
-测试
-
-
-\printindex
-
-\end{document}
diff --git a/Master/texmf-dist/doc/latex/ctex/test/test-xetex.tex b/Master/texmf-dist/doc/latex/ctex/test/test-xetex.tex
deleted file mode 100644
index c29b0da93fb..00000000000
--- a/Master/texmf-dist/doc/latex/ctex/test/test-xetex.tex
+++ /dev/null
@@ -1,817 +0,0 @@
-%# -*- coding: utf-8 -*-
-% $Id: test-xetex.tex 257 2011-03-11 04:56:11Z leoliu.pku@gmail.com $
-% test-xetex.tex: XeTeX only test case, use xelatex to run
-
-\documentclass[cs4size,a4paper,fancyhdr,fntef,UTF8,adobefonts,hyperref]{ctexbook}
-
-\usepackage{hyperref}
-
-\usepackage{shortvrb, makeidx}
-
-\setlength{\headheight}{15pt}
-
- \makeindex
-
- \MakeShortVerb{\|}
-
- \setlength{\parskip}{0.75ex plus .2ex minus .5ex}
- \renewcommand{\baselinestretch}{1.2}
-
- \pagestyle{fancy}
-
-
- \newcommand{\ctex}{\texttt{ctex}}
- \newcommand{\ctexorg}{\texttt{ctex.org}}
-
- \newcommand{\TestFile}{测试文件}
-
-
- \CTEXoptions[today=big]
- \CTEXsetup[name={第,节},number={\chinese{section}},format+={\bfseries},beforeskip={-10ex plus -.1ex minus -.1ex},afterskip={1ex plus .1ex minus .1ex}]{section}
- \CTEXsetup[name={附件},number={\chinese{chapter}}]{appendix}
-
- \CTEXsetup[name={第,篇},nameformat={\centering\bfseries},titleformat={\zihao{0}\bfseries}]{part}
-
- \setcounter{secnumdepth}{4}
- \CTEXsetup[name={(,)},number={\arabic{paragraph}}]{paragraph}
-
-
-\begin{document}
-
-\title{宏包 ctex \TestFile\thanks{just test}}
-\author{吴凌云}
-
-\maketitle
-
-\tableofcontents
-
-
-\part{前言}
-
-\chapter{简介} \label{chapter:intro}
-
-简介
-
-\section{说明}
-
-\ctex{} 宏包提供了编写中文 \LaTeX{} 文档常用的一些宏定义和命令。
-需要 CJK 宏包的支持,由 \ctexorg{} 制作并负责维护。
-
-本文件用于测试 \ctex{} 宏包的命令和功能。
-
-
-\part{正文}
-
-\chapter{基本命令}
-
-基本命令
-
-
-\section{字号}
-测试命令:|\zihao| \index{zihao}
-
-\begin{tabular}{l}
-\zihao{0} 初号字 English \\
-\zihao{-0} 小初号 English \\
-\zihao{1} 一号字 English \\
-\zihao{-1} 小一号 English \\
-\zihao{2} 二号字 English \\
-\zihao{-2} 小二号 English \\
-\zihao{3} 三号字 English \\
-\zihao{-3} 小三号 English \\
-\zihao{4} 四号字 English \\
-\zihao{-4} 小四号 English \\
-\zihao{5} 五号字 English \\
-\zihao{-5} 小五号 English \\
-\zihao{6} 六号字 English \\
-\zihao{-6} 小六号 English \\
-\zihao{7} 七号字 English \\
-\zihao{8} 八号字 English \\
-\end{tabular}
-
-\zihao{0}
-初号字初号字初号字初号字初号字初号字初号字初号字初号字初号字
-初号字初号字初号字初号字初号字初号字初号字初号字初号字初号字
-初号字初号字初号字初号字初号字初号字初号字初号字初号字初号字
-
-\zihao{-0}
-小初号小初号小初号小初号小初号小初号小初号小初号小初号小初号
-小初号小初号小初号小初号小初号小初号小初号小初号小初号小初号
-小初号小初号小初号小初号小初号小初号小初号小初号小初号小初号
-
-\zihao{1}
-一号字一号字一号字一号字一号字一号字一号字一号字一号字一号字
-一号字一号字一号字一号字一号字一号字一号字一号字一号字一号字
-一号字一号字一号字一号字一号字一号字一号字一号字一号字一号字
-
-\zihao{-1}
-小一号小一号小一号小一号小一号小一号小一号小一号小一号小一号
-小一号小一号小一号小一号小一号小一号小一号小一号小一号小一号
-小一号小一号小一号小一号小一号小一号小一号小一号小一号小一号
-
-\zihao{2}
-二号字二号字二号字二号字二号字二号字二号字二号字二号字二号字
-二号字二号字二号字二号字二号字二号字二号字二号字二号字二号字
-二号字二号字二号字二号字二号字二号字二号字二号字二号字二号字
-
-\zihao{-2}
-小二号小二号小二号小二号小二号小二号小二号小二号小二号小二号
-小二号小二号小二号小二号小二号小二号小二号小二号小二号小二号
-小二号小二号小二号小二号小二号小二号小二号小二号小二号小二号
-
-\zihao{3}
-三号字三号字三号字三号字三号字三号字三号字三号字三号字三号字
-三号字三号字三号字三号字三号字三号字三号字三号字三号字三号字
-三号字三号字三号字三号字三号字三号字三号字三号字三号字三号字
-
-\zihao{-3}
-小三号小三号小三号小三号小三号小三号小三号小三号小三号小三号
-小三号小三号小三号小三号小三号小三号小三号小三号小三号小三号
-小三号小三号小三号小三号小三号小三号小三号小三号小三号小三号
-
-\zihao{4}
-四号字四号字四号字四号字四号字四号字四号字四号字四号字四号字
-四号字四号字四号字四号字四号字四号字四号字四号字四号字四号字
-四号字四号字四号字四号字四号字四号字四号字四号字四号字四号字
-四号字四号字四号字四号字四号字四号字四号字四号字四号字四号字
-四号字四号字四号字四号字四号字四号字四号字四号字四号字四号字
-
-\zihao{-4}
-小四号小四号小四号小四号小四号小四号小四号小四号小四号小四号
-小四号小四号小四号小四号小四号小四号小四号小四号小四号小四号
-小四号小四号小四号小四号小四号小四号小四号小四号小四号小四号
-小四号小四号小四号小四号小四号小四号小四号小四号小四号小四号
-小四号小四号小四号小四号小四号小四号小四号小四号小四号小四号
-
-\zihao{5}
-五号字五号字五号字五号字五号字五号字五号字五号字五号字五号字
-五号字五号字五号字五号字五号字五号字五号字五号字五号字五号字
-五号字五号字五号字五号字五号字五号字五号字五号字五号字五号字
-五号字五号字五号字五号字五号字五号字五号字五号字五号字五号字
-五号字五号字五号字五号字五号字五号字五号字五号字五号字五号字
-
-\zihao{-5}
-小五号小五号小五号小五号小五号小五号小五号小五号小五号小五号
-小五号小五号小五号小五号小五号小五号小五号小五号小五号小五号
-小五号小五号小五号小五号小五号小五号小五号小五号小五号小五号
-小五号小五号小五号小五号小五号小五号小五号小五号小五号小五号
-小五号小五号小五号小五号小五号小五号小五号小五号小五号小五号
-
-\zihao{6}
-六号字六号字六号字六号字六号字六号字六号字六号字六号字六号字
-六号字六号字六号字六号字六号字六号字六号字六号字六号字六号字
-六号字六号字六号字六号字六号字六号字六号字六号字六号字六号字
-六号字六号字六号字六号字六号字六号字六号字六号字六号字六号字
-六号字六号字六号字六号字六号字六号字六号字六号字六号字六号字
-
-\zihao{-6}
-小六号小六号小六号小六号小六号小六号小六号小六号小六号小六号
-小六号小六号小六号小六号小六号小六号小六号小六号小六号小六号
-小六号小六号小六号小六号小六号小六号小六号小六号小六号小六号
-小六号小六号小六号小六号小六号小六号小六号小六号小六号小六号
-小六号小六号小六号小六号小六号小六号小六号小六号小六号小六号
-
-\zihao{7}
-七号字七号字七号字七号字七号字七号字七号字七号字七号字七号字
-七号字七号字七号字七号字七号字七号字七号字七号字七号字七号字
-七号字七号字七号字七号字七号字七号字七号字七号字七号字七号字
-七号字七号字七号字七号字七号字七号字七号字七号字七号字七号字
-七号字七号字七号字七号字七号字七号字七号字七号字七号字七号字
-
-\zihao{8}
-八号字八号字八号字八号字八号字八号字八号字八号字八号字八号字
-八号字八号字八号字八号字八号字八号字八号字八号字八号字八号字
-八号字八号字八号字八号字八号字八号字八号字八号字八号字八号字
-八号字八号字八号字八号字八号字八号字八号字八号字八号字八号字
-八号字八号字八号字八号字八号字八号字八号字八号字八号字八号字
-
-\normalsize
-
-\section{字距}
-
-测试命令:|\ziju| \index{ziju}
-
-标准字距为零,改变字距后:|\ziju{1}|
-
-{\ziju{1}
-现在的字距为 1 个字,英文不受影响:\\
-This is an English example。
-}
-
-\section{字宽}
-
-测试命令:|\ccwd| \index{ccwd}
-
-当前汉字字宽是 \the\ccwd,即盒子 \framebox[\ccwd]{\ } 的宽度。
-
-改变字号大小后:|\zihao{3}|
-
-{\zihao{3}
-当前汉字字宽是 \the\ccwd,即盒子 \framebox[\ccwd]{\ } 的宽度。
-}
-
-改变字距后:|\ziju{1}|
-
-{\ziju{1}
-当前汉字字宽是 \the\ccwd,即盒子 \framebox[\ccwd]{\ } 的宽度。
-}
-
-\section{段首缩进}
-
-测试命令:|\CTEXindent| \index{CTEXindent}
-
-标准的中文段首缩进是两个汉字:
-
-这是缩进的行。
-
-\noindent 这是没有缩进的行。
-
-改变字号大小后:|\zihao{3}|
-
-{\zihao{3}
-这是缩进的行。
-
-\noindent 这是没有缩进的行。
-}
-
-改变字距后:|\ziju{1}|
-
-{\ziju{1}
-这是缩进的行。
-
-\noindent 这是没有缩进的行。
-}
-
-\section{字体命令}
-
-\begin{tabular}{ll}
- |\songti| & {\songti 宋体} \\
- |\heiti| & {\heiti 黑体} \\
- |\fangsong| & {\fangsong 仿宋} \\
- |\kaishu| & {\kaishu 楷书} \\
- |\lishu| & (无效) \\ %{\lishu 隶书} \\
- |\youyuan| & (无效) \\ %{\youyuan 幼圆}
-\end{tabular}
-
-\index{songti} \index{heiti} \index{fangsong} \index{kaishu} \index{lishu} \index{youyuan}
-
-\section{字体框架}
-
-\begin{center}
-\begin{tabular}{lllll}
-
-\hline
- Family & Series & Shape & 命令 & 例子 \\ \hline
- {\bf rm} & & & |\rmfamily| &
- {\rmfamily English 中文字体} \\
- & & it & |\rmfamily\itshape| &
- {\rmfamily\itshape English 中文字体} \\
- & & sl & |\rmfamily\slshape| &
- {\rmfamily\slshape English 中文字体} \\ \cline{2-5}
- & bf & & |\rmfamily\bfseries| &
- {\rmfamily\bfseries English 中文字体} \\
- & bf & it & |\rmfamily\bfseries\itshape| &
- {\rmfamily\bfseries\itshape English 中文字体} \\
- & bf & sl & |\rmfamily\bfseries\slshape| &
- {\rmfamily\bfseries\slshape English 中文字体} \\ \hline
-
- {\bf sf} & & & |\sffamily| &
- {\sffamily English 中文字体} \\
- & & it & |\sffamily\itshape| &
- {\sffamily\itshape English 中文字体} \\
- & & sl & |\sffamily\slshape| &
- {\sffamily\slshape English 中文字体} \\ \cline{2-5}
- & bf & & |\sffamily\bfseries| &
- {\sffamily\bfseries English 中文字体} \\
- & bf & it & |\sffamily\bfseries\itshape| &
- {\sffamily\bfseries\itshape English 中文字体} \\
- & bf & sl & |\sffamily\bfseries\slshape| &
- {\sffamily\bfseries\slshape English 中文字体} \\ \hline
-
- {\bf tt} & & & |\ttfamily| &
- {\ttfamily English 中文字体} \\
- & & it & |\ttfamily\itshape| &
- {\ttfamily\itshape English 中文字体} \\
- & & sl & |\ttfamily\slshape| &
- {目前不可用} \\ \cline{2-5}
- & bf & & |\ttfamily\bfseries| &
- {\ttfamily\bfseries English 中文字体} \\
- & bf & it & |\ttfamily\bfseries\itshape| &
- {\ttfamily\bfseries\itshape English 中文字体} \\
- & bf & sl & |\ttfamily\bfseries\slshape| &
- {目前不可用} \\ \hline
-\end{tabular}
-\end{center}
-
-
-\chapter{高级命令}
-
-\section{中文数字}
-
-测试命令:|\CTEXnumber| |\CTEXdigits| \index{CTEXnumber} \index{CTEXdigits}
-
-\CTEXnumber{\test}{100002005}
-\typeout{\test}
-\test
-
-\CTEXdigits{\test}{100002005}
-\typeout{\test}
-\test
-
-\section{中文引用}
-
-测试命令:|\ref| |\ref*| \index{ref} \index{ref*}
-
-我们引用的是:\ref{chapter:intro}。
-
-我们引用的是:\ref*{chapter:intro}。(不带超链接)
-
-\section{索引}
-
-测试命令:|\index| \index{index}
-
-\index{test1}
-\index{test2}
-\index{test3}
-\index{test4}
-\index{test5}
-\index{test6}
-\index{test7}
-\index{test8}
-\index{test9}
-\index{test10}
-\index{test11}
-\index{test12}
-\index{test13}
-\index{test14}
-\index{test15}
-\index{test16}
-\index{test17}
-\index{test18}
-\index{test19}
-\index{test20}
-\index{test21}
-\index{test22}
-\index{test23}
-\index{test24}
-\index{test25}
-\index{test26}
-\index{test27}
-\index{test28}
-\index{test29}
-\index{test30}
-\index{test31}
-\index{test32}
-\index{test33}
-\index{test34}
-\index{test35}
-\index{test36}
-\index{test37}
-\index{test38}
-\index{test39}
-\index{test40}
-\index{test41}
-\index{test42}
-\index{test43}
-\index{test44}
-\index{test45}
-\index{test46}
-\index{test47}
-\index{test48}
-\index{test49}
-\index{test50}
-
-
-\chapter{中文标点}
-
-一千九百八十年间,西京城里出了桩异事,两个关系是死死的朋友,一日活得泼烦,去
-了唐贵妃杨玉环的墓地凭吊,见许多游人都抓了一包坟丘的土携在怀里,甚感疑惑,询
-问了,才知贵妃是绝代佳人,这土拿回去撒入花盆,花就十分鲜艳。这二人遂也刨了许
-多,用衣包回,装在一只收藏了多年的黑陶盆里,只待有了好的花籽来种。没想,数天
-之后,盆里兀自生出绿芽,月内长大,竟蓬蓬勃勃了一丛,但这草木特别,无人能识得
-品类。抱了去城中孕璜寺的老花工请教,花工也是不识。恰有智祥大师经过,又请教大
-师,大师还是摇头。其中一人却说:“常闻大师能卜卦预测,不妨占这花将来能开几
-枝?”大师命另一人取一个字来,那人适持花工的剪刀在手,随口说出个“耳”字。大
-师说:“花是奇花,当开四枝,但其景不久,必为尔所残也。”后花开果然如数,但形
-状类似牡丹,又类似玫瑰。且一枝蕊为红色,一枝蕊为黄色,一枝蕊为白色,一枝蕊为
-紫色,极尽娇美。一时消息传开每日欣赏者不绝,莫不叹为观止。两个朋友自然得意,
-尤其一个更是珍惜,供养案头,亲自浇水施肥,殷勤务弄。不料某日醉酒,夜半醒来忽
-觉得该去浇灌,竟误把厨房炉子上的热水壶提去,结果花被浇死。此人悔恨不已,索性
-也摔了陶盆,生病睡倒一月不起。
-
-\paragraph{第一段}
-此事虽异,毕竟为一盆花而已,知道之人还并不广大,过后也便罢了。没想到了夏天,
-西京城却又发生了一桩更大的人人都经历的异事。是这古历六月初七的晌午,先是太阳
-还红堂堂地照着,太阳的好处是太阳照着而人却忘记了还有太阳在照着,所以这个城里
-的人谁也没有往天上去看。街面的形势依旧是往日形势。有级别坐卧车的坐着卧车。没
-级别的,但有的是钱,便不愿挤那公共车了,抖着票子去搭出租车。偏偏有了什么重要
-的人物亲临到这里,数辆的警车护卫开道,尖锐的警笛就长声儿价地吼,所有的卧车,
-出租车、公共车只得靠边慢行,扰乱了自行车长河的节奏。只有徒步的人只管徒步,你
-踩着我的影子,我踩着他的影子,影子是不痛不痒的。突然。影子的颜色由深而浅,愈
-浅愈短,一瞬间全然消失。人没有了阴影拖着,似乎人不是了人,用手在屁股后摸摸,
-摸得一脸的疑惑。有人就偶尔往天上一瞅,立即欢呼:“天上有四个太阳了!”人们全
-举了头往天上看,天上果然出现了四个太阳。四个太阳大小一般,分不清了新旧雌雄,
-是聚在一起的,组成个丁字形。过去的经验里,天上是有过月亏和日蚀的,但同时有四
-个太阳却没有遇过,以为是眼睛看错了;再往天上看,那太阳就不再发红,是白的,白
-得像电焊光一样的白,白得还像什么?什么就也看不见了,完全的黑暗人是看不见了什
-么的,完全的光明人竟也是看不见了什么吗?大小的车辆再不敢发动了,只鸣喇叭,人
-却胡扑乱踏,恍惚里甚或就感觉身已不在街上了,是在看电影吧?放映机突然发生故障,
-银幕上的图象消失了,而音响还在进行着。一个人这么感觉了,所有的人差不多也都这
-么感觉了,于是寂静下来,竟静得死气沉沉,唯有城墙头上有人吹动的埙音最后要再吹
-一声,但没有吹起,是力气用完,像风撞在墙角,拐了一下,消失了。人们似乎看不起
-吹埙的人,笑了一下,猛地惊醒身处的现实,同时被寂静所恐惧,哇哇惊叫,各处便疯
-倒了许多。
-
-\paragraph{第二段}
-这样的怪异持续了近半个小时,天上的太阳又恢复成了一个。待人们的眼睛逐渐看见地
-上有了自己的影子,皆面面相觑,随之倒为人的狼狈有了羞愧,就慌不择路地四散。一
-时又是人乱如蚁,却不见了指挥交通的警察。安全岛上,悠然独坐的竟是一个老头。老
-头囚首垢面,却有一双极长的眉眼,冷冷地看着人的忙忙。这眼神使大家有些受不得,
-终就愤怒了,遂喊警察呢?警察在哪儿,姓苏的警察就一边跑一边戴头上的硬壳帽子,
-骂着老叫花子:“pi!”“pi”是西京城里骂“滚”的最粗俗的土话。老头听了,
-拿手指在安全岛上写,写出来却是一个极文雅的上古词:避,就慢慢地笑了。随着笑起
-来的是一大片,因为老头走下安全岛的时候、暴露了身上的衣服原是孕璜寺香客敬奉的
-锦旗所制。前心印着“有求”两字,那双腿岔开,裤裆处是粗糙的大针脚一直到了后腰,
-屁股蛋上左边就是个“必”字,右边就是个“应”字,老头并不知耻,却出口成章;说
-出了一段谣儿来。这谣儿后来流传全城,其辞是:一类人是公仆,高高在上享清福。二
-类人作“官倒”,投机倒把有人保。三类人搞承包,吃喝嫖赌全报销。四类人来租赁,
-坐在家里拿利润。五类人大盖帽,吃了原告吃被告。六类人手术刀,腰里揣满红纸包。
-七类人当演员,扭扭屁股就赚钱。八类人搞宣传,隔三岔五解个馋。九类人为教员,山
-珍海味认不全。十类人主人翁,老老实实学雷锋。
-
-此谣儿流传开来后,有人分析老头并不是个乞丐,或者说他起码是个教师,因为只有教
-师才能编出这样的谣辞,且谣辞中对前几类人都横加指责,唯独为教师一类人喊苦叫屈。
-但到底老头是什么人,无人再作追究。这一年里,恰是西京城里新任了一位市长,这市
-长原籍上海,夫人却是西京土著,十数春秋,西京的每任市长都有心在这座古城建功立
-业,但却差不多全是几经折腾,起色甚微,便铁打的营盘流水的官去了。新的市长虽不
-悦意在岳父门前任职,苦于身在仕途,全然由不得自己,到任后就犯难该从何处举纲张
-目。夫人属于贤内助,便召集了许多亲朋好友为其夫顾问参谋,就有了一个年轻人叫黄
-德复的,说出了一段建议来:西京是十二朝古都,文化积淀深厚是资本也是负担。各层
-干部和群众思维趋于保守,故长期以来经济发展比沿海省市远远落后,若如前几任的市
-长那样面面俱抓,常因企业老化,城建欠帐大多、用尽十分力,往往只有三分效果,且
-当今任职总是三年或五载就得调动,长远规划难以完成便又人事更新;与其这样,倒不
-如抓别人不抓之业,如发展文化和旅游,短期内倒有政绩出现。市长大受启发,不耻下
-问,竟邀这年轻人谈了三天三夜,又将其调离原来任职的学校来市府作了身边秘书。一
-时间,上京索要拨款,在下四处集资,干了一宗千古不朽之宏业,即修复了西京城墙,
-疏通了城河,沿城河边建成极富地方特色的娱乐场。又改建了三条大街:一条为仿唐建
-筑街,专售书画、瓷器;一条为仿宋建筑街,专营全市乃至全省民间小吃;一条仿明、
-清建筑街,集中了所有民间工艺品、土特产。但是,城市文化旅游业的大力发展,使城
-市的流动人员骤然增多,就出现了许多治安方面的弊病,一时西京城被外地人称作贼城、
-烟城、暗娼城。市民也开始滋生另一种的不满情绪。当那位囚首垢面的老头又在街头说
-他的谣儿,身后总是厮跟了一帮闲汉,嚷道:“来一段,再来一段!”,老头就说了两
-句:“说你行,你就行,不行也行。说不行,就不行,行也不行。”闲汉们听了,一齐
-鼓掌。老头并没说这谣儿所指何人,闲汉们却对号入座,将这谣儿传得风快,自然黄德
-复不久也听到了,便给公安局拨了电话,说老头散布市长的谣言,应予制止。公安局收
-留了老头,一查,原是一位十多年上访痞子。为何是上访痞子?因是此人十多年前任民
-办教师,转公办教师时受到上司陷害未能转成,就上访省府,仍未能成功,于是长住西
-京,隔三间五去省府门口提意见,递状书,静坐耍赖,慢慢地欲进没有门路,欲退又无
-台阶,精神变态,后来也索性不再上访。亦不返乡,就在街头流浪起来。公安局收审了
-十天、查无大罪,又放出来,用车一气拉出城三百里地放下。没想这老头几天后又出现
-在街头,却拉动了一辆架子车,沿街穿巷收拾破烂了。一帮闲汉自然拥他,唆使再说谣
-儿,老头却吝啬了口舌,只吼很高很长的“破烂喽-!承包破烂-喽!”这叫声每日
-早晚在街巷吼叫。常也有人在城墙头上吹埙,一个如狼嚎,一个鸣咽如鬼,两厢呼应,
-钟楼鼓楼上的成百上千只鸟类就聒噪一片了。
-
-
-\chapter{CJKfntef 和 CCTfntef}
-
-\CTEXunderdot{此谣儿流传开来后}
-
-\CTEXunderline{此谣儿流传开来后}
-
-\CTEXunderdblline{此谣儿流传开来后}
-
-\CTEXunderwave{此谣儿流传开来后}
-
-\CTEXsout{此谣儿流传开来后}
-
-\CTEXxout{此谣儿流传开来后}
-
-
-\begin{CTEXfilltwosides}{3cm}
-此谣 \\
-儿流 \\
-传开 \\
-来后
-\end{CTEXfilltwosides}
-
-
-\chapter{标题汉字与\%百分号\%}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-\chapter{其他测试}
-
-其他测试
-
-
-\appendix
-
-\chapter{测试}
-
-测试
-
-\chapter{测试}
-
-测试
-
-\chapter{测试}
-
-测试
-
-
-\printindex
-
-\end{document}
diff --git a/Master/texmf-dist/doc/latex/ctex/test/test-xetexgbk.tex b/Master/texmf-dist/doc/latex/ctex/test/test-xetexgbk.tex
deleted file mode 100644
index fcf7ffdea80..00000000000
--- a/Master/texmf-dist/doc/latex/ctex/test/test-xetexgbk.tex
+++ /dev/null
@@ -1,819 +0,0 @@
-%# -*- coding: gbk -*-
-% $Id: test-xetexgbk.tex 257 2011-03-11 04:56:11Z leoliu.pku@gmail.com $
-% test-xetex.tex: XeTeX only test case, use xelatex to run
-\XeTeXinputencoding "GBK"
-\documentclass[cs4size,a4paper,fancyhdr,fntef,GBK,winfonts,hyperref]{ctexbook}
-% ˵ʵ GBK ڴ˲á
-% Դļֹ \XeTeXinputencoding "GBK"
-
-\usepackage{hyperref}
-
-\usepackage{shortvrb, makeidx}
-
-\setlength{\headheight}{15pt}
-
- \makeindex
-
- \MakeShortVerb{\|}
-
- \setlength{\parskip}{0.75ex plus .2ex minus .5ex}
- \renewcommand{\baselinestretch}{1.2}
-
- \pagestyle{fancy}
-
-
- \newcommand{\ctex}{\texttt{ctex}}
- \newcommand{\ctexorg}{\texttt{ctex.org}}
-
- \newcommand{\TestFile}{ļ}
-
-
- \CTEXoptions[today=big]
- \CTEXsetup[name={,},number={\chinese{section}},format+={\bfseries},beforeskip={-10ex plus -.1ex minus -.1ex},afterskip={1ex plus .1ex minus .1ex}]{section}
- \CTEXsetup[name={},number={\chinese{chapter}}]{appendix}
-
- \CTEXsetup[name={,ƪ},nameformat={\centering\bfseries},titleformat={\zihao{0}\bfseries}]{part}
-
- \setcounter{secnumdepth}{4}
- \CTEXsetup[name={(,)},number={\arabic{paragraph}}]{paragraph}
-
-
-\begin{document}
-
-\title{ ctex \TestFile\thanks{just test}}
-\author{}
-
-\maketitle
-
-\tableofcontents
-
-
-\part{ǰ}
-
-\chapter{} \label{chapter:intro}
-
-
-
-\section{˵}
-
-\ctex{} ṩ˱д \LaTeX{} ĵõһЩ궨
-Ҫ CJK ֧֣ \ctexorg{} ά
-
-ļڲ \ctex{} ͹ܡ
-
-
-\part{}
-
-\chapter{}
-
-
-
-
-\section{ֺ}
-|\zihao| \index{zihao}
-
-\begin{tabular}{l}
-\zihao{0} English \\
-\zihao{-0} С English \\
-\zihao{1} һ English \\
-\zihao{-1} Сһ English \\
-\zihao{2} English \\
-\zihao{-2} С English \\
-\zihao{3} English \\
-\zihao{-3} С English \\
-\zihao{4} ĺ English \\
-\zihao{-4} Сĺ English \\
-\zihao{5} English \\
-\zihao{-5} С English \\
-\zihao{6} English \\
-\zihao{-6} С English \\
-\zihao{7} ߺ English \\
-\zihao{8} ˺ English \\
-\end{tabular}
-
-\zihao{0}
-ֳֳֳֳֳֳֳֳֳ
-ֳֳֳֳֳֳֳֳֳ
-ֳֳֳֳֳֳֳֳֳ
-
-\zihao{-0}
-СССССССССС
-СССССССССС
-СССССССССС
-
-\zihao{1}
-һһһһһһһһһһ
-һһһһһһһһһһ
-һһһһһһһһһһ
-
-\zihao{-1}
-СһСһСһСһСһСһСһСһСһСһ
-СһСһСһСһСһСһСһСһСһСһ
-СһСһСһСһСһСһСһСһСһСһ
-
-\zihao{2}
-ֶֶֶֶֶֶֶֶֶ
-ֶֶֶֶֶֶֶֶֶ
-ֶֶֶֶֶֶֶֶֶ
-
-\zihao{-2}
-СССССССССС
-СССССССССС
-СССССССССС
-
-\zihao{3}
-
-
-
-
-\zihao{-3}
-СССССССССС
-СССССССССС
-СССССССССС
-
-\zihao{4}
-ĺĺĺĺĺĺĺĺĺĺ
-ĺĺĺĺĺĺĺĺĺĺ
-ĺĺĺĺĺĺĺĺĺĺ
-ĺĺĺĺĺĺĺĺĺĺ
-ĺĺĺĺĺĺĺĺĺĺ
-
-\zihao{-4}
-СĺСĺСĺСĺСĺСĺСĺСĺСĺСĺ
-СĺСĺСĺСĺСĺСĺСĺСĺСĺСĺ
-СĺСĺСĺСĺСĺСĺСĺСĺСĺСĺ
-СĺСĺСĺСĺСĺСĺСĺСĺСĺСĺ
-СĺСĺСĺСĺСĺСĺСĺСĺСĺСĺ
-
-\zihao{5}
-
-
-
-
-
-
-\zihao{-5}
-СССССССССС
-СССССССССС
-СССССССССС
-СССССССССС
-СССССССССС
-
-\zihao{6}
-
-
-
-
-
-
-\zihao{-6}
-СССССССССС
-СССССССССС
-СССССССССС
-СССССССССС
-СССССССССС
-
-\zihao{7}
-ߺߺߺߺߺߺߺߺߺߺ
-ߺߺߺߺߺߺߺߺߺߺ
-ߺߺߺߺߺߺߺߺߺߺ
-ߺߺߺߺߺߺߺߺߺߺ
-ߺߺߺߺߺߺߺߺߺߺ
-
-\zihao{8}
-˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺
-˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺
-˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺
-˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺
-˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺ְ˺
-
-\normalsize
-
-\section{־}
-
-|\ziju| \index{ziju}
-
-׼־Ϊ㣬ı־|\ziju{1}|
-
-{\ziju{1}
-ڵ־Ϊ 1 ֣ӢIJӰ죺\\
-This is an English example
-}
-
-\section{ֿ}
-
-|\ccwd| \index{ccwd}
-
-ǰֿ \the\ccwd \framebox[\ccwd]{\ } Ŀȡ
-
-ıֺŴС|\zihao{3}|
-
-{\zihao{3}
-ǰֿ \the\ccwd \framebox[\ccwd]{\ } Ŀȡ
-}
-
-ı־|\ziju{1}|
-
-{\ziju{1}
-ǰֿ \the\ccwd \framebox[\ccwd]{\ } Ŀȡ
-}
-
-\section{}
-
-|\CTEXindent| \index{CTEXindent}
-
-׼Ķ֣
-
-
-\noindent ûС
-
-ıֺŴС|\zihao{3}|
-
-{\zihao{3}
-
-\noindent ûС
-}
-
-ı־|\ziju{1}|
-
-{\ziju{1}
-
-\noindent ûС
-}
-
-\section{}
-
-\begin{tabular}{ll}
- |\songti| & {\songti } \\
- |\heiti| & {\heiti } \\
- |\fangsong| & {\fangsong } \\
- |\kaishu| & {\kaishu } \\
- |\lishu| & Ч \\ %{\lishu } \\
- |\youyuan| & Ч %{\youyuan Բ}
-\end{tabular}
-
-\index{songti} \index{heiti} \index{fangsong} \index{kaishu} \index{lishu} \index{youyuan}
-
-\section{}
-
-\begin{center}
-\begin{tabular}{lllll}
-
-\hline
- Family & Series & Shape & & \\ \hline
- {\bf rm} & & & |\rmfamily| &
- {\rmfamily English } \\
- & & it & |\rmfamily\itshape| &
- {\rmfamily\itshape English } \\
- & & sl & |\rmfamily\slshape| &
- {\rmfamily\slshape English } \\ \cline{2-5}
- & bf & & |\rmfamily\bfseries| &
- {\rmfamily\bfseries English } \\
- & bf & it & |\rmfamily\bfseries\itshape| &
- {\rmfamily\bfseries\itshape English } \\
- & bf & sl & |\rmfamily\bfseries\slshape| &
- {\rmfamily\bfseries\slshape English } \\ \hline
-
- {\bf sf} & & & |\sffamily| &
- {\sffamily English } \\
- & & it & |\sffamily\itshape| &
- {\sffamily\itshape English } \\
- & & sl & |\sffamily\slshape| &
- {\sffamily\slshape English } \\ \cline{2-5}
- & bf & & |\sffamily\bfseries| &
- {\sffamily\bfseries English } \\
- & bf & it & |\sffamily\bfseries\itshape| &
- {\sffamily\bfseries\itshape English } \\
- & bf & sl & |\sffamily\bfseries\slshape| &
- {\sffamily\bfseries\slshape English } \\ \hline
-
- {\bf tt} & & & |\ttfamily| &
- {\ttfamily English } \\
- & & it & |\ttfamily\itshape| &
- {\ttfamily\itshape English } \\
- & & sl & |\ttfamily\slshape| &
- {Ŀǰ} \\ \cline{2-5}
- & bf & & |\ttfamily\bfseries| &
- {\ttfamily\bfseries English } \\
- & bf & it & |\ttfamily\bfseries\itshape| &
- {\ttfamily\bfseries\itshape English } \\
- & bf & sl & |\ttfamily\bfseries\slshape| &
- {Ŀǰ} \\ \hline
-\end{tabular}
-\end{center}
-
-
-\chapter{߼}
-
-\section{}
-
-|\CTEXnumber| |\CTEXdigits| \index{CTEXnumber} \index{CTEXdigits}
-
-\CTEXnumber{\test}{100002005}
-\typeout{\test}
-\test
-
-\CTEXdigits{\test}{100002005}
-\typeout{\test}
-\test
-
-\section{}
-
-|\ref| |\ref*| \index{ref} \index{ref*}
-
-õǣ\ref{chapter:intro}
-
-õǣ\ref*{chapter:intro}ӣ
-
-\section{}
-
-|\index| \index{index}
-
-\index{test1}
-\index{test2}
-\index{test3}
-\index{test4}
-\index{test5}
-\index{test6}
-\index{test7}
-\index{test8}
-\index{test9}
-\index{test10}
-\index{test11}
-\index{test12}
-\index{test13}
-\index{test14}
-\index{test15}
-\index{test16}
-\index{test17}
-\index{test18}
-\index{test19}
-\index{test20}
-\index{test21}
-\index{test22}
-\index{test23}
-\index{test24}
-\index{test25}
-\index{test26}
-\index{test27}
-\index{test28}
-\index{test29}
-\index{test30}
-\index{test31}
-\index{test32}
-\index{test33}
-\index{test34}
-\index{test35}
-\index{test36}
-\index{test37}
-\index{test38}
-\index{test39}
-\index{test40}
-\index{test41}
-\index{test42}
-\index{test43}
-\index{test44}
-\index{test45}
-\index{test46}
-\index{test47}
-\index{test48}
-\index{test49}
-\index{test50}
-
-
-\chapter{ı}
-
-һǧŰٰʮ䣬׮£ϵѣһջ÷ȥ
-ƹ񻷵Ĺƾ˶ץһЯڻɻѯ
-ˣ֪Ǿˣûȥ뻨裬ʮޡҲ
-࣬°أװһֻղ˶ĺֻ˺õĻ֡û룬
-֮أѿڳ󣬾һԣľرʶ
-Ʒࡣȥµϻ̣ҲDzʶǡʦ̴
-ʦʦҡͷһȴ˵ŴʦܲԤ⣬ռ⻨ܿ
-֦ʦһȡһʳֻļ֣˵֡
-ʦ˵滨֦侰ãΪҲ󻨿Ȼ
-״ĵõ塣һ֦Ϊɫһ֦Ϊɫһ֦Ϊɫһ֦Ϊ
-ɫһʱϢÿ߲Ī̾ΪֹȻ⣬
-һϧͷԽˮʩʣŪijƣҹ
-øȥ࣬ѳ¯ϵˮȥ˻ں޲ѣ
-Ҳˤ裬˯һ²
-
-\paragraph{һ}
-죬ϾΪһ軨ѣ֪֮˻󣬹Ҳˡû뵽죬
-ȴַһ׮˶¡³ߵ磬̫
-õţ̫ĺô̫Ŷȴ˻̫ţ
-˭ҲûȥơмԳԳû
-ģеǮ㲻ԸǹˣƱȥ⳵ƫƫʲôҪ
-ٵľľѾͳ۵غеԳ
-⳵ֻÿУгӵĽࡣֻͽֻͽ
-ҵӰӣҲӰӣӰDzʹġͻȻӰӵɫdz
-dẓһ˲ȫȻʧûӰţƺ˲ˣƨɺ
-һɻ˾żһĸ̫ˣȫ
-ͷϿϹȻĸ̫ĸ̫Сһ㣬ֲ¾ɴۣ
-ǾһģɸΡȥľй¿ʴģͬʱ
-̫ȴûΪ۾ˣϿ̫Ͳٷ죬ǰ׵ģ
-纸һİף׵ûʲôʲôҲˣȫĺڰǿʲ
-ôģȫĹ˾Ҳǿʲô𣿴Сijٲҷˣֻȣ
-ȴ̤͸оѲڽˣڿӰɣӳͻȻϣ
-Ļϵͼʧˣ컹ڽšһôоˣе˲Ҳ
-ôоˣǼžΨгǽͷ˴Ҫٴ
-һûд꣬ײǽǣһ£ʧˡƺ
-ˣЦһ£͵ؾʵͬʱž־壬۾У
-ࡣ
-
-\paragraph{ڶ}
-Ĺ˽Сʱϵָֻ̫һǵ۾𽥿
-ԼӰӣ֮Ϊ˵DZͻŲ·ɢһ
-ʱϣȴָӽͨľ졣ȫϣȻľһͷ
-ͷ׹棬ȴһ˫üۣؿ˵ææʹЩܲã
-վͷŭˣ캰أĶյľһһߴͷϵӲñӣ
-Ͻлӣpipi׵ͷˣ
-ָڰȫддȴһŵϹŴʣܣЦˡЦ
-һƬΪͷ°ȫʱ򡢱¶ϵ·ԭ;
-ơǰӡš֣˫ȲɴǴֲڵĴһֱ˺
-ƨɵ߾Ǹء֣ұ߾ǸӦ֣ͷ֪ܣȴڳ£˵
-һҥҥȫǣǣһǹͣ߸帣
-ٵͶ˱˸аԺζȫޣ
-ڼ˴ñԭԱ档ﴧֽ
-˵ԱŤŤƨɾ׬Ǯ˸ΪԱɽ
-亣ζϲȫʮ̣ʵʵѧ׷档
-
-ҥ˷ͷǸؤ˵ǸʦΪֻн
-ʦܱҥǣҥжǰ˶ָΨΪʦһ˺
-ͷʲôˣ׷һǡһλг
-ԭϺȴʮÿгųǽ
-ҵȴȫǼڣɫ΢ӪˮĹȥˡµг䲻
-ǰְ;ȫȻɲԼκͷѸôӺδٸ
-ĿټΪʲıһ˽л
-¸ģ˵һνʮŶĻʱҲǸ
-ɲȺ˼άڱأʳ÷չغʡԶԶǰε
-ץҵϻǽǷʴࡢþʮֻЧ
-ְؾ͵õԶ滮ɱ¸£
-ץ˲ץ֮ҵ緢չĻΣڵ֡г
-ʣ̸ҹֽԭְѧУи顣һ
-ʱ䣬ϾҪĴʣһǧŲ֮ҵ޸ǽ
-ͨ˳ǺӣسǺӱ߽ɼطɫֳָĽ֣һΪƽ
-֣ר黭һΪν֣רӪȫȫʡСԣһ
-彨֣乤ƷزǣĻҵĴչʹ
-еԱȻ࣬ͳΰıײһʱDZ˳ǡ
-̳ǡ潳ǡҲʼһֵIJλ׹ͷڽͷ˵
-ҥ˸һкµһΣһΣͷ˵
-䣺˵УУҲС˵УͲУҲСкˣһ
-ơͷû˵ҥָˣкȴԺҥ÷죬ȻƵ
-Ҳˣֲ˵绰˵ͷɢгҥԣӦֹ
-ͷһ飬ԭһλʮϷƦӡΪϷƦӣǴʮǰ
-ʦתʦʱܵ˾ݺδתɣϷʡδܳɹdzס
-ȥʡſ״飬ˣû·
-̨ף̬ҲԲϷá಻磬ڽͷ
-ʮ졢޴ַųóһط¡ûͷֳ
-ڽͷȴһӳؽִʰˡһкȻӵʹ˵ҥ
-ͷȴ˿ֻܸ࣬ߺܳġඣаãඣÿ
-ڽСҲڳǽͷϴһǺһӦ
-¥¥ϵijɰǧֻһƬˡ
-
-
-\chapter{CJKfntef CCTfntef}
-
-\CTEXunderdot{ҥ}
-
-\CTEXunderline{ҥ}
-
-\CTEXunderdblline{ҥ}
-
-\CTEXunderwave{ҥ}
-
-\CTEXsout{ҥ}
-
-\CTEXxout{ҥ}
-
-
-\begin{CTEXfilltwosides}{3cm}
-ҥ \\
- \\
- \\
-
-\end{CTEXfilltwosides}
-
-
-\chapter{⺺\%ٷֺ\%}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-
-\appendix
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-\chapter{}
-
-
-
-
-\printindex
-
-\end{document}
diff --git a/Master/texmf-dist/source/latex/ctex/ctex.dtx b/Master/texmf-dist/source/latex/ctex/ctex.dtx
new file mode 100644
index 00000000000..e81542a0afb
--- /dev/null
+++ b/Master/texmf-dist/source/latex/ctex/ctex.dtx
@@ -0,0 +1,8645 @@
+% \iffalse meta-comment
+% !TeX program = XeLaTeX
+% !TeX encoding = UTF-8
+%
+% Copyright (C) 2003--2015
+% 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 work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
+%
+% --------------------------------------------------------------------------
+%
+%<*internal>
+\iffalse
+%</internal>
+%<*readme>
+ctex is a collection of macro packages and document classes
+for LaTeX Chinese typesetting.
+
+This package is licensed in LPPL.
+
+The authors and contributors of this package are:
+
+ * Wu Lingyun <aloft@ctex.org>
+ * Jiang Jiang <gzjjgod@gmail.com>
+ * Wang Yue <yuleopen@gmail.com>
+ * Liu Haiyang <leoliu.pku@gmail.com>
+ * Li Yanrui <liyanrui.m2@gmail.com>
+ * Chen Zhichu <zhichu.chen@gmail.com>
+ * Li Qing <sobenlee@gmail.com>
+ * Liam Huang <liamhuang0205@gmail.com>
+
+If you are interested in the process of development you
+may observe
+
+ https://github.com/CTeX-org/ctex-kit
+
+Report feedback in the Issues section of ctex-kit project,
+or in [ctex](http://bbs.ctex.org) forum.
+
+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 (this file).
+
+%</readme>
+%<*internal>
+\fi
+\begingroup
+ \def\temp{LaTeX2e}
+\expandafter\endgroup\ifx\temp\fmtname\else
+\csname fi\endcsname
+%</internal>
+%<*install>
+
+\newread\inputcheck
+\openin\inputcheck=ctex.ver
+\ifeof\inputcheck
+ \def\ctexPutVersion{\string\GetIdInfo$Id$}
+\else
+ \input ctex.ver
+\fi
+\closein\inputcheck
+
+\input l3docstrip.tex
+
+\def\checkOption<#1{%
+ \ifcase
+ \ifx*#10\else \ifx/#11\else
+ \ifx+#12\else \ifx-#13\else
+ \ifx<#14\else \ifx @#15\else
+ \ifx.#16\else
+ 7\fi\fi\fi\fi\fi\fi\fi\relax
+ \expandafter\starOption\or
+ \expandafter\slashOption\or
+ \expandafter\plusOption\or
+ \expandafter\minusOption\or
+ \expandafter\verbOption\or
+ \expandafter\moduleOption\or
+ \expandafter\expOption\or
+ \expandafter\doOption\fi
+ #1%
+}
+\def\expOption .#1>#2\endLine{%
+ \maybeMsg{<.#1 . >}%
+ \Evaluate{#1}%
+ \begingroup
+ \catcode`\\=0 \catcode`\{=1 \catcode`\}=2
+ \xdef\expandedLineStuff{\scantokens{#2\noexpand}}%
+ \endgroup
+ \def\do##1##2##3{%
+ \if1\Expr{##2}\StreamPut##1{\expandedLineStuff}\fi
+ }%
+ \activefiles
+ }
+
+
+\keepsilent
+\askforoverwritefalse
+
+\preamble
+
+ 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.
+
+------------------------------------------------------------------------------
+
+\endpreamble
+
+\postamble
+
+ 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.
+\endpostamble
+
+\declarepostamble\emptypostamble
+\endpostamble
+
+
+\generate
+ {
+ \usedir{tex/latex/ctex}
+ \file{ctex.sty} {\from{\jobname.dtx}{package,style}}
+ \file{ctexcap.sty} {\from{\jobname.dtx}{package,ctexcap}}
+ \file{ctexsize.sty} {\from{\jobname.dtx}{package,ctexsize}}
+ \file{ctexart.cls} {\from{\jobname.dtx}{class,article}}
+ \file{ctexbook.cls} {\from{\jobname.dtx}{class,book}}
+ \file{ctexrep.cls} {\from{\jobname.dtx}{class,report}}
+ \usepostamble\emptypostamble
+ \file{ctex-c5size.clo} {\from{\jobname.dtx}{c5size}}
+ \file{ctex-cs4size.clo} {\from{\jobname.dtx}{cs4size}}
+ \file{ctex-article.def} {\from{\jobname.dtx}{heading,article}}
+ \file{ctex-book.def} {\from{\jobname.dtx}{heading,book}}
+ \file{ctex-report.def} {\from{\jobname.dtx}{heading,report}}
+ \file{ctex-scheme-plain.def} {\from{\jobname.dtx}{scheme,generic,plain}}
+ \file{ctex-scheme-plain-article.def} {\from{\jobname.dtx}{scheme,article,plain}}
+ \file{ctex-scheme-plain-book.def} {\from{\jobname.dtx}{scheme,book,plain}}
+ \file{ctex-scheme-plain-report.def} {\from{\jobname.dtx}{scheme,report,plain}}
+ \file{ctex-scheme-chinese.def} {\from{\jobname.dtx}{scheme,generic,chinese}}
+ \file{ctex-scheme-chinese-article.def} {\from{\jobname.dtx}{scheme,article,chinese}}
+ \file{ctex-scheme-chinese-book.def} {\from{\jobname.dtx}{scheme,book,chinese}}
+ \file{ctex-scheme-chinese-report.def} {\from{\jobname.dtx}{scheme,report,chinese}}
+ \file{ctex-name-gbk.cfg} {\from{\jobname.dtx}{GBK}}
+ \file{ctex-name-utf8.cfg} {\from{\jobname.dtx}{UTF8}}
+ \file{ctex.cfg} {\from{\jobname.dtx}{config}}
+ \file{ctexopts.cfg} {\from{\jobname.dtx}{ctexopts}}
+ \file{ctex-engine-pdftex.def} {\from{\jobname.dtx}{pdftex}}
+ \file{ctex-engine-xetex.def} {\from{\jobname.dtx}{xetex}}
+ \file{ctex-engine-luatex.def} {\from{\jobname.dtx}{luatex}}
+ \file{c19rm.fd} {\from{\jobname.dtx}{rm,c19}}
+ \file{c19sf.fd} {\from{\jobname.dtx}{sf,c19}}
+ \file{c19tt.fd} {\from{\jobname.dtx}{tt,c19}}
+ \file{c70rm.fd} {\from{\jobname.dtx}{rm,c70}}
+ \file{c70sf.fd} {\from{\jobname.dtx}{sf,c70}}
+ \file{c70tt.fd} {\from{\jobname.dtx}{tt,c70}}
+ \file{ctex-fontset-windows.def} {\from{\jobname.dtx}{fontset,windows}}
+ \file{ctex-fontset-windowsnew.def} {\from{\jobname.dtx}{fontset,windowsnew}}
+ \file{ctex-fontset-windowsold.def} {\from{\jobname.dtx}{fontset,windowsold}}
+ \file{ctex-fontset-adobe.def} {\from{\jobname.dtx}{fontset,adobe}}
+ \file{ctex-fontset-fandol.def} {\from{\jobname.dtx}{fontset,fandol}}
+ \file{ctex-fontset-mac.def} {\from{\jobname.dtx}{fontset,mac}}
+ \file{ctex-fontset-founder.def} {\from{\jobname.dtx}{fontset,founder}}
+ \file{ctex-fontset-ubuntu.def} {\from{\jobname.dtx}{fontset,ubuntu}}
+ \file{ctexspa.def}
+ {
+ \from{\jobname.dtx} {ctexspa}
+ \from{ctexpunct.spa} {}
+ }
+ \file{ctexmakespa.tex} {\from{\jobname.dtx}{spa,make}}
+ \file{ctexspamacro.tex} {\from{\jobname.dtx}{spa,macro}}
+ \file{zhadobefonts.tex} {\from{\jobname.dtx}{zhmap,adobe}}
+ \file{zhfandolfonts.tex} {\from{\jobname.dtx}{zhmap,fandol}}
+ \file{zhfounderfonts.tex} {\from{\jobname.dtx}{zhmap,founder}}
+ \file{zhubuntufonts.tex} {\from{\jobname.dtx}{zhmap,ubuntu}}
+ \file{zhwindowsfonts.tex} {\from{\jobname.dtx}{zhmap,windows}}
+ \usedir{source/latex/ctex}
+ \file{\jobname.ins} {\from{\jobname.dtx}{install}}
+ \nopreamble\nopostamble
+ \usedir{doc/latex/ctex}
+ \file{README.txt} {\from{\jobname.dtx}{readme}}
+ }
+
+\catcode32=12\space
+
+\Msg{*************************************************************}
+\Msg{* *}
+\Msg{* To finish the installation you have to move the following *}
+\Msg{* file into proper directories searched by TeX: *}
+\Msg{* *}
+\Msg{* The recommended directory is TDS:tex/latex/ctex *}
+\Msg{* *}
+\Msg{* ctex.sty *}
+\Msg{* ctexcap.sty *}
+\Msg{* ctexsize.sty *}
+\Msg{* ctexart.cls *}
+\Msg{* ctexbook.cls *}
+\Msg{* ctexrep.cls *}
+\Msg{* ctex-c5size.clo *}
+\Msg{* ctex-cs4size.clo *}
+\Msg{* ctex-article.def *}
+\Msg{* ctex-book.def *}
+\Msg{* ctex-report.def *}
+\Msg{* ctex-scheme-plain.def *}
+\Msg{* ctex-scheme-plain-article.def *}
+\Msg{* ctex-scheme-plain-book.def *}
+\Msg{* ctex-scheme-plain-report.def *}
+\Msg{* ctex-scheme-chinese.def *}
+\Msg{* ctex-scheme-chinese-article.def *}
+\Msg{* ctex-scheme-chinese-book.def *}
+\Msg{* ctex-scheme-chinese-report.def *}
+\Msg{* ctex-name-gbk.cfg *}
+\Msg{* ctex-name-utf8.cfg *}
+\Msg{* ctex.cfg *}
+\Msg{* ctexopts.cfg *}
+\Msg{* ctex-engine-pdftex.def *}
+\Msg{* ctex-engine-xetex.def *}
+\Msg{* ctex-engine-luatex.def *}
+\Msg{* c19rm.fd *}
+\Msg{* c19sf.fd *}
+\Msg{* c19tt.fd *}
+\Msg{* c70rm.fd *}
+\Msg{* c70sf.fd *}
+\Msg{* c70tt.fd *}
+\Msg{* ctex-fontset-windows.def *}
+\Msg{* ctex-fontset-windowsnew.def *}
+\Msg{* ctex-fontset-windowsold.def *}
+\Msg{* ctex-fontset-adobe.def *}
+\Msg{* ctex-fontset-fandol.def *}
+\Msg{* ctex-fontset-mac.def *}
+\Msg{* ctex-fontset-founder.def *}
+\Msg{* ctex-fontset-ubuntu.def *}
+\Msg{* ctexspa.def *}
+\Msg{* ctexmakespa.tex *}
+\Msg{* ctexspamacro.tex *}
+\Msg{* zhadobefonts.tex *}
+\Msg{* zhfandolfonts.tex *}
+\Msg{* zhfounderfonts.tex *}
+\Msg{* zhubuntufonts.tex *}
+\Msg{* zhwindowsfonts.tex *}
+\Msg{* *}
+\Msg{* To produce the documentation run the file ctex.dtx *}
+\Msg{* through XeLaTeX. *}
+\Msg{* *}
+\Msg{* Happy TeXing! *}
+\Msg{* *}
+\Msg{*************************************************************}
+
+\endbatchfile
+%</install>
+%<*internal>
+\fi
+%</internal>
+%<*!(readme|install|zhmap|spa)>
+%<*!(c19|c70|ctexspa)>
+%<*driver|package|class>
+\NeedsTeXFormat{LaTeX2e}
+\RequirePackage{expl3}
+%</driver|package|class>
+%<.!(readme|install|zhmap|spa|c19|c70|ctexspa)>\ctexPutVersion
+%<*driver>
+\InputIfFileExists{ctex.ver}{}{
+ \def\ctexGetVersionInfo{\GetIdInfo$Id$}}
+\ctexGetVersionInfo
+ {ctex source file}
+\ProvidesExplFile{\ExplFileName.\ExplFileExtension}
+%</driver>
+%<style> {Chinese adapter in LaTeX (CTEX)}
+%<style>\ProvidesExplPackage{\ExplFileName}
+%<ctexcap> {Chinese adapter in LaTeX (CTEX)}
+%<ctexcap>\ProvidesExplPackage{ctexcap}
+%<ctexsize> {Chinese font size definition (CTEX)}
+%<ctexsize>\ProvidesExplPackage{ctexsize}
+%<class&article> {Chinese adapter for class article (CTEX)}
+%<class&article>\ProvidesExplClass{ctexart}
+%<class&book> {Chinese adapter for class book (CTEX)}
+%<class&book>\ProvidesExplClass{ctexbook}
+%<class&report> {Chinese adapter for class report (CTEX)}
+%<class&report>\ProvidesExplClass{ctexrep}
+%<c5size> {c5size option (CTEX)}
+%<c5size>\ProvidesExplFile{ctex-c5size.clo}
+%<cs4size> {cs4size option (CTEX)}
+%<cs4size>\ProvidesExplFile{ctex-cs4size.clo}
+%<heading&article> {Heading modification for article (CTEX)}
+%<heading&article>\ProvidesExplFile{ctex-article.def}
+%<heading&book> {Heading modification for book (CTEX)}
+%<heading&book>\ProvidesExplFile{ctex-book.def}
+%<heading&report> {Heading modification for report (CTEX)}
+%<heading&report>\ProvidesExplFile{ctex-report.def}
+%<scheme&plain&generic> {Plain scheme for generic (CTEX)}
+%<scheme&plain&generic>\ProvidesExplFile{ctex-scheme-plain.def}
+%<scheme&plain&article> {Plain scheme for article (CTEX)}
+%<scheme&plain&article>\ProvidesExplFile{ctex-scheme-plain-article.def}
+%<scheme&plain&book> {Plain scheme for book (CTEX)}
+%<scheme&plain&book>\ProvidesExplFile{ctex-scheme-plain-book.def}
+%<scheme&plain&report> {Plain scheme for report (CTEX)}
+%<scheme&plain&report>\ProvidesExplFile{ctex-scheme-plain-report.def}
+%<scheme&chinese&generic> {Chinese scheme for generic (CTEX)}
+%<scheme&chinese&generic>\ProvidesExplFile{ctex-scheme-chinese.def}
+%<scheme&chinese&article> {Chinese scheme for article (CTEX)}
+%<scheme&chinese&article>\ProvidesExplFile{ctex-scheme-chinese-article.def}
+%<scheme&chinese&book> {Chinese scheme for book (CTEX)}
+%<scheme&chinese&book>\ProvidesExplFile{ctex-scheme-chinese-book.def}
+%<scheme&chinese&report> {Chinese scheme for report (CTEX)}
+%<scheme&chinese&report>\ProvidesExplFile{ctex-scheme-chinese-report.def}
+%<GBK> {Caption with encoding GBK (CTEX)}
+%<GBK>\ProvidesExplFile{ctex-name-gbk.cfg}
+%<UTF8> {Caption with encoding UTF8 (CTEX)}
+%<UTF8>\ProvidesExplFile{ctex-name-utf8.cfg}
+%<config> {Configuration file (CTEX)}
+%<config>\ProvidesExplFile{\ExplFileName.cfg}
+%<ctexopts> {Option configuration file (CTEX)}
+%<ctexopts>\ProvidesExplFile{ctexopts.cfg}
+%<pdftex> {(pdf)LaTeX adapter (CTEX)}
+%<pdftex>\ProvidesExplFile{ctex-engine-pdftex.def}
+%<xetex> {XeLaTeX adapter (CTEX)}
+%<xetex>\ProvidesExplFile{ctex-engine-xetex.def}
+%<luatex> {LuaLaTeX adapter (CTEX)}
+%<luatex>\ProvidesExplFile{ctex-engine-luatex.def}
+%<windows> {Windows fonts definition (CTEX)}
+%<windows>\ProvidesExplFile{ctex-fontset-windows.def}
+%<windowsnew> {Windows fonts definition for Vista or later version (CTEX)}
+%<windowsnew>\ProvidesExplFile{ctex-fontset-windowsnew.def}
+%<windowsold> {Windows fonts definition for XP or earlier version (CTEX)}
+%<windowsold>\ProvidesExplFile{ctex-fontset-windowsold.def}
+%<adobe> {Adobe fonts definition (CTEX)}
+%<adobe>\ProvidesExplFile{ctex-fontset-adobe.def}
+%<fandol> {Fandol fonts definition (CTEX)}
+%<fandol>\ProvidesExplFile{ctex-fontset-fandol.def}
+%<mac> {Mac OS X fonts definition (CTEX)}
+%<mac>\ProvidesExplFile{ctex-fontset-mac.def}
+%<founder> {Founder fonts definition (CTEX)}
+%<founder>\ProvidesExplFile{ctex-fontset-founder.def}
+%<ubuntu> {Ubuntu fonts definition (CTEX)}
+%<ubuntu>\ProvidesExplFile{ctex-fontset-ubuntu.def}
+ {\ExplFileDate}{2.0}{\ExplFileDescription}
+%</!(c19|c70|ctexspa)>
+%<rm&c19>\ProvidesFile{c19rm.fd}%
+%<sf&c19>\ProvidesFile{c19sf.fd}%
+%<tt&c19>\ProvidesFile{c19tt.fd}%
+%<rm&c70>\ProvidesFile{c70rm.fd}%
+%<sf&c70>\ProvidesFile{c70sf.fd}%
+%<tt&c70>\ProvidesFile{c70tt.fd}%
+%<ctexspa>\ProvidesFile{ctexspa.def}%
+%<c19|c70> [2014/03/08 v2.0 Chinese font definition (CTEX)]
+%<ctexspa> [2014/06/12 v2.0 Space info for CJKpunct (CTEX)]
+%</!(readme|install|zhmap|spa)>
+%<*driver>
+\ExplSyntaxOff
+\let\ctexrevnum\ExplFileVersion
+\expandafter\let\csname ver@thumbpdf.sty\endcsname\fmtversion
+\documentclass[a4paper,full,numbered]{l3doc}
+\usepackage[UTF8, punct = kaiming, heading,
+ linespread = 1.2, sub3section]{ctex}
+\ctexset{
+ abstractname = 简介,
+ indexname = 代码索引,
+ section = {
+ format = \Large\bfseries\raggedright,
+ name = {第,节},
+ },
+}
+\appto\abstract{\parindent=2\ccwd} ^^A l3doc.cls 设置列表环境中 \listparindent=\z@
+\usepackage[toc]{multitoc}
+\usepackage{geometry}
+\usepackage{tabularx}
+\usepackage{unicode-math}
+\geometry{includemp,hmargin={0mm,15mm},vmargin={25mm,15mm},footskip=7mm}
+\hypersetup{pdfstartview=FitH,bookmarksdepth=subsubsection}
+\setcounter{secnumdepth}{4}
+\setcounter{tocdepth}{2}
+\newcommand*\email{\nolinkurl}
+\setmainfont{TeX Gyre Pagella}
+\setsansfont{CMU Sans Serif}
+\setmonofont[
+ UprightFont=* Light, BoldFont=* Bold,
+ SlantedFont=* Light Oblique]{CMU Typewriter Text}
+\setmathfont{texgyrepagella-math.otf}
+\usepackage{xcolor}
+\usepackage{caption}
+\captionsetup{strut=off, labelsep=quad, labelfont+=bf}
+\makeatletter
+%% <--- http://tex.stackexchange.com/a/40896
+\patchcmd{\@addtocurcol}%
+ {\vskip \intextsep}%
+ {\edef\save@first@penalty{\the\lastpenalty}\unpenalty
+ \ifnum \lastpenalty = \@M % hopefully the OR penalty
+ \unpenalty
+ \else
+ \penalty \save@first@penalty \relax % put it back
+ \fi
+ \ifnum\outputpenalty <-\@Mii
+ \addvspace\intextsep
+ \vskip\parskip
+ \else
+ \addvspace\intextsep
+ \fi}%
+ {\typeout{*** SUCCESS ***}}{\typeout{*** FAIL ***}}
+\patchcmd{\@addtocurcol}%
+ {\vskip\intextsep \ifnum\outputpenalty <-\@Mii \vskip -\parskip\fi}%
+ {\ifnum\outputpenalty <-\@Mii
+ \aftergroup\vskip\aftergroup\intextsep
+ \aftergroup\nointerlineskip
+ \else
+ \vskip\intextsep
+ \fi}%
+ {\typeout{*** SUCCESS ***}}{\typeout{*** FAIL ***}}
+\patchcmd{\@getpen}{\@M}{\@Mi}
+ {\typeout{*** SUCCESS ***}}{\typeout{*** FAIL ***}}
+%% --->
+\ifxetex
+ \let\ctexdocverbaddon\xeCJKVerbAddon
+ \def\ctexdisableecglue{\xeCJKsetup{CJKecglue}}
+ \appto\meta@font@select{\ifinner\ctexdisableecglue\fi}
+\else
+ \let\ctexdocverbaddon\relax
+ \def\ctexdisableecglue{\ltjsetparameter{autoxspacing=false}}
+ \appto\meta@font@select{\ctexdisableecglue}
+\fi
+\setlist{noitemsep,topsep=\smallskipamount}
+\newlist{optdesc}{description}{3}
+%% 设置间距为 \marginparsep,与 l3doc 一致
+\setlist[optdesc]{%
+ font=\mdseries\ttfamily,align=right,
+ labelsep=\marginparsep,labelindent=-\marginparsep,leftmargin=*}
+\fvset{
+ fontsize=\small,baselinestretch=1,numbersep=5pt,
+ formatcom=\ctexdocverbaddon,
+ listparameters=\setlength\topsep{\MacrocodeTopsep}}
+\DefineVerbatimEnvironment{ctexexam}{Verbatim}{%
+ gobble=4,
+ frame=single,framesep=10pt,
+ label=\rule{0pt}{12pt}\textnormal{\bfseries 例 \arabic{ctexexam}},
+ listparameters=
+ \refstepcounter{ctexexam}\ctexexamlabelref
+ \appto\FV@EndList{\nointerlineskip}}
+\define@key{FV}{labelref}{\def\ctexexamlabelref{\label{#1}}}
+\let\ctexexamlabelref\empty
+\newcounter{ctexexam}
+\BeforeBeginEnvironment{function}{\par\nointerlineskip}
+\AtEndEnvironment{function}{%
+ \par\xdef\ctexfixprevdepth{\prevdepth=\the\prevdepth\space}%
+ \ctexfixdescrcoffinyoffset}
+%% l3doc 会在 function 环境的 syntax 和 descr 盒子中间加上 \medskipamount 的距离。
+%% 但是若 syntax 盒子为空(未使用 syntax 环境),就会显得不好看。
+%% 此时我们通过将 \medskipamount 设置为零来修正。
+\def\ctexfixdescrcoffinyoffset{%
+ \aftergroup\aftergroup\aftergroup\ctexzeromedskipamount}
+\def\ctexzeromedskipamount{\setlength\medskipamount{\z@skip}}
+\AfterEndEnvironment{syntax}{\let\ctexfixdescrcoffinyoffset\relax}
+\AfterEndEnvironment{function}{\ctexfixprevdepth}
+\AtBeginEnvironment{syntax}{\linespread{1}\ctexdisableecglue}
+\preto\MacroFont{\linespread{1}}
+\appto\MacroFont{\hyphenchar\font\m@ne\ctexdocverbaddon}
+\preto\AltMacroFont{\linespread{1}}
+\appto\AltMacroFont{\hyphenchar\font\m@ne\ctexdocverbaddon}
+\def\Module#1{\mbox{\normalfont\sffamily\textlangle#1\textrangle}}
+\ExplSyntaxOn
+%% 用 \vtop 让函数名字和语法盒子首行对齐
+\patchcmd \__codedoc_syntax:w
+ { { minipage } { \l__codedoc_syntax_dim } }
+ { { minipage } [t] { \l__codedoc_syntax_dim } }
+ { \iow_term:n { *** ~ SUCCESS ~ *** } }
+ { \iow_term:n { *** ~ FAIL ~ *** } }
+%% 左侧边注的函数列表采用单倍行距
+\cs_set_protected_nopar:Npx \__codedoc_typeset_names:
+ {
+ \exp_not:N \linespread { 1 }
+ \exp_not:o { \__codedoc_typeset_names: }
+ }
+\patchcmd \__codedoc_macro_typeset_one:n
+ { \vbox_unpack_clear:N }
+ { \linespread { 1 } \selectfont \vbox_unpack_clear:N }
+ { \iow_term:n { *** ~ SUCCESS ~ *** } }
+ { \iow_term:n { *** ~ FAIL ~ *** } }
+%% 不重复使用 \HD@target,避免索引出现重复页码
+\cs_set_protected:Npn \__codedoc_special_index_aux:nnnnn #1#2#3#4#5
+ {
+ \__codedoc_special_index_set:Nn \l__codedoc_index_escaped_macro_tl {#2}
+ \str_if_eq:onTF { \@currenvir } { macrocode }
+ { \codeline@wrindex }
+ {
+ \HD@target
+ \index
+ }
+ {
+ \tl_if_empty:nF { #3 #4 }
+ { #3 \actualchar #4 \levelchar }
+ #1
+ \actualchar
+ {
+ \token_to_str:N \verbatim@font \c_space_tl
+ \l__codedoc_index_escaped_macro_tl
+ }
+ \encapchar
+ hdclindex{\the\c@HD@hypercount}{#5}
+ }
+ }
+\DeclareDocumentCommand \cs { O{} m }
+ { \__codedoc_cmd_aux:no {#1} { \c__codedoc_backslash_tl #2 } }
+\DeclareDocumentCommand \tn { O{} m }
+ {
+ \__codedoc_cmd_aux:no
+ { index = TeX , replace = false , #1 }
+ { \c__codedoc_backslash_tl #2 }
+ }
+\DeclareDocumentCommand \meta { +m }
+ { \__codedoc_meta_aux:n {#1} }
+\DeclareExpandableDocumentCommand \bookmarkcstn { O{} m }
+ { \textbackslash \tl_to_str:n {#2} }
+\cs_new:Npn \bookmarkmeta #1 { < \tl_to_str:n {#1} > }
+\cs_generate_variant:Nn \__codedoc_cmd_aux:nn { no }
+\AtBeginEnvironment { syntax }
+ {
+ \char_set_active_eq:NN \| \orbar
+ \char_set_active_eq:NN \( \defaultvalaux
+ }
+%% 不对目录中出现的 \cs 和 \tn 等编索引
+\DeclareDocumentCommand \StopSpecialIndexModule { }
+ { \cs_set_eq:NN \__codedoc_special_index_module:nnnn \use_none:nnnn }
+\tl_map_inline:nn { \actualchar \encapchar \levelchar }
+ { \exp_args:Nx \DoNotIndex { \bslash \tl_to_str:N #1 } }
+\ExplSyntaxOff
+\AtBeginDocument{\addtocontents{toc}{\StopSpecialIndexModule}}
+\pdfstringdefDisableCommands{%
+ \let\cs\bookmarkcstn
+ \let\tn\bookmarkcstn
+ \let\meta\bookmarkmeta
+ \let\opt\@firstofone}
+\def\orbar{\textup{\textbar}}
+\def\defaultval#1{\textbf{\textup{#1}}}
+\def\defaultvalaux#1){\defaultval{#1}}
+\def\TF{true\orbar false}
+\def\TTF{\defaultval{true}\orbar false}
+\def\TFF{true\orbar\defaultval{false}}
+\protected\def\opt{\texttt}
+\def\pdfTeX{\hologo{pdfTeX}}
+\def\XeTeX{\hologo{XeTeX}}
+\def\XeLaTeX{\hologo{XeLaTeX}}
+\DeclareRobustCommand\LuaLaTeX{\hologo{LuaLaTeX}}
+\def\pdfLaTeX{\hologo{pdfLaTeX}}
+\def\LaTeX{\hologo{LaTeX}}
+\def\LaTeXe{\hologo{LaTeX2e}}
+\def\LTXIII{\hologo{LaTeX3}}
+\def\dvipdfmx{DVIPDFM\textit{x}}
+\def\ctexkitrev#1{%
+ \href{https://github.com/CTeX-org/ctex-kit/commit/#1}{\texttt{ctex-kit} rev. #1}}
+\patchcmd\theCodelineNo{\sffamily\tiny}{\normalfont\sffamily\tiny}{}{}
+\appto\GlossaryParms{%
+ \def\@idxitem{\par\hangindent 2em }%
+ \def\subitem{\@idxitem\hspace*{1em}}%
+ \def\subsubitem{\@idxitem\hspace*{2em}}}
+\patchcmd\l@section{2.5em}{1.5em}{}{}
+\patchcmd\l@subsection{2.5em}{1.5em}{}{}
+\patchcmd\changes@{\space}{\lbrack}{}{}
+\patchcmd\@wrglossary{hdpindex}{hdclindex{\the\c@HD@hypercount}}{}{}
+\newenvironment{defaultcapconfig}{%
+ \MakePercentComment
+ \input{ctex-name-utf8.cfg}%
+ \ExplSyntaxOff
+ \MakePercentIgnore}{}
+\makeatother
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+\def\glossaryname{版本历史}
+\GlossaryPrologue{\section*{\glossaryname}}
+\IndexPrologue{%
+ \section*{\indexname}
+ \textit{意大利体的数字表示描述对应索引项的页码;
+ 带下划线的数字表示定义对应索引项的代码行号;
+ 罗马字体的数字表示使用对应索引项的代码行号。}}
+\usepackage{makecell}
+\newcommand{\TeXLive}{\TeX\ Live}
+\newcommand{\opos}[1]{\texttt{\small #1}} ^^A option position
+\newcommand{\OPC}
+ {\opos{该选项只能在调用 \CTeX{} 宏包/文档类时作为选项使用}}
+\newcommand{\OSET}
+ {\opos{该选项只能用 \tn{ctexset} 来设置}}
+\newcommand{\OBOTH}
+ {\opos{该选项既可以作为宏包/文档类选项使用,也可以使用 \tn{ctexset} 来设置}}
+\usepackage{threeparttable}
+\begin{document}
+ \DocInput{\jobname.dtx}
+ \newgeometry{hmargin=15mm,vmargin={25mm,15mm},footskip=7mm}
+ \PrintChanges
+ \PrintIndex
+\end{document}
+%</driver>
+%
+% \fi
+%
+% \changes{v2.0}{2014/03/06}{应用 \LTXIII{} 重新整理代码。}
+% \changes{v2.0}{2014/03/12}{删除 \file{c19gbsn.fd} 和 \file{c19gkai.fd}。}
+%
+%
+% \CheckSum{4371}
+%
+% \CharacterTable
+% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+% Digits \0\1\2\3\4\5\6\7\8\9
+% Exclamation \! Double quote \" Hash (number) \#
+% Dollar \$ Percent \% Ampersand \&
+% Acute accent \' Left paren \( Right paren \)
+% Asterisk \* Plus \+ Comma \,
+% Minus \- Point \. Solidus \/
+% Colon \: Semicolon \; Less than \<
+% Equals \= Greater than \> Question mark \?
+% Commercial at \@ Left bracket \[ Backslash \\
+% Right bracket \] Circumflex \^ Underscore \_
+% Grave accent \` Left brace \{ Vertical bar \|
+% Right brace \} Tilde \~}
+%
+% \GetFileInfo{\jobname.dtx}%
+%
+% \title{\bfseries \CTeX{} 套件手册}
+% \author{\href{http://www.ctex.org}{ctex.org}}
+% \date{\filedate\qquad\fileversion\thanks{\ctexkitrev{\ctexrevnum}.}}
+% \maketitle
+%
+% \begin{abstract}
+% \CTeX{} 套件是面向中文排版的通用 \LaTeX{} 排版框架,为中文 \LaTeX{} 文档
+% 提供了汉字输出支持、标点压缩、字体字号命令、标题文字汉化、中文版式调整、数字
+% 日期转换等支持功能,可适应论文、报告、书籍、幻灯片等不同类型的中文文档。
+%
+% \CTeX{} 套件支持 \LaTeX{}、\pdfLaTeX{}、\XeLaTeX{} 和 \LuaLaTeX{} 等多种不同
+% 的编译方式,并为它们提供了统一的界面。主要功能由宏包 \pkg{ctex} 和中文文档类
+% \cls{ctexart}、\cls{ctexrep}、\cls{ctexbook} 实现。
+% \end{abstract}
+%
+% \clearpage
+% \tableofcontents
+% \clearpage
+% \setlength{\parskip}{0.8ex}
+%
+% \begin{documentation}
+%
+% \section{介绍}
+%
+% \subsection*{历史}
+%
+% \CTeX{} 套件的源头有两个:一是王磊编写的 \cls{cjkbook} 文档类,二是吴凌云编写的
+% \file{GB.cap}。
+% 这些工作没有经过认真、系统的设计,也没有用户文档,不利于维护和改进。
+%
+% 2003 年,吴凌云使用 \pkg{doc} 和 \pkg{DocStrip} 重构了整个工程,并增加了许多新的功能,
+% 称为 \pkg{ctex} 宏包。2007 年,oseen 和王越在 \pkg{ctex} 宏包的基础上,
+% 增加了对 UTF-8 编码的支持,开发出了 \pkg{ctexutf8} 宏包。
+%
+% 2009 年 5 月,我们在 Google Code 建立了 ctex-kit 项目^^A
+% \footnote{\nolinkurl{http://code.google.com/p/ctex-kit/}},
+% 对 \pkg{ctex} 宏包及相关脚本进行了整合,并加入了对 \XeTeX{} 引擎的支持。
+% 在开发新版本时,考虑到合作开发和调试的方便,我们放弃了 \pkg{doc} 和 \pkg{DocStrip},
+% 采取了直接编写宏包代码的方式。
+%
+% 2014 年 3 月,为了适应 \LaTeX{} 的最新发展,特别是 \LTXIII{} 的逐渐成熟,李清用
+% \LTXIII{} 重构了整个宏包的代码,并重新使用 \pkg{doc} 和 \pkg{DocStrip} 工具进行代码
+% 的管理,升级版本号为 2.0,并改称 \CTeX{} 套件。
+%
+% 2015 年 3 月,由于 Google Code 即将停止服务,ctex-kit 项目迁移至
+% \href{https://github.com/CTeX-org/ctex-kit}{GitHub}^^A
+% \footnote{\url{https://github.com/CTeX-org/ctex-kit}}。
+%
+% 最初,Knuth 在设计开发 \TeX{} 的时候没有考虑到多国语言支持,特别是对多字节的中日韩
+% 语言的支持。这使得 \TeX{} 以至后来的 \LaTeX{} 对中文的支持一直不是很好。即使在
+% \pkg{CJK} 宏包解决了中文字符处理的问题以后,中文用户使用 \LaTeX{} 仍然要面对许
+% 多困难。
+% 这些困难里,以章节标题的中文化为最。由于中文和西文语言习惯的差异,用户很难使用标准
+% 文档类中的代码结构来表达中文标题。于是,用户不得不对标准文档类做较大的修改。
+% 除此之外,日期格式、首行缩进、中文字号和字距等细节问题,也需要精细的调校。
+% 我们设计 \CTeX{} 套件的目的之一就是解决这些 \LaTeX{} 文档的汉化难题。
+%
+% 另一方面,随着 \TeX{} 引擎和 \LaTeX{} 宏包的不断发展,\LaTeX{} 的中文支持方式从早期的
+% 专用系统(如 \pkg{CCT})发展为适用于不同引擎的多种方式^^A
+% \footnote{比如:\pdfTeX{} 引擎下的 \pkg{CJK}、\pkg{zhmCJK}宏包、
+% \XeTeX{} 引擎下的 \pkg{xeCJK} 宏包和 \LuaTeX{} 引擎下的 \pkg{LuaTeX-ja} 宏
+% 包}。这些方式的适用情况和使用方式有不少细节上的差异,同时操作系统的不同、语言环境的不同等
+% 客观情况又进一步带来了更多的细节差异。我们设计 \CTeX{} 套件的另一个主要目的就是
+% 尽可能消除这些差异带来的影响,使用户能够以一个统一的接口来使用不同的中文支持方式,
+% 使得同一份文档能够在不同环境下交换使用。
+%
+% \CTeX{} 套件的许多实现细节离不开热心朋友们在 \url{bbs.ctex.org} 论坛上的讨论,
+% 在此对参与讨论的朋友们表示感谢。
+%
+% \subsection*{关于套件名字的说明}
+%
+% \CTeX{} 之名是英文单词 China(中国)或 Chinese(中文)的首字母“C”与 “\TeX{}”
+% 结合而成的。在纯文本环境下,该名字应写作“CTeX”。
+%
+% \CTeX{} 套件是由 \href{http://bbs.ctex.org}{\CTeX{} 社区} 发起并维护的
+% LaTeX 宏包和文档类的集合。
+% 社区另有发布名为 \href{http://www.ctex.org/CTeX}{\CTeX{} 套装}
+% 的 \TeX{} 发行版,与本文档所述的 \CTeX{} 套件并非是同一事物。
+%
+% ctex 则是本套件中的 \pkg{ctex.sty} 的名字。这一完全小写的名称,在过去也被用来指代
+% 整个 \CTeX{} 套件,不过现在则特指 \pkg{ctex.sty} 这一宏包。
+%
+% \section{简明教程}
+%
+% \subsection{\CTeX{} 套件的组成}
+%
+% 为了适应用户不同的需求,我们将 \CTeX{} 套件的主要功能分散在三个中文文档类和三个宏包当中,
+% 具体的组成见表~\ref{tab:ctex}。
+%
+% \begin{table}[htbp]
+% \centering
+% \caption{\CTeX{} 套件的组成}\label{tab:ctex}
+% \begin{tabularx}{\linewidth}{llX}
+% \toprule
+% 类别 & 文件 & 说明 \\
+% \midrule
+% 文档类 & \file{ctexart.cls} & 标准文档类 \cls{article} 的中文化版本,一般适用于
+% 短篇幅的文章 \\
+% & \file{ctexrep.cls} & 标准文档类 \cls{report} 的中文化版本,一般适用于
+% 中篇幅的报告 \\
+% & \file{ctexbook.cls} & 标准文档类 \cls{book} 的中文化版本,一般适用于
+% 长篇幅的书籍 \\
+% \midrule
+% 宏包 & \file{ctex.sty} & 提供全部功能,但\emph{默认不开启章节标题设置功能},
+% 需要使用 \opt{heading} 选项来开启 \\
+% & \file{ctexcap.sty} & \emph{过时宏包,仅作兼容使用},相当于开启章节标题
+% 设置功能的 \file{ctex.sty} \\
+% & \file{ctexsize.sty} & 定义和调整中文字号,可在 \pkg{ctex} 宏包
+% 或 \CTeX{} 中文文档类之外单独调用 \\
+% \bottomrule
+% \end{tabularx}
+% \end{table}
+%
+% \subsection{使用 \CTeX{} 文档类}
+%
+% \emph{如果用户需要在标准文档类的基础上添加中文支持和中文版式支持,我们建议用户使用 \CTeX{}
+% 套件提供的三个中文文档类。}
+%
+% \CTeX{} 套件提供了三个中文文档类:\cls{ctexart}、\cls{ctexrep} 和 \cls{ctexbook},
+% 分别对应 \LaTeX{} 的标准文档类 \cls{article}、\cls{report} 和 \cls{book}。使用它们
+% 的时候,需要将涉及到的所有源文件使用 UTF-8 编码保存^^A
+% \footnote{使用 (pdf)\LaTeX{} 时也能够使用 GBK 编码,但不推荐。
+% (见 \ref{subs:encoding}~节)}。
+%
+% \begin{ctexexam}
+% \documentclass[UTF8]{ctexart}
+% \begin{document}
+% 中文文档类测试。你需要将所有源文件保存为 UTF-8 编码。
+%
+% 你可以使用 XeLaTeX 或 LuaLaTeX 编译,也可以使用 (pdf)LaTeX 编译。
+% 推荐使用 XeLaTeX 或 LuaLaTeX 编译。
+% \end{document}
+% \end{ctexexam}
+%
+% \subsection{使用 \pkg{ctex} 宏包}
+%
+% \emph{用户在使用非标准文档类时,如果需要添加中文支持或中文版式支持,则可以使用 \pkg{ctex}
+% 宏包。}
+%
+% 以下是使用 \cls{beamer} 文档类编写中文演示文稿的一个示例。
+% \begin{ctexexam}
+% \documentclass{beamer}
+% \usepackage[UTF8]{ctex}
+% \begin{document}
+% \begin{frame}{中文演示文档}
+% \begin{itemize}
+% \item 你需要将所有源文件保存为 UTF-8 编码
+% \item 你可以使用 XeLaTeX 或 LuaLaTeX 编译
+% \item 也可以使用 (pdf)LaTeX 编译
+% \item 推荐使用 XeLaTeX 或 LuaLaTeX 编译
+% \end{itemize}
+% \end{frame}
+% \end{document}
+% \end{ctexexam}
+%
+% 有些文档类是建立在 \LaTeX{} 标准文档类之上开发的。这时,给 \pkg{ctex} 宏包
+% 加上 \opt{heading} 选项,可以将章节标题设置为中文风格。
+% \begin{ctexexam}
+% \documentclass{ltxdoc}
+% \usepackage[UTF8, heading = true]{ctex}
+% \begin{document}
+% \section{简介}
+% 章节标题中文化的 \LaTeX{} 手册。
+% \end{document}
+% \end{ctexexam}
+%
+% \section{依赖与安装}
+%
+% \CTeX{} 是一个 \LaTeX{} 宏包,只有一个源文件 \file{ctex.dtx}。
+% 使用不同的编译方式时,\CTeX{} 依赖的宏包略有不同。在安装 \CTeX{} 套件之前,请确保
+% 你的系统里已经正确安装了这些宏包。\CTeX{} 依赖宏包的详情叙述如下:
+%
+% \begin{itemize}
+% \item \pkg{expl3}、\pkg{xparse} 和 \pkg{l3keys2e} 宏包。它们属于 \pkg{l3kernel}
+% 和 \pkg{l3packages} 套件,它们还依赖
+% \begin{itemize}
+% \item \pkg{etex} 宏包。
+% \end{itemize}
+% \item \pkg{ifpdf} 宏包,属于 \pkg{oberdiek} 套件。
+% \item \pkg{etoolbox} 宏包。
+% \item \pkg{everysel} 宏包,属于 \pkg{ms} 套件。
+% \item \pkg{zhnumber} 宏包。
+% \item[$\Rightarrow$] 以上是各种编译方式都必需的依赖项。
+% \item \pkg{CJK} 套件,它的下划线功能依赖 \pkg{ulem} 宏包。
+% \item \pkg{CJKpunct} 宏包。
+% \item \pkg{zhmetrics} 宏包。
+% \item \pkg{zhmCJK} 宏包。
+% \item[$\Rightarrow$] 以上是使用 \pdfLaTeX{} 或 \LaTeX{} + \dvipdfmx{} 的编译方式所需要
+% 的依赖项,其中 \pkg{zhmCJK} 是可选的。
+% \item \pkg{xeCJK} 宏包,它还依赖
+% \begin{itemize}
+% \item \pkg{fontspec} 宏包,它还依赖
+% \begin{itemize}
+% \item \pkg{euenc} 宏包。
+% \item \pkg{xunicode} 宏包,它还依赖 \pkg{tipa} 宏包。
+% \end{itemize}
+% \end{itemize}
+% \item[$\Rightarrow$] 以上是使用 \XeLaTeX{} 编译时的依赖项。
+% \item \pkg{LuaTeX-ja} 套件,它还依赖
+% \begin{itemize}
+% \item \pkg{luaotfload} 宏包,它还依赖 \pkg{luatexbase} 宏包。
+% \item \pkg{xkeyval} 宏包。
+% \end{itemize}
+% \item[$\Rightarrow$] 以上是使用 \LuaLaTeX{} 编译时的依赖项。
+% \end{itemize}
+%
+% \CTeX{} 依赖的各个宏包和套件均已被 \TeXLive{} 和 \hologo{MiKTeX} 收录。如果
+% 你是这两个 \TeX{} 发行版的用户,可以使用他们提供的宏包管理器来安装这些宏包,或将他们
+% 更新到最新版本。如果你不使用这两个发行版,请参考你使用的 \TeX{} 发行版和相关宏包
+% 的说明文档。
+%
+% 出于一些原因,\pkg{zhmCJK} 尚未被收入 \TeXLive{} 和 \hologo{MiKTeX}。因此,若
+% 你希望使用 \pkg{zhmCJK} 作为 \CTeX{} 套件的底层中文支持方式,需要自行安装该宏包。
+% \pkg{zhmCJK} 的安装较为复杂。我们建议你从 CTAN 下载 \pkg{zhmCJK} 的
+% \href{http://mirrors.ctan.org/install/language/chinese/zhmcjk.tds.zip}{TDS
+% 安装包},按目录结构将文件复制到 \TeX{} 发行版的本地 TDS 根目录,然后刷新文件
+% 名数据库。关于安装的详细内容,可以参照其
+% \href{http://mirrors.ctan.org/language/chinese/zhmcjk/zhmCJK.pdf}{宏包手册}
+% 中第 3 节的指导。
+%
+% \CTeX{} 的正式版本也已被 \TeXLive{} 和 \hologo{MiKTeX} 收录。因此,使用这两个发行版
+% 的用户可以如常使用宏包管理器来安装。如果你不使用者两个发行版,我们建议你从 CTAN
+% 下载 \CTeX{} 的
+% \href{http://mirrors.ctan.org/install/language/chinese/ctex.tds.zip}{TDS
+% 安装包} 按目录结构将文件复制到 \TeX{} 发行版的本地 TDS 根目录,然后刷新文件
+% 名数据库。
+%
+% \section{宏包选项与 \tn{ctexset} 命令}
+% \label{sec:options}
+%
+% \CTeX{} 套件已经尽可能就中文的行文和版式习惯做了调整和配置,通常而言,这些配置
+% 已经够用。因此,除非必要,我们不建议普通用户修改这些默认配置。如果你认为 \CTeX{} 套件
+% 的默认配置还可以完善,可以在项目主页上
+% \href{https://github.com/CTeX-org/ctex-kit/issues}{提交 issue},
+% 向我们反映,我们会酌情在后续版本中予以改进。
+%
+% 不过,\CTeX{} 套件也提供了一系列选项。用户可以使用这些选项来控制 \CTeX{} 套件的行为。
+% 具体来说,这些选项里,有的以传统的方式提供,
+% 也有的以 \meta{key}|=|\meta{value} 的形式提供。对于以键值对形式提供的选项,
+% 在下面的说明中使用\textbf{粗体}来表示 \CTeX{} 的默认设置。
+%
+% 另一方面,在这些选项里,有些选项只能作为宏包/文档类选项,需要在引入宏包/文档类的时候指定;
+% 有些选项只能通过 \CTeX{} 套件提供的用户接口 \tn{ctexset} 来设定;
+% 也有一些选项既可以作为宏包/文档类选项,也可以通过 \tn{ctexset} 来设定。
+% 后续文档中将在使用说明中对每个选项的使用方式做说明。
+%
+% \begin{function}{\ctexset}
+% \begin{syntax}
+% \tn{ctexset} \Arg{键值列表}
+% \end{syntax}
+% 是 \CTeX{} 套件的通用控制命令,用来在宏包载入后控制宏包的各项功能。
+% \tn{ctexset} 的参数是一个键值列表,以通用的接口完成各项设置。
+% \end{function}
+%
+% \tn{ctexset} 的参数是一组由逗号分隔的选项列表,列表中的选项通常是一个
+% \meta{key}|=|\meta{value} 格式的定义。例如设置摘要与参考文献标题名称
+% (\ref{subs:capname}~节)就可以使用:
+% \begin{ctexexam}[labelref=exam:capname]
+% \ctexset{
+% abstractname = {本文概要},
+% bibname = {文\quad 献}
+% }
+% \end{ctexexam}
+%
+% \tn{ctexset} 采用 \LaTeX3 风格的键值设置,支持不同类型的选项与层次化的选
+% 项设置,相关示例见 \ref{sec:secstyle}~节。
+%
+% \section{编译方式、编码与中文字库}
+% \label{sec:chinese}
+%
+% \subsection{编译方式}
+% \label{subs:compile}
+%
+% \CTeX{} 套件会根据用户使用的编译方式\footnote{\LaTeX、\pdfLaTeX、\XeLaTeX 以及
+% \LuaLaTeX。},在底层选择不同的中文支持方式(见表 \ref{tab:chinese-support})。
+%
+% \begin{table}[htbp]
+% \centering
+% \caption{\CTeX{} 套件的中文支持方式}
+% \begin{tabular}{ccc}
+% \toprule
+% (pdf)\LaTeX & \XeLaTeX & \LuaLaTeX \\
+% \midrule
+% \pkg{CJK} & \pkg{xeCJK} & \pkg{LuaTeX-ja} \\
+% \bottomrule
+% \end{tabular}
+% \label{tab:chinese-support}
+% \end{table}
+%
+% 不同的编译方式和中文支持方式会在一定程度上影响 \CTeX{} 套件的行为,比如宏包对编码的处理。
+% 在用户使用 \XeLaTeX{} 及 \LuaLaTeX{} 编译时,\CTeX{} 套件使用(且仅能
+% 使用)UTF-8 编码;而因为历史原因,在用户使用 \LaTeX{} 及 \pdfLaTeX{} 编译
+% 时,宏包默认使用 GBK 编码。用户需要\emph{保证编译方式、
+% 源文件编码、宏包编码选项三者一致}。
+% 关于宏包编码选项,可以参考 \ref{subs:encoding}~节。
+%
+% 除去文档编码之外,选择不同的编译方式还可能影响 \CTeX{} 套件对字体选择、空格处理、
+% 标点处理的处理。具体的影响将在本文档后续内容中进行阐述。
+%
+% \subsection{中文编码}
+% \label{subs:encoding}
+%
+% \begin{function}{GBK, UTF8}
+% \begin{syntax}
+% \OPC
+% \end{syntax}
+% 指明编写文档时使用的编码格式。\CTeX{} 套件无法检测用户编写文档时使用的编码格式,因此
+% 需要用户自行指定编码。\emph{我们建议用户总是使用 UTF-8 编码,并显式指定 \opt{UTF8}
+% 选项,并使用 \XeLaTeX{} 或 \LuaLaTeX{} 编译。}
+%
+% 使用 \XeLaTeX{} 或 \LuaLaTeX{} 编译时,\CTeX{} 套件强制使用 UTF-8 编码,
+% 此时 \opt{GBK} 选项无效。
+% 使用 (pdf)\LaTeX{} 编译时,\CTeX{} 套件默认启用 \opt{GBK} 选项;不过,用户也可以
+% 显式声明 \opt{UTF8} 选项,使 \CTeX{} 套件工作在 UTF-8 编码下。
+% \end{function}
+%
+% \subsection{中文字库}
+% \label{subs:options-CJK-font}
+%
+% 以往,为 \LaTeX{} 文档配置中文支持是一件相当繁琐的事情。默认情况下,
+% \CTeX{} 套件能自动检测用户使用的编译方式(参见 \ref{subs:compile}~节)和
+% 操作系统\footnote{\CTeX{} 套件现在能够识别 Mac~OS~X 系统以及 Windows 系统。},
+% 选择合适的底层支持和字库,从而简化配置过程。自动配置的情况参见
+% 表~\ref{tab:default-font-select}。
+%
+% \begin{table}[htbp]
+% \centering
+% \begin{threeparttable}
+% \caption{\CTeX{} 套件自动配置字体策略}
+% \label{tab:default-font-select}
+% \begin{tabular}{*{5}{c}}
+% \toprule
+% & Mac OS X & Windows New\tnote{1} & Windows Old\tnote{2} &
+% 其他 \\
+% \midrule
+% \XeLaTeX{} & \makecell{\pkg{xeCJK}\\华文字库} &
+% \makecell{\pkg{xeCJK}\\中易字库 + 微软雅黑} & \makecell{\pkg{xeCJK}\\中易字库} &
+% \makecell{\pkg{xeCJK}\\Fandol 字库\tnote{3}} \\
+% \cmidrule(lr){1-5}
+% \LuaLaTeX{}\tnote{4} & \makecell{\pkg{LuaTeX-ja}\\华文字库} &
+% \makecell{\pkg{LuaTeX-ja}\\中易字库 + 微软雅黑} &
+% \makecell{\pkg{LuaTeX-ja}\\中易字库} &
+% \makecell{\pkg{LuaTeX-ja}\\Fandol 字库} \\
+% \cmidrule(lr){1-5}
+% \pdfLaTeX{} & 不可用 &
+% \makecell{\pkg{CJK} + \pkg{zhmetrics}\\中易字库 + 微软雅黑} &
+% \makecell{\pkg{CJK} + \pkg{zhmetrics}\\中易字库} & 不可用 \\
+% \cmidrule(lr){1-5}
+% \makecell{\LaTeX{} + \\\dvipdfmx{}} & 不可用 &
+% \makecell{\pkg{CJK} + \pkg{zhmetrics}\\中易字库 + 微软雅黑} &
+% \makecell{\pkg{CJK} + \pkg{zhmetrics}\\中易字库} &
+% \makecell{\pkg{CJK} + \pkg{zhmetrics}\\Fandol 字库} \\
+% \bottomrule
+% \end{tabular}
+% \begin{tablenotes}\footnotesize
+% \item [1] Windows Vista 及以后的 Windows 操作系统。
+% \item [2] Windows XP 及以前的 Windows 操作系统。
+% \item [3] 由马起园、苏杰、黄晨成等人开发的开源中文字体,
+% 参见:\url{https://github.com/clerkma/fandol-fonts}。
+% \item [4] \LuaLaTeX{} 编译时使用 \pkg{LuaTeX-ja} 宏包。对此,
+% 第 \ref{sec:lualatex-chinese}~节有特别说明。
+% \end{tablenotes}
+% \end{threeparttable}
+% \end{table}
+%
+% 通常,由 \CTeX{} 套件进行的自动配置已经足够使用,无需用户手工干预;但
+% 是 \CTeX{} 仍然提供了一系列选项,供在 \CTeX{} 的自动选择机制因为
+% 意外情况失效,或者在用户有特殊需求的情况下使用。\emph{除非必要,用户不
+% 应使用这些选项。}
+%
+% \begin{function}{zhmap}
+% \begin{syntax}
+% zhmap = <\TTF|zhmCJK>
+% \OPC\opos{,并且只在使用 \pdfLaTeX{}/\LaTeX{} 编译时有意义}
+% \end{syntax}
+% 指定字体映射机制。
+% \end{function}
+%
+% 选项为 \opt{true} 时,使用 \pkg{zhmetrics} 宏包,将 CJK 字库
+% 通过 \tn{special} 命令映射到 \file{.ttf} 文件;
+% 选项为 \opt{false} 时,使用传统的 CJK 字库(Type 1)^^A
+% \footnote{如果需要使用自定义的字体映射文件,或者希望使用 Type1 字库,请禁用本选项。};
+% 选项为 \opt{zhmCJK} 时,将载入 \pkg{zhmCJK} 宏包^^A
+% \footnote{\pkg{zhmCJK} 宏包基于 \pkg{zhmetrics} 和 \pkg{CJK} 宏包,提供与
+% \pkg{xeCJK} 宏包类似的用户接口。}^^A
+% ,由 \pkg{zhmCJK} 宏包提供从 CJK 字库到 \file{.ttf} 的映射。
+%
+% \begin{function}{fontset}
+% \begin{syntax}
+% fontset =^^A
+% <none|adobe|fandol|founder|mac|ubuntu|windows|windowsnew|windowsold...>
+% \OBOTH
+% \end{syntax}
+% 指定 \CTeX{} 套件加载的字库。
+%
+% 如果没有指定 \opt{fontset} 的值,\CTeX{} 套件将自动检测用户使用的操作系统,配置
+% 相应的字体(参见表~\ref{tab:default-font-select})。
+% \end{function}
+%
+% \CTeX{} 预定义了以下六种中文字库。
+%
+% \begin{optdesc}
+% \item[adobe] 使用 Adobe 公司的四款中文字体,\emph{不支持 \pdfLaTeX}。
+% \item[fandol] 使用 Fandol 中文字体,\emph{不支持 \pdfLaTeX}。
+% \item[founder] 使用方正公司的中文字体。
+% \item[mac] 使用 Mac OS X 系统下的华文字体,\emph{不支持 (pdf)\LaTeX}。
+% \item[ubuntu] 使用 Ubuntu 系统下的文泉驿和文鼎字体。
+% \item[windows] 使用简体中文 Windows 系统下的中文字体,自动判断 Windows 系
+% 统版本,采用 |windowsnew| 或 |windowsold| 的设置。
+% \item[windowsnew] 使用简体中文 Windows Vista 或之后系统下的中易字体和微软
+% 雅黑字体。
+% \item[windowsold] 使用简体中文 Windows XP 或之前系统下的中易字体。
+% \end{optdesc}
+%
+% 注意:使用 (pdf)\LaTeX{} 编译的时候,若设置 \opt{zhmap = false}(比如需要
+% 使用 \LaTeX{} + DVIPS 编译),则需要按照传统方式^^A
+% \footnote{可以使用 \pkg{zhmetrics} 宏包提供的脚本
+% \href{https://github.com/CTeX-org/ctex-kit/blob/master/zhmetrics/CTeXFonts.lua}
+% {\file{CTeXFonts.lua}}。}^^A
+% 在本地安装好 CJK 字体。
+%
+% 如果不想使用 \CTeX{} 预定义的中文字库,可以设置 \opt{fontset} 为下述值之一。
+%
+% \begin{optdesc}
+% \item[none] 不配置中文字体,需要用户自己配置。
+% \item[\meta{name}] 这里 \meta{name} 为自定义的名字。
+% \CTeX{} 套件将载入名为 |ctex-fontset-|\meta{name}|.def| 的文件作为字体配置
+% 文件。因此,请先保证文件的存在。可以在当前工作目录或者本地 \texttt{TDS} 目录
+% 树下合适位置建立一个名为 |ctex-fontset-|\meta{name}|.def| 的文件,在这个文件
+% 里面自定义中文字体。然后通过使用 |fontset=|\meta{name} 选项来调用它。字体配置
+% 文件的具体写法可以参考 \CTeX{} 套件 \texttt{fontset} 目录下的字体配置文件。
+% \end{optdesc}
+%
+% 注意:\emph{如果希望使用 \tn{ctexset} 在导言区指定字库,则需要先在宏包/文档类选项中指定
+% \opt{fontset = none}}。例如:
+% \begin{ctexexam}
+% \documentclass[fontset = none]{ctexart}
+% \ctexset{fontset = founder}
+% \begin{document}
+% 在文档类选项中声明 \verb|fontset = none|,随后在导言区用 \tn{ctexset}
+% 指定字体。
+% \end{document}
+% \end{ctexexam}
+%
+% \CTeX{} 套件预定义的中文字库还定义了一些字体命令。
+%
+% \begin{optdesc}
+% \item[\tn{songti}] 宋体,CJK 等价命令 |\CJKfamily{zhsong}|。
+% \item[\tn{heiti}] 黑体,CJK 等价命令 |\CJKfamily{zhhei}|。
+% \item[\tn{fangsong}] 仿宋,CJK 等价命令 |\CJKfamily{zhfs}|。
+% \item[\tn{kaishu}] 楷书,CJK 等价命令 |\CJKfamily{zhkai}|。
+% \end{optdesc}
+% 其中 \tn{fangsong} 在 \opt{ubuntu} 字库中没有定义。在
+% \opt{windows} 和 \opt{founder} 字库中,还有 \tn{lishu} 和 \tn{youyuan}。
+% \begin{optdesc}
+% \item[\tn{lishu}] 隶书,CJK 等价命令 |\CJKfamily{zhli}|。
+% \item[\tn{youyuan}] 圆体,CJK 等价命令 |\CJKfamily{zhyou}|。
+% \end{optdesc}
+% 在 \opt{windowsnew} 字库中,还有 \tn{yahei}。
+% \begin{optdesc}
+% \item[\tn{yahei}] 微软雅黑,CJK 等价命令 |\CJKfamily{zhyahei}|。
+% \end{optdesc}
+%
+% \section{排版格式设定}
+% \label{sec:format-settings}
+% \subsection{文档默认字号}
+% \label{subs:options-class}
+%
+% \begin{function}{zihao}
+% \begin{syntax}
+% zihao = <-4|5|false>
+% \OPC
+% \end{syntax}
+% 将文章默认字号(\tn{normalsize})设置为小四号字或五号字,\tn{false} 禁用本功能。
+% 这两个选项可以用于三个 \CTeX{} 文档类和 \pkg{ctex} 宏包,
+% 也可以用于 \pkg{ctexsize} 宏包。
+%
+% \opt{scheme = chinese} 时,默认值为 |5|,即设置 \tn{normalsize} 为五号字。
+% \end{function}
+%
+% \opt{cs4size} 和 \opt{c5size} 选项还会将标准文档类中的字体大小命令调整为
+% 中文字号(见表 \ref{tab:fontsize})。
+%
+% \begin{table}[htbp]
+% \centering
+% \setlength\tabcolsep{1em}
+% \caption{标准字体命令与字号的对应}\label{tab:fontsize}
+% \begin{tabular}{l*2{c>{\ttfamily}r}*3{>{\ttfamily}c}}
+% \toprule
+% & \multicolumn2c{|zihao = 5|} & \multicolumn2c{|zihao = -4|} &
+% \multicolumn1c{|10pt|} & \multicolumn1c{|11pt|} & \multicolumn1c{|12pt|} \\
+% \cmidrule(lr){2-3} \cmidrule(lr){4-5}
+% \cmidrule(lr){6-6} \cmidrule(lr){7-7} \cmidrule(lr){8-8}
+% 字体命令 & 字号 & \textrm{bp} & 字号 & \textrm{bp}
+% & \textrm{pt} & \textrm{pt} & \textrm{pt} \\
+% \midrule
+% |\tiny| & 七号 & 5.5 & 小六 & 6.5 & ~5 & ~6 & ~6 \\
+% |\scriptsize| & 小六 & 6.5 & 六号 & 7.5 & ~7 & ~8 & ~8 \\
+% |\footnotesize| & 六号 & 7.5 & 小五 & 9~~ & ~8 & ~9 & 10 \\
+% |\small| & 小五 & 9~~ & 五号 & 10.5 & ~9 & 10 & 11 \\
+% |\normalsize| & 五号 & 10.5 & 小四 & 12~~ & 10 & 11 & 12 \\
+% |\large| & 小四 & 12~~ & 小三 & 15~~ & 12 & 12 & 14 \\
+% |\Large| & 小三 & 15~~ & 小二 & 18~~ & 14 & 14 & 17 \\
+% |\LARGE| & 小二 & 18~~ & 二号 & 22~~ & 17 & 17 & 20 \\
+% |\huge| & 二号 & 22~~ & 小一 & 24~~ & 20 & 20 & 25 \\
+% |\Huge| & 一号 & 26~~ & 一号 & 26~~ & 25 & 25 & 25 \\
+% \bottomrule
+% \end{tabular}
+%\end{table}
+%
+% \begin{function}{10pt, 11pt, 12pt}
+% \begin{syntax}
+% \OPC
+% \end{syntax}
+% \CTeX{} 文档类是在 \LaTeX{} 标准文档类之上开发的。因此,除了可以使用 \CTeX{}
+% 宏包定义的字号选项之外,还可以使用标准文档类的同类选项(\opt{10pt}、\opt{11pt}
+% 和 \opt{12pt})。在使用这些来自标准文档类的选项的时候,\CTeX{} 文档类的字号
+% 选项会被抑制。亦即,在 \opt{zihao} 选项之后设置 \opt{10pt} 选项,
+% \opt{zihao} 选项将不再起作用。
+% \end{function}
+%
+% 标准文档类的其他选项在 \CTeX{} 文档类中依旧有效。例如,设置纸张大小和方向的
+% \opt{a4paper} 和 \opt{landscape},设置单双面的 \opt{oneside} 和
+% \opt{twoside} 等。\CTeX{} 会将这些选项传给标准文档类^^A
+% \footnote{事实上,\LaTeX{} 在文档类中的选项是全局设定的,除了对使用的文档类有
+% 影响外,也可能会影响到随后使用的宏包。如果这些宏包中有某些选项出现在文档类的
+% 选项列表中,那么该选项将会被自动激活。}。
+%
+% \subsection{章节标题风格}
+% \label{subs:options-heading}
+%
+% \begin{function}{heading}
+% \begin{syntax}
+% heading = <\TFF>
+% \opos{该选项只能在调用 \pkg{ctex.sty} 时作为宏包选项使用}
+% \end{syntax}
+% \CTeX{} 套件提供了一套用于修改文档章节标题格式的接口。该选项用于选择是否
+% 启用该功能。详细的设置方法请参见
+% \ref{sec:secstyle}~节和 \ref{subs:pagestyle}~节。
+% \end{function}
+%
+% \CTeX{} 套件提供的三个文档类总是启用该功能。如果在 \pkg{ctex.sty} 下启用该选项,
+% 将会检查当前是否使用 \LaTeX{} 标准文档类。
+% 若然,则该选项将会使得 \pkg{ctex.sty} 宏包的行为和 \CTeX{} 套件提供的
+% 三个中文文档类\emph{完全}一致;若不然,则会根据 \tn{chapter}
+% 是否有定义来使用 \cls{ctexbook} 或者 \cls{ctexart} 的标题设置。
+%
+% \begin{function}{sub3section, sub4section}
+% \begin{syntax}
+% \OPC
+% \end{syntax}
+% 会修改 \tn{paragraph} 和 \tn{subparagraph} 的格式。
+%
+% 默认情况下,\tn{paragraph} 和 \tn{subparagraph} 会将标题与随后的正文
+% 排版在同一个段落。启用 \opt{sub3section} 会将 \tn{paragraph} 的格式修改为
+% 类似 \tn{section} 的格式,并将 \tn{subparagraph} 的格式修改为原本 \tn{paragraph}
+% 的格式。启用 \opt{sub4section} 会将 \tn{paragraph} 和 \tn{subparagraph} 的格式
+% 都修改为类似 \tn{section} 的格式。
+%
+% 启用该选项通常需要将计数器 |secnumdepth| 的值为设置为 4 或 5。
+%
+% 具体格式可参考 \ref{sec:secstyle}~节中的 \opt{afterskip} 等选项。
+%
+% 注意,上述两个选项只有在 \opt{heading} 选项启用的时候才有意义。亦即,只有在使用
+% 三个 \CTeX{} 文档类或启用了 \opt{heading} 的 \pkg{ctex.sty} 的时候才有意义。
+% \end{function}
+%
+% \subsection{排版方案选项}
+% \label{subs:options-type-style}
+%
+% \begin{function}{scheme}
+% \begin{syntax}
+% scheme = <(chinese)|plain>
+% \OPC
+% \end{syntax}
+% 选择文章的排版方案,预设有 \opt{chinese} 和 \opt{plain} 两种方案。%
+% \begin{optdesc}
+% \item[chinese] 调整默认字号为五号字,并调整行距为 |1.3|;
+% 汉化文档中的标题名字(如“图”、“表”、“目录”和“参考文献”,
+% 见 \ref{subs:capname}~节);
+% 在 \opt{heading = true} 的情况下^^A
+% \footnote{使用 \CTeX{} 文档类,或者使用 \pkg{ctex} 宏包且开启该选项时。}^^A
+% (\ref{subs:options-heading}~节),还会将章节标题的风格修改为
+% 中文样式(见 \ref{sec:secstyle}~节)。
+% \item[plain] 不调整默认字号和行距,不会汉化文档中的标题名字,也不会将章节标题风格
+% 修改为中文样式,同时不会 \tn{pagestyle},并禁用 \opt{autoindent}
+% 选项。事实上,此时的 \CTeX{} 套件只提供了中文支持功能,而不对文章版式进行任何修改。
+% \end{optdesc}
+% \end{function}
+%
+% \begin{function}{punct}
+% \begin{syntax}
+% punct = <(quanjiao)|banjiao|kaiming|CCT|plain>
+% \OBOTH
+% \end{syntax}
+% 设置标点处理格式。预定义好的格式有:
+% \end{function}
+%
+% \begin{optdesc}
+% \item[quanjiao] 全角式:所有标点占一个汉字宽度,相邻两个标点占 1.5 汉字宽度;
+% \item[banjiao] 半角式:所有标点占半个汉字宽度;
+% \item[kaiming] 开明式:句末点号^^A
+% \footnote{标点符号分为标号与点号。点号分为两类,一共七种:句末点号有^^A
+% 句号、问号和叹号;句内点号有逗号、顿号、冒号和分号。}用占一个汉字宽度,标^^A
+% 号和句内点号占半个汉字宽度;
+% \item[CCT] CCT 式:所有标点符号的宽度略小于一个汉字宽度;
+% \item[plain] 原样(不调整标点间距)。
+% \end{optdesc}
+%
+% \begin{function}{space}
+% \begin{syntax}
+% space = <\TF|(auto)>
+% \OBOTH
+% \end{syntax}
+% 是否在生成的 PDF 中保留汉字后面的空格。
+% \end{function}
+%
+% \begin{optdesc}
+% \item[true] 总是保留汉字后的空格。此时,用户需要自行在行尾加上~|%|~处理换行产生
+% 的空格\footnote{\LaTeX{} 将单个换行视作一个空格。}。
+% \item[false] 总是忽略掉汉字后面的空格,不论汉字后是什么(使用 (pdf)\LaTeX{}
+% 编译时);等同于 \opt{auto} 的效果(使用 \XeLaTeX{} 编译时)。不建议使用该选项。
+% \item[auto] 根据空格后面的情况决定是否保留:如果空格后面是汉字,则忽略该
+% 空格,否则保留。
+% \end{optdesc}
+%
+% 例如,使用
+% \begin{ctexexam}
+% \ctexset{space=true}
+% 汉字 分词
+% 技术 English
+% \end{ctexexam}
+% 将得到“{\ctexset{space=true}汉字 分词 技术 English}”;使用
+% \begin{ctexexam}
+% \ctexset{space=auto}
+% 汉字 分词
+% 技术 English
+% \end{ctexexam}
+% 则会得到“{\ctexset{space=auto}汉字 分词 技术 English}”。
+%
+% \emph{使用 \textup{\LuaLaTeX} 编译的时候,该选项无效:汉字间的空格以及汉字与西文字符
+% 之间的空格总是有效,不会被忽略,但可以自动忽略掉由换行产生的空格。}
+%
+% \begin{function}{linespread}
+% \begin{syntax}
+% linespread = <数值>
+% \OPC
+% \end{syntax}
+% 接受一个浮点数值,设置行距倍数。
+%
+% \opt{scheme = chinese} 时,默认值为 1.3,即 1.3 倍行距。此时,相邻两行的基线
+% (\tn{baselineskip})距离为 $1.3\times 1.2=1.56$ 倍字体高度。
+%
+% \opt{scheme = plain} 时,\CTeX{} 套件默认不调整行距倍数,文档中的行距由所选文档类和
+% 其他宏包或用户设置决定。
+% \end{function}
+%
+% \begin{function}{autoindent}
+% \begin{syntax}
+% autoindent = <\TTF|数值|带单位的数值>
+% \OBOTH
+% \end{syntax}
+% 在字体大小发生变化时,是否自动调整段首缩进(\tn{parindent})的大小。
+%
+% \meta{数值 \orbar 带单位的数值} 用于设置段首缩进的长度。如果不带单位,则默认
+% 单位是单个汉字字宽 \tn{ccwd};如果带单位,则使用该单位。
+%
+% \opt{autoindent = true} 等价于设置 \opt{autoindent = 2}。
+%
+% 当 \opt{autoindent = false} 时,可以设置固定长度的段首缩进。如设
+% 置每段缩进 40 点:
+% \begin{ctexexam}
+% \ctexset{autoindent=false}
+% \setlength\parindent{40pt}
+% \end{ctexexam}
+% \end{function}
+%
+% \begin{function}{linestretch}
+% \begin{syntax}
+% linestretch = <数值或长度>
+% \OSET
+% \end{syntax}
+% \opt{linestretch} 是一个比较特殊的选项,它用来设置汉字之间弹性间距的弹性程
+% 度。如果有单位,则可以在选项中直接写;如果是数字,单位则是汉字宽度
+% \tn{ccwd} 的倍数。
+%
+% 如果行宽不是汉字宽度的整数倍,为了让段落左右两端对齐,自然就要求伸展汉字之
+% 间的间距,而 \opt{linestretch} 选项就是设置每行总的允许伸行量。初始值是允
+% 许每行伸行一个汉字的宽度 \tn{ccwd},并且此宽度能根据字号变化动态调整。
+%
+% 过小的 \opt{linestretch} 可能导致段落文字右侧可能参差不齐;较大的
+% \opt{linestretch} 选项则可以帮助拥有较长不可断行内容的复杂段落方便地断行,
+% 而不会产生大量编译警告;但很大的 \opt{linestretch} 则会掩盖段落不良断行产
+% 生的坏盒子警告。
+%
+% 如果将 \opt{linestretch} 选项的值设置为 \tn{maxdimen},则可以禁止按字号自
+% 动修改每行的允许伸长量。此时汉字间的弹性间距则固定为 \tn{baselineskip} 的
+% $0.08$ 倍。
+% \end{function}
+%
+% \section{文档汉化}
+% \label{sec:chinese-localization}
+% \subsection{日期汉化}
+%
+% \CTeX 宏包对显示当前日期的 \tn{today} 命令进行了汉化,使之以中文的方式显示今
+% 天的日期。如编译本文档的日期就是“\today”。
+%
+% \begin{function}{today}
+% \begin{syntax}
+% today = <(small)|big|old>
+% \OSET
+% \end{syntax}
+% 该选项用来控制 \tn{today} 命令的输出格式:
+% \begin{optdesc}
+% \item[small] \ctexset{today=small}
+% 效果为“\today”。使用阿拉伯数字和汉字的日期格式。
+% \item[big] \ctexset{today=big}
+% 效果为“\today”。使用全汉字的日期格式。
+% \item[old] \ctexset{today=old}
+% 效果为“\today”。使用文档原来的(英文)日期格式。
+% \end{optdesc}
+% \end{function}
+%
+% 设置日期格式使用 \tn{ctexset} 命令完成,例如设置全汉字的日期格式:
+% \begin{ctexexam}
+% \ctexset{today=big}
+% \end{ctexexam}
+%
+% \CTeX 宏包的中文日期功能实际上是调用 \pkg{zhnumber} 宏包完成的。如果需要更
+% 多有关日期、时间的命令和更复杂的设置,可以查阅 \pkg{zhnumber} 宏包的文档。
+%
+% \subsection{文档标题汉化}
+% \label{subs:capname}
+%
+% 这里主要介绍由宏包 \opt{scheme} 选项(\ref{subs:options-type-style}~节)控制
+% 的文档标题汉化功能。
+%
+% 设置文档标题名的示例可见例~\ref{exam:capname}。下面的选项(如
+% \opt{contentsname})主要用来重新定义与选项同名的宏(如 \tn{contentsname})的
+% 定义。
+%
+% \begin{defaultcapconfig}
+%
+% \begin{function}{contentsname}
+% \begin{syntax}
+% contentsname = <名字>
+% \OSET
+% \end{syntax}
+% 设置目录标题名 \tn{contentsname}。中文默认为“\contentsname”。
+% \end{function}
+%
+% \begin{function}{listfigurename}
+% \begin{syntax}
+% listfigurename = <名字>
+% \OSET
+% \end{syntax}
+% 设置插图目录标题名 \tn{listfigurename}。中文默认为“\listfigurename”。
+% \end{function}
+%
+% \begin{function}{listtablename}
+% \begin{syntax}
+% listtablename = <名字>
+% \OSET
+% \end{syntax}
+% 设置表格目录标题名 \tn{listtablename}。中文默认为“\listtablename”。
+% \end{function}
+%
+% \begin{function}{figurename}
+% \begin{syntax}
+% figurename = <名字>
+% \OSET
+% \end{syntax}
+% 设置图片环境标题名 \tn{figurename}。中文默认为“\figurename”。
+% \end{function}
+%
+% \begin{function}{tablename}
+% \begin{syntax}
+% tablename = <名字>
+% \OSET
+% \end{syntax}
+% 设置表格环境标题名 \tn{tablename}。中文默认为“\tablename”。
+% \end{function}
+%
+% \begin{function}{abstractname}
+% \begin{syntax}
+% abstractname = <名字>
+% \OSET
+% \end{syntax}
+% 设置摘要 \env{abstract} 环境标题名 \tn{abstractname}。中文默认
+% 为“\abstractname”。注意 \cls{book} 类没有摘要,该选项无效。
+% \end{function}
+%
+% \begin{function}{indexname}
+% \begin{syntax}
+% indexname = <名字>
+% \OSET
+% \end{syntax}
+% 设置索引标题名 \tn{indexname}。中文默认为“\indexname”。
+% \end{function}
+%
+% \begin{function}{appendixname}
+% \begin{syntax}
+% appendixname = <名字>
+% \OSET
+% \end{syntax}
+% 设置附录标题名 \tn{appendixname}。中文默认为“\appendixname”。
+% \end{function}
+%
+% \begin{function}{bibname}
+% \begin{syntax}
+% bibname = <名字>
+% \OSET
+% \end{syntax}
+% 设置参考文献标题名 \tn{refname}(对 \cls{article})或 \tn{bibname}(对
+% \cls{report} 和 \cls{book})。中文默认为“\refname”。
+% \end{function}
+%
+% \end{defaultcapconfig}
+%
+% \subsection{页面格式设置与汉化}
+% \label{subs:pagestyle}
+%
+% 当使用了 \CTeX 的文档类或是用 \pkg{ctex} 宏包加载了 \opt{heading} 选项时,会
+% 设置整个文档的页面格式(page style)为 |headings|,即相当于设置了
+% \begin{verbatim}[gobble=2]
+% \pagestyle{headings}
+% \end{verbatim}
+% 在页眉中显示当前章节的编号与标题。
+%
+% 同时,\CTeX 宏包也会对默认的 |headings| 页面格式进行修改,使之调用
+% \tn{CTEXthechapter}、\tn{CTEXthesection} 等宏来正确显示中文的章节编号。
+%
+% \CTeX 宏包的默认页面格式设置是经过汉化的 |headings|,其基本效果如本文档所
+% 示,只在页眉一侧显示章节编号和标题,另一侧显示页码。
+%
+% 更复杂的页面格式可以通过调用 \pkg{fancyhdr}、\pkg{titleps} 等宏包来设
+% 置。\CTeX 宏包同时也为这些自定义页面格式
+% 的包提供了以下宏供使用:
+% \begin{itemize}
+% \item \tn{CTEXthechapter}、\tn{CTEXthesection} 等章节编号(见
+% \ref{sec:secstyle} 节)。它们用来代替英文文档类中的
+% \tn{thechapter}、\tn{thesection} 等宏。
+%
+% \item \tn{leftmark}、\tn{rightmark},它们是在使用章节标题命令后,自动设置的
+% 宏。它们实际是在与章节标题命令对应的标记命令
+% \tn{chaptermark}、\tn{sectionmark} 中调用 \tn{markright} 或 \tn{markboth} 生
+% 成的。
+% \end{itemize}
+% 有关 \LaTeX 页面标记的涵义与使用细节,已经超出了本文档讨论的范围。可以参考
+% \cite[Chapter~23]{knuthtex1986}、\cite[\S4.3, \S4.4]{mittelbach2004} 等书籍。
+%
+% 这里举一个例子,说明通过重定义 \tn{sectionmark},在 \cls{ctexart} 文档类中的
+% 标准 |headings| 页面格式下控制页眉的方式:
+% \begin{ctexexam}
+% \documentclass{ctexart}
+% \pagestyle{headings}
+% \ctexset{section={
+% name={第,节},
+% number=\arabic{section},
+% }
+% }
+% \renewcommand\sectionmark[1]{%
+% \markright{\CTEXthesection——#1}}
+%
+% \begin{document}
+%
+% \section{天地玄黄}
+% \newpage
+%
+% \section{宇宙洪荒}
+%
+% \end{document}
+% \end{ctexexam}
+% 在上例中,我们设置了页眉的形式是用破折号分开的节编号与节标题,即“第 1 节
+% ——天地玄黄”、“第 2 节——宇宙洪荒”。
+%
+% \CTeX 宏包已经对 \pkg{fancyhdr} 宏包进行了补丁,载入 \pkg{fancyhdr} 后,其
+% |fancy| 页面格式将使用 \tn{CTEXthechapter} 等宏显示中文章节编号。
+%
+% 关于 \pkg{fancyhdr} 的具体用法可以参见其宏包手册。通常也只要像在标准的英文文
+% 档类中使用 \pkg{fancyhdr} 一样定义页眉页脚格式即可,并不需要额外的定义。
+%
+% 下面我则给出一个与前例类似而稍复杂的例子,展示如何在文档中设置页眉内容与页眉
+% 的格式。
+% \begin{ctexexam}
+% \documentclass{ctexart}
+% \ctexset{section={
+% name={第,节},
+% number=\arabic{section},
+% }
+% }
+% \usepackage{fancyhdr}
+% \fancyhf{}
+% \lhead{\textnormal{\kaishu\rightmark}}
+% \rhead{--\ \thepage\ --}
+% \pagestyle{fancy}
+% % \sectionmark 的重定义需要在 \pagestyle 之后生效
+% \renewcommand\sectionmark[1]{%
+% \markright{\CTEXthesection——#1}}
+%
+% \begin{document}
+%
+% \section{天地玄黄}
+% \newpage
+%
+% \section{宇宙洪荒}
+%
+% \end{document}
+% \end{ctexexam}
+% 本例的页眉效果大致如下(有页眉线):
+% \begin{trivlist}\item
+% \textnormal{\kaishu 第 1 节——天地玄黄}\hfill -- 1 --\par
+% \smallskip\hrule
+% \end{trivlist}
+%
+% \section{章节标题格式设置}
+% \label{sec:secstyle}
+%
+% \CTeX 宏包对 \LaTeX 的标准文档类(\cls{article}、\cls{report} 和
+% \cls{book})进行了扩充。当以 \opt{heading} 选项调用 \CTeX 宏包时
+% (\ref{subs:options-heading}~节),则会启用章
+% 节标题的格式设置功能。本节就来介绍有关章节标题的格式选项,所有选项使用
+% \tn{ctexset} 命令设置。
+%
+% \changes{v2.0}{2015/03/21}{\tn{CTEXsetup}, \tn{CTEXoptions} 是过时命令。}
+% 章节标题的格式选项是分层设置的。顶层的选项是章节标题名称,次一级的选项是章节
+% 标题的格式。章节标题名包括 |part|, |chapter|, |section|, |subsection|,
+% |subsubsecton|, |paragraph|, |subparagraph|;而可用的格式包括 \opt{name},
+% \opt{number}, \opt{format}, \opt{nameformat}, \opt{numberformat},
+% \opt{aftername}, \opt{titleformat}, \opt{beforeskip}, \opt{afterskip},
+% \opt{indent}, \opt{pagestyle} 等。但注意,对 \cls{article} 及其衍生的
+% \cls{ctexart} 等文档类,没有 |chapter| 级别的标题。
+%
+% 多级选项之间用斜线分开,例如,\opt{part/name} 选项设置 \tn{part} 标题的在数
+% 字前后的名称,而 \opt{section/number} 选项设置 \tn{section} 标题的数字类型。
+%
+% \begin{function}{part/name, chapter/name, section/name, subsection/name,
+% subsubsection/name, paragraph/name, subparagraph/name}
+% \begin{syntax}
+% name = \{<前名字>,<后名字>\}
+% name = \Arg{前名字}
+% \OSET
+% \end{syntax}
+% 设置章节的名字。名字可以分为前后两部分,即章节编号前后的词语,两个词之间用
+% 一个半角逗号分开;也可以只有一部分,表示只有章节编号之前的名字。例如:
+% \begin{ctexexam}
+% \ctexset{
+% chapter/name = {第,章},
+% section/name = {\S},
+% }
+% \end{ctexexam}
+% 会使得 \tn{chapter} 标题使用形如“第一章”的名字,而 \tn{section} 标题则使
+% 用形如“\S1”的名字。
+% \end{function}
+%
+% \begin{table}[htbp]
+% \small\centering
+% \caption{\opt{name} 选项的默认设置}
+% \begin{tabular}{llll}
+% \toprule
+% 标题名 & \makecell{\opt{scheme = chinese} \\ 的默认值} &
+% \makecell{\opt{scheme = plain} \\ 的默认值} & 注 \\
+% \midrule
+% part & |{第,部分}| & |{\partname\space}| & 原 \tn{partname} 为 Part \\
+% chapter & |{第,章}| & |{\chaptername\space}|
+% & 原 \tn{chaptername} 为 Chapter \\
+% section & |{}| & |{}| & \\
+% subsection & |{}| & |{}| & \\
+% subsubsection & |{}| & |{}| & \\
+% paragraph & |{}| & |{}| & \\
+% subparagraph & |{}| & |{}| & \\
+% \bottomrule
+% \end{tabular}
+% \end{table}
+%
+% \begin{function}{part/number, chapter/number, section/number, subsection/number,
+% subsubsection/number, paragraph/number, subparagraph/number}
+% \begin{syntax}
+% number = \Arg{数字输出命令}
+% \OSET
+% \end{syntax}
+% 设置章节编号的数字输出格式。\meta{数字输出命令} 通常是对应章节编号计数器的
+% 输出命令,如 \tn{thesection} 或 |\chinese{chapter}| 之类。
+% \begin{ctexexam}
+% \ctexset{
+% section/number = \Roman{section}
+% }
+% \end{ctexexam}
+%
+% \opt{number} 选项的定义同时将控制对章节计数器的交叉引用。在引用计数器时,
+% 记录在 \LaTeX{} 辅助文件中的是 \opt{number} 选项的定义。
+%
+% 但是,\opt{number} 选项不会影响计数器本身的输出。即设置 |section/number|
+% 不会影响 \tn{thesection} 的定义。(但该选项会影响 \tn{CTEXthesection} 的定
+% 义,见后。)
+% \end{function}
+%
+% \begin{table}[htbp]
+% \small\centering
+% \caption{\opt{number} 选项的默认设置}
+% \setlength\leftskip{0pt plus 1 fil minus \marginparwidth}
+% \begin{tabular}{llll}
+% \toprule
+% 标题名 & \makecell{\opt{scheme = chinese} \\ 的默认值} &
+% \makecell{\opt{scheme = plain} \\ 的默认值}
+% & 原 |\the|\meta{标题} 等价定义 \\
+% \midrule
+% part & |\chinese{part}| & |\thepart| & |\Roman{part}| \\
+% chapter & |\chinese{chapter}| & |\thechapter| & |\arabic{chapter}| \\
+% section & 同右 & |\thesection| & |\arabic{section}| \\
+% subsection & 同右 & |\thesubsection| & |\thesection.\arabic{subsection}| \\
+% subsubsection & 同右 & |\thesubsubsection|
+% & |\thesubsection.\arabic{subsubsection}| \\
+% paragraph & 同右 & |\theparagraph|
+% & |\thesubsubsection.\arabic{paragraph}| \\
+% subparagraph & 同右 & |\thesubparagraph|
+% & |\theparagraph.\arabic{subparagraph}| \\
+% \bottomrule
+% \end{tabular}
+% \end{table}
+%
+% \begin{function}{\CTEXthepart, \CTEXthechapter, \CTEXthesection,
+% \CTEXthesubsection, \CTEXthesubsubsection, \CTEXtheparagraph,
+% \CTEXthesubparagraph}
+% 以 |\CTEXthe| 开头的这组宏给出结合了 \opt{name} 与 \opt{number} 选项的章节
+% 编号输出格式。例如在 \opt{scheme = chinese} 时,默认章编号输出格式就是
+% \tn{CTEXthechapter},形如“第一章”。
+%
+% 这组宏在 \CTeX 文档类中将代替 \tn{thechapter} 等宏的作用,在章节中引用本章
+% 节的完整编号。例如用于帮助定义自定义的目录格式、页眉格式等。
+% \end{function}
+%
+% 使用 \tn{ctexset} 设置多级选项时,可以在同一个上级选项下设置多个下级选项。例
+% 如同时设置 |section| 一级标题的 \opt{name} 与 \opt{number} 选项:
+% \begin{ctexexam}
+% \ctexset{
+% section = {
+% name = {第,节},
+% number = \chinese{section}
+% }
+% }
+% \end{ctexexam}
+%
+%
+% \begin{function}{part/format, chapter/format, section/format,
+% subsection/format, subsubsection/format, paragraph/format,
+% subparagraph/format,
+% .../format+}
+% \begin{syntax}
+% format = \Arg{格式命令}
+% format+= \Arg{格式命令}
+% \OSET
+% \end{syntax}
+% \opt{format} 选项用于控制章节标题的全局格式,作用域为章节名字和随后的标题
+% 内容。可以用于控制章节标题的对齐方式、整体字体字号等格式。
+%
+% 带加号的 \opt{format+} 选项则用于在已有格式之后追加新的格式命令。
+%
+% 例如,设置章格式为无衬线字体左对齐,为节格式增加无衬线字体设置:
+% \begin{ctexexam}
+% \ctexset{
+% chapter/format=\sffamily\raggedright,
+% section/format+=\sffamily
+% }
+% \end{ctexexam}
+% \end{function}
+%
+% \begin{table}[htbp]
+% \small\centering
+% \caption{\opt{format} 选项的默认设置}
+% \begin{tabular}{lll}
+% \toprule
+% 标题名 & \makecell{\opt{scheme = chinese} \\ 的默认值} &
+% \makecell{\opt{scheme = plain} \\ 的默认值} \\
+% \midrule
+% part (article) & |\centering| & |\raggedright| \\
+% part & 同右 & |\centering| \\
+% chapter & |\centering| & |\raggedright| \\
+% section & |\Large\bfseries\centering| & |\Large\bfseries| \\
+% subsection & 同右 & |\large\bfseries| \\
+% subsubsection & 同右 & |\normalsize\bfseries| \\
+% paragraph & 同右 & |\normalsize\bfseries| \\
+% subparagraph & 同右 & |\normalsize\bfseries| \\
+% \bottomrule
+% \end{tabular}
+% \end{table}
+%
+% \begin{function}{part/nameformat, chapter/nameformat, section/nameformat,
+% subsection/nameformat, subsubsection/nameformat, paragraph/nameformat,
+% subparagraph/nameformat,
+% .../nameformat+}
+% \begin{syntax}
+% nameformat = \Arg{格式命令}
+% nameformat+= \Arg{格式命令}
+% \OSET
+% \end{syntax}
+% \opt{nameformat} 用于控制章节名字的格式,作用域为章节名字,包括编号。它一
+% 般用于章节名(包括编号)与章节标题的字体、字号等设置不一致的情形。参见
+% \opt{titleformat} 选项。
+%
+% \opt{nameformat+} 用于在已有的章节名字格式后附加内容。
+% \end{function}
+%
+% \begin{table}[htbp]
+% \small\centering
+% \caption{\opt{nameformat} 选项的默认设置}
+% \begin{tabular}{lll}
+% \toprule
+% 标题名 & \makecell{\opt{scheme = chinese} \\ 的默认值} &
+% \makecell{\opt{scheme = plain} \\ 的默认值} \\
+% \midrule
+% part (article) & 同右 & |\Large\bfseries| \\
+% part & 同右 & |\huge\bfseries| \\
+% chapter & 同右 & |\huge\bfseries| \\
+% section & 同右 & |{}| \\
+% subsection & 同右 & |{}| \\
+% subsubsection & 同右 & |{}| \\
+% paragraph & 同右 & |{}| \\
+% subparagraph & 同右 & |{}| \\
+% \bottomrule
+% \end{tabular}
+% \end{table}
+%
+% \begin{function}{part/numberformat, chapter/numberformat,
+% section/numberformat, subsection/numberformat, subsubsection/numberformat,
+% paragraph/numberformat, subparagraph/numberformat,
+% .../numberformat+}
+% \begin{syntax}
+% numberformat = \Arg{格式命令}
+% numberformat+= \Arg{格式命令}
+% \OSET
+% \end{syntax}
+% \opt{numberformat} 选项用于控制章节编号的格式,作用域仅为编号数字本身。对
+% 各级标题默认均为空,当你需要编号的格式和前后的章节名字不一样时可以使用。
+%
+% \opt{numberformat+} 选项用于在原有编号格式后面附加格式命令。
+%
+% 例如,我们可以使用 \opt{numberformat} 特别强调章标题中的数字:
+% \begin{ctexexam}
+% \ctexset{
+% chapter/number = \arabic{chapter},
+% chapter/numberformat = \color{blue}\zihao{0}\itshape,
+% }
+% \end{ctexexam}
+% 上面的代码在 |cap| 选项下可以做出类似这样的章标题效果:
+% \begin{center}
+% \huge\bfseries 第 \textit{\color{blue}\zihao{0}4} 章
+% \end{center}
+% \end{function}
+%
+% \begin{function}{part/aftername, chapter/aftername, section/aftername,
+% subsection/aftername, subsubsection/aftername, paragraph/aftername,
+% subparagraph/aftername}
+% \begin{syntax}
+% aftername=\Arg{代码}
+% \OSET
+% \end{syntax}
+% \opt{aftername} 选项的参数 \meta{代码} 将被插入到章节编号与其后的标题内容之
+% 间,用于控制格式变换。常用于控制章节编号与标题内容之间的距离,或者控制标题
+% 是否另起一行。
+% \end{function}
+%
+% \begin{table}[htbp]
+% \small\centering
+% \caption{\opt{aftername} 选项的默认设置}
+% \begin{tabular}{lll}
+% \toprule
+% 标题名 & \makecell{\opt{scheme = chinese} \\ 的默认值} &
+% \makecell{\opt{scheme = plain} \\ 的默认值} \\
+% \midrule
+% part (article) & |\quad| & |\par\nobreak| \\
+% part & 同右 & |\par\vskip 20pt| \\
+% chapter & |\quad| & |\par\nobreak\vskip 20pt| \\
+% section & 同右 & |\quad| \\
+% subsection & 同右 & |\quad| \\
+% subsubsection & 同右 & |\quad| \\
+% paragraph & 同右 & |\quad| \\
+% subparagraph & 同右 & |\quad| \\
+% \bottomrule
+% \end{tabular}
+% \end{table}
+%
+% \begin{function}{part/titleformat, chapter/titleformat, section/titleformat,
+% subsection/titleformat, subsubsection/titleformat, paragraph/titleformat,
+% subparagraph/titleformat,
+% .../titleformat+}
+% \begin{syntax}
+% titleformat = \Arg{格式命令}
+% titleformat+= \Arg{格式命令}
+% \OSET
+% \end{syntax}
+% \opt{titleformat} 选项用于控制标题内容的格式,作用域为章节标题内容。
+%
+% \opt{titleformat+} 选项用于在原有标题格式后面附加格式命令。
+%
+% 需要注意的是,\opt{titleformat} 选项的最后一个格式命令可以是一个有一个
+% 参数的命令。这个命令的参数接受标题内容,用于实现特殊效果。
+% 例如,实现多行标题的居中悬挂对齐:
+% \end{function}
+% \begin{ctexexam}
+% \usepackage{varwidth} %% 提供 varwidth 环境
+% \ctexset{
+% chapter/name = {第,回},
+% chapter/titleformat = \chaptertitleformat
+% }
+% \newcommand\chaptertitleformat[1]{%% 以标题内容为参数
+% \begin{varwidth}[t]{.7\linewidth}#1\end{varwidth}}
+% ......
+% \chapter{情中情因情感妹妹\\错里错以错劝哥哥}
+% \end{ctexexam}
+% 上面的代码可以做出类似这样的章标题效果:
+% \begin{center}\Large\bfseries
+% 第三十四回\quad
+% \begin{tabular}[t]{l}
+% 情中情因情感妹妹\\
+% 错里错以错劝哥哥
+% \end{tabular}
+% \end{center}
+%
+% \begin{table}[htbp]
+% \small\centering
+% \caption{\opt{titleformat} 选项的默认设置}
+% \begin{tabular}{lll}
+% \toprule
+% 标题名 & \makecell{\opt{scheme = chinese} \\ 的默认值} &
+% \makecell{\opt{scheme = plain} \\ 的默认值} \\
+% \midrule
+% part (article) & |\Large\bfseries| & |\huge\bfseries| \\
+% part & |\huge\bfseries| & |\Huge\bfseries| \\
+% chapter & |\huge\bfseries| & |\Huge\bfseries| \\
+% section & 同右 & |{}| \\
+% subsection & 同右 & |{}| \\
+% subsubsection & 同右 & |{}| \\
+% paragraph & 同右 & |{}| \\
+% subparagraph & 同右 & |{}| \\
+% \bottomrule
+% \end{tabular}
+% \end{table}
+%
+% \begin{function}{part/beforeskip, chapter/beforeskip, section/beforeskip,
+% subsection/beforeskip, subsubsection/beforeskip, paragraph/beforeskip,
+% subparagraph/beforeskip}
+% \begin{syntax}
+% beforeskip = \Arg{弹性间距}
+% \OSET
+% \end{syntax}
+% \opt{beforeskip} 选项用于设置章节标题前的垂直间距及章节标题后首段的缩进。
+%
+% \meta{弹性间距} 的绝对值被用于设置标题间的垂直间距,而 \meta{弹性间距} 的正
+% 负号用于设置标题后第一段的首行缩进。当参数是负值时,章节标题后的第一段按英
+% 文文档的排版习惯,没有首行缩进;参数是正值时,则保留首行缩进。
+%
+% 使用 \opt{sub3section} 或 \opt{sub4section} 宏包选项(见
+% \ref{subs:options-heading}~节)后,\tn{paragraph} 与 \tn{subparagraph}
+% 这两级标题会改为排在不同段,会影响 \opt{beforeskip} 选项的默认值。
+% \end{function}
+%
+% \begin{table}[htbp]
+% \small\centering
+% \caption{\opt{beforeskip} 选项的默认设置}
+% \begin{tabular}{lll}
+% \toprule
+% 标题名 & \makecell{\opt{scheme = chinese} \\ 的默认值} &
+% \makecell{\opt{scheme = plain} \\ 的默认值} \\
+% \midrule
+% part (article) & |4ex| & |-4ex| \\
+% part & 无效 & 无效 \\
+% chapter & |50pt| & |-50pt| \\
+% section & |3.5ex plus 1ex minus .2ex| & |-3.5ex plus -1ex minus -.2ex| \\
+% subsection & |3.25ex plus 1ex minus .2ex| & |-3.25ex plus -1ex minus -.2ex| \\
+% subsubsection & |3.25ex plus 1ex minus .2ex| & |-3.25ex plus -1ex minus -.2ex| \\
+% paragraph & 同右 & |3.25ex plus 1ex minus .2ex| \\
+% \qquad(sub3section) & |3.25ex plus 1ex minus .2ex| & |-3.25ex plus -1ex minus -.2ex| \\
+% \qquad(sub4section) & 同上 & 同上 \\
+% subparagraph & 同右 & |3.25ex plus 1ex minus .2ex| \\
+% \qquad(sub4section) & |3.25ex plus 1ex minus .2ex| & |-3.25ex plus -1ex minus -.2ex| \\
+% \bottomrule
+% \end{tabular}
+% \end{table}
+%
+% \begin{function}{part/afterskip, chapter/afterskip, section/afterskip,
+% subsection/afterskip, subsubsection/afterskip, paragraph/afterskip,
+% subparagraph/afterskip}
+% \begin{syntax}
+% afterskip = \Arg{弹性间距}
+% \OSET
+% \end{syntax}
+% \opt{afterskip} 选项控制章节标题与后面下方之间的距离。\meta{弹性间距} 的正
+% 负号确定标题与后面正文是否排在同一段。如果是正值则正文另起一段,\meta{弹性
+% 间距} 给出垂直间距;如果是负值则章节标题与正文第一段排在同一段,\meta{弹性
+% 间距} 的绝对值给出水平间距。
+%
+% 默认情况下,\tn{paragraph}、\tn{subparagraph} 两级标题是与后面正文排在同一
+% 段的,\opt{afterskip} 选项取负数;但使用 \opt{sub3section} 或
+% \opt{sub4section} 宏包选项(见 \ref{subs:options-heading}~节)后,则这
+% 两级标题会改为排在不同段。
+%
+% \opt{afterskip} 选项的默认值,在 \opt{scheme} 选项的不同取值下相同。
+% \end{function}
+%
+% \begin{table}[htbp]
+% \begin{minipage}[t]{.5\linewidth}
+% \small\centering
+% \caption{\opt{afterskip} 选项的默认设置}
+% \begin{tabular}{ll}
+% \toprule
+% 标题名 & 默认值 \\
+% \midrule
+% part (article) & |3ex| \\
+% part & 无效 \\
+% chapter & |40pt| \\
+% section & |2.3ex plus .2ex| \\
+% subsection & |1.5ex plus .2ex| \\
+% subsubsection & |1.5ex plus .2ex| \\
+% paragraph & |-1em| \\
+% \qquad(sub3section) & |1ex plus .2ex| \\
+% \qquad(sub4section) & 同上 \\
+% subparagraph & |-1em| \\
+% \qquad(sub4section) & |1ex plus .2ex| \\
+% \bottomrule
+% \end{tabular}
+% \end{minipage}%
+% \begin{minipage}[t]{.5\linewidth}
+% \small\centering
+% \caption{\opt{indent} 选项的默认设置}
+% \begin{tabular}{ll}
+% \toprule
+% 标题名 & 默认值 \\
+% \midrule
+% part (article) & |0pt| \\
+% part & 无效 \\
+% chapter & |0pt| \\
+% section & |0pt| \\
+% subsection & |0pt| \\
+% subsubsection & |0pt| \\
+% paragraph & |0pt| \\
+% subparagraph & |\parindent| \\
+% \qquad(sub3section) & |0pt| \\
+% \qquad(sub4section) & |0pt| \\
+% \bottomrule
+% \end{tabular}
+% \end{minipage}%
+% \end{table}
+%
+% \begin{function}{part/indent, chapter/indent, section/indent,
+% subsection/indent, subsubsection/indent, paragraph/indent,
+% subparagraph/indent}
+% \begin{syntax}
+% indent = \Arg{缩进间距}
+% \OSET
+% \end{syntax}
+% \opt{indent} 选项用于设置章节标题本身的首行缩进。
+%
+% \opt{indent} 选项的默认值,在 \opt{scheme} 选项的不同取值下相同。
+% \end{function}
+%
+% \begin{ctexexam}
+% \ctexset{section={
+% format=\Large\bfseries,
+% indent=20pt,
+% }
+% }
+% \section{首行缩进的标题}
+% \noindent 无缩进的正文。
+% \end{ctexexam}
+%
+% \begin{function}{part/pagestyle, chapter/pagestyle}
+% \begin{syntax}
+% pagestyle = \Arg{页面格式}
+% \OSET
+% \end{syntax}
+% 设置 \cls{book}/\cls{ctexbook} 或 \cls{report}/\cls{ctexrep} 文档类
+% 中,\tn{part} 与 \tn{chapter} 标题所在页的页面格式(page style)。
+% \end{function}
+%
+% \begin{table}[htbp]
+% \small\centering
+% \caption{\opt{pagestyle} 选项的默认设置}
+% \begin{tabular}{ll}
+% \toprule
+% 标题名 & 默认值 \\
+% \midrule
+% part (article) & 无效 \\
+% part & |plain| \\
+% chapter & |plain| \\
+% \bottomrule
+% \end{tabular}
+% \end{table}
+%
+%
+% \begin{function}{appendix/name}
+% \begin{syntax}
+% name = \{<前名字>,<后名字>\}
+% name = \Arg{前名字}
+% \OSET
+% \end{syntax}
+% 设置附录章(对 \cls{book} 与 \cls{report})或附录节(对 \cls{article})的
+% 名字。用法与普通章节 \opt{name} 选项类似。
+%
+% 注意该选项与 \opt{appendixname} 选项(\ref{subs:capname}~节)在意义上有
+% 些重叠,但意义不同。\opt{appendixname} 选项只用来重定义
+% \tn{appendixname},而不管 \tn{appendixname} 如何使用;该选项则决定在章节标
+% 题中输出的名字,可以调用 \tn{appendixname} 设置。
+% \end{function}
+%
+% \begin{table}[htbp]
+% \small\centering
+% \caption{\opt{appendix/name} 选项的默认设置}
+% \begin{tabular}{llllll}
+% \toprule
+% 文档类 & 影响命令 & \makecell{\opt{scheme = chinese} \\ 的默认值} & 实际定义
+% & \makecell{\opt{scheme = plain} \\ 的默认值} & 实际定义 \\
+% \midrule
+% article & \tn{section} & |{}| & & |{}| & \\
+% book, report & \tn{chapter} & |\appendixname| & |附录|
+% & |\appendixname| & |Appendix| \\
+% \bottomrule
+% \end{tabular}
+% \end{table}
+%
+% \begin{function}{appendix/number}
+% \begin{syntax}
+% number = \Arg{数字输出命令}
+% \OSET
+% \end{syntax}
+% 设置附录章(对 \cls{book} 与 \cls{report})或附录节(对 \cls{article})编
+% 号的数字输出格式。用法与普通章节的 \opt{number} 选项类似。
+%
+% 该选项也同时控制附录章节计数器的交叉引用。
+%
+% 与普通章节的 \opt{number} 选项类似,同样需要注意,该选项不会影响计数器本身
+% 的输出,即不影响 \tn{thesection} 或 \tn{thechapter} 的定义。
+% \end{function}
+%
+% \begin{table}[htbp]
+% \small\centering
+% \caption{\opt{appendix/number} 选项的默认设置}
+% \begin{tabular}{llllll}
+% \toprule
+% 文档类 & 影响命令 & 默认值 \\
+% \midrule
+% article & \tn{section} & |\Alph{section}| \\
+% book, report & \tn{chapter} & |\Alph{chapter}| \\
+% \bottomrule
+% \end{tabular}
+% \end{table}
+%
+% \section{实用命令}
+% \label{sec:useful-commands}
+% \subsection{字号与间距}
+%
+% \begin{function}{\zihao}
+% \begin{syntax}
+% \tn{zihao}\Arg{字号}
+% \end{syntax}
+% 用于调整字号大小。其中 \meta{字号} 的有效值共有 16 个,如表 \ref{tab:zihao}
+% 所示。使用 \tn{zihao} 命令调整字体大小时,西文字号大小会始终和中文字号保持一致。
+% \end{function}
+%
+% \begin{table}[htbp]
+% \centering
+% \catcode`*\active
+% \def*{\phantom{.}}
+% \def~{\phantom{0}}
+% \tabcolsep=1em
+% \caption{中文字号}\label{tab:zihao}
+% \begin{tabular}{>{\ttfamily}ccl}
+% \toprule
+% $\meta{字号}$ & 大小(bp) & 意义 \\
+% \midrule
+% ~0 & 42*~ & \zihao{0} 初号 \\
+% -0 & 36*~ & \zihao{-0} 小初号 \\
+% ~1 & 26*~ & \zihao{1} 一号 \\
+% -1 & 24*~ & \zihao{-1} 小一号 \\
+% ~2 & 22*~ & \zihao{2} 二号 \\
+% -2 & 18*~ & \zihao{-2} 小二号 \\
+% ~3 & 16*~ & \zihao{3} 三号 \\
+% -3 & 15*~ & \zihao{-3} 小三号 \\
+% ~4 & 14*~ & \zihao{4} 四号 \\
+% -4 & 12*~ & \zihao{-4} 小四号 \\
+% ~5 & 10.5 & \zihao{5} 五号 \\
+% -5 & ~9*~ & \zihao{-5} 小五号 \\
+% ~6 & ~7.5 & \zihao{6} 六号 \\
+% -6 & ~6.5 & \zihao{-6} 小六号 \\
+% ~7 & ~5.5 & \zihao{7} 七号 \\
+% ~8 & ~5*~ & \zihao{8} 八号 \\
+% \bottomrule
+% \end{tabular}
+% \end{table}
+%
+% \begin{function}{\ziju}
+% \begin{syntax}
+% \tn{ziju}\Arg{中文字符宽度的倍数}
+% \end{syntax}
+% 用于调整相邻汉字之间的间距,即(在正常中文行文中)前一个汉字的右边缘与后一个汉字
+% 的左边缘之间的距离。其中参数可以是任意浮点数值;而中文字符宽度指的是实际汉字的
+% 宽度,不包含当前字距。
+%
+% 这个命令会影响 \tn{ccwd} 的值,但不会影响英文字距。
+% \end{function}
+%
+% \begin{function}{\ccwd}
+% 当前汉字的字宽保存在长度寄存器 \tn{ccwd} 之中。汉字字宽是相邻两个汉字中心
+% 之间的距离,包含字距在内。因此修改字距会间接修改字宽。
+% \end{function}
+%
+% \begin{function}{\CTEXsetfont}
+% 更新当前的中文字体信息,包括当前字距(\tn{ccwd})和段首缩进(\tn{parindent})。
+% 一般来说,用户无需使用这个命令。
+% \end{function}
+%
+% \subsection{中文数字转换}
+%
+% \CTeX{} 套件的中文数字转换功能实际上是调用 \pkg{zhnumber} 宏包来完成。下面只
+% 介绍一些基本的用法,更高级的用法可以查阅 \pkg{zhnumber} 宏包的文档。
+%
+% \begin{function}{\chinese}
+% \begin{syntax}
+% \tn{chinese} \Arg{counter}
+% \end{syntax}
+% \tn{chinese} 命令与 \tn{roman} 等命令的用法类似,作用在一个 \LaTeX{}
+% 计数器上,将计数器的值以中文数字的形式输出。
+% \end{function}
+%
+% \begin{function}{\zhnumber}
+% \begin{syntax}
+% \tn{zhnumber} \Arg{number}
+% \end{syntax}
+% 以中文格式输出数字。这里的数字可以是整数、小数和分数。
+% \end{function}
+%
+% \begin{function}{\zhdigits}
+% \begin{syntax}
+% \tn{zhdigits} \Arg{number}
+% \end{syntax}
+% 将阿拉伯数字转换为中文数字串。
+% \end{function}
+%
+% \begin{function}{\CTEXnumber}
+% \begin{syntax}
+% \tn{CTEXnumber} "\"<macro> \Arg{number}
+% \end{syntax}
+% |\|<macro> 必须是一个 \TeX{} 宏,不需预先定义。\tn{CTEXnumber} 通过
+% \tn{zhnumber} 将 \meta{number} 转为中文数字,最后将结果存储在 |\|<macro>
+% 里。对 |\|<macro> 的定义是局部的,将它展开一次就可以得到转换结果。
+% \end{function}
+%
+% 一般来说,并不需要使用 \tn{CTEXnumber},直接使用 \tn{zhnumber} 即可。但是,如果
+% 在文档中需要多次使用同一个数字 \meta{number} 的中文形式,就可以先用
+% \tn{CTEXnumber} 将结果保存起来备用,而不是每次使用时都用 \tn{zhnumber} 现场
+% 转换一次。
+%
+% \begin{function}{\CTEXdigits}
+% \begin{syntax}
+% \tn{CTEXdigits} "\"<macro> \Arg{number}
+% \end{syntax}
+% \tn{CTEXdigits} 与 \tn{CTEXnumber} 类似,但其转换的结果是中文数字串,而不是
+% 中文数字。
+% \end{function}
+%
+% \subsection{杂项}
+%
+% \begin{function}{\CTeX}
+% 用于显示 \CTeX 标志。
+% \end{function}
+%
+% \section{\LuaLaTeX{} 下的中文支持方式}
+% \label{sec:lualatex-chinese}
+%
+% 在 \LuaLaTeX{} 下,\CTeX{} 套件依赖 \pkg{LuaTeX-ja} 宏包来完成中文支持。
+% 该宏包是日本 \TeX{} 社区的北川弘典、前田一贵、八登崇之等人开发的,设计目的主要
+% 是在 \LuaTeX{} 引擎下实现日本 p\TeX{} 引擎的(大部分)功能。它为了兼容 p\LaTeX
+% 的使用习惯,对 \LaTeXe 的 \pkg{NFSS} 作了不少修改和扩充。这对于简体中文用户来说
+% 不是必要的,因而 \CTeX{} 禁用了它在 \LaTeX{} 格式下的大部分设置,只保留了必要的
+% 部分。同时修改了它的字体设置方式,使得相关命令与 \pkg{xeCJK} 宏包大致相同。
+%
+% 20150420 版以后的 \pkg{LuaTeX-ja} 宏包开始支持竖排,但 \CTeX{} 暂不支持竖排。
+%
+% \subsection{\LuaLaTeX{} 下替代字体的设置}
+%
+% \begin{function}{AlternateFont}
+% \begin{syntax}
+% \tn{setCJKfamilyfont} \Arg{family}
+% \ [
+% \ AlternateFont =
+% \ \{
+% \ \Arg{character range_1} \oarg{alternate font features_1} \Arg{alternate font name_1} ||
+% \ \Arg{character range_2} \oarg{alternate font features_2} \Arg{alternate font name_2} ||
+% \ ......
+% \ \} ,
+% \ <base font features>
+% \ ] \Arg{base font name}
+% \end{syntax}
+% 在设置字体族 \meta{family} 的时候,同时设置该字体族在字符范围
+% \meta{character range_n} 内,对应字形的替代字体。
+% \end{function}
+%
+% \begin{function}{CharRange}
+% \begin{syntax}
+% \tn{setCJKfamilyfont} \Arg{family}
+% \ [
+% \ CharRange = \Arg{character range} ,
+% \ <alternate font features>
+% \ ] \Arg{alternate font name}
+% \end{syntax}
+% 只设置字体族 \meta{family} 在字符范围 \meta{character range} 内,对应字形的
+% 替代字体。
+% \end{function}
+%
+% 一个 \tn{setCJKfamilyfont} 里只能使用一次 \opt{CharRange} 或者
+% \opt{AlternateFont},但可以将它们分开重叠使用。例如下面的方式是有效的。
+%
+% \begin{ctexexam}
+% \setCJKmainfont[AlternateFont={...}{...}, ...]{...}
+% \setCJKmainfont[CharRange={"4E00->"67FF,-2}, ...]{...}
+% \setCJKmainfont[CharRange={"6800->"9FFF}, ...]{...}
+% \end{ctexexam}
+%
+% \begin{function}{declarecharrange}
+% \begin{syntax}
+% \tn{ctexset}
+% \ \{
+% \ declarecharrange =
+% \ \{
+% \ \Arg{name_1} \Arg{character range_1} ,
+% \ \Arg{name_2} \Arg{character range_2} ,
+% \ ...
+% \ \}
+% \ \}
+% \end{syntax}
+% 预先声明字符范围。声明字符范围 \meta{name} 之后,它的名字 \meta{name} 可以
+% 用在 \opt{AlternateFont} 和 \opt{CharRange} 选项的 \meta{character range}
+% 之中,表示对应的字符范围。
+% \end{function}
+%
+% 在声明字符范围 \meta{name} 的同时,还为 \tn{setCJKmainfont} 等字体设置命令定义
+% 了选项 \meta{name},用于设置对应字符的替代字体:
+% \begin{quote}\linespread{1}\small\ttfamily
+% \meta{name} = \oarg{alternate font features} \Arg{alternate font name}
+% \end{quote}
+% \meta{name} 选项可以与 \opt{AlternateFont} 共同使用,但不能与 \opt{CharRange}
+% 一起使用。如果没有给 \meta{name} 设置值,则等价于设置 \opt{CharRange=\meta{name}},
+% 即只设置 \meta{name} 对应的字符范围的替代字体。
+%
+% \begin{function}{clearalternatefont,resetalternatefont}
+% \begin{syntax}
+% \tn{ctexset}
+% \ \{
+% \ clearalternatefont = \Arg{family_1, family_2, ...} ,
+% \ resetalternatefont = \Arg{family_1, family_2, ...} ,
+% \ clearalternatefont ,
+% \ resetalternatefont
+% \ \}
+% \end{syntax}
+% 清除与重置 CJK 字体族 \meta{family} 的替换字体设置。如果没有给定值,则作用于
+% 当前 CJK 字体族。清除与重置操作总是全局的。
+% \end{function}
+%
+% \section{\CTeX{} 套件的配置文件}
+%
+% \CTeX{} 套件提供了不同的配置文件,可以通过修改配置文件来改变 \CTeX{} 套件的
+% 默认行为。
+%
+% 在多数情况下,并不需要修改配置文件,\CTeX{} 套件的默认设置已经能满足大多数用
+% 户的需要。不恰当地修改 \CTeX{} 套件的默认行为也可能导致同一文件在别处无法正
+% 常编译或排版效果完全不同,因此修改应该慎重。
+%
+% 但在一些情况下,直接修改配置文件仍是必要的,例如:
+% \begin{itemize}
+% \item 系统没有安装默认设置的字体文件,无法编译。
+% \item 需要经常编译来自其他系统的中文 \TeX{} 文件,但对方的操作系统或默认设置
+% 与本机不同。
+% \end{itemize}
+%
+% 与 \CTeX{} 套件的源代码一样,配置文件采用 \LaTeX3 的语法编写。
+%
+% \CTeX{} 套件的配置文件随宏包其他文件一起安装在 \TeX{} 系统 TDS 目录树中,文
+% 件后缀是 \file{.cfg}。为了避免本地配置文件内容因 \CTeX{} 套件的更新而丢失,
+% 不要直接修改系统 TDS 目录树中的配置文件,而应该将系统自带的配置文件复制到本
+% 地的或用户私有的 TDS 目录树中修改,并运行 |texhash| 命令刷新文件名数据库。
+%
+% 例如对于 \TeX{} Live,系统自带的配置文件就在 \TeX{} Live 安装目录下的
+% \path{texmf-dist/tex/latex/ctex/config/} 子目录下,可以修改它的副本,保存在
+% 本地 TDS 树的 \path{texmf-local/tex/latex/ctex/} 目录下,或者用户 TDS 树的
+% \path{~/.texlive2015/texmf-var/tex/latex/ctex/} 目录下,作为本地/用户专有的
+% 配置文件。复制配置文件后需要运行 |texhash| 命令使本地配置文件生效。
+%
+% \hologo{MiKTeX} 的配置文件也保存在类似的目录结构中,\hologo{MiKTeX} 管理的
+% 几个 TDS 根目录可以在 \hologo{MiKTeX} Options 设置项中查看到,这里不再赘述。
+%
+% 除了修改本地 \TeX{} 系统中的配置文件,对于特定文档,也可以将修改过的配置文件
+% 保存在文档的工作目录下。此时配置文件就只对工作目录下的所有文档生效。
+%
+% \subsection{修改宏包默认选项}
+%
+% 配置文件 \file{ctexopts.cfg} 可以用来修改宏包的默认选项。随系统安装的配置文
+% 件除了文件信息声明外没有实际的内容,但在注释中给出了一个简单的示例,只要取消
+% 注释就可以生效。
+%
+% \begin{ctexexam}
+% % 系统自带 ctexopts.cfg 注释中的示例语句,固定默认字体集为 windowsnew。
+% % 该设置可以用在安装了 Windows 字体的非 Windows 系统中。
+% \keys_set:nn { ctex / option } { fontset = windowsnew }
+% \end{ctexexam}
+% 如上例所示,宏包选项通常使用 \LaTeX3 的 \cs{keys_set:nn} 命令完成键值设置,
+% 第一个参数是固定的子模块 |ctex/option|,第二个参数中是用户定义的新的默认宏包
+% 选项。
+%
+% \file{ctexopts.cfg} 中的设置将在 \CTeX{} 套件的开始处,定义过宏包选项之后,
+% \tn{ProcessKeysOptions} 命令之前生效。最好只使用此配置文件修改宏包默认选项。
+%
+% \subsection{宏包载入后的配置}
+%
+% 配置文件 \file{ctex.cfg} 将在宏包的末尾被载入生效。可以用它完成任意的设置,
+% 或是覆盖已有的定义。随系统安装的配置文件除版本信息外没有实际内容,注意配置文
+% 件中也使用 \LaTeX3 语法。
+%
+% \begin{ctexexam}
+% % 简单的 ctex.cfg 内容示例。
+% % 修改默认的页面格式设置。
+% \pagestyle{plain}
+% \end{ctexexam}
+%
+% \begin{ctexexam}
+% % 略复杂的 ctex.cfg 内容示例:禁止段末孤字成行。
+% % 在使用 XeTeX 编译时,打开 xeCJK 的 CheckSingle 选项。
+% \xetex_if_engine:T
+% {
+% \xeCJKsetup { CheckSingle }
+% }
+% % 在使用 LuaTeX 编译时,设置 LuaTeX-ja 的 jcharwidowpenalty 参数。
+% \luatex_if_engine:T
+% {
+% \ltjsetparameter { jcharwidowpenalty = 10000 }
+% }
+% \end{ctexexam}
+%
+% \subsection{配置标题中文翻译}
+%
+% 由于 \CTeX{} 套件需要同时支持 GBK 和 UTF-8 两种编码,因此对标题的中文翻译写
+% 在两个配置文件当中:\file{ctex-name-gbk.cfg} 和 \file{ctex-name-utf8.cfg}。
+% 两个文件的设置相同,只是编码不同。
+%
+% 为了同一文档在不同电脑上编译效果的一致性,通常不建议修改默认的中文翻译。
+%
+% \subsection{自定义字体集}
+%
+% \ref{subs:options-CJK-font}~节介绍的用于 |fontset| 选项的自定义字库文件,
+% 类似于 \CTeX{} 套件的配置文件,也应该与其他本地配置文件一起保存在本地
+% \texttt{TDS} 目录树下,并可以配合 \file{ctexopts.cfg} 等配置文件使用。
+%
+% \section{对旧版本的兼容性}
+%
+% \subsection{\CTeX\ 0.8a 及以前的版本}
+%
+% 在 ctex-kit 项目成立之前,\CTeX 宏包的最后一个版本是 \CTeX\
+% 0.8a(2007/05/06)。
+%
+% 第 2 版未考虑对这些很早版本的兼容性。
+%
+% \subsection{\CTeX\ 0.9--\CTeX\ 1.0d}
+%
+% 在 2009 年在 ctex-kit 项目成立后,新增了 \XeTeX{} 引擎的支持,并增加了不少控
+% 制字体的命令和选项。
+%
+% 这里主要介绍新版本 \CTeX 宏包相对 1.02d 版本(2014/06/09)的兼容性。
+%
+% 第 2 版的 \CTeX 宏包已尽力保证对 1.0x 版本的兼容性,原有为 1.0x 编写的代码,
+% 在第 2 版的 \CTeX 宏包下保证仍能编译,并且在大多数情况下保持编译效果不变。
+%
+% \CTeX 宏包在 0.8a 以前的版本支持以 \pkg{CCT} 作为底层中文支持方式,从 0.9 版
+% 之后即不再推荐使用,只保留向后兼容。在 \CTeX 宏包第 2 版中则完全不再支持
+% \pkg{CCT}。
+%
+% 下面这些是在旧版本 \CTeX 宏包中存在,而在新版本中已不建议使用的选项和命令,
+% 在未来版本中可能会删去它们的支持。
+%
+% 在多数情况下它们的功能仍将保留,但也有部分选项命令功能已失效。
+%
+% \begin{function}{cs4size, c5size}
+% 分别相当于 |zihao=-4| 和 |zihao=5|,过时选项。
+% \end{function}
+%
+% \begin{function}{CCT, CCTfont}
+% 相关选项已删除。
+% \end{function}
+%
+% \begin{function}{indent, noindent}
+% 使用 \opt{indent} 宏包选项会载入 \pkg{indentfirst} 宏包。过时选项。
+%
+% \opt{noindent} 什么也不做,也不会使章节首行停止缩进。需要使用 \tn{ctexset}
+% 命令设置章节的 \opt{beforeskip} 选项为正数才能完成原来 \opt{noindent} 选项的
+% 工作。另外,设置 \opt{scheme = plain} 可以保持原有英文文档类的效果,使章节首行停止缩
+% 进。过时选项。
+% \end{function}
+%
+% \begin{function}{zhmap, nozhmap}
+% \opt{zhmap} 宏包选项增加了参数,扩充了功能,除了支持真假值参数外,还支持选择
+% \pkg{zhmCJK} 作为底层中文处理宏包。(\ref{subs:options-CJK-font}~节)
+%
+% \opt{nozhmap} 选项相当于 |zhmap=false|。过时选项。
+% \end{function}
+%
+% \begin{function}{winfonts, adobefonts, nofonts}
+% 宏包选项 \opt{winfonts} 相当于 |fontset=windows|,\opt{adobefonts} 相当于
+% |fontset=adobe|,\opt{nofonts} 相当于 |fontset=none|。这几个选项是过时选项,
+% 对于新文档,应使用 \opt{fontset} 选项设置不同字体集。
+%
+% 另外,第 2 版 \CTeX 宏包的默认字体不再是 Windows 系统字体,而是根据检测到的
+% 操作系统选择使用 Windows、Mac 的系统字体还是 Fandol 字体
+% (\ref{subs:options-CJK-font}~节)。
+% \end{function}
+%
+% \begin{function}{punct, nopunct}
+% 旧版本中宏包 \opt{punct} 选项没有参数,现在可以用参数设定标点风格
+% (\ref{subs:options-type-style}~节)。原有无参形式的 \opt{punct} 选项相当
+% 于 |punct=quanjiao|。
+%
+% 旧版宏包中 \opt{nopunct} 选项的效果大致相当于 |punct=plain|。过时选项,不推荐使用。
+% \end{function}
+%
+% \begin{function}{cap, nocap}
+% 原有的 \opt{cap} 和 \opt{nocap} 选项由新的 \opt{scheme} 选项代替。
+% (\ref{subs:options-type-style}~节)
+%
+% \opt{cap} 选项相当于 |scheme = chinese|,\opt{nocap} 选项相当
+% 于 |scheme = plain|。它们均已过时,仅因兼容性而保留。
+% \end{function}
+%
+% \begin{function}{space, nospace}
+% 新版本宏包 \opt{space} 选项增加真假值参数。
+% (\ref{subs:options-type-style}~节)
+%
+% \opt{nospace} 选项相当于 |space=false|,成为过时选项。
+% \end{function}
+%
+% \begin{function}{fancyhdr}
+% 新版本宏包中总是自动处理对 \pkg{fancyhdr} 宏包的兼容性,而由用户自己使用
+% \tn{usepackage} 载入 \pkg{fancyhdr} 宏包。
+%
+% \opt{fancyhdr} 选项过时,因兼容性保留,功能是载入 \pkg{fancyhdr} 宏包。
+% \end{function}
+%
+% \begin{function}{hyperref}
+% 新版本宏包中总是自动处理对 \pkg{hyperref} 宏包的兼容性,而由用户自己使用
+% \tn{usepackage} 载入 \pkg{hyperref} 宏包。
+%
+% \opt{hyperref} 选项过时,因兼容性保留,功能是在导言区末尾载入 \pkg{hyperref}
+% 宏包。
+% \end{function}
+%
+% \begin{function}{fntef}
+% 旧版本的 \opt{fntef} 选项用于统一 \pkg{CCTfntef} 与 \pkg{CJKfntef} 的界面,
+% 新版本 \CTeX{} 套件不再支持 \pkg{CCT},而是直接载入 \pkg{CJKfntef} 或
+% \pkg{xeCJKfntef} 宏包并禁用其彩色设置。该选项是过时选项。
+% \end{function}
+%
+% \begin{function}{\CTEXunderdot, \CTEXunderline, \CTEXunderdblline,
+% \CTEXunderwave, \CTEXsout, \CTEXxout, \CTEXfilltwosides}
+% 在调用 \opt{fntef} 宏包选项的同时,旧版本 \CTeX{} 宏包由于需要支持 \pkg{CCT}
+% 系统,会将以 |\CJK| 开头的 \tn{CJKunderline} 等宏换名为以 |\CTEX| 开头的
+% \tn{CTEXunderline} 等宏。此功能在新版本的 \CTeX{} 套件中已失去意义。
+%
+% 此外,在 \pdfTeX{} 引擎下,用于设置格式的 \tn{CJKunderdotbasesep} 等宏也被换
+% 名为 \tn{CTEXunderdotbasesep} 等宏。
+%
+% 在新版本中,上述由 \opt{fntef} 衍生的相关宏都成为过时命令。
+% \end{function}
+%
+% \begin{function}{\CTEXindent}
+% 更新 \tn{ccwd} 宽度后设置 |\parindent=2\ccwd|。过时命令。
+% \end{function}
+%
+% \begin{function}{\CTEXnoindent}
+% 设置 |\parindent=0pt|。过时命令。
+% \end{function}
+%
+% \begin{function}{\CTEXsetup}
+% \begin{syntax}
+% \tn{CTEXsetup}\oarg{选项}\Arg{标题}
+% \end{syntax}
+% 相当于设置了
+% \texttt{\tn{ctexset}\{ \meta{标题} = \Arg{选项} \}}。
+% 过时命令。
+% \end{function}
+%
+% \begin{function}{\CTEXoptions}
+% \begin{syntax}
+% \tn{CTEXoptions}\oarg{选项}
+% \end{syntax}
+% 相当于设置了
+% \texttt{\tn{ctexset}\Arg{选项}}。
+% 过时命令。
+% \end{function}
+%
+% \begin{function}{\Chinese}
+% \begin{syntax}
+% \tn{Chinese}\oarg{counter}
+% \end{syntax}
+% 新版套件中 \tn{chinese} 统一了旧版本中 \tn{chinese} 和 \tn{Chinese} 的功能。因此,
+% 该命令已过时。
+% \end{function}
+%
+% \begin{function}{captiondelimiter}
+% 原为 \tn{CTEXoptions} 命令的选项,用于控制 \tn{caption} 编号后面的标点。此选
+% 项已过时,并在新版本的 \CTeX 宏包中失效。
+%
+% 可以使用 \pkg{caption} 宏包的 \opt{labelsep} 选项来完成同样的功能。
+% \begin{ctexexam}
+% % 代替 \CTEXoptions[captiondelimiter={:}]
+% \usepackage{caption}
+% \captionsetup{labelsep=colon}
+% \end{ctexexam}
+% \end{function}
+%
+%
+% \subsection{\CTeX\ 1.02c 以后的 SVN 开发版}
+%
+% \CTeX 宏包在 1.02c 版本(2011/03/11)之后在 Google code 上的 SVN 开发版本,
+% 内部版本号一直升到 1.11 版,但从未正式发布。SVN 开发版在 1.02c 版本的基础上
+% 新增的功能在第 2 版中大多继承了过来,但新增的命令与选项都不再保持兼容。
+%
+% \CTeX 宏包第 2 版不保证对未发布的 SVN 开发版兼容。
+%
+% \section{开发人员}
+%
+% \begin{itemize}
+% \item 吴凌云 (\email{aloft@ctex.org})
+% \item 江疆 (\email{gzjjgod@gmail.com})
+% \item 王越 (\email{yuleopen@gmail.com})
+% \item 刘海洋 (\email{LeoLiu.PKU@gmail.com})
+% \item 李延瑞 (\email{LiYanrui.m2@gmail.com})
+% \item 陈之初 (\email{zhichu.chen@gmail.com})
+% \item 李清 (\email{sobenlee@gmail.com})
+% \item 黄晨成 (\email{liamhuang0205@gmail.com})
+% \end{itemize}
+%
+% \begin{thebibliography}{9}
+% \bibitem{knuthtex1986}
+% \textsc{Donald~Ervin Knuth}.
+% \newblock \textit{The {{\TeX{}book}}}, \textit{Computers \& Typesetting},
+% volume~A.
+% \newblock Addison-Wesley, 1986
+%
+% \bibitem{mittelbach2004}
+% \textsc{Frank Mittelbach} and \textsc{Michel Goossens}.
+% \newblock \textit{The {{\LaTeX}} Companion}.
+% \newblock Tools and Techniques for Computer Typesetting. Boston:
+% Addison-Wesley, second edition, 2004
+%
+% \end{thebibliography}
+%
+% \end{documentation}
+%
+%
+% \StopEventually{}
+%
+%
+%\begin{implementation}
+% \clearpage
+% \section{代码实现}
+%
+% \begin{macrocode}
+%<@@=ctex>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*ctexcap>
+\PassOptionsToPackage { heading = true } { ctexcap }
+\RequirePackageWithOptions { ctex }
+%</ctexcap>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*class|style|ctexsize>
+\RequirePackage { xparse , l3keys2e }
+%</class|style|ctexsize>
+% \end{macrocode}
+%
+% 检查 \pkg{expl3} 和 \pkg{l3keys2e} 的版本。
+% \begin{macrocode}
+%<*class>
+\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 } }
+%</class>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*class|style>
+\RequirePackage { etoolbox , ifpdf , fix-cm , everysel }
+% \end{macrocode}
+%
+% \subsection{内部函数与变量}
+%
+% \begin{variable}[internal]
+% {\l_@@_tmp_tl,\l_@@_tmp_int,\l_@@_tmp_dim,\l_@@_tmp_box}
+% \begin{macrocode}
+\tl_new:N \l_@@_tmp_tl
+\int_new:N \l_@@_tmp_int
+\dim_new:N \l_@@_tmp_dim
+\box_new:N \l_@@_tmp_box
+% \end{macrocode}
+% \end{variable}
+%
+% 对旧版本的宏包给出错误信息。
+% \begin{macrocode}
+\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.
+ }
+% \end{macrocode}
+%
+% \begin{macro}[internal]{\ctex_lua_now_x:n}
+% 最新的 \pkg{expl3} 去掉了 \pkg{l3luatex} 模块,因而 \cs{lua_now_x:n} 不再有定义。
+% \begin{macrocode}
+\cs_new_eq:NN \ctex_lua_now_x:n \luatex_directlua:D
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_if_pdfmode:TF}
+% \tn{ifpdf} 的简单 wrapper。
+% \begin{macrocode}
+\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:
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_if_preamble:TF}
+% 测试是否在 \LaTeXe{} 的导言区。\LaTeXe{} 中的 \tn{@onlypreamble} 命令可以处
+% 理宏参数,使其在 \env{document} 环境后被重定义为 \tn{@notprerr},而又由于
+% \tn{@onlypreamble} 本身也被这样处理过,因此可以测试 \tn{@onlypreamble} 是否
+% 与 \tn{@notprerr} 相同来确定是否在导言区。
+% \begin{macrocode}
+\prg_new_conditional:Npnn \ctex_if_preamble: { TF }
+ {
+ \if_meaning:w \@onlypreamble \@notprerr
+ \prg_return_false:
+ \else:
+ \prg_return_true:
+ \fi:
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[int]{\ctex_at_end_package:nn}
+% 与 \pkg{filehook} 的 \tn{AtEndOfPackageFile*} 类似,如果原来没有在载入宏包则
+% 在宏包末尾执行语句,否则立即执行。
+% \begin{macrocode}
+\cs_new_protected:Npn \ctex_at_end_package:nn #1#2
+ {
+ \@ifpackageloaded { #1 }
+ { #2 }
+ { \ctex_add_hook:cn { g_@@_at_end_ #1 _hook_tl } { #2 } }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[int]{\ctex_add_hook:Nn, \ctex_add_hook:cn}
+% 给钩子附加内容。
+% \begin{macrocode}
+\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 }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[int]{\ctex_package_end_hook:n, \ctex_package_end_hook:o}
+% 宏包末尾钩子,只执行一次,用后清除。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ctex_package_end_hook:n #1
+ {
+ \cs_if_exist_use:cT { g_@@_at_end_ #1 _hook_tl }
+ { \cs_undefine:c { g_@@_at_end_ #1 _hook_tl } }
+ }
+\cs_generate_variant:Nn \ctex_package_end_hook:n { o }
+% \end{macrocode}
+% \end{macro}
+%
+% 对 \tn{@popfilename} 做补丁来实现 \cs{ctex_at_end_package:nn} 的功能。
+% \begin{macrocode}
+\tl_put_left:Nn \@popfilename
+ { \ctex_package_end_hook:o { \@currname } }
+% \end{macrocode}
+%
+% \begin{macro}[internal]{\ctex_file_wrapper:nnn}
+% 设置文件操作的 \tn{catcode} 环境,参数 |#1| 是设置,|#2| 是文件操作,|#3| 是恢复。
+% 默认关闭 \LTXIII{} 语法环境,并设置 |@| 的 \tn{catcode} 为 $11$。
+% \begin{macrocode}
+\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
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_file_input:n}
+% 输入文件。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ctex_file_input:n #1
+ { \ctex_file_wrapper:nnn { } { \file_input:n {#1} } { } }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_scheme_input:n}
+% 输入 \opt{scheme} 文件。先查找当前文档类下的 \meta{scheme},找不到再查找一般的文件。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ctex_scheme_input:n #1
+ {
+ \ctex_file_wrapper:nnn
+ { }
+ {
+ \tl_if_exist:NTF \c_@@_class_tl
+ {
+ \file_if_exist_input:nF { ctex-scheme- #1 - \c_@@_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 }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_parse_name:NN}
+% 用 \tn{DeclareRobustCommand} 定义的宏或者由 \tn{newcommand} 或 \tn{newrobustcmd}
+% 定义的带一个可选参数的宏第一次展开的结果都不是其实际定义,实际定义被保存在另外的
+% 宏中。由这些命令定义的宏的第一次展开结果可以有下面的形式(细节可查阅 \pkg{xpatch}
+% 的文档):
+% \begin{verbatim}[numbers=left,gobble=4]
+% \protect␣\xaa␣␣ % \DeclareRobustCommand\xaa[1]{...}
+% \protect␣\xab␣␣ % \DeclareRobustCommand\xab[1][]{...}
+% \@protected@testopt␣\xac␣\\xac␣{} % \newcommand\xac[1][]{...}
+% \@testopt␣\\xad␣{} % \newrobustcmd\xad[1][]{...}
+% \x@protect␣\1\protect␣\1␣␣ % \DeclareRobustCommand\1[1]{...}
+% \x@protect␣\2\protect␣\2␣␣ % \DeclareRobustCommand\2[1][]{...}
+% \@protected@testopt␣\3\\3␣{} % \newcommand\3[1][]{...}
+% \@testopt␣\\4␣{} % \newrobustcmd\4[1][]{...}
+% \end{verbatim}
+% \pkg{etoolbox} 的 \tn{patchcmd} 的主要原理是先对宏的 \tn{meaning} 作字符串
+% 替换,然后再用 \tn{scantokens} 来重建它。我们希望对宏的实际定义打补丁,为此需要
+% 先得到对应的名字。\pkg{letltxmacro}、\pkg{show2e} 和 \pkg{xpatch} 宏包中都有
+% 类似的工作。我们不想依赖 \pkg{xpatch},主要是因为它与同作者的 \pkg{regexpatch}
+% 宏包共用了主要函数的名字,从而将导致用户不能使用 \pkg{regexpatch}。
+% \begin{macrocode}
+\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
+ {
+ \@@_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 \@@_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 \@@_parse_name:w
+ \token_get_replacement_spec:N #3 AESAOPA ~ < \q_stop
+ }
+ { /#5 ~ } { #5 ~ }
+ }
+ {
+ \str_case:onTF { \@@_parse_name:w #1 AESAOPA ~ < \q_stop }
+ {
+ { /@protected@ #2 #4 } { }
+ { /@ #4 } { }
+ }
+ { /#5 } {#5}
+ }
+ }
+ }
+ \cs_new:Npn \@@_parse_name:w #1 AESAOPA ~ #2 < #3 \q_stop { #1#2 }
+ }
+\cs_generate_variant:Nn \ctex_parse_name:NNn { NNx }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]
+% {\ctex_patch_cmd:NnnTF,\ctex_preto_cmd:NnTF,\ctex_appto_cmd:NnTF}
+% 在打补丁前先解析实际名字。
+% \begin{macrocode}
+\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 }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_patch_cmd:Nnn}
+% 参数记号 |#| 作为宏的参数被读入时,总是会双写,会影响随后的字符串替换。需要先
+% 将它转换为普通符号。并且在补丁的时候关闭 \LTXIII{} 语法。
+% \begin{macrocode}
+\cs_new_protected:Npn \ctex_patch_cmd:Nnn
+ {
+ \group_begin:
+ \char_set_catcode_other:N \#
+ \@@_patch_cmd:Nnn
+ }
+\cs_new_protected:Npn \@@_patch_cmd:Nnn #1#2#3
+ {
+ \group_end:
+ \group_begin:
+ \ExplSyntaxOff
+ \ctex_patch_cmd:NnnTF #1 {#2} {#3}
+ {
+ \cs_gset_eq:NN \@@_tmp:w #1
+ \group_end:
+ \cs_set_eq:NN #1 \@@_tmp:w
+ \cs_undefine:N \@@_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.
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_set_default_ccwd:Nn}
+% 若参数 |#2| 带长度单位,则设置它为 |tl| 变量 |#1| 的值,否则以 \tn{ccwd} 为单位。
+% \begin{macrocode}
+\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 } }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_default_pt:n}
+% 最新版本的 \pkg{expl3} 已经不允许 \cs{dim_to_decimal:n} 的参数带额外的单位。
+% 然而我们需要这个特性实现可展的 \tn{@defaultunits}。
+% \begin{macrocode}
+\cs_new:Npn \ctex_default_pt:n #1
+ {
+ \exp_after:wN \@@_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 \@@_default_pt:w #1 PT #2 \q_stop { #1 PT }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{variable}[internal]{\l_@@_encoding_tl}
+% (pdf)\LaTeX{} 初始化编码为 GBK,其它则是 UTF8。
+% \begin{macrocode}
+\tl_new:N \l_@@_encoding_tl
+\tl_set:Nx \l_@@_encoding_tl
+ { \pdftex_if_engine:TF { GBK } { UTF8 } }
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}[internal]{\g_@@_section_depth_flag}
+% 若大于 |3|,则 \tn{paragraph} 和 \tn{subparagraph} 标题单独占一行;若为 |3|,则
+% \tn{paragraph} 单独占一行。
+% \begin{macrocode}
+\cs_new_eq:NN \g_@@_section_depth_flag \c_two
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}[internal]{\g_@@_zhmCJK_bool}
+% 是否使用 \pkg{zhmCJK} 宏包。
+% \begin{macrocode}
+\bool_new:N \g_@@_zhmCJK_bool
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}[internal]{\l_@@_autoindent_tl}
+% 保存 \opt{autoindent} 选项的值,空值表示不自动调整首行缩进。
+% \begin{macrocode}
+\tl_new:N \l_@@_autoindent_tl
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[internal]{\ctex_if_autoindent_touched:F}
+% 检查 \opt{autoindent} 选项是否被用户设置。
+% \begin{macrocode}
+\cs_new_eq:NN \ctex_if_autoindent_touched:F \use:n
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_zhmap_case:nnn}
+% 参数 |#1| 是 \pkg{zhmCJK} 的内容,|#2| 是 \pkg{zhmetrics}。
+% \begin{macrocode}
+\cs_new_eq:NN \ctex_zhmap_case:nnn \use_ii:nnn
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_at_end:n}
+% 区分 \tn{AtEndOfClass} 和 \tn{AtEndOfPackage},虽然它们的意思都是一样的。
+% \begin{macrocode}
+%<class>\cs_new_protected_nopar:Npn \ctex_at_end:n { \AtEndOfClass }
+%<style>\cs_new_protected_nopar:Npn \ctex_at_end:n { \AtEndOfPackage }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{variable}[internal]{\g_@@_std_options_clist}
+% 保存传递给标准文档类的选项。
+% \begin{macrocode}
+%<*class>
+\clist_new:N \g_@@_std_options_clist
+%</class>
+% \end{macrocode}
+% \end{variable}
+%
+% 对无效选项给出警告。
+% \begin{macrocode}
+\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'. }
+% \end{macrocode}
+%
+% 对过时选项或命令给出警告。
+% \begin{macrocode}
+\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 }
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</class|style>
+%<*class|style|ctexsize>
+% \end{macrocode}
+%
+% \begin{variable}[internal]{\g_@@_font_size_flag}
+% |0| 表示修改默认字体大小为五号,|1| 为小四号,其它值则不作修改。
+% \begin{macrocode}
+\cs_new_eq:NN \g_@@_font_size_flag \c_minus_one
+% \end{macrocode}
+% \end{variable}
+%
+% \subsection{宏包选项}
+%
+% \begin{macrocode}
+\keys_define:nn { ctex / option }
+ {
+% \end{macrocode}
+%
+% \changes{v2.0}{2015/05/06}{新增 \opt{zihao} 选项。}
+% \changes{v2.0}{2015/05/06}{\opt{c5size}, \opt{cs4size} 是过时选项。}
+%
+% \begin{macro}{zihao}
+% \begin{macrocode}
+ zihao .choice: ,
+ zihao .default:n = { 5 } ,
+ zihao / 5 .code:n = { \cs_gset_eq:NN \g_@@_font_size_flag \c_zero } ,
+ zihao / -4 .code:n = { \cs_gset_eq:NN \g_@@_font_size_flag \c_one } ,
+ zihao / false .code:n = { \cs_gset_eq:NN \g_@@_font_size_flag \c_two } ,
+%<ctexsize> }
+%</class|style|ctexsize>
+%<*class|style>
+ 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: ,
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v2.0}{2014/04/23}{新增 \opt{linespread} 选项。}
+%
+% \begin{macro}{linespread}
+% 行距初始值为标志 \texttt{nan},用于检查用户是否设置了 \opt{linespread} 选项。
+% \begin{macrocode}
+ linespread .fp_set:N = \l_@@_line_spread_fp ,
+ linespread .initial:n = { \c_nan_fp } ,
+ linespread .value_required: ,
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v2.0}{2014/03/13}{新增 \opt{autoindent} 选项。}
+%
+% \begin{macro}{autoindent}
+% 自动调整段落的首行缩进功能。
+% \begin{macrocode}
+ autoindent .choice: ,
+ autoindent .default:n = { true } ,
+ autoindent / true .code:n =
+ {
+ \tl_set:Nn \l_@@_autoindent_tl { 2 \ccwd }
+ \cs_set_eq:NN \ctex_if_autoindent_touched:F \use_none:n
+ } ,
+ autoindent / false .code:n =
+ {
+ \tl_clear:N \l_@@_autoindent_tl
+ \cs_set_eq:NN \ctex_if_autoindent_touched:F \use_none:n
+ } ,
+ autoindent / unknown .code:n =
+ {
+ \ctex_set_default_ccwd:Nn \l_@@_autoindent_tl {#1}
+ \cs_set_eq:NN \ctex_if_autoindent_touched:F \use_none:n
+ } ,
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v2.0}{2015/03/21}{\opt{indent}, \opt{noindent} 是过时选项。}
+% \begin{macro}{indent}
+% 仅为兼容性保留,已过时。
+% \begin{macrocode}
+ 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: ,
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{GBK,UTF8}
+% \begin{macrocode}
+ GBK .code:n = { \tl_set:Nn \l_@@_encoding_tl { GBK } } ,
+ UTF8 .code:n = { \tl_set:Nn \l_@@_encoding_tl { UTF8 } } ,
+ GBK .value_forbidden: ,
+ UTF8 .value_forbidden: ,
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v2.0}{2014/03/08}{新增 \opt{fontset} 选项。}
+% \changes{v2.0}{2015/03/21}{\opt{nofonts}, \opt{adobefonts}, \opt{winfonts}
+% 是过时选项。}
+%
+% \begin{macro}{fontset}
+% 初始值为空。若用户未指定,则根据操作系统载入对应字体配置,可以区分 Windows、
+% Mac~OS~X 和其它。
+% \begin{macrocode}
+ fontset .tl_gset:N = \g_@@_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: ,
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v2.0}{2014/03/08}{新增 \opt{zhmCJK} 支持选项。}
+% \changes{v2.0}{2015/03/22}{\opt{nozhmap} 是过时选项。}
+%
+% \begin{macro}{zhmap}
+% \begin{macrocode}
+ zhmap .choice: ,
+ zhmap .default:n = { true } ,
+ zhmap / zhmCJK .code:n =
+ {
+ \bool_gset_true:N \g_@@_zhmCJK_bool
+ \cs_gset_eq:NN \ctex_zhmap_case:nnn \use_i:nnn
+ } ,
+ zhmap / true .code:n =
+ {
+ \bool_gset_false:N \g_@@_zhmCJK_bool
+ \cs_gset_eq:NN \ctex_zhmap_case:nnn \use_ii:nnn
+ } ,
+ zhmap / false .code:n =
+ {
+ \bool_gset_false:N \g_@@_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: ,
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v2.0}{2014/04/11}{\opt{punct} 选项可以设置标点格式。}
+% \changes{v2.0}{2015/03/21}{\opt{nopunct} 是过时选项。}
+%
+% \begin{macro}{punct}
+% 设置标点符号输出格式。
+% \begin{macrocode}
+ punct .tl_set:N = \l_@@_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: ,
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v2.0}{2015/03/22}{\opt{nospace} 是过时选项。}
+% \begin{macro}{space}
+% \begin{macrocode}
+ 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: ,
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v2.0}{2014/03/08}{\pkg{ctex} 宏包新增 \opt{heading} 选项。}
+%
+% \begin{macro}{heading}
+% \begin{macrocode}
+ heading .bool_set:N = \l_@@_heading_bool ,
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v2.0}{2015/04/15}{新增 \opt{scheme} 选项,并将 \opt{cap} 和 \opt{nocap}
+% 列为过时选项}
+% \begin{macro}{scheme}
+% \begin{macrocode}
+ scheme .tl_set:N = \l_@@_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: ,
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{sub3section,sub4section}
+% \begin{macrocode}
+ sub3section .code:n =
+ { \cs_gset_eq:NN \g_@@_section_depth_flag \c_three } ,
+ sub4section .code:n =
+ { \cs_gset_eq:NN \g_@@_section_depth_flag \c_four } ,
+ sub3section .value_forbidden: ,
+ sub4section .value_forbidden: ,
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v2.0}{2015/04/20}{\opt{hyperref} 成为过时选项,原选项功能总是打开。}
+% \changes{v2.0}{2015/04/20}{\opt{fancyhdr} 成为过时选项,原选项功能总是打开。}
+% \changes{v2.0}{2015/04/20}{\opt{fntef} 成为过时选项,原选项功能总是打开。}
+% \begin{macro}{fntef,fancyhdr,hyperref}
+% \begin{macrocode}
+ 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 } }
+ } ,
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</class|style>
+%<*class|style|ctexsize>
+% \end{macrocode}
+%
+% \changes{v2.0}{2015/05/06}{兼容 \pkg{extsizes} 宏包、\cls{beamer}、\pkg{memoir}
+% 等提供的更多字号选项。}
+% \begin{macro}{10pt,11pt,12pt}
+% 使 \pkg{ctex} 和 \pkg{ctexsize} 可以接受文档类的全局选项,不修改默认字体大小。
+% 在文档类下还将参数传给标准文档类。
+% \begin{macrocode}
+\tl_clear:N \l_@@_tmp_tl
+\clist_map_inline:nn
+ {
+ 10pt , 11pt , 12pt ,
+ 8pt , 9pt , 14pt , 17pt , 20pt , 25pt , 30pt , 36pt , 48pt , 60pt
+ }
+ {
+ \tl_put_right:Nn \l_@@_tmp_tl
+ {
+ #1 .code:n =
+%<*!class>
+ { \cs_gset_eq:NN \g_@@_font_size_flag \c_minus_one } ,
+%</!class>
+%<*class>
+ {
+ \cs_gset_eq:NN \g_@@_font_size_flag \c_minus_one
+ \clist_gput_right:Nn \g_@@_std_options_clist {#1}
+ } ,
+%</class>
+ #1 .value_forbidden: ,
+ }
+ }
+\use:x { \keys_define:nn { ctex / option } { \exp_not:o { \l_@@_tmp_tl } } }
+\tl_clear:N \l_@@_tmp_tl
+% \end{macrocode}
+% \end{macro}
+%
+% 将未知选项传给标准文档类。
+% \begin{macrocode}
+%<*class>
+\keys_define:nn { ctex / option }
+ {
+ unknown .code:n =
+ { \clist_gput_right:No \g_@@_std_options_clist { \CurrentOption } }
+ }
+%</class>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<!ctexsize>\ctex_file_input:n { ctexopts.cfg }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\ProcessKeysOptions { ctex / option }
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</class|style|ctexsize>
+%<*class|style>
+% \end{macrocode}
+%
+% 五号字使用标准文档类的 |10pt| 字体大小设置,小四号字则使用 |12pt|。
+% \begin{macrocode}
+%<*class>
+\if_case:w \g_@@_font_size_flag
+ \clist_gput_right:Nn \g_@@_std_options_clist { 10pt }
+\or:
+ \clist_gput_right:Nn \g_@@_std_options_clist { 12pt }
+\fi:
+% \end{macrocode}
+%
+% 使用 \tn{PassOptionsToClass} 是为了预防可能存在的选项冲突。
+% \begin{macrocode}
+%<*article>
+\tl_const:Nn \c_@@_class_tl { article }
+\PassOptionsToClass { \g_@@_std_options_clist } { article }
+\LoadClass { article }
+%</article>
+%<*book>
+\tl_const:Nn \c_@@_class_tl { book }
+\PassOptionsToClass { \g_@@_std_options_clist } { book }
+\LoadClass { book }
+%</book>
+%<*report>
+\tl_const:Nn \c_@@_class_tl { report }
+\PassOptionsToClass { \g_@@_std_options_clist } { report }
+\LoadClass { report }
+%</report>
+%</class>
+% \end{macrocode}
+%
+% \begin{macrocode}
+\tl_set_eq:Nc \l_@@_tmp_tl { ver@ \@currname . \@currext }
+%<*class>
+\cs_new_eq:cN { ver@ctex. \@pkgextension } \l_@@_tmp_tl
+\cs_new_eq:cN { ver@ctexcap. \@pkgextension } \l_@@_tmp_tl
+\cs_new_eq:cN { ver@ctexsize. \@pkgextension } \l_@@_tmp_tl
+%</class>
+%<*style>
+\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_@@_tmp_tl }
+%</style>
+% \end{macrocode}
+%
+% \subsection{用户设置接口}
+%
+% \changes{v2.0}{2014/03/18}{新增统一设置接口 \tn{ctexset}。}
+%
+% \begin{macro}{\ctexset}
+% \begin{macrocode}
+\NewDocumentCommand \ctexset { +m }
+ { \keys_set:nn { ctex } {#1} }
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v2.0}{2015/03/21}{\tn{CTEXsetup}, \tn{CTEXoptions} 是过时命令。}
+% \begin{macro}{\CTEXsetup,\CTEXoptions}
+% 过时命令。
+% \begin{macrocode}
+\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} }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</class|style>
+% \end{macrocode}
+%
+% \subsection{特定引擎支持与设置}
+%
+% \subsubsection{\pkg{ctex-engine-pdftex.def}}
+%
+% \begin{macrocode}
+%<*pdftex>
+% \end{macrocode}
+%
+% 首先检查选项,决定是否载入 \pkg{zhmCJK} 宏包。
+% \begin{macrocode}
+\if_bool:N \g_@@_zhmCJK_bool
+ \PassOptionsToPackage { encoding = \l_@@_encoding_tl } { zhmCJK }
+ \RequirePackage { zhmCJK }
+% \end{macrocode}
+% 不载入 \pkg{zhmCJK} 宏包时直接调用 \pkg{CJK} 及相关宏包。
+% \begin{macrocode}
+\else:
+ \str_if_eq:onTF { \l_@@_encoding_tl } { GBK }
+ { \RequirePackage { CJK } }
+ { \RequirePackage { CJKutf8 } }
+ \RequirePackage { CJKpunct , CJKspace }
+% \end{macrocode}
+%
+% \begin{macro}[internal]{\ctex_load_zhmap:nnnn}
+% 载入 \pkg{zhmetrics} 的字体映射文件,同时设置 \tn{CJKrmdefault} 等。
+% \begin{macrocode}
+ \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
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+ \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 }
+% \end{macrocode}
+%
+% \pkg{zhmCJK} 判断结束。
+% \begin{macrocode}
+\fi:
+% \end{macrocode}
+%
+% \begin{macro}[internal]{\ctex_CJK_input:n,\CJK@input}
+% \pkg{breqn} 包可能会在正文中将 |^| 的 \tn{catcode} 改为 $12$ 或 $13$,这将
+% 破坏 \pkg{CJK} 对汉字的首字节的定义(\tn{CJK@loadBinding} 和
+% \tn{CJK@loadEncoding})。因此需要确保载入 \file{.enc} 和 \file{.bdg} 文件时,
+% |^| 的 \tn{catcode} 为 $7$。
+% \begin{macrocode}
+\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
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_plane_to_utfxvibe:Nn,\CJK@surr}
+% \changes{v2.0}{2014/04/08}{解决与 \tn{nouppercase} 的冲突。}
+% \pkg{fancyhdr} 宏包的 \tn{nouppercase} 会将 \tn{uppercase} 定义为 \tn{relax},而
+% \tn{CJK@surr} 需要用它将 \tn{CJK@plane} 转化成大写字母,这就造成了冲突^^A
+% \footnote{\url{https://github.com/CTeX-org/ctex-kit/issues/146}}。
+% 我们在这里给出 \tn{CJK@surr} 的一个不依赖 \tn{uppercase} 的实现。
+% \begin{macrocode}
+\if_cs_exist:N \CJK@surr
+ \cs_new_protected_nopar:Npn \ctex_plane_to_utfxvibe:Nn #1#2
+ {
+ \tl_set:Nx \l_@@_tmp_tl {#2}
+ \int_set:Nn \l_@@_tmp_int
+ { \exp_args:No \int_from_hex:n { \l_@@_tmp_tl } }
+ \int_compare:nNnTF \l_@@_tmp_int < \c_two_hundred_fifty_six
+ { \tl_gset:Nx #1 { \int_to_Hex:n { \l_@@_tmp_int } } }
+ {
+ \int_sub:Nn \l_@@_tmp_int { \c_two_hundred_fifty_six }
+ \tl_gset:Nx #1
+ {
+ \int_to_Hex:n
+ { \int_div_truncate:nn { \l_@@_tmp_int } { \c_four } + "D800 }
+ \int_to_Hex:n
+ { \int_mod:nn { \l_@@_tmp_int } { \c_four } + "DC }
+ }
+ }
+ }
+ \cs_set_eq:NN \CJK@surr \ctex_plane_to_utfxvibe:Nn
+\fi:
+% \end{macrocode}
+% \end{macro}
+%
+% \pkg{CJKpunct} 宏包会在 \tn{AtBeginDocument} 的里设置标点格式为 \opt{quanjiao}。
+% \begin{macrocode}
+\AtBeginDocument
+ {
+ \str_if_eq_x:nnF { \l_@@_punct_tl } { quanjiao }
+ { \punctstyle { \l_@@_punct_tl } }
+ }
+% \end{macrocode}
+%
+% 启用中文字符功能。\texttt{GBK} 编码时,将汉字的首字节设置为活动字符,并对这些
+% 字符初始化;\texttt{UTF8} 编码时,上游宏包已经处理好。
+% \tn{CJK@makeActive} 应该先于 \file{ctex-name-gbk.cfg} 等文件的载入。
+% 注意 \tn{CJK@loadBinding} 需要调用补丁后的 \tn{CJK@input}。使用
+% \pkg{zhmCJK} 时,此功能已经被启用。
+% \begin{macrocode}
+\reverse_if:N \if_bool:N \g_@@_zhmCJK_bool
+ \str_if_eq:onF { \l_@@_encoding_tl } { UTF8 }
+ {
+ \CJK@makeActive
+ \CJK@loadBinding { standard }
+ }
+% \end{macrocode}
+%
+% 在导言区结束时调用 \tn{CJK@envStart} 启用完整的中文功能。
+%
+% \tn{CJK@envStart} 的定义是
+% \begin{verbatim}
+% \def\CJK@envStart#1#2#3{
+% \CJK@upperReset
+% \ifCJK@lowercase@
+% \CJK@lowerReset
+% \fi%
+% \CJK@makeActive%
+% \CJK@global\let\CJK@selectFamily \CJK@selFam
+% \CJK@global\let\CJK@selectEnc \CJK@selEnc%
+% \def\CJK@@@enc{#2}
+% \ifx\CJK@@@enc \@empty
+% \PackageInfo{CJK}{
+% no encoding parameter given,\MessageBreak
+% waiting for \protect\CJKenc\space commands}
+% \else
+% \CJKenc{#2}
+% \fi
+% \CJKfontenc{#2}{#1}
+% \CJKfamily{#3}
+% \def\CJK@series{\f@series}
+% \def\CJK@shape{\f@shape}%
+% \csname CJKhook\endcsname}
+% \end{verbatim}
+% \tn{CJK@upperReset} 可能会有一定风险,因此我们直到导言区末尾才使用
+% \tn{CJK@envStart}。这样可以避免将 \env{CJK} 环境内置入 \env{document} 环境的
+% 最里层,最后也就不需要 \tn{clearpage}。\pkg{zhmCJK} 已经提供类似功能。
+% \begin{macrocode}
+ \exp_args:Nx \AtEndPreamble
+ {
+ \exp_not:N \CJK@envStart
+ { } { \l_@@_encoding_tl } { \exp_not:N \CJKfamilydefault }
+ \exp_not:N \CJKtilde
+ }
+% \end{macrocode}
+%
+% \pkg{zhmCJK} 判断结束。
+% \begin{macrocode}
+\fi:
+% \end{macrocode}
+%
+% \begin{macro}[internal]{\ctex_auto_ignorespaces:}
+% 关闭名字空间,保存 \tn{CJK@@ignorespaces} 的定义,方便使用。
+% \begin{macrocode}
+%<@@=>
+\cs_new_eq:NN \ctex_auto_ignorespaces: \CJK@@ignorespaces
+% \end{macrocode}
+% 恢复名字空间,要把它放在一个 \env{macrocode} 环境中,\cls{l3doc} 才能正确工作。
+% \begin{macrocode}
+%<@@=ctex>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_ignorespaces_case:N,\ctex_set_ignorespaces:}
+% 设置忽略空格的的方式。根据 \opt{space} 选项的值重定义 \tn{CJK@ignorespaces},
+% 并保存起来供 \tn{CJKhook} 备用。
+% \begin{macrocode}
+\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: }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\CJKhook}
+% \env{CJK} 和 \env{CJK*} 环境都会重新定义 \tn{CJK@ignorespaces}。我们在 \pkg{CJK}
+% 宏包提供的 \tn{CJKhook} 里重新设置它,让这两个环境忽略空格的方式都受 \opt{space}
+% 选项的控制。这对 \pkg{zhmCJK} 是必要的。
+% \begin{macrocode}
+\ctex_add_hook:Nn \CJKhook { \ctex_set_ignorespaces: }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_punct_set:n}
+% 设置 CJK 族对应到实际的字体。|#1| 是 \opt{fontset} 的名字。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ctex_punct_set:n #1
+ {
+ \clist_map_inline:Nn \c_@@_punct_family_clist
+ {
+ \cs_if_free:cF { c_@@_ #1 ##1 _punct_spaces_tl }
+ {
+ \cs_set_eq:cc
+ { CJKpunct@ ##1 @spaces }
+ { c_@@_ #1 ##1 _punct_spaces_tl }
+ }
+ }
+ }
+\clist_const:Nn \c_@@_punct_family_clist
+ {
+ zhsong , zhhei , zhfs , zhkai , zhli , zhyou ,
+ zhsongb , zhheil , zhheib , zhyoub , zhyahei , zhyaheib
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_punct_map_family:nn}
+% CJK 族 |#1| 使用族 |#2| 的边界信息。
+% \begin{macrocode}
+\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 } }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_punct_map_bfseries:nn}
+% CJK 族 |#1| 的 \tn{bfseries} 使用族 |#2| 的边界信息。
+% \begin{macrocode}
+\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}
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_punct_map_itshape:nn}
+% CJK 族 |#1| 的 \tn{itshape} 使用族 |#2| 的边界信息。
+% \begin{macrocode}
+\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}
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_punct_space:nn,\ctexspadef}
+% 定义标点的边界信息。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ctex_punct_space:nn #1#2
+ { \tl_const:cn { c_@@_ #1 _punct_spaces_tl } {#2} }
+\cs_new_eq:NN \ctexspadef \ctex_punct_space:nn
+% \end{macrocode}
+% \end{macro}
+%
+% 载入边界信息文件。
+% \begin{macrocode}
+\ctex_file_input:n { ctexspa.def }
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</pdftex>
+% \end{macrocode}
+%
+% \subsubsection{\pkg{ctex-engine-xetex.def}}
+%
+% \begin{macrocode}
+%<*xetex>
+% \end{macrocode}
+%
+% \begin{macrocode}
+\RequirePackage { xeCJK }
+\exp_args:Nx \xeCJKsetup
+ {
+ LoadFandol = false ,
+ AutoFakeBold = true ,
+ PunctStyle = \l_@@_punct_tl
+ }
+% \end{macrocode}
+%
+% 最新版本的 \pkg{fontspec} 默认对 \tn{rmfamily} 和 \tn{sffamily} 设置
+% |Ligatures=TeX|,对 \tn{ttfamily} 设置 |WordSpace={1,0,0}| 和
+% |PunctuationSpace=WordSpace|。
+% \begin{macrocode}
+\@ifpackagelater { fontspec } { 2014/05/25 } { }
+ { \msg_error:nnn { ctex } { package-too-old } { fontspec } }
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</xetex>
+% \end{macrocode}
+%
+% \subsubsection{\pkg{ctex-engine-luatex.def}}
+%
+% \begin{macrocode}
+%<*luatex>
+% \end{macrocode}
+%
+% \changes{v2.0}{2014/03/08}{通过 \pkg{LuaTeX-ja} 宏包支持 \LuaLaTeX。}
+%
+% \pkg{LuaTeX-ja} 为了兼容 p\LaTeX 的使用习惯,对 \LaTeXe 的 \pkg{NFSS} 作了不少
+% 修改和扩充,这对于简体中文用户来说不是必要的。我们在这里禁用它。
+% \begin{macrocode}
+\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 } }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\RequirePackage { luatexja }
+\@ifpackagelater { luatexja-core } { 2015/02/22 } { }
+ { \msg_error:nnn { ctex } { package-too-old } { luatexja } }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\RequirePackage { fontspec }
+\@ifpackagelater { fontspec } { 2014/05/25 } { }
+ { \msg_error:nnn { ctex } { package-too-old } { fontspec } }
+% \end{macrocode}
+%
+% \paragraph{\pkg{LuaTeX-ja} 的默认设置}
+%
+% \begin{macrocode}
+\ExplSyntaxOff
+% \end{macrocode}
+%
+% 以下设置抄录自 \file{lltjdefs.sty}。
+% \begin{macrocode}
+\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}
+% \end{macrocode}
+%
+% 以下设置抄录自 \file{ltj-latex.sty}。
+% \begin{macrocode}
+\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
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\ExplSyntaxOn
+% \end{macrocode}
+%
+% \paragraph{\pkg{LuaTeX-ja} 的补丁}
+%
+% \begin{macrocode}
+%<@@=ctex_ltj>
+% \end{macrocode}
+%
+% 在 \LaTeX{} 下,\pkg{LuaTeX-ja} 对 \pkg{fontspec}、\pkg{xunicode}、\pkg{unicode-math}
+% 和 \pkg{listings} 打了补丁。其中前三个是把 \tn{char} 换成 \tn{ltjalchar},确保
+% 字符是 ALchar 类。我们这里用 \pkg{xunicode-addon} 来处理 \pkg{xunicode}。
+% \begin{macrocode}
+\RequirePackage { xunicode-addon }
+\AtBeginUTFCommand
+ {
+ \group_begin:
+ \ctex_lua_now_x:n { tex.globaldefs = 0 }
+ \ltj@allalchar
+ }
+\AtEndUTFCommand { \group_end: }
+% \end{macrocode}
+% 对 \pkg{fontspec} 沿用 \pkg{LuaTeX-ja} 的补丁。
+% \begin{macrocode}
+\RequirePackage { lltjp-fontspec }
+% \end{macrocode}
+% \pkg{lltjp-unicode-math} 让数学符号命令成为普通的文字宏。为了避免它被展开,应该
+% 用 \tn{protected} 来定义。
+% \begin{macrocode}
+\group_begin:
+\char_set_catcode_other:n { \c_zero }
+\cs_new_protected:Npn \@@_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 \@@_um_char:Nw }
+ }
+% \end{macrocode}
+% 对 \pkg{listings} 的补丁是让代码环境支持 JAchar 类。\pkg{LuaTeX-ja} 的补丁会将
+% 代码目录标题改为日文,我们不需要。
+% \begin{macrocode}
+\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 } }
+ }
+ }
+% \end{macrocode}
+%
+% \paragraph{字体切换方式}
+%
+% \begin{macro}[internal]{\ctex_ltj_select_font:,\CJK@family}
+% \tn{CJK@family} 保存的是当前 CJK 实际的字体族名,如果为空表示没有设置过字体。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ctex_ltj_select_font:
+ {
+ \cs_if_exist_use:cF { \l_@@_current_font_tl }
+ { \tl_if_empty:NF \CJK@family { \@@_select_font_aux: } }
+ }
+\tl_new:N \CJK@family
+\tl_new:N \l_@@_current_font_tl
+\tl_set:Nn \l_@@_current_font_tl
+ { \CJK@encoding / \CJK@family / \f@series / \f@shape / \f@size }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\@@_select_font_aux:}
+% 使用 \tn{pickup@font} 取得字体名称前,总需要先设置 \tn{font@name}。在这里将
+% \tn{f@family} 换成 CJK 字体族,并确保编码正确。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \@@_select_font_aux:
+ {
+ \group_begin:
+ \tl_set_eq:NN \f@encoding \CJK@encoding
+ \tl_set_eq:NN \f@family \CJK@family
+ \@@_push_fontname:n { \use:c { \curr@fontshape / \f@size } }
+ \ctex_ltj_pickup_font:
+ \group_end:
+ \font@name
+ \@@_pop_fontname:
+% \end{macrocode}
+% 当字形未定义的时候,\textsf{NFSS} 就会启动替换机制(\tn{wrong@fontshape})。
+% 第一次启动后,\cs{l_@@_current_font_tl} 还是没有定义。为此,我们再次选择字体,
+% 确保它有定义和指向正确的 \texttt{font.id}。这对 \opt{AlternateFont} 的设置
+% 特别重要。
+% \begin{macrocode}
+ \cs_if_exist:cF { \l_@@_current_font_tl }
+ { \@@_select_font_aux: }
+ }
+\cs_new_protected_nopar:Npn \@@_push_fontname:n #1
+ {
+ \cs_gset_eq:NN \@@_save_fontname:w \font@name
+ \cs_gset_nopar:Npx \font@name {#1}
+ }
+\cs_new_protected_nopar:Npn \@@_pop_fontname:
+ { \cs_gset_eq:NN \font@name \@@_save_fontname:w }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_ltj_pickup_font:}
+% 替换 \tn{define@newfont} 内部调用的 \tn{extract@font} 和 \tn{do@subst@correction}。
+% \begin{macrocode}
+\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:
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_ltj_extract_font:}
+% \pkg{LuaTeX-ja} 的 \tn{globaljfont} 在 \pkg{luatexja-core} 中定义:
+% \begin{verbatim}
+% %%%%%%%% \jfont\CS={...:...;jfm=metric;...}, \globaljfont
+% \protected\def\jfont{%
+% \afterassignment\ltj@@jfont\directlua{luatexja.jfont.jfontdefX(false, 'yoko')}}
+% \protected\def\globaljfont{%
+% \afterassignment\ltj@@jfont\directlua{luatexja.jfont.jfontdefX(true, 'yoko')}}
+% \def\ltj@@jfont{\directlua{luatexja.jfont.jfontdefY()}}
+% \end{verbatim}
+% \texttt{jfontdefX} 函数的作用是把 \tn{CS} 定义为其后的字体,\texttt{jfontdefY}
+% 的作用是更新 \texttt{JFM} 和记录相关字体信息。最后的工作是:
+% \begin{verbatim}
+% tex.sprint(cat_lp, global_flag, '\\protected\\expandafter\\def\\csname ',
+% cstemp , '\\endcsname{\\ltj@cur'..
+% (jfm_dir == 'yoko' and 'j' or 't') .. 'fnt', fn, '\\relax}')
+% \end{verbatim}
+% \tn{CS} 的作用就是把 \tn{ltj@curjfnt} 设置为刚才定义的字体的 \texttt{font.id}。
+% \begin{macrocode}
+\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 \@@_patch_external_font:w \external@font }
+ }
+ \exp_after:wN \globaljfont \font@name \external@font \scan_stop:
+% \end{macrocode}
+% 这里 \tn{font@name} 不会直接改变当前字体,而 \tn{DeclareFontFamily} 和
+% \tn{DeclareFontShape} 的最后一个参数通常要使用 \tn{font} 来引用当前字体。
+% 为此,我们在分组内启用之前定义的字体,以便能得到正确的 \tn{font}。对字体参数的
+% 赋值总是全局的,不会受到分组的影响。
+% \begin{macrocode}
+ \font@name
+ \ctex_lua_now_x:n { font.current(tex.attribute['ltj@curjfnt']) }
+ \use:c { \f@encoding + \f@family }
+ \use:c { \curr@fontshape }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_ltj_subst_font:}
+% \tn{do@subst@correction} 在设置通过 \texttt{sub} 或者 \texttt{ssub} 函数定义的
+% 字体时会用到。如果没有设置 \opt{SlantedFont},\pkg{fontspec} 会设置
+% \tn{itdefault} 作为 \tn{sldefault} 的替代字形,因而会用到这个函数。它的本来定义是:
+% \begin{verbatim}
+% \def\do@subst@correction{%
+% \xdef\subst@correction{%
+% \font@name
+% \global\expandafter\font
+% \csname \curr@fontshape/\f@size\endcsname
+% \noexpand\fontname\font
+% \relax}%
+% \aftergroup\subst@correction
+% }
+% \end{verbatim}
+% 我们在这里不需要定义新字体,而是设置对应字体的命令。
+% \begin{macrocode}
+\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_@@_current_font_tl }
+ {
+ \cs_gset_protected_nopar:Npx \subst@correction
+ {
+ \cs_new_eq:NN
+ \exp_not:c { \l_@@_current_font_tl }
+ \font@name
+ }
+ \group_insert_after:N \group_insert_after:N
+ \group_insert_after:N \subst@correction
+ }
+ \group_end:
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal,TF]{\ctex_ltj_if_alternate_shape_exist:n}
+% 即 \pkg{LuaTeX-ja} 中的 \tn{ltj@@does@alt@set},判断是否存在替代字体。
+% \begin{macrocode}
+\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:
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[aux]{\@@_patch_external_font:w}
+% 若对字体的定义完全相同,则它们有相同的 \texttt{font.id}。因此如果字形是由
+% \textsf{NFSS} 的替换机制定义的,它们就有相同的 \texttt{font.id}。
+% |print_aftl_address| 函数的定义是
+% \begin{verbatim}
+% function print_aftl_address()
+% tex.sprint(cat_lp, ';ltjaltfont' .. tostring(aftl_base):sub(8))
+% end
+% \end{verbatim}
+% 主要目的是,如果当前字形有替代字体,则往字形的定义中加入一些标志,确保
+% \texttt{font.id} 唯一。
+% \begin{macrocode}
+\cs_new_nopar:Npn \@@_patch_external_font:w #1 ~ at
+ { #1 \ctex_lua_now_x:n { luatexja.jfont.print_aftl_address() } ~ at }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_ltj_select_alternate_font:}
+% 在 \tn{selectfont} 中更新替代字体。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ctex_ltj_select_alternate_font:
+ {
+ \ctex_ltj_if_alternate_shape_exist:nT { \l_@@_current_shape_tl }
+ {
+ \ctex_lua_now_x:n
+ {
+ luatexja.jfont.output_alt_font_cmd
+ ('y', '\luatexluaescapestring { \l_@@_current_shape_tl }')
+ }
+ \ctex_lua_now_x:n { luatexja.jfont.pickup_alt_font_a ('\f@size') }
+ }
+ }
+\tl_new:N \l_@@_current_shape_tl
+\tl_set:Nn \l_@@_current_shape_tl
+ { \CJK@encoding / \CJK@family / \f@series / \f@shape }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ltj@pickup@altfont@auxy}
+% 被用在函数 |output_alt_font_cmd| 中,作用是定义替代字体。
+% \begin{macrocode}
+\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
+ \@@_push_fontname:n { \use:c { \curr@fontshape / \f@size } }
+ \ctex_ltj_pickup_font:
+ \group_end:
+ \@@_pop_fontname:
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%<@@=>
+% \end{macrocode}
+%
+% \begin{macro}[internal]{\ltj@pickup@altfont@copy}
+% 被用在函数 |pickup_alt_font_a| 中。\tn{ltj@@getjfontnumber} 的作用是将字体命令
+% |#1| 对应的 \texttt{font.id} 保存到 \tn{ltj@tempcntc} 中。
+% \begin{macrocode}
+\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}' )
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\ExplSyntaxOff
+% \end{macrocode}
+%
+% 以下内容抄录自 \file{lltjfont.sty},目的是让汉字可以在数学环境中直接使用。
+% \begin{macrocode}
+\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}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\let\@@italiccorr=\/
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<@@=ctex_ltj>
+% \end{macrocode}
+%
+% \begin{macrocode}
+\ExplSyntaxOn
+% \end{macrocode}
+%
+% \begin{macro}[internal]{\ctex_mono_jfm:n,\l_@@_jfm_tl}
+% \pkg{LuaTeX-ja} 中与标点格式 \opt{plain} 对应的 \texttt{JFM} 是 \opt{mono}。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ctex_mono_jfm:n #1
+ {
+ \str_if_eq:nnTF {#1} { plain }
+ { \tl_set:Nn \l_@@_jfm_tl { mono } }
+ { \tl_set:Nn \l_@@_jfm_tl {#1} }
+ }
+\tl_new:N \l_@@_jfm_tl
+\cs_generate_variant:Nn \ctex_mono_jfm:n { o }
+\ctex_mono_jfm:o { \l__ctex_punct_tl }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\CJK@encoding,\@@_change_encoding:}
+% 在 \LaTeX 下,\pkg{LuaTeX-ja} 依赖字体编码来实现特殊设置。例如上述的
+% \tn{ltj@@IsFontJapanese} 就是通过判断编码来实现的,它在设置数学字体时会用到。所以
+% 不应该与西文共用 \texttt{EU2}。定义字体族 song 为 \tn{CJK@encoding} 的默认替换
+% 字体。下划线 |_| 不在 \tn{nfss@catcodes} 里,可以放心使用。
+% \begin{macrocode}
+\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 \@@_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_@@_jfm_tl } { }
+\DeclareFontShape { \CJK@encoding } { song } { \bfdefault } { \updefault }
+ { <-> psft:SimHei:cid=Adobe-GB1-5;jfm=\l_@@_jfm_tl } { }
+\tl_const:Nn \c_@@_math_tl { CJKmath }
+\DeclareSymbolFont { \c_@@_math_tl }
+ { \CJK@encoding } { song } { \mddefault } { \updefault }
+\SetSymbolFont { \c_@@_math_tl } { bold }
+ { \CJK@encoding } { song } { \bfdefault } { \updefault }
+\int_const:Nn \c_@@_math_fam_int { \use:c { sym \c_@@_math_tl } }
+\jfam \c_@@_math_fam_int
+% \end{macrocode}
+% \end{macro}
+%
+% \paragraph{字体族的定义与使用}
+%
+% 这是 \pkg{luatexja-fontspec} 中新增的一些字体选项。
+% \begin{macrocode}
+\newfontfeature { CID } { cid = #1 }
+\newfontfeature { JFM } { jfm = #1 }
+\newfontfeature { JFM-var } { jfmvar = #1 }
+% \end{macrocode}
+%
+% 在新版本的 \pkg{fontspec} 中,\cs{__fontspec_namewrap:n} 变成了私有函数。
+% \begin{macrocode}
+\keys_define:nn { fontspec-preparse-external }
+ {
+ NoEmbed .code:n =
+ { \cs_set_eq:NN \__fontspec_namewrap:n \@@_noembed_wrap:n }
+ }
+\cs_new:Npn \@@_noembed_wrap:n #1 { psft: #1 }
+% \end{macrocode}
+%
+% \begin{macro}[internal]{\ctex_ltj_set_family:nnn}
+% 将自定义的字体族名与 \pkg{fontspec} 实际设置的名字对应起来。
+% \begin{macrocode}
+\cs_new_protected:Npn \ctex_ltj_set_family:nnn #1#2#3
+ {
+ \group_begin:
+ \clist_clear:N \l_@@_char_range_clist
+ \seq_clear:N \l_@@_alternate_seq
+ \tl_set:Nn \l_@@_base_CJKfamily_tl {#1}
+ \keys_set_known:nnN { ctex_ltj / fontspec } {#2} \l_@@_tmp_tl
+ \clist_set:No \l_@@_font_options_clist { \l_@@_tmp_tl }
+ \ctex_ltj_set_alternate_family:nnF {#1} {#3}
+ {
+ \prop_gput:Nnn \g_@@_family_font_name_prop {#1} {#3}
+ \prop_gput:Nno \g_@@_family_font_options_prop
+ {#1} { \l_@@_font_options_clist }
+ \@@_update_family_uid:N \l_@@_font_options_clist
+ \@@_use_global_options:N \l_@@_font_options_clist
+ \@@_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_@@_base_CJKfamily_tl
+\clist_new:N \l_@@_font_options_clist
+\cs_new_protected_nopar:Npn \@@_use_global_options:N #1
+ {
+ \clist_concat:NNN #1 \g_@@_default_features_clist #1
+ \clist_put_left:Nx #1 { JFM = \l_@@_jfm_tl }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{variable}[internal]
+% {\g_@@_family_name_prop,\g_@@_family_font_name_prop,\g_@@_family_font_options_prop}
+% 分别保存 \pkg{fontspec} 设置的字体族名、字体名称和字体选项。
+% \begin{macrocode}
+\prop_new:N \g_@@_family_name_prop
+\prop_new:N \g_@@_family_font_name_prop
+\prop_new:N \g_@@_family_font_options_prop
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[internal]{\@@_check_family:n}
+% 删除重复的定义,清除替代字体的先前设置。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \@@_check_family:n #1
+ {
+ \prop_gpop:NnNT \g_@@_family_font_name_prop {#1} \l_@@_tmp_tl
+ {
+ \cs_undefine:c { \@@_family_csname:n {#1} }
+ \cs_undefine:c { \@@_alternate_cs:n {#1} }
+ \prop_gpop:NnNT \g_@@_family_name_prop {#1} \l_@@_base_family_tl
+ {
+ \use:c { \@@_alternate_cs:n { clear / #1 } }
+ \cs_undefine:c { \@@_alternate_cs:n { clear / #1 } }
+ \cs_undefine:c { \@@_alternate_cs:n { reset / #1 } }
+ \prop_gremove:Nn \g_@@_reset_alternate_prop {#1}
+ }
+ \msg_warning:nnxx { ctex } { redefine-family } {#1} { \l_@@_tmp_tl }
+ }
+ }
+\tl_new:N \l_@@_tmp_tl
+\msg_new:nnn { ctex } { redefine-family }
+ { Redefining~CJKfamily~`\@@_msg_family_map:n {#1}'~(#2). }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\@@_gset_family_cs:nn}
+% 在设置字体时,实际上并不是马上就定义。而是只保存相关参数,在通过 \tn{CJKfamily}
+% 第一次使用时才定义。需要注意将编码改为 \tn{CJK@encoding}。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \@@_gset_family_cs:nn #1#2
+ {
+ \cs_gset_protected_nopar:cpx { \@@_family_csname:n {#1} }
+ {
+ \group_begin:
+ \@@_change_encoding:
+ \exp_not:n { \cs_set_eq:NN \CJKfamily \use_none:n }
+ \exp_not:n { \fontspec_set_family:Nnn \g_@@_fontspec_family_tl }
+ { \exp_not:o { \l_@@_font_options_clist } } {#2}
+ \prop_gput:Nno \exp_not:N \g_@@_family_name_prop {#1}
+ { \exp_not:N \g_@@_fontspec_family_tl }
+ \tl_gset_eq:NN \exp_not:N \g_@@_fontspec_family_tl
+ \exp_not:N \g_@@_fontspec_family_tl
+ \@@_set_alternate_family:n {#1}
+ \group_end:
+ }
+ }
+\tl_new:N \l_@@_base_family_tl
+\tl_new:N \g_@@_fontspec_family_tl
+\cs_new_nopar:Npn \@@_family_csname:n #1 { ctex_ltj/family/#1 }
+\cs_new_protected_nopar:Npn \@@_set_alternate_family:n #1
+ {
+ \tl_set:Nn \l_@@_base_CJKfamily_tl {#1}
+ \tl_set_eq:NN \l_@@_base_family_tl \g_@@_fontspec_family_tl
+ \cs_if_exist_use:c { \@@_alternate_cs:n { reset / #1 } }
+ \cs_if_exist_use:c { \@@_alternate_cs:n {#1} }
+ }
+\cs_new:Npn \@@_alternate_cs:n #1 { ctex_ltj/alternate_family/#1 }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\CJKfamily}
+% 切换字体。
+% \begin{macrocode}
+\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
+ }
+ { \@@_family_unknown_warning:n {#1} }
+ }
+\tl_new:N \l_ctex_ltj_family_tl
+\cs_generate_variant:Nn \ctex_ltj_switch_family:n { x }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal,TF]{\ctex_ltj_family_if_exist:n}
+% 判断 CJK 字体族 |#1| 是否存在,若存在则把实际族名保存到 |#2| 中。
+% \begin{macrocode}
+\prg_new_protected_conditional:Npnn \ctex_ltj_family_if_exist:xN #1#2 { T , F , TF }
+ {
+ \prop_get:NxNTF \g_@@_family_name_prop {#1} #2
+ { \prg_return_true: }
+ {
+ \cs_if_exist_use:cTF { \@@_family_csname:n {#1} }
+ {
+ \tl_set_eq:NN #2 \g_@@_fontspec_family_tl
+ \prg_return_true:
+ }
+ { \prg_return_false: }
+ }
+ }
+\cs_generate_variant:Nn \prop_get:NnNTF { Nx }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\@@_family_unknown_warning:n}
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \@@_family_unknown_warning:n #1
+ {
+ \prop_if_empty:NF \g_@@_family_font_name_prop
+ {
+ \seq_if_in:NnF \g_@@_unknown_family_seq {#1}
+ {
+ \seq_gput_right:Nn \g_@@_unknown_family_seq {#1}
+ \msg_warning:nnn { ctex } { family-unknown } {#1}
+ }
+ }
+ }
+\seq_new:N \g_@@_unknown_family_seq
+\msg_new:nnn { ctex } { family-unknown }
+ {
+ Unknown~CJK~family~`\@@_msg_family_map:n {#1}'~is~being~ignored.\\
+ Try~to~use~`\@@_msg_def_family_map:n {#1}'~to~define~it.
+ }
+\cs_new_nopar:Npn \@@_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 \@@_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}
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_ltj_fontspec:nn}
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ctex_ltj_fontspec:nn #1#2
+ {
+ \prop_get:NnNTF \g_@@_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_@@_family_int
+ \@@_fontspec:xnn
+ { CJKfontspec ( \int_use:N \g_@@_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 \@@_fontspec:nnn #1#2#3
+ {
+ \bool_if:NT \l_@@_add_alternate_bool
+ {
+ \cs_if_free:cF
+ { \@@_alternate_cs:n { reset / \l_ctex_ltj_family_tl } }
+ {
+ \cs_gset_eq:cc
+ { \@@_alternate_cs:n { reset / #1 } }
+ { \@@_alternate_cs:n { reset / \l_ctex_ltj_family_tl } }
+ \cs_gset_eq:cc
+ { \@@_alternate_cs:n { clear / #1 } }
+ { \@@_alternate_cs:n { clear / \l_ctex_ltj_family_tl } }
+ }
+ \bool_set_false:N \l_@@_add_alternate_bool
+ }
+ \prop_gput:Nnn \g_@@_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 \@@_fontspec:nnn { x }
+\prop_new:N \g_@@_fontspec_prop
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]
+% {\ctex_ltj_add_font_features:n,\ctex_ltj_add_font_features:nn}
+% \begin{macrocode}
+\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_@@_family_font_name_prop
+ {#1} \l_@@_tmp_tl
+ {
+ \prop_get:NnN \g_@@_family_font_options_prop
+ {#1} \l_@@_font_options_clist
+ \clist_put_right:Nn \l_@@_font_options_clist {#2}
+ \bool_set_true:N \l_@@_add_alternate_bool
+ \ctex_ltj_fontspec:xx
+ { \exp_not:o { \l_@@_font_options_clist } }
+ { \exp_not:o { \l_@@_tmp_tl } }
+ }
+ { \msg_warning:nn { ctex } { addCJKfontfeature-ignored } }
+ }
+\bool_new:N \l_@@_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.
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]
+% {\setCJKfamilyfont,\newCJKfontfamily,\CJKfontspec,\addCJKfontfeatures}
+% \begin{macrocode}
+\NewDocumentCommand \setCJKfamilyfont { m O { } m }
+ { \ctex_ltj_set_family:xxx {#1} {#2} {#3} }
+\NewDocumentCommand \newCJKfontfamily { o m O { } m }
+ {
+ \tl_set:Nx \l_@@_tmp_tl
+ { \IfNoValueTF {#1} { \cs_to_str:N #2 } {#1} }
+ \cs_new_protected_nopar:Npx #2
+ { \ctex_ltj_switch_family:n { \l_@@_tmp_tl } }
+ \ctex_ltj_set_family:xxx { \l_@@_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
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]
+% {\setCJKmainfont,\setCJKsansfont,\setCJKmonofont,
+% \setCJKmathfont,\defaultCJKfontfeatures}
+% \begin{macrocode}
+\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_@@_math_tl } {#1} {#2} }
+\NewDocumentCommand \defaultCJKfontfeatures { m }
+ { \clist_gset:Nn \g_@@_default_features_clist {#1} }
+\clist_new:N \g_@@_default_features_clist
+\@onlypreamble \setCJKmainfont
+\@onlypreamble \setCJKsansfont
+\@onlypreamble \setCJKmonofont
+\@onlypreamble \setCJKmathfont
+\@onlypreamble \setCJKromanfont
+\@onlypreamble \defaultCJKfontfeatures
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\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 }
+% \end{macrocode}
+%
+% \begin{macro}[internal]{\ctex_ltj_ensure_default_family:}
+% 在导言区结束确认 \tn{CJKfamilydefault} 确实存在。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ctex_ltj_ensure_default_family:
+ {
+ \prop_if_empty:NF \g_@@_family_font_name_prop
+ {
+ \ctex_ltj_family_if_exist:xNF { \CJKfamilydefault } \l_@@_tmpa_tl
+ {
+ \str_if_eq_x:nnTF { \CJKfamilydefault } { \CJKrmdefault }
+ { \use:n }
+ {
+ \ctex_ltj_family_if_exist:xNTF { \CJKrmdefault } \l_@@_tmpa_tl
+ { \tl_gset:Nn \CJKfamilydefault { \CJKrmdefault } \use_none:n }
+ { \use:n }
+ }
+ {
+ \prop_map_inline:Nn \g_@@_family_font_name_prop
+ {
+ \prop_map_break:n
+ { \tl_gset_rescan:Nnn \CJKfamilydefault { } { ##1 } }
+ }
+ }
+ }
+ \normalfont
+ \ctex_ltj_update_mathfont:
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_ltj_update_mathfont:}
+% 更新数学字体为实际的字体。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ctex_ltj_update_mathfont:
+ {
+ \ctex_ltj_family_if_exist:xNTF { \c_@@_math_tl } \l_@@_tmp_tl
+ { \ctex_ltj_update_mathfont:n { \l_@@_tmp_tl } }
+ {
+ \ctex_ltj_family_if_exist:xNT { \CJKfamilydefault } \l_@@_tmp_tl
+ { \ctex_ltj_update_mathfont:n { \l_@@_tmp_tl } }
+ }
+ }
+\cs_new_protected_nopar:Npn \ctex_ltj_update_mathfont:n #1
+ {
+ \tl_const:Nx \c_@@_math_family_tl {#1}
+ \DeclareSymbolFont { \c_@@_math_tl } { \CJK@encoding }
+ { \c_@@_math_family_tl } { \mddefault } { \updefault }
+ \cs_if_free:cTF
+ { \CJK@encoding/\c_@@_math_family_tl/\bfdefault/\updefault }
+ {
+ \SetSymbolFont { \c_@@_math_tl } { bold } { \CJK@encoding }
+ { \c_@@_math_family_tl } { \mddefault } { \updefault }
+ }
+ {
+ \SetSymbolFont { \c_@@_math_tl } { bold } { \CJK@encoding }
+ { \c_@@_math_family_tl } { \bfdefault } { \updefault }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \paragraph{替代字体的设置}
+%
+% \begin{macro}{AlternateFont,CharRange}
+% 设置替代字体的选项。
+% \begin{macrocode}
+\keys_define:nn { ctex_ltj / fontspec }
+ {
+ AlternateFont .code:n = \ctex_ltj_set_alternate_seq:n {#1} ,
+ AlternateFont .value_required: ,
+ CharRange .clist_set:N = \l_@@_char_range_clist ,
+ CharRange .value_required:
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_ltj_set_alternate_seq:n}
+% 我们使用 \verb=||= 作为替代字体序列的分隔标志。它可能被设置为活动字符,为此
+% 需要先“消毒”,同时过滤掉空元素。
+% \begin{macrocode}
+\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_@@_char_range_clist
+ {
+ \tl_set:Nn \l_@@_tmp_tl {#1}
+ \tl_replace_all:Nnn \l_@@_tmp_tl { // } { || }
+ \seq_set_split:NnV \l_@@_tmp_seq { || } \l_@@_tmp_tl
+ \seq_set_filter:NNn \l_@@_tmp_seq \l_@@_tmp_seq
+ { ! \tl_if_blank_p:n { ##1 } }
+ \seq_concat:NNN \l_@@_alternate_seq
+ \l_@@_alternate_seq \l_@@_tmp_seq
+ }
+ }
+ }
+\seq_new:N \l_@@_tmp_seq
+\seq_new:N \l_@@_alternate_seq
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_ltj_set_alternate_family:nnF}
+% 如果在字体的选项中设置了 \opt{CharRange},则只设置替代字体。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ctex_ltj_set_alternate_family:nnF #1#2#3
+ {
+ \clist_if_empty:NTF \l_@@_char_range_clist
+ {
+ \@@_check_family:n {#1}
+ \seq_if_empty:NF \l_@@_alternate_seq
+ { \ctex_ltj_save_alternate_seq:cn { \@@_alternate_cs:n {#1} } {#2} }
+ #3
+ }
+ { \ctex_ltj_set_alternate_family:nn {#1} {#2} }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]
+% {\ctex_ltj_save_alternate_seq:Nn,\ctex_ltj_save_alternate_seq:Nnnwn}
+% 保存由 \opt{AlternateFont} 设置的替代字体序列。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ctex_ltj_save_alternate_seq:Nn #1#2
+ {
+ \seq_map_inline:Nn \l_@@_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_@@_char_range_clist {#3}
+ \clist_set:Nn \l_@@_alternate_options_clist {#4}
+ \@@_use_global_options:N \l_@@_alternate_options_clist
+ \tl_if_blank:nTF {#5}
+ { \tl_set:Nn \l_@@_tmp_tl {#2} }
+ {
+ \tl_set:Nn \l_@@_tmp_tl {#5}
+ \tl_replace_all:Nnn \l_@@_tmp_tl { * } {#2}
+ }
+ \use:x
+ {
+ \ctex_ltj_save_alternate_family:Nnnn \exp_not:N #1
+ { \exp_not:o { \l_@@_char_range_clist } }
+ { \exp_not:o { \l_@@_alternate_options_clist } }
+ { \exp_not:o { \l_@@_tmp_tl } }
+ }
+ }
+\clist_new:N \l_@@_alternate_options_clist
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_ltj_set_alternate_family:nn}
+% 设置选项 \opt{CharRange} 范围内的替代字体。如果已经定义了主字体,我们也马上
+% 定义替代字体,否则只保存起来备用。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ctex_ltj_set_alternate_family:nn #1#2
+ {
+ \@@_update_family_uid:N \l_@@_font_options_clist
+ \@@_use_global_options:N \l_@@_font_options_clist
+ \ctex_ltj_set_alternate_family:coonn
+ { \@@_alternate_cs:n {#1} }
+ { \l_@@_char_range_clist }
+ { \l_@@_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_@@_family_name_prop {#5} \l_@@_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 }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_ltj_save_alternate_family:Nnnn}
+% 保存替代字体序列的定义,以备定义主字体时使用。
+% \begin{macrocode}
+\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} } }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_ltj_set_alternate_family:nnn}
+% 实际定义替代字体族。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ctex_ltj_set_alternate_family:nnn #1#2#3
+ {
+ \group_begin:
+ \@@_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_@@_char_range_clist {#1}
+ \fontspec_set_family:Nnn \l_@@_alternate_family_tl {#2} {#3}
+ \group_end:
+ }
+\tl_new:N \l_@@_alternate_family_tl
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_ltj_swap_cs:NN}
+% 交换两个控制序列的意义。
+% \begin{macrocode}
+\cs_new_protected:Npn \ctex_ltj_swap_cs:NN #1#2
+ {
+ \cs_set_eq:NN \@@_tmp:w #1
+ \cs_set_eq:NN #1 #2
+ \cs_set_eq:NN #2 \@@_tmp:w
+ \cs_undefine:N \@@_tmp:w
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{LTJFONTUID,\@@_update_family_uid:N}
+% \pkg{fontspec} 在一个字体族的选项和字体名称相同的时候,就不定义新字体。为了
+% 避免混淆替代字体的设置,我们新定义一个虚拟的选项 \opt{LTJFONTUID},确保
+% \pkg{fontspec} 对 CJK 字体族总是定义新字体。
+% \begin{macrocode}
+\keys_define:nn { fontspec } { LTJFONTUID .code:n = }
+\cs_new_protected_nopar:Npn \@@_update_family_uid:N #1
+ {
+ \int_gincr:N \g_@@_family_int
+ \clist_put_right:Nx #1 { LTJFONTUID = \int_use:N \g_@@_family_int }
+ }
+\int_new:N \g_@@_family_int
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_ltj_declare_alternate_shape:nnnnnn}
+% 在定义替代字体的字形时,通过字符范围与主字体的对应字形关联起来。
+% \tn{DeclareFontShape@} 一个有六个参数,我们只需要使用它的第三个参数 \meta{series}
+% 和第四个参数 \meta{shape}。
+% \begin{macrocode}
+\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_@@_char_range_clist
+ { \l_@@_base_family_tl } {#3} {#4}
+ { \l_fontspec_family_tl } {#3} {#4}
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_ltj_set_alternate_shape:Nnnnnnn}
+% 与 \pkg{LuaTeX-ja} 的 \tn{DeclareAlternateKanjiFont} 的功能类似,区别是固定编码
+% 为 \tn{CJK@encoding}。这个设置总是全局的。
+% \begin{macrocode}
+\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_@@_char_range_prop { ##1 } \l_@@_char_range_tl
+ {
+ \ctex_ltj_set_alternate_shape:nnN { #2/#3/#4 } { #5/#6/#7 }
+ \l_@@_char_range_tl
+ }
+ { \ctex_ltj_set_alternate_shape:nnn { #2/#3/#4 } { #5/#6/#7 } { ##1 } }
+ }
+ \@@_save_alternate_shape:cnn
+ { \@@_alternate_cs:n { clear / \l_@@_base_CJKfamily_tl } }
+ { luatexja.jfont.clear_alt_font_latex }
+ { '\luatexluaescapestring { \CJK@encoding/#2/#3/#4 }' }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_ltj_set_alternate_shape:nnn}
+% 我们使用 \texttt{->} 而不是像 \pkg{LuaTeX-ja} 一样使用 \texttt{-} 作为区间的
+% 分隔符。\pkg{LuaTeX-ja} 支持使用负数来引用由 \texttt{JFM} 设置的字符类。如果
+% 使用 \texttt{-} 作为分隔符,那么负数单独使用时,就需要把它放在两层花括号之内
+% (例如 |{{-1}}|),或者使用类似 |{-1}-{-1}| 的形式才不会解释错误。
+% \begin{macrocode}
+\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 ) }
+ \@@_save_alternate_shape:cnn
+ { \@@_alternate_cs:n { reset / \l_@@_base_CJKfamily_tl } }
+ { luatexja.jfont.set_alt_font_latex } {#1}
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_ltj_set_alternate_shape:nnN}
+% 若字符范围预先由 \texttt{declarecharrange} 声明,则可以直接使用。
+% \begin{macrocode}
+\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 }'
+ }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[aux]{\@@_save_alternate_shape:Nnn}
+% 将实际设置的替换字形保存起来用于清除或恢复。
+% 暂时令 \cs{l_@@_base_family_tl} 为 \cs{scan_stop:} 是让它不被展开,使得替换
+% 字体的设置可以在 \tn{addCJKfontfeature} 中直接使用。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \@@_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_@@_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 \@@_save_alternate_shape:Nnn { c }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{clearalternatefont,resetalternatefont}
+% 清除和重置操作总是全局的。
+% \begin{macrocode}
+\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_@@_base_family_tl
+ {
+ \cs_if_exist_use:cT { \@@_alternate_cs:n { clear / #1 } }
+ {
+ \prop_gput:Nno \g_@@_reset_alternate_prop
+ {#1} { \l_@@_base_family_tl }
+ \tl_set_eq:NN \CJK@family \l_@@_base_family_tl
+ \selectfont
+ }
+ }
+ { \@@_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_@@_reset_alternate_prop {#1} \CJK@family
+ {
+ \tl_set_eq:NN \l_@@_base_family_tl \CJK@family
+ \use:c { \@@_alternate_cs:n { reset / #1 } }
+ \selectfont
+ }
+ \group_end:
+ }
+\prop_new:N \g_@@_reset_alternate_prop
+\cs_generate_variant:Nn \clist_map_function:nN { x }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{declarecharrange}
+% 预先声明字符范围。
+% \begin{macrocode}
+\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} { \@@_declare_char_range:nn ##1 } }
+\cs_generate_variant:Nn \ctex_ltj_declare_char_range:n { x }
+\cs_new_protected_nopar:Npn \@@_declare_char_range:nn #1#2
+ { \use:x { \ctex_ltj_declare_char_range:nn { \tl_trim_spaces:n {#1} } } {#2} }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_ltj_declare_char_range:nn,\g_@@_char_range_prop}
+% |#1| 是名字,|#2| 是范围。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ctex_ltj_declare_char_range:nn #1#2
+ {
+ \tl_clear:N \l_@@_char_range_tl
+ \clist_map_function:nN {#2} \ctex_ltj_save_char_range:n
+ \prop_gput:Nno \g_@@_char_range_prop {#1} { \l_@@_char_range_tl }
+ \ctex_ltj_def_char_range_key:n {#1}
+ \tl_clear:N \l_@@_char_range_tl
+ }
+\tl_new:N \l_@@_char_range_tl
+\prop_new:N \g_@@_char_range_prop
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_ltj_save_char_range:n}
+% 预先解释字符区间的意义。
+% \begin{macrocode}
+\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_@@_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} }
+ }
+ } }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_ltj_def_char_range_key:n}
+% 在字体设置选项中定义字符范围键。
+% \begin{macrocode}
+\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 } }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_ltj_char_range_key:nn}
+% 如果字符范围键没有值,则只设置的这个字符范围内的替代字体。
+% \begin{macrocode}
+\cs_new_protected:Npn \ctex_ltj_char_range_key:nn #1#2
+ {
+ \tl_if_blank:nTF {#2}
+ { \tl_set:Nn \l_@@_char_range_clist {#1} }
+ {
+ \clist_if_empty:NT \l_@@_char_range_clist
+ {
+ \tl_set:Nn \l_@@_tmp_tl { {#1} }
+ \@@_char_range_parse_feature:w #2 \q_stop
+ }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\@@_char_range_parse_feature:w}
+% 可以使用加方括号的方式,通过文件名来调用字体。这容易与字体选项混淆。例如,需要
+% 将 |[simsun.ttc]| 设置为 \opt{range} 的主字体,就需要使用
+% |range={{[simsun.ttc]}}| 或者 |[]{[simsun.ttc]}|。下面的目的是,支持直接使用
+% |[simsun.ttc]| 和 |[...][simsun.ttc]|。
+% \begin{macrocode}
+\NewDocumentCommand \@@_char_range_parse_feature:w
+ { +o o u { \q_stop } }
+ {
+ \exp_args:NNf \tl_put_right:Nn \l_@@_tmp_tl
+ {
+ \IfNoValueTF {#1} { {#3} }
+ {
+ \IfNoValueTF {#2}
+ { \tl_if_blank:nTF {#3} { { [#1] } } { [ {#1} ] {#3} } }
+ { [ {#1} ] { [#2] } }
+ }
+ }
+ \seq_put_right:No \l_@@_alternate_seq { \l_@@_tmp_tl }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \paragraph{其它设置}
+%
+% \begin{macro}[internal]{\ctex_ltj_update_xkanjiskip:,\l_@@_xkanjiskip_skip}
+% \tn{ltjsetparameter} 对 \opt{xkanjiskip} 是即时赋值。\tn{zw} 与字体相关,因此
+% 需要每次 \tn{selectfont} 的时候更新一次 \opt{xkanjiskip}。如果用户设置过
+% \opt{xkanjiskip},就不更新。注意,同 \TeX{} 的 \tn{baselineskip} 一样,如果在
+% 一个段落内多次设置了 \opt{kanjiskip} 或 \opt{xkanjiskip},最后的设置会影响
+% 全段。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ctex_ltj_update_xkanjiskip:
+ {
+ \skip_if_eq:nnT
+ { \ltjgetparameter { xkanjiskip } } { \l_@@_xkanjiskip_skip }
+ {
+ \skip_set:Nn \l_@@_xkanjiskip_skip { .25 \zw plus 1pt minus 1pt }
+ \ltjsetxkanjiskip \l_@@_xkanjiskip_skip
+ }
+ }
+% \end{macrocode}
+% 注意,此时还没有实际设置字体,所以 \tn{zw} 是 \opt{0pt}。
+% \begin{macrocode}
+\skip_new:N \l_@@_xkanjiskip_skip
+\skip_set:Nn \l_@@_xkanjiskip_skip { .25 \zw plus 1pt minus 1pt }
+% \end{macrocode}
+% \end{macro}
+%
+% 在抄录环境中禁用 \opt{autospacing} 和 \opt{autoxspacing}。然而,\pkg{LuaTeX-ja}
+% 还是会使 JAchar 自动折行。没有看到有简单的禁用折行的办法,可能需要设置所有的
+% JAchar 的 \opt{prebreakpenalty} 或 \opt{postbreakpenalty} 为 \texttt{10000}:
+% \begin{verbatim}
+% \directlua
+% {
+% luatexja.isglobal = tex.globaldefs > 0 and "global" or ""
+% for i = 0x80, 0x10FFFF do
+% if luatexja.charrange.jcr_table_main[i] > 0 and
+% luatexja.charrange.jcr_table_main[i] < 218 and
+% luatexja.charrange.is_japanese_char_curlist(i) then
+% luatexja.stack.set_stack_table(luatexja.stack_table_index.PRE + i, 10000)
+% end
+% end
+% }
+% \end{verbatim}
+% \begin{macrocode}
+\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 } }
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<@@=ctex>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</luatex>
+% \end{macrocode}
+%
+% \subsubsection{调整 \tn{CJKfamilydefault}}
+%
+% \begin{macro}[internal]{\ctex_update_default_family:}
+% 在导言区结束,如果 \tn{CJKfamilydefault} 没有被更改,则在此时根据西文字体的情况
+% 更新 \tn{CJKfamilydefault}。\pkg{xeCJK} 已经有这个功能,不需要再调整。
+% \begin{macrocode}
+%<*pdftex|luatex>
+\cs_new_protected_nopar:Npn \ctex_update_default_family:
+ {
+ \tl_if_eq:NNT \CJKfamilydefault \l_@@_family_default_init_tl
+ {
+ \group_begin:
+ \cs_set_eq:NN \@@_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:
+ }
+% \end{macrocode}
+% 使用 \LuaLaTeX{} 时,自动调整得到的 \tn{CJKfamilydefault} 可能没有定义,需要确认
+% 它的存在性。使用 \pkg{CJK} 宏包时,\texttt{C19rm} 等总是有定义的,不需要确认。
+% \begin{macrocode}
+%<*luatex>
+ \ctex_ltj_ensure_default_family:
+%</luatex>
+ }
+\AtEndPreamble { \ctex_update_default_family: }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\l_@@_family_default_init_tl}
+% 往 \tn{CJKfamilydefault} 中加入标志,用于判断它是否被更改。
+% \begin{macrocode}
+\tl_new:N \l_@@_family_default_init_tl
+\cs_new_eq:NN \@@_family_default_wrap:n \use:n
+\tl_set:Nx \l_@@_family_default_init_tl
+ {
+ \exp_not:N \@@_family_default_wrap:n
+ { \exp_not:o { \CJKfamilydefault } }
+ }
+\tl_gset_eq:NN \CJKfamilydefault \l_@@_family_default_init_tl
+%</pdftex|luatex>
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{操作系统的判断}
+%
+% \changes{v2.0}{2014/04/16}{自动检测操作系统,载入对应的字体配置。}
+%
+% \begin{macro}[internal]{\ctex_detected_platform:}
+% 在 \LuaTeX{} 下直接用调用 |os.name| 来判断。
+% \begin{macrocode}
+%<*luatex>
+\cs_new_protected_nopar:Npn \ctex_detected_platform:
+ {
+ \tl_gset:Nx \g_@@_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
+ }
+ }
+ }
+%</luatex>
+% \end{macrocode}
+% \pdfTeX{} 和 \XeTeX{} 下则依据 \file{/dev/null} 和 \file{nul:} 的存在性以及
+% 文件系统的大小写敏感性来判断。Mac~OS~X 的大小写敏感性在安装时是可选的。为了
+% 保险起见,这里的判断很繁琐,最多要进行 4 次文件操作!
+% \begin{macrocode}
+%<*xetex|pdftex>
+\cs_new_protected_nopar:Npn \ctex_detected_platform:
+ {
+ \file_if_exist:nTF { /dev/null }
+ {
+ \file_if_exist:nTF { nul: }
+ {
+ \file_if_exist:nTF { \c_@@_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_@@_fontset_tl { windows } }
+ }
+\tex_uppercase:D \exp_after:wN
+ {
+ \exp_after:wN \tl_const:Nn \exp_after:wN \c_@@_engine_file_tl
+ \exp_after:wN { \g_file_current_name_tl }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_if_macosx:TF}
+% 以 \file{/mach_kernel} 为特征文件判断 Mac~OS~X。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ctex_if_macosx:TF #1#2
+ {
+ \file_if_exist:nTF { \c_@@_macosx_file_tl }
+ { \tl_gset:Nn \g_@@_fontset_tl {#1} }
+ { \tl_gset:Nn \g_@@_fontset_tl {#2} }
+ }
+\tl_const:Nn \c_@@_macosx_file_tl { /mach_kernel }
+%</xetex|pdftex>
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\pkg{hyperref} 兼容性处理}
+%
+% 现在处理各个引擎下的 PDF 中文书签问题。根据编译引擎与文件编码的不
+% 同,\pkg{ctex} 向 \pkg{hyperref} 传递适当的参数,完成中文书签的正确设置。用
+% 户仍需要自己载入 \pkg{hyperref} 宏包。
+%
+% \begin{macro}[internal]{\ctex_hypersetup:n}
+% 如果已经载入 \pkg{hyperref} 宏包,则直接使用其定义设置选项;否则
+% \cs{ctex_hypersetup:n} 的效果与 \tn{PassOptionsToPackage} 一致,只传递宏包参
+% 数。如果用户不载入 \pkg{hyperref} 宏包,相关参数即被丢弃。
+% \begin{macrocode}
+%<*class|style>
+\@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 }
+%</class|style>
+% \end{macrocode}
+% \end{macro}
+%
+% 在 \pdfTeX{} 下使用 \texttt{GBK} 编码,\dvipdfmx{} 驱动可以直接用它的
+% \tn{special} 命令,其它模式用 \pkg{xCJK2uni} 宏包处理。使用 \texttt{UTF-8} 编
+% 码时,\pkg{CJKutf8} 已经处理了书签问题,但仍需要设置 \opt{pdfencoding} 为
+% \opt{unicode},目的是在书签的开头写入 BOM (|\376\377|),提示这是
+% \texttt{UTF-16BE} 字节流。
+% \begin{macrocode}
+%<*pdftex>
+\ctex_hypersetup:n { driverfallback = dvipdfmx }
+\str_if_eq:onTF { \l_@@_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 } }
+%</pdftex>
+% \end{macrocode}
+% 在 \XeTeX{} 下,\pkg{hyperref} 在处理带有非 ASCII 字符和 |\%| 的书签时有问题^^A
+% \footnote{\url{https://github.com/CTeX-org/ctex-kit/issues/39}}。
+% 事实上,\pkg{hyperref} 在驱动文件 \file{hxetex.def} 中设置了
+% \tn{Hy@unicodetrue},从而书签总是会被 \tn{HyPsd@ConvertToUnicode} 转化成
+% \texttt{UTF-16BE} 编码的形式(抄录自 \tn{pdfstringdef}的定义):
+% \begin{verbatim}
+% \ifHy@unicode
+% \HyPsd@ConvertToUnicode#1%
+% \ifx\HyPsd@pdfencoding\HyPsd@pdfencoding@auto
+% \ltx@IfUndefined{StringEncodingConvertTest}{%
+% }{%
+% \EdefUnescapeString\HyPsd@temp#1%
+% \ifxetex
+% \let\HyPsd@UnescapedString\HyPsd@temp
+% \StringEncodingConvertTest\HyPsd@temp\HyPsd@temp
+% {utf16be}{ascii-print}{%
+% \EdefEscapeString\HyPsd@temp\HyPsd@temp
+% \global\let#1\HyPsd@temp
+% \HyPsd@EscapeTeX#1%
+% \Hy@unicodefalse
+% }{%
+% \HyPsd@ToBigChars#1%
+% }%
+% \end{verbatim}
+% 通过宏包选项 \opt{pdfencoding=unicode} 设置 \tn{HyPsd@pdfencoding} 为
+% \opt{unicode},可以避免随后再将书签从 \texttt{UTF-16BE} 字节流转化回正常
+% 字符(其中使用的 \tn{HyPsd@ToBigChars} 没有考虑书签中含有 |\%| 的情况)。
+% Heiko Oberdiek 在 \file{README} 中说明了将书签转化回正常字符的意图:避免
+% XDVIPDFMX 的警告^^A
+% \footnote{\url{http://project.ktug.org/dvipdfmx/mailman/dvipdfmx/2009-December/000153.html}}:
+% \begin{verbatim}
+% ** WARNING ** Failed to convert input string to UTF16...
+% \end{verbatim}
+% \XeTeX{} 的维护者 Khaled Hosny 已经注意到了这个问题^^A
+% \footnote{\url{http://tug.org/pipermail/tex-live/2013-December/034613.html}}。
+% 需要注意的是,\file{hxetex.def} 重载了宏包选项 \opt{unicode},目的是不能设置
+% 它为 \opt{false},但也导致它不会改变 \tn{HyPsd@pdfencoding}。如果
+% \pkg{hyperref} 先于 \CTeX{} 被载入,那么 \opt{unicode} 选项是没有意义的。
+% 因此要通过意义相同但在 \XeTeX{} 下更保险的 \opt{pdfencoding} 选项来设置。
+% 为了与 \XeTeX 下的行为一致(使用 \tn{HyPsd@LoadUnicode} 载入 \file{puenc.def}),
+% 在 \LuaTeX{} 下也启用这个选项。
+% \begin{macrocode}
+%<*xetex|luatex>
+\ctex_hypersetup:n { pdfencoding = unicode }
+%</xetex|luatex>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*pdftex|xetex|luatex>
+% \end{macrocode}
+%
+% \subsubsection{\pkg{CJKfntef}、\pkg{xeCJKfntef} 相关设置}
+%
+% \CTeX{} 套件对 \pdfTeX{} 与 \XeTeX{} 引擎,分别载入 \pkg{CJKfntef} 或
+% \pkg{xeCJKfntef} 宏包,并关闭宏包默认的彩色等多余格式。
+%
+% \changes{v2.0}{2015/03/25}{默认关闭 \pkg{CJKfntef} 或 \pkg{xeCJKfntef} 的彩
+% 色设置。}
+% \changes{v2.0}{2015/03/25}{\tn{CTEXunderdot}, \tn{CTEXunderline},
+% \tn{CTEXunderdblline}, \tn{CTEXunderwave}, \tn{CTEXsout}, \tn{CTEXxout} 是过
+% 时命令;\env{CTEXfilltwosides} 是过时环境。}
+%
+% 载入 \pkg{CJKfntef} 或 \pkg{xeCJKfntef} 并做适当格式设置。有关 |\CTEX| 开头
+% 的宏定义是过时命令,仅做兼容性保留。
+%
+% \begin{macrocode}
+%<pdftex>\RequirePackage { CJKfntef } \normalem
+%<xetex>\RequirePackage { xeCJKfntef }
+%<*luatex>
+\msg_new:nnn { ctex } { fntef-not-available }
+ { Functions~ of~ `CJKfntef'~ is~ not~ available~ in~ LuaLaTeX. }
+\msg_warning:nn { ctex } { fntef-not-available }
+%</luatex>
+\clist_map_inline:nn
+ { underdot , underline , underdblline , underwave , sout , xout }
+%<*pdftex|xetex>
+ {
+%<pdftex> \tl_clear:c { CJK#1color }
+%<xetex> \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 }
+%</pdftex|xetex>
+%<*luatex>
+ { \cs_new_eq:cN { CTEX#1 } \use:n }
+\cs_new_eq:NN \CTEXfilltwosides \use_none:n
+\cs_new_eq:NN \endCTEXfilltwosides \prg_do_nothing:
+%</luatex>
+%<*pdftex>
+\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 } }
+ }
+%</pdftex>
+% \end{macrocode}
+%
+% \subsubsection{\tn{ccwd} 的更新}
+%
+% \begin{macro}[internal]{\ctex_update_ccwd:,\ccwd}
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ctex_update_ccwd:
+%<*pdftex|xetex>
+ {
+ \hbox_set:Nn \l_@@_tmp_box { \CJKglue }
+ \dim_set:Nn \ccwd { \box_wd:N \l_@@_tmp_box + \f@size \p@ }
+ }
+%</pdftex|xetex>
+%<*luatex>
+ { \skip_set:Nn \ccwd { \ltjgetparameter { kanjiskip } + \zw } }
+%</luatex>
+\dim_new:N \ccwd
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_update_ccglue:}
+% 更新字间距。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ctex_update_ccglue:
+%<*pdftex>
+ {
+ \cs_set_protected_nopar:Npn \CJKglue
+ { \skip_horizontal:N \l_@@_ccglue_skip }
+ }
+%</pdftex>
+%<*xetex>
+ { \xeCJKsetup { CJKglue = { \skip_horizontal:N \l_@@_ccglue_skip } } }
+%</xetex>
+%<*luatex>
+ { \ltjsetkanjiskip \l_@@_ccglue_skip }
+%</luatex>
+\skip_new:N \l_@@_ccglue_skip
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal,pTF]{\ctex_if_ccglue_touched:}
+% 检查用户是否修改过汉字间距。
+% \begin{macrocode}
+\prg_new_conditional:Npnn \ctex_if_ccglue_touched: { TF }
+ {
+%<*pdftex|xetex>
+ \if_meaning:w \CJKglue \@@_ccglue:
+ \prg_return_false: \else: \prg_return_true: \fi:
+%</pdftex|xetex>
+%<*luatex>
+ \skip_if_eq:nnTF { \l_@@_ccglue_skip } { \ltjgetparameter { kanjiskip } }
+ { \prg_return_false: } { \prg_return_true: }
+%</luatex>
+ }
+% \end{macrocode}
+% 注意下面的标记不能用 \verb"%<pdftex|xetex>",它会导致旧版本的 \pkg{l3docstrip}
+% 不能替换 \texttt{@@}。
+% \begin{macrocode}
+%<*pdftex|xetex>
+\ctex_at_end:n { \cs_new_eq:NN \@@_ccglue: \CJKglue }
+%</pdftex|xetex>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_update_em_unit:}
+% 将当前汉字的宽度保存到 \tn{ccwd} 中备用。不采用 \texttt{1 em},因为这时的
+% \texttt{1 em} 实际上来自西文字体的信息,未必等于汉字的宽度,这似乎在传统的
+% \file{.tfm} 字体上表现更明显。在 \pdfTeX{} 和 \XeTeX{} 下,直接使用 |\f@size\p@|
+% 作为汉字的宽度,这应该对大多数汉字字体都成立,但不适用于诸如“方正兰亭黑长”之类
+% 的特殊字体。在 \XeTeX{} 可以用 \tn{fontcharwd} 来改进。而在 \pdfTeX{} 下,若使用
+% \pkg{zhmetrics} 技术,所有的汉字共享同一个 \file{.tfm},\tn{fontcharwd} 也就没有
+% 意义。在 \LuaTeX{} 下,\pkg{LuaTeX-ja} 总是按照 JFM 中的设置输出汉字的宽度,可以
+% 直接用 \tn{zw} 作为汉字宽度。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ctex_update_em_unit:
+%<pdftex|xetex> { \dim_set:Nn \ccwd { \f@size \p@ } }
+%<luatex> { \dim_set:Nn \ccwd { \zw } }
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{其它}
+%
+% \begin{macro}[internal]{\ctex_add_to_selectfont:n,\CTEX@selectfont@hook}
+% \tn{EverySelectfont} 直到文档开始时才有效。为了 \tn{ccwd} 和 \pkg{LuaTeX-ja} 的
+% 字体设置在导言区也可用,我们还需要在这里手工修改 \tn{selectfont}。\pkg{everysel}
+% 宏包会用 \tn{CheckCommand} 来检查 \tn{selectfont} 是否为标准定义。我们修改了
+% \tn{selectfont},所以会给出一个警告。为了消除这个警告,在它检查之前,还原本来
+% 定义。
+% \begin{macrocode}
+\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 \@@_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 ~ } \@@_save_selectfont: }
+ }
+ { \ctex_patch_failure:N \selectfont }
+ }
+\ExplSyntaxOn
+% \end{macrocode}
+% \end{macro}
+%
+% \tn{CJK@plane} 有定义,说明处于 \pkg{CJK} 宏包的 \tn{CJKsymbol} 之内,不必使用钩子。
+% \begin{macrocode}
+%<*pdftex>
+\EverySelectfont { \cs_if_exist:NF \CJK@plane { \CTEX@selectfont@hook } }
+%</pdftex>
+%<*xetex|luatex>
+\EverySelectfont { \CTEX@selectfont@hook }
+%</xetex|luatex>
+% \end{macrocode}
+%
+% Attribute 寄存器 \tn{ltj@curjfnt} 的初始值是 $-1$,必须把它设置为一个有效的
+% \texttt{font.id},否则编译时会直接退出。
+% \begin{macrocode}
+%<*luatex>
+\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
+%</luatex>
+% \end{macrocode}
+%
+% \begin{macro}{space}
+% 在导言区或正文中设置忽略空格方式。
+% \pdfTeX{} 和 \XeTeX{} 下初始设置为 \opt{auto},\LuaTeX{} 下是无效选项。
+% \begin{macrocode}
+\keys_define:nn { ctex }
+ {
+%<*pdftex|xetex>
+ space .choice: ,
+ space / true .code:n =
+%<pdftex> { \ctex_ignorespaces_case:N \prg_do_nothing: } ,
+%<xetex> { \xeCJKsetup { CJKspace = true } } ,
+ space / auto .code:n =
+%<pdftex> { \ctex_ignorespaces_case:N \ctex_auto_ignorespaces: } ,
+%<xetex> { \xeCJKsetup { CJKspace = false } } ,
+ space / false .code:n =
+%<pdftex> { \ctex_ignorespaces_case:N \tex_ignorespaces:D } ,
+%<xetex> { \xeCJKsetup { CJKspace = false } } ,
+ space .default:n = { true } ,
+ space .initial:n = { auto }
+%</pdftex|xetex>
+%<*luatex>
+ space .code:n =
+ { \msg_warning:nn { ctex } { invalid-option } }
+%</luatex>
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{punct}
+% 在导言区或正文中设置标点符号输出格式。\pkg{LuaTeX-ja} 设置的是字体的默认 \texttt{JFM},
+% 只会影响到之后设置的字体。
+% \begin{macrocode}
+\keys_define:nn { ctex }
+ {
+ punct .code:n =
+ {
+ \tl_set:Nx \l_@@_punct_tl { #1 }
+%<pdftex> \punctstyle { \l_@@_punct_tl }
+%<xetex> \xeCJKsetup { PunctStyle = \l_@@_punct_tl }
+%<luatex> \ctex_mono_jfm:o { \l_@@_punct_tl }
+ } ,
+ punct .default:n = { quanjiao } ,
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</pdftex|xetex|luatex>
+%<*class|style>
+% \end{macrocode}
+%
+% \subsubsection{载入引擎定义文件}
+%
+% 最后载入各个编译引擎的定义文件。
+% \begin{macrocode}
+\pdftex_if_engine:TF
+ {
+ \tl_set:Nx \l_@@_encoding_tl { \l_@@_encoding_tl }
+ \ctex_file_input:n { ctex-engine-pdftex.def }
+ }
+ {
+ \tl_set:Nn \l_@@_encoding_tl { UTF8 }
+ \xetex_if_engine:TF
+ { \ctex_file_input:n { ctex-engine-xetex.def } }
+ { \ctex_file_input:n { ctex-engine-luatex.def } }
+ }
+% \end{macrocode}
+%
+% \subsection{字距与缩进}
+%
+% \begin{macro}{autoindent}
+% \opt{autoindent} 也是可以用在正文中的选项,意义与宏包选项 |option/autoindent| 相同。
+% \begin{macrocode}
+\keys_define:nn { ctex }
+ {
+ autoindent .choice: ,
+ autoindent .default:n = { true } ,
+ autoindent / true .code:n =
+ {
+ \tl_set:Nn \l_@@_autoindent_tl { 2 \ccwd }
+ \ctex_select_size:
+ } ,
+ autoindent / false .code:n =
+ { \tl_clear:N \l_@@_autoindent_tl } ,
+ autoindent / unknown .code:n =
+ {
+ \ctex_set_default_ccwd:Nn \l_@@_autoindent_tl {#1}
+ \ctex_select_size:
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CTEXsetfont}
+% 无论字体大小是否变化都更新相关信息。
+% \begin{macrocode}
+\NewDocumentCommand \CTEXsetfont { } { \ctex_select_size: }
+\cs_new_protected_nopar:Npn \ctex_select_size:
+ { \cs_if_free:NTF \size@update { \ctex_update_size: } { \selectfont } }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_update_size:}
+% 在字号变化时更新 \tn{ccwd}、\tn{parindent} 和汉字间距。字距为零则恢复正常设置。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ctex_update_size:
+ {
+ \tl_if_eq:NNTF \l_@@_ziju_tl \c_@@_zero_tl
+ {
+ \ctex_update_stretch:
+ \ctex_update_parindent:
+ }
+ { \ctex_update_ziju: }
+ }
+\tl_const:Nx \c_@@_zero_tl { \fp_use:N \c_zero_fp }
+\tl_new:N \l_@@_ziju_tl
+\tl_set_eq:NN \l_@@_ziju_tl \c_@@_zero_tl
+% \end{macrocode}
+% 在 \tn{selectfont} 中,若 \tn{size@update} 为 \tn{relax},说明字体大小没有变化,
+% 我们也就不用更新相关参数。
+% \begin{macrocode}
+\ctex_add_to_selectfont:n
+ { \cs_if_free:NF \size@update { \ctex_update_size: } }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{linestretch}
+% 若行宽不是汉字宽度的整数倍,自然要求伸展它们之间的差。这里设置的是在此基础上的
+% 额外伸展量。初始化为一个汉字的宽度。若设置为 \tn{maxdimen},则禁用此功能。
+% 参数的默认单位是汉字的宽度 \tn{ccwd}。
+% \begin{macrocode}
+\keys_define:nn { ctex }
+ {
+ linestretch .code:n =
+ {
+ \ctex_set_default_ccwd:Nn \l_@@_line_stretch_tl {#1}
+ \ctex_select_size:
+ } ,
+ linestretch .value_required:
+ }
+\tl_new:N \l_@@_line_stretch_tl
+\tl_set:Nn \l_@@_line_stretch_tl { \ccwd }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_update_stretch:}
+% 首先计算一行上汉字的字数,\tn{CJKglue} 相当于将 \tn{linewidth} 与汉字总宽度之差
+% 均匀地填充到汉字之间。\hologo{eTeX} 的除法是四舍五入,而我们这里应该用截断。由于
+% 没有可展性的要求,直接用原语 \cs{tex_divide:D} 要比 \cs{int_div_truncate:nn}
+% 快一些。下面的算法还兼顾到了 \tn{linewidth} 不为汉字字宽的整数倍的情况。
+% 若用户禁用 \opt{linestretch} 并且修改过 \tn{CJKglue},则只更新
+% \tn{ccwd},否则设置伸展量为 $0.08$ 倍 \tn{baselineskip}。注意 \pkg{everysel} 的
+% 钩子位于 \tn{size@update} 之前,\tn{baselineskip} 还未更新,不能直接使用它。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ctex_update_stretch:
+ {
+ \ctex_update_em_unit:
+ \dim_set:Nn \l_@@_tmp_dim { \l_@@_line_stretch_tl }
+ \dim_compare:nNnTF \l_@@_tmp_dim = \c_max_dim
+ {
+ \ctex_if_ccglue_touched:TF
+ { \ctex_update_ccwd: }
+ {
+ \dim_set:Nn \l_@@_tmp_dim
+ { \baselinestretch \etex_glueexpr:D \f@baselineskip \scan_stop: }
+ \skip_set:Nn \l_@@_ccglue_skip
+ { \c_zero_dim plus .08 \l_@@_tmp_dim }
+ \ctex_update_ccglue:
+ }
+ }
+ {
+ \int_set:Nn \l_@@_tmp_int
+ { \etex_dimexpr:D \linewidth - \ccwd - \l_@@_tmp_dim \scan_stop: }
+ \tex_divide:D \l_@@_tmp_int \ccwd
+ \int_compare:nNnTF \l_@@_tmp_int > \c_zero
+ {
+ \skip_set:Nn \l_@@_ccglue_skip
+ {
+ \c_zero_dim plus \dim_eval:n
+ {
+ ( \linewidth - \ccwd - \l_@@_tmp_int \ccwd ) /
+ \l_@@_tmp_int
+ }
+ }
+ }
+ { \skip_zero:N \l_@@_ccglue_skip }
+ \ctex_update_ccglue:
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_update_parindent:}
+% 更新段落首行缩进。此函数在字号变化时调用。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ctex_update_parindent:
+ {
+ \tl_if_empty:NF \l_@@_autoindent_tl
+ {
+ \dim_compare:nNnF \parindent = \c_zero_dim
+ { \dim_set:Nn \parindent { \l_@@_autoindent_tl } }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ziju}
+% 若参数为 $0$,则恢复正常间距。
+% \begin{macrocode}
+\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_@@_ziju_tl { \fp_eval:n {#1} }
+ \ctex_select_size:
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_update_ziju:}
+% 更新字距。若字距不大于 $-1$,即 \tn{ccwd} 为非正值,则不计算伸缩值。
+% 否则,首先假定汉字的宽度为正常宽度加上字距,看一行上能正常放下多少个汉字。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ctex_update_ziju:
+ {
+ \ctex_update_em_unit:
+ \dim_set:Nn \l_@@_ziju_dim { \l_@@_ziju_tl \ccwd }
+ \dim_add:Nn \ccwd { \l_@@_ziju_dim }
+ \dim_compare:nNnTF \ccwd > \c_zero_dim
+% \end{macrocode}
+% 伸展量保证行内的剩余空白能够被均匀地填充到汉字之间,收缩的最大限度是让当前行
+% 还能够再挤下一个汉字并且不会出现负间距。由 \TeX{} 决定伸展还是收缩。
+% \begin{macrocode}
+ {
+ \dim_set:Nn \l_@@_tmp_dim
+ { \linewidth - \ccwd + \l_@@_ziju_dim }
+ \int_set:Nn \l_@@_tmp_int { \l_@@_tmp_dim }
+ \tex_divide:D \l_@@_tmp_int \ccwd
+ \dim_sub:Nn \l_@@_tmp_dim { \l_@@_tmp_int \ccwd }
+% \end{macrocode}
+% 由于 \tn{parindent} 是一个固定值,并不参与伸缩,容易导致第一行出现坏盒子。
+% 我们在这里将字数减去 $2$,以此放大伸缩值。
+% \begin{macrocode}
+ \dim_compare:nNnF \parindent = \c_zero_dim
+ {
+ \int_compare:nNnF \l_@@_tmp_int < \c_three
+ { \int_sub:Nn \l_@@_tmp_int { \c_two } }
+ }
+ \skip_set:Nn \l_@@_ccglue_skip
+ {
+ \l_@@_ziju_dim
+ plus \dim_eval:n { \l_@@_tmp_dim / \l_@@_tmp_int }
+ minus \dim_min:nn { \dim_abs:n { \l_@@_ziju_dim } }
+ { ( \ccwd - \l_@@_tmp_dim ) / ( \l_@@_tmp_int + \c_one ) }
+ }
+ }
+ { \skip_set:Nn \l_@@_ccglue_skip { \l_@@_ziju_dim } }
+ \ctex_update_ccglue:
+% \end{macrocode}
+% 字距设置得比较大时,为了尽量保证段首缩进能够与下一行对齐,应该需要相应地加上
+% 或者减去伸缩值。但是这里并不清楚 \TeX{} 是伸展还是收缩,之前以“当前行是否还
+% 放得下一个汉字”为标准加上或减去伸缩值的做法也未必与实际结果一致,所以只好还
+% 是设置为 |2\ccwd|。
+% \begin{macrocode}
+ \ctex_update_parindent:
+ }
+\dim_new:N \l_@@_ziju_dim
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v2.0}{2015/03/21}{\tn{CTEXindent}, \tn{CTEXnoindent} 是过时命令。}
+% \begin{macro}{\CTEXindent,\CTEXnoindent}
+% 过时命令。
+% \begin{macrocode}
+\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
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\bool_if:NT \l_@@_indent_bool
+ { \RequirePackage { indentfirst } }
+% \end{macrocode}
+%
+% \subsection{中文数字与日期}
+%
+% \begin{macrocode}
+\PassOptionsToPackage { encoding = \l_@@_encoding_tl } { zhnumber }
+\RequirePackage { zhnumber }
+% \end{macrocode}
+%
+% \begin{macro}{\chinese}
+% \begin{macrocode}
+\cs_new_eq:NN \chinese \zhnum
+\cs_new_eq:NN \Chinese \chinese
+\cs_new_eq:NN \CTEXcounter \use_none:n
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CTEXnumber,\CTEXdigits}
+% \begin{macrocode}
+\NewDocumentCommand \CTEXnumber { m m }
+ { \protected@edef #1 { \zhnumber {#2} } }
+\NewDocumentCommand \CTEXdigits { m m }
+ { \protected@edef #1 { \zhdigits {#2} } }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{today}
+% \begin{macrocode}
+\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'. }
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{其它中文标题定义}
+%
+% \changes{v2.0}{2014/03/08}{将标题汉化功能加入 \pkg{ctex.sty}。}
+%
+% \begin{macrocode}
+\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 ,
+%<article> bibname .tl_set:N = \refname
+%<book|report> bibname .tl_set:N = \bibname
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*style>
+\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 }
+ }
+ }
+%</style>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</class|style>
+% \end{macrocode}
+%
+% \subsection{中文化的标题结构}
+%
+% 本节内容在 \CTeX{} 文档类或打开 \opt{heading} 选项下生效。
+% \begin{macrocode}
+%<*class|heading>
+% \end{macrocode}
+%
+% \subsubsection{定义标题格式选项}
+%
+% \begin{variable}[internal]{\c_@@_headings_seq}
+% \begin{macrocode}
+\seq_new:N \c_@@_headings_seq
+\seq_gset_from_clist:Nn \c_@@_headings_seq
+ {
+%<article> part , section , subsection , subsubsection ,
+%<book|report> part , chapter , section , subsection , subsubsection ,
+ paragraph , subparagraph
+ }
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[internal]{\@@_initial_heading:n}
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \@@_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 }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\@@_def_heading_keys:n}
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \@@_def_heading_keys:n #1
+ {
+ \tl_put_right:Nx \l_@@_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: ,
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_assign_heading_name:nn,\@@_assign_heading_name:nnn}
+% \opt{name} 的值是一个至多两个元素的逗号分隔列表。由于 \LTXIII{} 的
+% \texttt{clist} 总是会自动忽略空元素,所以设置 |name={,章}| 后,第一个元素将会
+% 是“章”,必须用空的分组保护空元素:|name={{},章}|,这在使用中有些许不便。我们
+% 可以改用 \texttt{seq} 或者手写函数解析参数来加以改进。为实现的简单起见,这里用
+% 了 \pkg{xparse} 的 \tn{SplitArgument},它带有参数的长度检查。
+% \begin{macrocode}
+\NewDocumentCommand \ctex_assign_heading_name:nn
+ { m > { \SplitArgument { \c_one } { , } } +m }
+ { \@@_assign_heading_name:nnn {#1} #2 }
+\cs_new_protected:Npn \@@_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} }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\tl_clear:N \l_@@_tmp_tl
+\seq_map_inline:Nn \c_@@_headings_seq
+ {
+ \@@_initial_heading:n {#1}
+ \@@_def_heading_keys:n {#1}
+ }
+\use:x { \keys_define:nn { ctex } { \exp_not:o { \l_@@_tmp_tl } } }
+\tl_clear:N \l_@@_tmp_tl
+% \end{macrocode}
+%
+% \changes{v2.0}{2014/03/21}{标题设置新增 \opt{pagestyle} 选项。}
+%
+% \begin{macro}{pagestyle}
+% 只在 \cls{ctexbook} 和 \cls{ctexrep} 下有定义。
+% \begin{macrocode}
+%<*book|report>
+\keys_define:nn { ctex }
+ {
+ part / pagestyle .tl_set:N = \CTEX@part@pagestyle ,
+ chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle
+ }
+%</book|report>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsubsection{标准标题命令的修改}
+%
+% \paragraph{part 的标题}
+%
+% \begin{macrocode}
+%<@@=>
+% \end{macrocode}
+%
+% \begin{macro}[internal]{\part}
+% \begin{macrocode}
+%<*article>
+\renewcommand\part{%
+ \if@noskipsec \leavevmode \fi
+ \par
+% \addvspace{4ex}%
+ \@tempskipa \CTEX@part@beforeskip \relax
+ \ifdim \@tempskipa <\z@
+ \@tempskipa -\@tempskipa \@afterindentfalse
+ \else
+ \@afterindenttrue
+ \fi
+ \addvspace{\@tempskipa}%
+ \secdef\@part\@spart}
+%</article>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\@part}
+% \begin{macrocode}
+%<*article>
+\def\@part[#1]#2{%
+ \ifnum \c@secnumdepth >\m@ne
+ \refstepcounter{part}%
+% \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
+ \addcontentsline{toc}{part}{\CTEXthepart\hspace{1em}#1}%
+ \else
+ \addcontentsline{toc}{part}{#1}%
+ \fi
+ {\interlinepenalty \@M
+% \normalfont \parindent \z@ \raggedright
+ \normalfont \parindent \CTEX@part@indent \CTEX@part@format
+ \ifnum \c@secnumdepth >\m@ne
+% \Large\bfseries\partname\nobreakspace\thepart\par\nobreak
+ \CTEX@partname
+ \fi
+% \huge\bfseries #2%
+ \CTEX@part@titleformat{#2}%
+ \markboth{}{}\par}%
+ \nobreak
+% \vskip 3ex
+ \vskip \CTEX@part@afterskip
+ \@afterheading}
+%</article>
+% \end{macrocode}
+%
+% 标准文档类是在 \tn{part} 和 \tn{chapter} 定义的最开始设置 \tn{thispagestyle},
+% 我们这里的修改出现在它之后,可以覆盖之前的设置。
+% \begin{macrocode}
+%<*book|report>
+\def\@part[#1]#2{%
+ \thispagestyle{\CTEX@part@pagestyle}%
+ \ifnum \c@secnumdepth >-2\relax
+ \refstepcounter{part}%
+% \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
+ \addcontentsline{toc}{part}{\CTEXthepart\hspace{1em}#1}%
+ \else
+ \addcontentsline{toc}{part}{#1}%
+ \fi
+ \markboth{}{}%
+ {\interlinepenalty \@M
+% \normalfont \centering
+ \normalfont \CTEX@part@format
+ \ifnum \c@secnumdepth >-2\relax
+% \huge\bfseries\partname\nobreakspace\thepart\par\vskip 20\p@
+ \CTEX@partname
+ \fi
+% \Huge\bfseries #2\par}%
+ \CTEX@part@titleformat{#2}\par}%
+ \@endpart}
+%</book|report>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\@spart}
+% \begin{macrocode}
+%<*article>
+\def\@spart#1{%
+ {\interlinepenalty \@M
+% \normalfont \parindent \z@ \raggedright
+ \normalfont \parindent \CTEX@part@indent \CTEX@part@format
+% \huge \bfseries #1\par}%
+ \CTEX@part@titleformat{#1}\par}%
+ \nobreak
+% \vskip 3ex
+ \vskip \CTEX@part@afterskip
+ \@afterheading}
+%</article>
+%<*book|report>
+\def\@spart#1{%
+ {\interlinepenalty \@M
+% \normalfont \centering
+ \normalfont \CTEX@part@format
+% \Huge \bfseries #1\par}%
+ \CTEX@part@titleformat{#1}\par}%
+ \@endpart}
+%</book|report>
+% \end{macrocode}
+% \end{macro}
+%
+% \paragraph{chapter 的标题}
+%
+% \begin{macrocode}
+%<*book|report>
+% \end{macrocode}
+%
+% \begin{macro}[internal]{\@chapter}
+% \begin{macrocode}
+\def\@chapter[#1]#2{%
+ \ifnum \c@secnumdepth >\m@ne
+%<book> \if@mainmatter
+ \refstepcounter{chapter}%
+% \typeout{\@chapapp\space\thechapter.}%
+ \typeout{\CTEXthechapter}%
+ \addcontentsline{toc}{chapter}
+% {\protect\numberline{\thechapter}#1}%
+ {\protect\numberline{\CTEXthechapter\hspace{0.3em}}#1}%
+%<book> \else
+%<book> \addcontentsline{toc}{chapter}{#1}%
+%<book> \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}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\@makechapterhead}
+% \begin{macrocode}
+\def\@makechapterhead#1{%
+ \thispagestyle{\CTEX@chapter@pagestyle}%
+% \vspace*{50\p@}%
+ \@tempskipa \CTEX@chapter@beforeskip \relax
+ \ifdim \@tempskipa <\z@
+ \@tempskipa -\@tempskipa \@afterindentfalse
+ \else
+ \@afterindenttrue
+ \fi
+ \vspace*{\@tempskipa}%
+% {\normalfont \parindent \z@ \raggedright
+ {\normalfont \parindent \CTEX@chapter@indent \CTEX@chapter@format
+ \ifnum \c@secnumdepth >\m@ne
+%<book> \if@mainmatter
+% \huge\bfseries\@chapapp\space\thechapter\par\nobreak\vskip 20\p@
+ \CTEX@chaptername
+%<book> \fi
+ \fi
+ \interlinepenalty\@M
+% \Huge \bfseries #1\par\nobreak
+ \CTEX@chapter@titleformat{#1}\par\nobreak
+% \vskip 40\p@
+ \vskip \CTEX@chapter@afterskip
+ }}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\@makeschapterhead}
+% \begin{macrocode}
+\def\@makeschapterhead#1{%
+ \thispagestyle{\CTEX@chapter@pagestyle}%
+% \vspace*{50\p@}%
+ \@tempskipa \CTEX@chapter@beforeskip \relax
+ \ifdim \@tempskipa <\z@
+ \@tempskipa -\@tempskipa \@afterindentfalse
+ \else
+ \@afterindenttrue
+ \fi
+ \vspace*{\@tempskipa}%
+% {\normalfont \parindent \z@ \raggedright
+ {\normalfont \parindent \CTEX@chapter@indent \CTEX@chapter@format
+ \interlinepenalty\@M
+% \Huge \bfseries #1\par\nobreak
+ \CTEX@chapter@titleformat{#1}\par\nobreak
+% \vskip 40\p@
+ \vskip \CTEX@chapter@afterskip
+ }}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</book|report>
+% \end{macrocode}
+%
+% \paragraph{section 类的标题}
+%
+% \begin{macro}[internal]{\@seccntformat}
+% \begin{macrocode}
+\def\@seccntformat#1{%
+ \@ifundefined{CTEX@#1name}%
+ {\csname the#1\endcsname\quad}%
+ {\csname CTEX@#1name\endcsname}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\@sect}
+% \begin{macrocode}
+\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 #8\@@par}%
+ \interlinepenalty \@M
+ \csname CTEX@#1@titleformat\endcsname{#8}\@@par}%
+ \endgroup
+ \csname #1mark\endcsname{#7}%
+ \addcontentsline{toc}{#1}{%
+ \ifnum #2>\c@secnumdepth \else
+% \protect\numberline{\csname the#1\endcsname}%
+ \protect\numberline{\@ifundefined{CTEXthe#1}%
+ {\csname the#1\endcsname}%
+ {\csname CTEXthe#1\endcsname}}%
+ \fi
+ #7}%
+ \else
+ \def\@svsechd{%
+ #6{\hskip #3\relax
+% \@svsec #8}%
+ \@svsec \csname CTEX@#1@titleformat\endcsname{#8}}%
+ \csname #1mark\endcsname{#7}%
+ \addcontentsline{toc}{#1}{%
+ \ifnum #2>\c@secnumdepth \else
+% \protect\numberline{\csname the#1\endcsname}%
+ \protect\numberline{\@ifundefined{CTEXthe#1}%
+ {\csname the#1\endcsname}%
+ {\csname CTEXthe#1\endcsname}}%
+ \fi
+ #7}}%
+ \fi
+ \@xsect{#5}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\@ssect}
+% \tn{@ssect} 并没有参数给出当前标题的名字,扩展它的参数会与 \pkg{hyperref} 冲突。
+% 它的第二个参数是 BEFORESKIP(\tn{@startsection} 的第四个参数),在定义中并没有
+% 被用到,应该可以用它来传递名字。我们这里通过函数 \tn{CTEX@titleformat@n} 来传递,
+% 它将在 |#4| 中被重定义为相应的 \opt{titleformat}。
+% \begin{macrocode}
+\def\@ssect#1#2#3#4#5{%
+ \@tempskipa #3\relax
+ \ifdim \@tempskipa>\z@
+ \begingroup
+ #4{%
+ \@hangfrom{\hskip #1}%
+% \interlinepenalty \@M #5\@@par}%
+ \interlinepenalty \@M
+ \CTEX@titleformat@n{#5}\@@par}%
+ \endgroup
+ \else
+% \def\@svsechd{#4{\hskip #1\relax #5}}%
+ \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}}}%
+ \fi
+ \@xsect{#3}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%<@@=ctex>
+% \end{macrocode}
+%
+% \begin{macro}[internal]{\CTEX@set@titleformat@n, \CTEX@titleformat@n}
+% 在 \tn{@startsection} 中设置 \tn{CTEX@titleformat@n} 为相应函数。
+% \begin{macrocode}
+\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
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\int_zero:N \l_@@_tmp_int
+\clist_map_inline:nn
+ { section , subsection , subsubsection , paragraph , subparagraph }
+ {
+ \int_incr:N \l_@@_tmp_int
+ \cs_gset_protected_nopar:cpx {#1}
+ {
+ \exp_not:N \@startsection {#1}
+ { \int_use:N \l_@@_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 }
+ }
+ }
+ }
+% \end{macrocode}
+%
+%
+% \paragraph{附录标题}
+%
+% \begin{macrocode}
+\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
+ }
+% \end{macrocode}
+%
+% \begin{macro}[internal]{\appendix}
+% \begin{macrocode}
+\cs_new_eq:NN \CTEX@save@appendix \appendix
+\cs_gset_protected_nopar:Npn \appendix
+ {
+ \CTEX@save@appendix
+%<*article>
+ \gdef \CTEX@presection { \CTEX@preappendix }
+ \gdef \CTEX@thesection { \CTEX@appendixnumber }
+ \gdef \CTEX@postsection { \CTEX@postappendix }
+%</article>
+%<*book|report>
+ \gdef \CTEX@prechapter { \CTEX@preappendix }
+ \gdef \CTEX@thechapter { \CTEX@appendixnumber }
+ \gdef \CTEX@postchapter { \CTEX@postappendix }
+%</book|report>
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{目录标签的宽度}
+%
+% \begin{macro}[internal]{\numberline}
+% \begin{macrocode}
+\cs_new_protected:Npn \CTEX@toc@width@n #1
+ {
+ \hbox_set:Nn \l_@@_tmp_box {#1}
+ \dim_set:Nn \@tempdima
+ {
+ \dim_max:nn { \@tempdima }
+ { \box_wd:N \l_@@_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
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{页眉信息的修改}
+%
+% \begin{macro}[internal]{\ps@headings}
+% \begin{macrocode}
+%<*article>
+\ctex_patch_cmd:Nnn \ps@headings { \thesection } { \CTEXthesection }
+\if@twoside
+ \ctex_patch_cmd:Nnn \ps@headings { \thesubsection } { \CTEXthesubsection }
+\fi:
+%</article>
+%<*book|report>
+\ctex_patch_cmd:Nnn \ps@headings
+ { \@chapapp\ \thechapter.~\ } { \CTEXthechapter \quad }
+\if@twoside
+ \ctex_patch_cmd:Nnn \ps@headings { \thesection.~\ } { \CTEXthesection \quad }
+\fi:
+%</book|report>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}[internal]{\ps@fancy}
+% 这里对 \pkg{fancyhdr} 宏包打补丁。原来 \pkg{fancyhdr} 宏包中使用
+% \tn{thesection} 等宏表示页眉中的章节编号,这里改用 \pkg{ctex} 包所用的
+% \tn{CTEXthesection} 系列宏。
+% \begin{macrocode}
+\ctex_at_end_package:nn { fancyhdr }
+ {
+%<*article>
+ \ctex_patch_cmd:Nnn \ps@fancy
+ { \thesection \hskip 1em \relax } { \CTEXthesection \quad }
+ \ctex_patch_cmd:Nnn \ps@fancy
+ { \thesubsection \hskip 1em \relax } { \CTEXthesubsection \quad }
+%</article>
+%<*book|report>
+ \ctex_patch_cmd:Nnn \ps@fancy
+%<book> { \@chapapp\ \thechapter.~\ } { \if@mainmatter \CTEXthechapter \quad \fi }
+%<report> { \@chapapp\ \thechapter.~\ } { \CTEXthechapter \quad }
+ \ctex_patch_cmd:Nnn \ps@fancy
+ { \thesection.~\ } { \CTEXthesection \quad }
+%</book|report>
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{标签引用数字的汉化}
+%
+% \begin{macro}[internal]{\refstepcounter}
+% 对标题进行引用时,设置标签为通过 \opt{number} 选项设置的形式。
+% \begin{macrocode}
+\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 } }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_varioref_hook:}
+% 关于标签引用的宏包可能会修改 \tn{refstepcounter}。其中 \pkg{cleveref} 和
+% \pkg{hyperref} 宏包都会保存之前的定义,并且它们都要求尽可能晚的被载入,所以
+% 对我们上述的修改影响不大。需要注意的是 \pkg{varioref} 宏包,如果它在
+% \CTeX{} 之后被载入,我们之前的修改将会被覆盖。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ctex_varioref_hook:
+ {
+ \seq_map_inline:Nn \c_@@_headings_seq
+ { \ctex_fix_varioref_label:n { ##1 } }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\@@_fix_varioref_label:n}
+% \pkg{varioref} 宏包的 \tn{labelformat} 实际上是定义一个以 |\the<#1>| 为参数的宏
+% |\p@<#1>|。\LaTeX{} 在定义计数器 |<#1>| 时,都会将 |\p@<#1>| 初始化为 \tn{@empty}。
+% 如果这个宏非空,说明用户自定义了标签格式,我们就不再修改。这里不能使用
+% \cs{exp_args:Nnc},因为 \texttt{c} 这种展开格式不会将参数放在花括号内。而
+% \tn{labelformat} 的定义是
+% \begin{verbatim}
+% \def\labelformat#1{\expandafter\def\csname p@#1\endcsname##1}
+% \end{verbatim}
+% 它的第二个参数必须放在花括号内,否则将会被作为宏的定界符号。
+% \begin{macrocode}
+\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: } }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% 如果 \pkg{varioref} 已经被载入,则使用它来设置。
+% \begin{macrocode}
+\@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: }
+ }
+% \end{macrocode}
+%
+% \subsubsection{载入 \meta{scheme} 文件}
+%
+% \begin{macrocode}
+\ctex_scheme_input:o { \l_@@_scheme_tl }
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</class|heading>
+% \end{macrocode}
+%
+% \subsubsection{标题格式的 \opt{scheme} 定义}
+%
+% 下面使用 \CTeX 文档类的设置方式,\opt{plain} 模拟标准文档类直接定义或以
+% \tn{@startsection} 设定的章节标题格式,\opt{chinese} 汉化的标题格式。
+%
+% \begin{macrocode}
+%<*scheme&(article|book|report)>
+% \end{macrocode}
+%
+% \begin{macrocode}
+\keys_set:nn { ctex / part }
+ {
+%<*plain>
+ name = \partname \space ,
+ number = \thepart ,
+%</plain>
+%<*article>
+ nameformat = \Large \bfseries ,
+ afterskip = 3ex ,
+%<*plain>
+ format = \raggedright ,
+ aftername = \par \nobreak ,
+ titleformat = \huge \bfseries ,
+ beforeskip = -4ex
+%</plain>
+%<*chinese>
+ number = \chinese { part } ,
+ format = \centering ,
+ aftername = \quad ,
+ titleformat = \Large \bfseries ,
+ beforeskip = 4ex
+%</chinese>
+%</article>
+%<*book|report>
+ format = \centering ,
+ nameformat = \huge \bfseries ,
+ aftername = \par \vskip 20 \p@ ,
+ pagestyle = plain ,
+%<*plain>
+ titleformat = \Huge \bfseries
+%</plain>
+%<*chinese>
+ titleformat = \huge \bfseries
+%</chinese>
+%</book|report>
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*book|report>
+\keys_set:nn { ctex / chapter }
+ {
+ pagestyle = plain ,
+ nameformat = \huge \bfseries ,
+ afterskip = 40 \p@ ,
+%<*plain>
+ name = \chaptername \space ,
+ number = \thechapter ,
+ format = \raggedright ,
+ aftername = \par \nobreak \vskip 20 \p@ ,
+ titleformat = \Huge \bfseries ,
+ beforeskip = -50 \p@
+%</plain>
+%<*chinese>
+ number = \chinese { chapter } ,
+ format = \centering ,
+ aftername = \quad ,
+ titleformat = \huge \bfseries ,
+ beforeskip = 50 \p@
+%</chinese>
+ }
+%</book|report>
+% \end{macrocode}
+%
+% \begin{macrocode}
+\keys_set:nn { ctex / section }
+ {
+ number = \thesection ,
+ aftername = \quad ,
+ afterskip = 2.3ex \@plus .2ex ,
+%<*plain>
+ format = \Large \bfseries ,
+ beforeskip = -3.5ex \@plus -1ex \@minus -.2ex
+%</plain>
+%<*chinese>
+ format = \Large \bfseries \centering ,
+ beforeskip = 3.5ex \@plus 1ex \@minus .2ex
+%</chinese>
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\keys_set:nn { ctex / subsection }
+ {
+ number = \thesubsection ,
+ format = \large \bfseries ,
+ aftername = \quad ,
+ afterskip = 1.5ex \@plus .2ex ,
+%<*plain>
+ beforeskip = -3.25ex \@plus -1ex \@minus -.2ex
+%</plain>
+%<*chinese>
+ beforeskip = 3.25ex \@plus 1ex \@minus .2ex
+%</chinese>
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\keys_set:nn { ctex / subsubsection }
+ {
+ number = \thesubsubsection ,
+ format = \normalsize \bfseries ,
+ aftername = \quad ,
+ afterskip = 1.5ex \@plus .2ex ,
+%<*plain>
+ beforeskip = -3.25ex \@plus -1ex \@minus -.2ex
+%</plain>
+%<*chinese>
+ beforeskip = 3.25ex \@plus 1ex \@minus .2ex
+%</chinese>
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\keys_set:nn { ctex / paragraph }
+ {
+ number = \theparagraph ,
+ format = \normalsize \bfseries ,
+ aftername = \quad
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\keys_set:nn { ctex / subparagraph }
+ {
+ number = \thesubparagraph ,
+ format = \normalsize \bfseries ,
+ aftername = \quad
+ }
+% \end{macrocode}
+%
+% 处理 \opt{sub3section} 与 \opt{sub4section} 的格式。
+% \begin{macrocode}
+\int_compare:nNnTF \g_@@_section_depth_flag > \c_two
+ {
+ \keys_set:nn { ctex / paragraph }
+ {
+%<*plain>
+ beforeskip = -3.25ex \@plus -1ex \@minus -.2ex ,
+%</plain>
+%<*chinese>
+ beforeskip = 3.25ex \@plus 1ex \@minus .2ex ,
+%</chinese>
+ afterskip = 1ex \@plus .2ex
+ }
+ }
+ {
+ \keys_set:nn { ctex / paragraph }
+ {
+ beforeskip = 3.25ex \@plus 1ex \@minus .2ex ,
+ afterskip = -1em
+ }
+ }
+\int_compare:nNnTF \g_@@_section_depth_flag > \c_three
+ {
+ \keys_set:nn { ctex / subparagraph }
+ {
+%<*plain>
+ beforeskip = -3.25ex \@plus -1ex \@minus -.2ex ,
+%</plain>
+%<*chinese>
+ beforeskip = 3.25ex \@plus 1ex \@minus .2ex ,
+%</chinese>
+ afterskip = 1ex \@plus .2ex
+ }
+ }
+ {
+ \keys_set:nn { ctex / subparagraph }
+ {
+ beforeskip = 3.25ex \@plus 1ex \@minus .2ex ,
+ afterskip = -1em
+ }
+ }
+\int_compare:nNnTF \g_@@_section_depth_flag > \c_two
+ { \keys_set:nn { ctex / subparagraph } { indent = \c_zero_dim } }
+ { \keys_set:nn { ctex / subparagraph } { indent = \parindent } }
+% \end{macrocode}
+%
+% 处理附录的格式。
+% \begin{macrocode}
+\keys_set:nn { ctex / appendix }
+%<*article>
+ { number = \@Alph \c@section }
+%</article>
+%<*book|report>
+ {
+ name = \appendixname \space ,
+ number = \@Alph \c@chapter
+ }
+%</book|report>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</scheme&(article|book|report)>
+% \end{macrocode}
+%
+% \subsubsection{\pkg{ctex.sty} 的 \opt{heading} 选项}
+%
+% \begin{macrocode}
+%<*style>
+% \end{macrocode}
+%
+% \begin{macrocode}
+\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_@@_heading_bool
+ {
+ \clist_map_inline:nn { article , book , report }
+ {
+ \@ifclassloaded {#1}
+ { \clist_map_break:n { \tl_const:Nn \c_@@_class_tl {#1} } } { }
+ }
+ \tl_if_exist:NF \c_@@_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_@@_class_tl { book }
+ }
+ { \tl_const:Nn \c_@@_class_tl { article } }
+ \msg_warning:nnx { ctex } { not-standard-class } { \c_@@_class_tl }
+ }
+ \ctex_file_input:n { ctex- \c_@@_class_tl .def }
+ }
+ { \ctex_scheme_input:o { \l_@@_scheme_tl } }
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</style>
+% \end{macrocode}
+%
+% \subsubsection{标题配置文件}
+%
+% \begin{macrocode}
+%<*UTF8|GBK>
+% \end{macrocode}
+%
+% \begin{macrocode}
+\keys_set:nn { ctex }
+ {
+ contentsname = 目录 ,
+ listfigurename = 插图 ,
+ listtablename = 表格 ,
+ figurename = 图 ,
+ tablename = 表 ,
+ abstractname = 摘要 ,
+ indexname = 索引 ,
+ bibname = 参考文献 ,
+ appendixname = 附录
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\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{macrocode}
+%
+% \begin{macrocode}
+%</UTF8|GBK>
+% \end{macrocode}
+%
+% \subsection{\opt{chinese} 方案的其他设置}
+%
+% \begin{macrocode}
+%<*scheme&chinese>
+% \end{macrocode}
+%
+% \opt{chinese} 在标准文档类下的页面格式总采用 \texttt{headings}。
+% \begin{macrocode}
+%<article|book|report>\pagestyle { headings }
+% \end{macrocode}
+%
+% 汉化标题名字。
+% \begin{macrocode}
+\str_if_eq:onTF { \l_@@_encoding_tl } { GBK }
+ { \ctex_file_input:n { ctex-name-gbk.cfg } }
+ { \ctex_file_input:n { ctex-name-utf8.cfg } }
+% \end{macrocode}
+%
+% 日期格式。
+% \begin{macrocode}
+\keys_set:nn { ctex } { today = small }
+% \end{macrocode}
+%
+% 若用户未设置宏包选项 \opt{zihao},则设置 \tn{normalsize} 为五号字。
+% \begin{macrocode}
+\int_compare:nNnF \g_@@_font_size_flag > \c_minus_one
+ { \cs_gset_eq:NN \g_@@_font_size_flag \c_zero }
+% \end{macrocode}
+%
+% 若用户未设置宏包选项 \opt{linespread},则设置行距初始值为 $1.3\times 1.2=1.56$
+% 倍字体大小。
+% \begin{macrocode}
+\fp_compare:nNnT { \l_@@_line_spread_fp } ? { \c_zero_fp }
+ { \keys_set:nn { ctex / option } { linespread = 1.3 } }
+% \end{macrocode}
+%
+% 若用户未设置宏包选项 \opt{autoindent},则自动调整首行缩进。
+% \begin{macrocode}
+\ctex_if_autoindent_touched:F
+ { \keys_set:nn { ctex } { autoindent = true } }
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</scheme&chinese>
+% \end{macrocode}
+%
+% \subsection{中文字号}
+%
+% \begin{macrocode}
+%<*class|style|ctexsize>
+% \end{macrocode}
+%
+% \changes{v2.0}{2014/03/08}{将中文字号功能提取到可以独立使用的 \pkg{ctexsize}。}
+%
+% \begin{macro}{\zihao}
+% \begin{macrocode}
+\NewDocumentCommand \zihao { m }
+ { \exp_args:Nx \ctex_zihao:n {#1} \tex_ignorespaces:D }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_zihao:n}
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ctex_zihao:n #1
+ {
+ \prop_get:NnNTF \c_@@_font_size_prop {#1} \l_@@_font_size_tl
+ { \exp_after:wN \fontsize \l_@@_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_@@_font_size_seq { ~and~ } { ,~ } { ,~and~ }.
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{定义中文字号}
+%
+% \changes{v2.0}{2014/03/08}{中文字号不再采用近似值。}
+%
+% \begin{variable}[internal]{\c_@@_font_size_prop}
+% \begin{macro}[aux]{\@@_save_font_size:nn}
+% 基础行距是字号的 $1.2$ 倍,采用 \hologo{eTeX} 的 scaling 运算得到的结果
+% 要比简单的 |1.2\dimexpr| 精确^^A
+% \footnote{\url{http://thread.gmane.org/gmane.comp.tex.latex.latex3/3190}}。
+% \begin{macrocode}
+\prop_new:N \c_@@_font_size_prop
+\seq_new:N \c_@@_font_size_seq
+\cs_new_protected_nopar:Npn \@@_save_font_size:nn #1#2
+ {
+ \use:x
+ {
+ \prop_gput:Nnn \exp_not:N \c_@@_font_size_prop {#1}
+ {
+ { \dim_to_decimal:n {#2} }
+ { \dim_to_decimal:n { (#2) * \c_six / \c_five } }
+ }
+ }
+ \seq_gput_right:Nn \c_@@_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 }
+ }
+ { \@@_save_font_size:nn #1 }
+% \end{macrocode}
+% \end{macro}
+% \end{variable}
+%
+% \begin{macro}[internal]{\ctex_declare_math_sizes:nnnn}
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ctex_declare_math_sizes:nnnn #1#2#3#4
+ {
+ \@@_get_font_sizes:Nn \l_@@_font_size_tl { {#1} {#2} {#3} {#4} }
+ \exp_after:wN \DeclareMathSizes \l_@@_font_size_tl
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[aux]{\@@_get_font_sizes:Nn}
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \@@_get_font_sizes:Nn #1#2
+ {
+ \tl_clear:N #1
+ \tl_map_inline:nn {#2}
+ {
+ \prop_get:NnNTF \c_@@_font_size_prop {##1} \l_@@_tmp_tl
+ { \tl_put_right:Nx #1 { { \tl_head:N \l_@@_tmp_tl } } }
+ { \tl_put_right:Nx #1 { { \dim_to_decimal:n { ##1 } } } }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\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 }
+% \end{macrocode}
+%
+% \subsubsection{修改默认字号大小}
+%
+% \begin{macro}[internal]{\ctex_set_font_size:Nnn}
+% \begin{macrocode}
+\cs_new_protected:Npn \ctex_set_font_size:Nnn #1#2#3
+ {
+ \prop_get:NnNTF \c_@@_font_size_prop {#2} \l_@@_font_size_tl
+ { \exp_after:wN \@@_set_font_size:nnNn \l_@@_font_size_tl #1 {#3} }
+ { \msg_error:nnn { ctex } { fontsize } {#2} }
+ }
+\cs_new_protected:Npn \@@_set_font_size:nnNn #1#2#3#4
+ { \cs_set_protected_nopar:Npn #3 { \@setfontsize #3 {#1} {#2} #4 } }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\if_case:w \g_@@_font_size_flag
+ \ctex_file_input:n { ctex-c5size.clo }
+\or:
+ \ctex_file_input:n { ctex-cs4size.clo }
+\fi:
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</class|style|ctexsize>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*c5size>
+\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 } { }
+%</c5size>
+%<*cs4size>
+\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 } { }
+%</cs4size>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<ctexsize>\normalsize
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*class|style>
+% \end{macrocode}
+%
+% \subsection{更新行距}
+%
+% \cs{l_@@_line_spread_fp} 被设置了才有必要更新行距和 \tn{footnotesep}。
+% \begin{macrocode}
+\fp_compare:nNnF { \l_@@_line_spread_fp } ? { \c_zero_fp }
+ {
+ \linespread { \fp_use:N \l_@@_line_spread_fp }
+% \end{macrocode}
+%
+% \changes{v2.0}{2014/04/23}{调整 \tn{footnotesep} 的大小,以适合行距的变化。}
+%
+% \begin{variable}[internal]{\footnotesep}
+% 我们调整了行距,可能导致脚注的间距与行距不协调,需要调整 \tn{footnotesep}。标准
+% 文档类对 \tn{footnotesep} 的设置是,字体大小为 \tn{footnotesize} 时 \tn{strutbox}
+% 的高度(默认值是 |.7\baselineskip|)。我们沿用这个设置方法,只需要更新具体的大小。
+% \begin{macrocode}
+ \group_begin: \footnotesize \exp_args:NNNo \group_end:
+ \dim_set:Nn \footnotesep { \dim_use:N \box_ht:N \strutbox }
+ }
+% \end{macrocode}
+% \end{variable}
+%
+% 激活默认字体大小,更新行距、\tn{parindent} 和 \tn{CJKglue}。
+% \begin{macrocode}
+\normalsize
+% \end{macrocode}
+%
+% \subsection{其它功能}
+%
+% \begin{macro}{\CTeX}
+% \file{ctex-faq.sty} 中的定义是
+% \begin{verbatim}
+% \DeclareRobustCommand\CTeX{$\mathbb{C}$\kern-.05em\TeX}
+% \end{verbatim}
+% 然而 \tn{mathbb} 未必有定义,这里就不采用它了,只定义最简单的形式。
+% 同 \pkg{hologo} 宏包的设置类似,\CTeX{} 可以用在 \tn{csname} 和 PDF 书签中。
+% \begin{macrocode}
+\NewDocumentCommand \CTeX { }
+ { \ifincsname CTeX \else: C \TeX \fi: }
+\AtBeginDocument
+ {
+ \cs_if_exist_use:NT \pdfstringdefDisableCommands
+ { { \tl_set:Nn \CTeX { CTeX } } }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v2.0}{2014/03/28}{\opt{captiondelimiter} 是过时选项。}
+% \begin{macro}[internal]{captiondelimiter}
+% 过时选项。
+% \begin{macrocode}
+\keys_define:nn { ctex }
+ {
+ captiondelimiter .code:n =
+ {
+ \msg_warning:nnn { ctex } { deprecated-option }
+ { You~can~load~the~package~`caption'~to~get~its~functionality. }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</class|style>
+% \end{macrocode}
+%
+% \subsubsection{列表环境的缩进}
+%
+% \begin{macro}[internal]{\verse,\quotation}
+% 只在使用文档类的时候修改诗歌和引用环境的缩进。
+% \begin{macrocode}
+%<*scheme&!generic&chinese>
+\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 }
+%</scheme&!generic&chinese>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%<*class|style>
+% \end{macrocode}
+%
+% \subsubsection{其他兼容性修改}
+%
+% \begin{macro}[internal]{\end}
+% \changes{v2.0}{2014/03/09}
+% {解决 \pkg{etoolbox} 与 \pkg{breqn} 关于 \tn{end} 的冲突。}
+% \pkg{breqn} 宏包对 \tn{end} 作了如下处理,然而这个处理并不保险。
+% \begin{verbatim}
+% \def\@tempa#1\endcsname#2\@nil{\def\latex@end##1{#2}}
+% \expandafter\@tempa\end{#1}\@nil
+% \def\end#1{\csname end#1\endcsname \latex@end{#1}}%
+% \end{verbatim}
+% \pkg{etoolbox} 在 \tn{end} 定义中的 \tn{csname} 前加入
+% 钩子 |\csuse{@end@#1@hook}|。如果 \pkg{etoolbox} 先于 \pkg{breqn} 被载入(这
+% 在使用 \cls{ctexart} 等文档类时几乎是必然的),|\csuse{@end@#1@hook}| 将会被
+% 忽略,即 \tn{AtEndEnvironment} 失效。如果交换两个宏包的载入顺序,则
+% \pkg{etoolbox} 会给出警告:\tn{AfterEndEnvironment} 失效,我们不打算处理这种
+% 情况。
+% \begin{macrocode}
+\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
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{载入中文字体}
+%
+% \begin{macro}[internal]{\ctex_fontset_error:n}
+% 字库不可用时给出紧急错误信息,停止读取定义文件。
+% \begin{macrocode}
+\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. }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ctex_load_fontset:}
+% 如果用户没有指定字体,则探测操作系统,载入相应的字体配置。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ctex_load_fontset:
+ {
+ \tl_if_empty:NTF \g_@@_fontset_tl
+ {
+ \ctex_detected_platform:
+ \ctex_file_input:n { ctex-fontset- \g_@@_fontset_tl .def }
+ }
+ {
+ \file_if_exist:nTF { ctex-fontset- \g_@@_fontset_tl .def }
+ { \ctex_file_input:n { ctex-fontset- \g_@@_fontset_tl .def } }
+ {
+ \use:x
+ {
+ \ctex_detected_platform:
+ \msg_error:nnxx { ctex } { fontset-not-found }
+ { \g_@@_fontset_tl } { \exp_not:N \g_@@_fontset_tl }
+ }
+ \ctex_file_input:n { ctex-fontset- \g_@@_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. }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{fontset}
+% 在导言区通过 \tn{ctexset} 载入中文字库的选项。
+% \begin{macrocode}
+\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_@@_fontset_tl } { none }
+ {
+ \tl_gset:Nx \g_@@_fontset_tl {#1}
+ \ctex_load_fontset:
+ }
+ {
+ \msg_error:nnxx { ctex } { fontset-loaded }
+ { \g_@@_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.
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% 载入中文字库。
+% \begin{macrocode}
+\str_if_eq:onF { \g_@@_fontset_tl } { none }
+ { \ctex_load_fontset: }
+% \end{macrocode}
+%
+% \subsection{宏包配置文件}
+%
+% \subsubsection{\pkg{ctex.cfg}}
+%
+% \begin{macrocode}
+\ctex_at_end:n { \ctex_file_input:n { ctex.cfg } }
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</class|style>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*config>
+%%
+%</config>
+% \end{macrocode}
+%
+% \subsubsection{\pkg{ctexopts.cfg}}
+%
+% 这里仅为配置文件示例:使用 Windows Vista 或以后版本的字体设置。
+% \begin{macrocode}
+%<*ctexopts>
+%%
+%% \keys_set:nn { ctex / option } { fontset = windowsnew }
+%</ctexopts>
+% \end{macrocode}
+%
+% \subsection{字体定义文件}
+%
+% \subsubsection{传统定义方式}
+%
+% \begin{macrocode}
+%<*c19|c70>
+%%
+%% Chinese characters
+%%
+%<c19>%% character set: GBK (extension of GB 2312)
+%<c70>%% character set: Unicode
+%% font encoding: Unicode
+%%
+%</c19|c70>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<rm&c19>\DeclareFontFamily{C19}{rm}{\hyphenchar\font\m@ne}
+%<rm&c70>\DeclareFontFamily{C70}{rm}{\hyphenchar\font\m@ne}
+%<sf&c19>\DeclareFontFamily{C19}{sf}{\hyphenchar\font\m@ne}
+%<sf&c70>\DeclareFontFamily{C70}{sf}{\hyphenchar\font\m@ne}
+%<tt&c19>\DeclareFontFamily{C19}{tt}{\hyphenchar\font\m@ne}
+%<tt&c70>\DeclareFontFamily{C70}{tt}{\hyphenchar\font\m@ne}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*rm>
+%<*c19>
+\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}
+%</c19>
+%<*c70>
+\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}
+%</c70>
+%</rm>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*sf>
+%<*c19>
+\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}{\CJKnormal}
+\DeclareFontShape{C19}{sf}{b}{sl}{<-> CJKb * gbkyousl}{\CJKbold}
+\DeclareFontShape{C19}{sf}{bx}{sl}{<-> CJKb * gbkyousl}{\CJKbold}
+\DeclareFontShape{C19}{sf}{m}{it}{<-> CJK * gbkyou}{\CJKnormal}
+\DeclareFontShape{C19}{sf}{b}{it}{<-> CJKb * gbkyou}{\CJKbold}
+\DeclareFontShape{C19}{sf}{bx}{it}{<-> CJKb * gbkyou}{\CJKbold}
+%</c19>
+%<*c70>
+\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}{\CJKnormal}
+\DeclareFontShape{C70}{sf}{b}{sl}{<-> CJKb * uniyousl}{\CJKbold}
+\DeclareFontShape{C70}{sf}{bx}{sl}{<-> CJKb * uniyousl}{\CJKbold}
+\DeclareFontShape{C70}{sf}{m}{it}{<-> CJK * uniyou}{\CJKnormal}
+\DeclareFontShape{C70}{sf}{b}{it}{<-> CJKb * uniyou}{\CJKbold}
+\DeclareFontShape{C70}{sf}{bx}{it}{<-> CJKb * uniyou}{\CJKbold}
+%</c70>
+%</sf>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*tt>
+%<*c19>
+\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}{\CJKnormal}
+\DeclareFontShape{C19}{tt}{b}{sl}{<-> CJKb * gbkfssl}{\CJKbold}
+\DeclareFontShape{C19}{tt}{bx}{sl}{<-> CJKb * gbkfssl}{\CJKbold}
+\DeclareFontShape{C19}{tt}{m}{it}{<-> CJK * gbkfs}{\CJKnormal}
+\DeclareFontShape{C19}{tt}{b}{it}{<-> CJKb * gbkfs}{\CJKbold}
+\DeclareFontShape{C19}{tt}{bx}{it}{<-> CJKb * gbkfs}{\CJKbold}
+%</c19>
+%<*c70>
+\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}{\CJKnormal}
+\DeclareFontShape{C70}{tt}{b}{sl}{<-> CJKb * unifssl}{\CJKbold}
+\DeclareFontShape{C70}{tt}{bx}{sl}{<-> CJKb * unifssl}{\CJKbold}
+\DeclareFontShape{C70}{tt}{m}{it}{<-> CJK * unifs}{\CJKnormal}
+\DeclareFontShape{C70}{tt}{b}{it}{<-> CJKb * unifs}{\CJKbold}
+\DeclareFontShape{C70}{tt}{bx}{it}{<-> CJKb * unifs}{\CJKbold}
+%</c70>
+%</tt>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*fontset>
+% \end{macrocode}
+%
+% \subsubsection{\pkg{ctex-fontset-windows.def},
+% \pkg{ctex-fontset-windowsnew.def}, \pkg{ctex-fontset-windowsold.def}}
+%
+% \pkg{ctex} 包利用 \path{C:\boot.ini} 文件的存在性来判断是否使用 Windows XP
+% 及以前的版本,分别载入新旧字体设置。
+% \begin{macrocode}
+%<*windows>
+\file_if_exist:nTF { C:/boot.ini }
+ { \ctex_file_input:n { ctex-fontset-windowsold.def } }
+ { \ctex_file_input:n { ctex-fontset-windowsnew.def } }
+%</windows>
+% \end{macrocode}
+%
+% 旧的 Windows 字体设置使用黑体作为无衬线体,楷体和仿宋是 GB2312 编码;新的
+% Windows 字体设置使用微软雅黑作为无衬线体,楷体和仿宋是大字库。
+% \begin{macrocode}
+%<*windowsnew,windowsold>
+\pdftex_if_engine:TF
+ {
+ \ctex_zhmap_case:nnn
+ {
+ \ctex_punct_set:n { windows }
+ \setCJKmainfont
+ [ BoldFont = simhei.ttf , ItalicFont = simkai.ttf ] { simsun.ttc }
+%<*windowsold>
+ \setCJKsansfont { simhei.ttf }
+ \ctex_punct_map_family:nn { \CJKsfdefault } { zhhei }
+%</windowsold>
+% \end{macrocode}
+% Windows 8 以后,微软雅黑由原来的 \file{.ttf} 后缀改为 \file{.ttc} 后缀,需要
+% 加以区分。
+% \begin{macrocode}
+%<*windowsnew>
+ \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 }
+%</windowsnew>
+ \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 }
+ }
+ }
+ {
+%<*windowsold>
+ \setCJKmainfont
+ [ BoldFont = SimHei , ItalicFont = KaiTi_GB2312 ] { SimSun }
+ \setCJKsansfont { SimHei }
+ \setCJKmonofont { FangSong_GB2312 }
+ \setCJKfamilyfont { zhkai } { KaiTi_GB2312 }
+ \setCJKfamilyfont { zhfs } { FangSong_GB2312 }
+%</windowsold>
+%<*windowsnew>
+ \setCJKmainfont
+ [ BoldFont = SimHei , ItalicFont = KaiTi ] { SimSun }
+ \setCJKsansfont
+ [ BoldFont = { *~Bold } ] { Microsoft~YaHei }
+ \setCJKmonofont { FangSong }
+ \setCJKfamilyfont { zhkai } { KaiTi }
+ \setCJKfamilyfont { zhfs } { FangSong }
+%</windowsnew>
+ \setCJKfamilyfont { zhsong } { SimSun }
+ \setCJKfamilyfont { zhhei } { SimHei }
+ \setCJKfamilyfont { zhli } { LiSu }
+ \setCJKfamilyfont { zhyou } { YouYuan }
+%<*windowsnew>
+ \setCJKfamilyfont { zhyahei }
+ [ BoldFont = { *~Bold } ] { Microsoft~YaHei }
+%</windowsnew>
+ }
+%</windowsnew,windowsold>
+% \end{macrocode}
+%
+% \subsubsection{\pkg{ctex-fontset-adobe.def}}
+%
+% \begin{macrocode}
+%<*adobe>
+% \end{macrocode}
+%
+% \tn{pdfmapline} 不支持 OpenType 字体,因而 \opt{adobe} 字体集在 pdf 模式下
+% 就没有定义。\opt{fandol} 的情况类似。
+% \begin{macrocode}
+\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 }
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</adobe>
+%<*fandol>
+% \end{macrocode}
+%
+% \subsubsection{\pkg{ctex-fontset-fandol.def}}
+%
+% \begin{macrocode}
+\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 }
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</fandol>
+%<*mac>
+% \end{macrocode}
+%
+% \subsubsection{\pkg{ctex-fontset-mac.def}}
+%
+% OS X Mavericks (10.9) 预装的主要简体中文字体如下^^A
+% \footnote{\url{http://support.apple.com/kb/HT5944}}:
+% \begin{verbatim}
+% /Library/Fonts/Baoli.ttc: 报隶-简,Baoli SC:style=Regular
+% /Library/Fonts/Hannotate.ttc: 手札体-简,Hannotate SC:style=Bold
+% /Library/Fonts/Hannotate.ttc: 手札体-简,Hannotate SC:style=Regular
+% /Library/Fonts/Hanzipen.ttc: 翩翩体-简,HanziPen SC:style=Bold
+% /Library/Fonts/Hanzipen.ttc: 翩翩体-简,HanziPen SC:style=Regular
+% /Library/Fonts/Hei.ttf: Hei
+% /Library/Fonts/Hiragino Sans GB W3.otf: 冬青黑体简体中文 W3,Hiragino Sans GB W3
+% /Library/Fonts/Hiragino Sans GB W6.otf: 冬青黑体简体中文 W6,Hiragino Sans GB W6
+% /Library/Fonts/Kai.ttf: Kai
+% /Library/Fonts/Kaiti.ttc: STKaiti
+% /Library/Fonts/Kaiti.ttc: 楷体-简,Kaiti SC:style=Black
+% /Library/Fonts/Kaiti.ttc: 楷体-简,Kaiti SC:style=Bold
+% /Library/Fonts/Kaiti.ttc: 楷体-简,Kaiti SC:style=Regular
+% /Library/Fonts/Lantinghei.ttc: 兰亭黑-简,Lantinghei SC:style=Demibold
+% /Library/Fonts/Lantinghei.ttc: 兰亭黑-简,Lantinghei SC:style=Heavy
+% /Library/Fonts/Lantinghei.ttc: 兰亭黑-简,Lantinghei SC:style=Extralight
+% /Library/Fonts/Libian.ttc: 隶变-简,Libian SC
+% /Library/Fonts/Songti.ttc: STSong
+% /Library/Fonts/Songti.ttc: 宋体-简,Songti SC:style=Black
+% /Library/Fonts/Songti.ttc: 宋体-简,Songti SC:style=Bold
+% /Library/Fonts/Songti.ttc: 宋体-简,Songti SC:style=Light
+% /Library/Fonts/Songti.ttc: 宋体-简,Songti SC:style=Regular
+% /Library/Fonts/WawaSC-Regular.otf: 娃娃体-简,Wawati SC
+% /Library/Fonts/WeibeiSC-Bold.otf: 魏碑-简,Weibei SC
+% /Library/Fonts/Xingkai.ttc: 行楷-简,Xingkai SC:style=Bold
+% /Library/Fonts/Xingkai.ttc: 行楷-简,Xingkai SC:style=Light
+% /Library/Fonts/Yuanti.ttc: 圆体-简,Yuanti SC:style=Bold
+% /Library/Fonts/Yuanti.ttc: 圆体-简,Yuanti SC:style=Light
+% /Library/Fonts/Yuanti.ttc: 圆体-简,Yuanti SC:style=Regular
+% /Library/Fonts/YuppySC-Regular.otf: 雅痞-简,Yuppy SC
+% /Library/Fonts/华文仿宋.ttf: STFangsong
+% /Library/Fonts/华文细黑.ttf: STHeiti:style=Light
+% /Library/Fonts/华文黑体.ttf: STHeiti:style=Regular
+% /System/Library/Fonts/STHeiti Light.ttc: 黑体-简,Heiti SC:style=Light
+% /System/Library/Fonts/STHeiti Medium.ttc: 黑体-简,Heiti SC:style=Medium
+% \end{verbatim}
+% 在 \dvipdfmx{} 下,可以通过下述方式使用华文宋体和华文楷体:
+% \begin{verbatim}
+% \special{pdf:mapline unisong@Unicode@ unicode :4:Songti.ttc}
+% \special{pdf:mapline unikai@Unicode@ unicode :4:Kaiti.ttc}
+% \end{verbatim}
+% 而 \tn{pdfmapline} 似乎不支持带索引的 \texttt{ttc} 字体,\file{Songti.ttc} 默认
+% 使用的是 Songti SC Black,\file{Kaiti.ttc} 默认使用的是 Kaiti SC Black。
+% 华文黑体不能通过这种方式使用:
+% \begin{verbatim}
+% \special{pdf:mapline unihei@Unicode@ unicode \detokenize{华文黑体}.ttf}
+% \end{verbatim}
+% \dvipdfmx{} 不能生成 PDF,报下述错误:
+% \begin{verbatim}
+% ** WARNING ** UCS-4 TrueType cmap table...
+% ** ERROR ** Unable to read OpenType/TrueType Unicode cmap table.
+% \end{verbatim}
+% 如果将 CMap 改为 UniGB-UTF16-H,错误信息是
+% \begin{verbatim}
+% ** WARNING ** No usable TrueType cmap table found for font "华文黑体.ttf".
+% ** WARNING ** CID character collection for this font is set to "Adobe-GB1"
+% ** ERROR ** Cannot continue without this...
+% \end{verbatim}
+% 在 \pdfTeX{} 下生成的 PDF 只有方框^^A
+% \footnote{\url{http://www.newsmth.net/bbscon.php?bid=460&id=312640}}。
+% 华文细黑和华文仿宋的情况类似。
+% \begin{macrocode}
+\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 }
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</mac>
+%<*founder>
+% \end{macrocode}
+%
+% \subsubsection{\pkg{ctex-fontset-founder.def}}
+%
+% \begin{macrocode}
+\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 }
+% \end{macrocode}
+%
+% 在 WPS For Linux 附带的 5.00 版和家庭版 5.20 版的“方正细黑一\_GBK”的字体名称
+% 是 |FZXiHeiI-Z08|。但在网上发现不少文档和资料都是 \verb*|FZXiHei I-Z08|,而在
+% 官方资料《2013 方正字库字体样张》中对应的英文名字是 \verb*|FZXiHei I|。可以用
+% Postscript 名字 |FZXH1K--GBK1-0| 来统一。经测试时发现(WPS 中的字体),\XeTeX{}
+% 找该字体时会出现明显的延迟,而用字体文件名 |FZXH1K.TTF| 又可能会出现大小写问题,
+% 遂采用汉字名称。由于 \pkg{luaotfload} 不支持汉字名称,故使用 Postscript 名字,
+% 速度不受影响。
+% \begin{macrocode}
+ \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 }
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</founder>
+%<*ubuntu>
+% \end{macrocode}
+%
+% \subsubsection{\pkg{ctex-fontset-ubuntu.def}}
+%
+% 以下根据 Ubuntu 12.04 的中文字体情况设置。CMap 不清楚应该是什么,指定为
+% UniGB-UTF16-H 还是有警告:
+% \begin{verbatim}
+% ** WARNING ** UCS-4 TrueType cmap table...
+% \end{verbatim}
+% 需要注意的是 \file{uming.ttc} 和 \file{ukai.ttc} 看起来像有四种字形的样子,但
+% 其实只有“令”和“骨”这区区两个字有新字形,其余都取旧字形^^A
+% \footnote{\url{http://www.freedesktop.org/wiki/Software/CJKUnifonts/Download/}}。
+% \begin{macrocode}
+\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 }
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</ubuntu>
+% \end{macrocode}
+%
+% \subsubsection{中文字体命令}
+%
+% \begin{macrocode}
+%<*!windows>
+% \end{macrocode}
+%
+% \begin{macrocode}
+\NewDocumentCommand \songti { } { \CJKfamily { zhsong } }
+\NewDocumentCommand \heiti { } { \CJKfamily { zhhei } }
+%<!ubuntu>\NewDocumentCommand \fangsong { } { \CJKfamily { zhfs } }
+\NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } }
+%<*windowsnew|windowsold|founder>
+\NewDocumentCommand \lishu { } { \CJKfamily { zhli } }
+\NewDocumentCommand \youyuan { } { \CJKfamily { zhyou } }
+%</windowsnew|windowsold|founder>
+%<windowsnew>\NewDocumentCommand \yahei { } { \CJKfamily { zhyahei } }
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</!windows>
+%</fontset>
+%<*zhmap>
+% \end{macrocode}
+%
+% \subsubsection{\pkg{zhmetrics} 的字体映射}
+%
+% 确认 \tn{catcode},没有重复载入检查。
+% \begin{macrocode}
+\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
+% \end{macrocode}
+%
+% \begin{macrocode}
+\input ifpdf.sty\relax
+% \end{macrocode}
+%
+% 提供非 \LaTeX{} 格式下的 \tn{ProvidesFile}。
+% \begin{macrocode}
+\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
+% \end{macrocode}
+%
+% \paragraph{\pkg{zhwindowsfonts.tex}}
+%
+% \begin{macrocode}
+%<*windows>
+\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}
+
+%</windows>
+% \end{macrocode}
+%
+% \paragraph{\pkg{zhadobefonts.tex}}
+%
+% \begin{macrocode}
+%<*adobe>
+\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}
+
+%</adobe>
+% \end{macrocode}
+%
+% \paragraph{\pkg{zhfandolfonts.tex}}
+%
+% \begin{macrocode}
+%<*fandol>
+\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}
+
+%</fandol>
+% \end{macrocode}
+%
+% \paragraph{\pkg{zhfounderfonts.tex}}
+%
+% \begin{macrocode}
+%<*founder>
+\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}
+
+%</founder>
+% \end{macrocode}
+%
+% \paragraph{\pkg{zhubuntufonts.tex}}
+%
+% \begin{macrocode}
+%<*ubuntu>
+\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}
+
+%</ubuntu>
+% \end{macrocode}
+%
+% \begin{macrocode}
+\fi
+
+\ctex@zhmap@endinput
+%</zhmap>
+% \end{macrocode}
+%
+% \subsubsection{制作 \texttt{spa} 文件}
+%
+% 我们通过 \XeTeX{} 的 \tn{XeTeXglyphbounds} 取得字体中标点符号的边界信息,为
+% \pkg{CJKpunct} 宏包制作 \file{spa}。
+%
+% \begin{macrocode}
+%<*spa>
+%<*macro>
+\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 }
+ }
+% \end{macrocode}
+%
+% \pkg{CJKpunct} 定义的标点符号是:
+% \begin{verbatim}
+% ‘“「『〔([{〈《〖【
+% —…、。,.:;!?%〕)]}〉》〗】’”」』
+% \end{verbatim}
+% 注意顺序不能改变。
+% \begin{macrocode}
+\seq_new:N \c_@@_punct_seq
+\seq_gset_from_clist:Nn \c_@@_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
+ }
+% \end{macrocode}
+%
+% \begin{macro}[internal]{\ctex_make_spa:nn}
+% |#1| 是 \file{spa} 文件名,|#2| 是由 CJK 族名与字体构成的逗号列表。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ctex_make_spa:nn #1#2
+ {
+ \iow_open:Nn \g_@@_spa_iow {#1}
+ \clist_map_inline:nn {#2}
+ { \@@_write_family:nn ##1 }
+ \iow_close:N \g_@@_spa_iow
+ }
+\iow_new:N \g_@@_spa_iow
+\cs_new_eq:NN \MAKESPA \ctex_make_spa:nn
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_write_family:nn #1#2
+ {
+ \group_begin:
+ \tex_font:D \l_@@_punct_font = "#2" ~ at ~ 100 pt \scan_stop:
+ \l_@@_punct_font
+ \clist_clear:N \l_@@_punct_bounds_clist
+ \seq_map_inline:Nn \c_@@_punct_seq
+ { \exp_args:No \@@_save_bounds:n { \int_use:N \XeTeXcharglyph ##1 } }
+ \iow_now:Nx \g_@@_spa_iow
+ {
+ \token_to_str:N \ctexspadef {#1}
+% \end{macrocode}
+% 最后这三个逗号对 \pkg{CJKpunct} 来说是必要的。
+% \begin{macrocode}
+ { \l_@@_punct_bounds_clist , , , }
+ }
+ \group_end:
+ }
+\cs_new_protected_nopar:Npn \@@_save_bounds:n #1
+ {
+ \clist_put_right:Nx \l_@@_punct_bounds_clist
+ {
+ \@@_calc_bounds:nn { \c_one } {#1} ,
+ \@@_calc_bounds:nn { \c_three } {#1}
+ }
+ }
+\clist_new:N \l_@@_punct_bounds_clist
+% \end{macrocode}
+%
+% \pkg{CJKpunct} 要求的格式是边界空白宽度与 1\,em 的比值的一百倍。
+% \begin{macrocode}
+\cs_new_nopar:Npn \@@_calc_bounds:nn #1#2
+ {
+ \fp_eval:n
+ {
+ round
+ (
+ \dim_to_decimal_in_unit:nn
+ { 100 \XeTeXglyphbounds #1 ~ #2 }
+ { 1 em }
+ )
+ }
+ }
+\ExplSyntaxOff
+%</macro>
+% \end{macrocode}
+%
+% 下面是 \CTeX{} 定义的一些字体。
+% \begin{macrocode}
+%<*make>
+\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
+%</make>
+%</spa>
+% \end{macrocode}
+%
+% \end{implementation}
+%
+% \Finale
+%
+\endinput
diff --git a/Master/texmf-dist/source/latex/ctex/ctexpunct.spa b/Master/texmf-dist/source/latex/ctex/ctexpunct.spa
new file mode 100644
index 00000000000..d357f18a679
--- /dev/null
+++ b/Master/texmf-dist/source/latex/ctex/ctexpunct.spa
@@ -0,0 +1,30 @@
+\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,,,}
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'.
diff --git a/Master/tlpkg/bin/tlpkginfo b/Master/tlpkg/bin/tlpkginfo
index 3b8819248c6..be921baafaf 100755
--- a/Master/tlpkg/bin/tlpkginfo
+++ b/Master/tlpkg/bin/tlpkginfo
@@ -73,7 +73,7 @@ sub ctaninfo {
# erroneous or problematic tds files (when new, tell CTAN and author)
$erroneous_tds = join ("|",
qw(countriesofeurope dad ebproof engpron gost hacm he-she hobby imtekda
- mathdesign spanish sttools),
+ mathdesign),
);
# Heiko's tds files (don't propagate through CTAN fast enough).
diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds
index d34df995eac..5515efe8207 100755
--- a/Master/tlpkg/libexec/ctan2tds
+++ b/Master/tlpkg/libexec/ctan2tds
@@ -969,6 +969,7 @@ chomp ($Build = `cd $Master/../Build/source && pwd`);
'softmaker-freefonts', "die 'skipping, requires nonfree fonts'",
'soulpos', "die 'skipping, use bezos'",
'soyombo', "die 'skipping, noinfo license, Mongolian ca.1996'",
+ 'spanish', "die 'skipping, complicated collection'",
'springer', "die 'skipping, licenses not checked'",
'sprite', "die 'skipping, noinfo license'",
'ssqquote', "die 'skipping, nonfree license'",