From 9591c0c57b007ba49f15f0970009bc27efa23db4 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 14 May 2015 21:23:11 +0000 Subject: ctex (14may15) git-svn-id: svn://tug.org/texlive/trunk@37393 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/ctex/README | 65 +- Master/texmf-dist/doc/latex/ctex/ctex.pdf | Bin 226095 -> 890109 bytes Master/texmf-dist/doc/latex/ctex/ctex.tex | 1036 --- Master/texmf-dist/doc/latex/ctex/test/test-cjk.tex | 817 -- .../doc/latex/ctex/test/test-cjkutf8.tex | 820 -- .../texmf-dist/doc/latex/ctex/test/test-xetex.tex | 817 -- .../doc/latex/ctex/test/test-xetexgbk.tex | 819 -- Master/texmf-dist/source/latex/ctex/ctex.dtx | 8645 ++++++++++++++++++++ Master/texmf-dist/source/latex/ctex/ctexpunct.spa | 30 + Master/texmf-dist/tex/generic/ctex/ctexmakespa.tex | 68 + .../texmf-dist/tex/generic/ctex/ctexspamacro.tex | 94 + .../texmf-dist/tex/generic/ctex/zhadobefonts.tex | 106 + .../texmf-dist/tex/generic/ctex/zhfandolfonts.tex | 106 + .../texmf-dist/tex/generic/ctex/zhfounderfonts.tex | 142 + .../texmf-dist/tex/generic/ctex/zhubuntufonts.tex | 130 + .../texmf-dist/tex/generic/ctex/zhwindowsfonts.tex | 142 + .../texmf-dist/tex/latex/ctex/back/ctexartutf8.cls | 13 - .../tex/latex/ctex/back/ctexbookutf8.cls | 13 - .../texmf-dist/tex/latex/ctex/back/ctexcaputf8.sty | 13 - .../texmf-dist/tex/latex/ctex/back/ctexreputf8.cls | 13 - Master/texmf-dist/tex/latex/ctex/back/ctexutf8.sty | 13 - Master/texmf-dist/tex/latex/ctex/cfg/ctex.cfg | 4 - .../texmf-dist/tex/latex/ctex/cfg/ctexcap-gbk.cfg | 46 - .../texmf-dist/tex/latex/ctex/cfg/ctexcap-utf8.cfg | 46 - Master/texmf-dist/tex/latex/ctex/cfg/ctexcap.cfg | 111 - .../tex/latex/ctex/cfg/ctexopts.cfg.template | 6 - .../tex/latex/ctex/config/ctex-name-gbk.cfg | 53 + .../tex/latex/ctex/config/ctex-name-utf8.cfg | 53 + Master/texmf-dist/tex/latex/ctex/config/ctex.cfg | 36 + .../texmf-dist/tex/latex/ctex/config/ctexopts.cfg | 37 + Master/texmf-dist/tex/latex/ctex/ctex-article.def | 316 + Master/texmf-dist/tex/latex/ctex/ctex-book.def | 363 + Master/texmf-dist/tex/latex/ctex/ctex-c5size.clo | 72 + Master/texmf-dist/tex/latex/ctex/ctex-cs4size.clo | 72 + Master/texmf-dist/tex/latex/ctex/ctex-report.def | 357 + Master/texmf-dist/tex/latex/ctex/ctex.sty | 996 ++- Master/texmf-dist/tex/latex/ctex/ctexart.cls | 1265 ++- Master/texmf-dist/tex/latex/ctex/ctexbook.cls | 1312 ++- Master/texmf-dist/tex/latex/ctex/ctexcap.sty | 122 +- Master/texmf-dist/tex/latex/ctex/ctexrep.cls | 1306 ++- Master/texmf-dist/tex/latex/ctex/ctexsize.sty | 215 + Master/texmf-dist/tex/latex/ctex/ctexspa.def | 64 + .../texmf-dist/tex/latex/ctex/def/ctex-article.def | 220 - Master/texmf-dist/tex/latex/ctex/def/ctex-book.def | 252 - .../texmf-dist/tex/latex/ctex/def/ctex-caption.def | 165 - .../texmf-dist/tex/latex/ctex/def/ctex-class.def | 96 - .../texmf-dist/tex/latex/ctex/def/ctex-common.def | 423 - Master/texmf-dist/tex/latex/ctex/def/ctex-gbk.def | 31 - .../tex/latex/ctex/def/ctex-loadclass.def | 16 - .../texmf-dist/tex/latex/ctex/def/ctex-report.def | 242 - Master/texmf-dist/tex/latex/ctex/def/ctex-utf8.def | 31 - .../tex/latex/ctex/engine/ctex-cct-engine.def | 82 - .../tex/latex/ctex/engine/ctex-cjk-common.def | 57 - .../tex/latex/ctex/engine/ctex-cjk-engine.def | 66 - .../tex/latex/ctex/engine/ctex-engine-luatex.def | 1047 +++ .../tex/latex/ctex/engine/ctex-engine-pdftex.def | 349 + .../tex/latex/ctex/engine/ctex-engine-xetex.def | 147 + .../tex/latex/ctex/engine/ctex-xecjk-engine.def | 37 - Master/texmf-dist/tex/latex/ctex/fd/c19gbsn.fd | 17 - Master/texmf-dist/tex/latex/ctex/fd/c19gbsn.fdx | 62 - Master/texmf-dist/tex/latex/ctex/fd/c19gkai.fd | 17 - Master/texmf-dist/tex/latex/ctex/fd/c19gkai.fdx | 62 - Master/texmf-dist/tex/latex/ctex/fd/c19rm.fd | 64 +- Master/texmf-dist/tex/latex/ctex/fd/c19sf.fd | 56 +- Master/texmf-dist/tex/latex/ctex/fd/c19tt.fd | 56 +- Master/texmf-dist/tex/latex/ctex/fd/c70rm.fd | 62 +- Master/texmf-dist/tex/latex/ctex/fd/c70sf.fd | 54 +- Master/texmf-dist/tex/latex/ctex/fd/c70tt.fd | 54 +- .../tex/latex/ctex/fontset/ctex-cjk-adobefonts.def | 7 - .../tex/latex/ctex/fontset/ctex-cjk-winfonts.def | 82 - .../tex/latex/ctex/fontset/ctex-fontset-adobe.def | 92 + .../tex/latex/ctex/fontset/ctex-fontset-fandol.def | 103 + .../latex/ctex/fontset/ctex-fontset-founder.def | 86 + .../tex/latex/ctex/fontset/ctex-fontset-mac.def | 50 + .../tex/latex/ctex/fontset/ctex-fontset-ubuntu.def | 73 + .../latex/ctex/fontset/ctex-fontset-windows.def | 38 + .../latex/ctex/fontset/ctex-fontset-windowsnew.def | 102 + .../latex/ctex/fontset/ctex-fontset-windowsold.def | 87 + .../latex/ctex/fontset/ctex-xecjk-adobefonts.def | 21 - .../tex/latex/ctex/fontset/ctex-xecjk-winfonts.def | 23 - .../tex/latex/ctex/opt/ctex-caption-opts.def | 11 - .../tex/latex/ctex/opt/ctex-class-opts.def | 26 - .../tex/latex/ctex/opt/ctex-common-opts.def | 58 - .../ctex/scheme/ctex-scheme-chinese-article.def | 130 + .../latex/ctex/scheme/ctex-scheme-chinese-book.def | 142 + .../ctex/scheme/ctex-scheme-chinese-report.def | 142 + .../tex/latex/ctex/scheme/ctex-scheme-chinese.def | 45 + .../ctex/scheme/ctex-scheme-plain-article.def | 117 + .../latex/ctex/scheme/ctex-scheme-plain-book.def | 131 + .../latex/ctex/scheme/ctex-scheme-plain-report.def | 131 + .../tex/latex/ctex/scheme/ctex-scheme-plain.def | 35 + Master/tlpkg/bin/tlpkginfo | 2 +- Master/tlpkg/libexec/ctan2tds | 1 + 93 files changed, 19246 insertions(+), 7008 deletions(-) delete mode 100644 Master/texmf-dist/doc/latex/ctex/ctex.tex delete mode 100644 Master/texmf-dist/doc/latex/ctex/test/test-cjk.tex delete mode 100644 Master/texmf-dist/doc/latex/ctex/test/test-cjkutf8.tex delete mode 100644 Master/texmf-dist/doc/latex/ctex/test/test-xetex.tex delete mode 100644 Master/texmf-dist/doc/latex/ctex/test/test-xetexgbk.tex create mode 100644 Master/texmf-dist/source/latex/ctex/ctex.dtx create mode 100644 Master/texmf-dist/source/latex/ctex/ctexpunct.spa create mode 100644 Master/texmf-dist/tex/generic/ctex/ctexmakespa.tex create mode 100644 Master/texmf-dist/tex/generic/ctex/ctexspamacro.tex create mode 100644 Master/texmf-dist/tex/generic/ctex/zhadobefonts.tex create mode 100644 Master/texmf-dist/tex/generic/ctex/zhfandolfonts.tex create mode 100644 Master/texmf-dist/tex/generic/ctex/zhfounderfonts.tex create mode 100644 Master/texmf-dist/tex/generic/ctex/zhubuntufonts.tex create mode 100644 Master/texmf-dist/tex/generic/ctex/zhwindowsfonts.tex delete mode 100644 Master/texmf-dist/tex/latex/ctex/back/ctexartutf8.cls delete mode 100644 Master/texmf-dist/tex/latex/ctex/back/ctexbookutf8.cls delete mode 100644 Master/texmf-dist/tex/latex/ctex/back/ctexcaputf8.sty delete mode 100644 Master/texmf-dist/tex/latex/ctex/back/ctexreputf8.cls delete mode 100644 Master/texmf-dist/tex/latex/ctex/back/ctexutf8.sty delete mode 100644 Master/texmf-dist/tex/latex/ctex/cfg/ctex.cfg delete mode 100644 Master/texmf-dist/tex/latex/ctex/cfg/ctexcap-gbk.cfg delete mode 100644 Master/texmf-dist/tex/latex/ctex/cfg/ctexcap-utf8.cfg delete mode 100644 Master/texmf-dist/tex/latex/ctex/cfg/ctexcap.cfg delete mode 100644 Master/texmf-dist/tex/latex/ctex/cfg/ctexopts.cfg.template create mode 100644 Master/texmf-dist/tex/latex/ctex/config/ctex-name-gbk.cfg create mode 100644 Master/texmf-dist/tex/latex/ctex/config/ctex-name-utf8.cfg create mode 100644 Master/texmf-dist/tex/latex/ctex/config/ctex.cfg create mode 100644 Master/texmf-dist/tex/latex/ctex/config/ctexopts.cfg create mode 100644 Master/texmf-dist/tex/latex/ctex/ctex-article.def create mode 100644 Master/texmf-dist/tex/latex/ctex/ctex-book.def create mode 100644 Master/texmf-dist/tex/latex/ctex/ctex-c5size.clo create mode 100644 Master/texmf-dist/tex/latex/ctex/ctex-cs4size.clo create mode 100644 Master/texmf-dist/tex/latex/ctex/ctex-report.def create mode 100644 Master/texmf-dist/tex/latex/ctex/ctexsize.sty create mode 100644 Master/texmf-dist/tex/latex/ctex/ctexspa.def delete mode 100644 Master/texmf-dist/tex/latex/ctex/def/ctex-article.def delete mode 100644 Master/texmf-dist/tex/latex/ctex/def/ctex-book.def delete mode 100644 Master/texmf-dist/tex/latex/ctex/def/ctex-caption.def delete mode 100644 Master/texmf-dist/tex/latex/ctex/def/ctex-class.def delete mode 100644 Master/texmf-dist/tex/latex/ctex/def/ctex-common.def delete mode 100644 Master/texmf-dist/tex/latex/ctex/def/ctex-gbk.def delete mode 100644 Master/texmf-dist/tex/latex/ctex/def/ctex-loadclass.def delete mode 100644 Master/texmf-dist/tex/latex/ctex/def/ctex-report.def delete mode 100644 Master/texmf-dist/tex/latex/ctex/def/ctex-utf8.def delete mode 100644 Master/texmf-dist/tex/latex/ctex/engine/ctex-cct-engine.def delete mode 100644 Master/texmf-dist/tex/latex/ctex/engine/ctex-cjk-common.def delete mode 100644 Master/texmf-dist/tex/latex/ctex/engine/ctex-cjk-engine.def create mode 100644 Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-luatex.def create mode 100644 Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-pdftex.def create mode 100644 Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-xetex.def delete mode 100644 Master/texmf-dist/tex/latex/ctex/engine/ctex-xecjk-engine.def delete mode 100644 Master/texmf-dist/tex/latex/ctex/fd/c19gbsn.fd delete mode 100644 Master/texmf-dist/tex/latex/ctex/fd/c19gbsn.fdx delete mode 100644 Master/texmf-dist/tex/latex/ctex/fd/c19gkai.fd delete mode 100644 Master/texmf-dist/tex/latex/ctex/fd/c19gkai.fdx delete mode 100644 Master/texmf-dist/tex/latex/ctex/fontset/ctex-cjk-adobefonts.def delete mode 100644 Master/texmf-dist/tex/latex/ctex/fontset/ctex-cjk-winfonts.def create mode 100644 Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-adobe.def create mode 100644 Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-fandol.def create mode 100644 Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-founder.def create mode 100644 Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-mac.def create mode 100644 Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-ubuntu.def create mode 100644 Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windows.def create mode 100644 Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsnew.def create mode 100644 Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsold.def delete mode 100644 Master/texmf-dist/tex/latex/ctex/fontset/ctex-xecjk-adobefonts.def delete mode 100644 Master/texmf-dist/tex/latex/ctex/fontset/ctex-xecjk-winfonts.def delete mode 100644 Master/texmf-dist/tex/latex/ctex/opt/ctex-caption-opts.def delete mode 100644 Master/texmf-dist/tex/latex/ctex/opt/ctex-class-opts.def delete mode 100644 Master/texmf-dist/tex/latex/ctex/opt/ctex-common-opts.def create mode 100644 Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-article.def create mode 100644 Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-book.def create mode 100644 Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-report.def create mode 100644 Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese.def create mode 100644 Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-article.def create mode 100644 Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-book.def create mode 100644 Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-report.def create mode 100644 Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain.def 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 * Wang Yue * Liu Haiyang - * Li Yanrui - * Chen Zhichu + * Li Yanrui + * Chen Zhichu + * Li Qing + * Liam Huang 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 Binary files a/Master/texmf-dist/doc/latex/ctex/ctex.pdf and b/Master/texmf-dist/doc/latex/ctex/ctex.pdf 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 +% +%<*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 + * Jiang Jiang + * Wang Yue + * Liu Haiyang + * Li Yanrui + * Chen Zhichu + * Li Qing + * Liam Huang + +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). + +% +%<*internal> +\fi +\begingroup + \def\temp{LaTeX2e} +\expandafter\endgroup\ifx\temp\fmtname\else +\csname fi\endcsname +% +%<*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 +% +%<*internal> +\fi +% +%<*!(readme|install|zhmap|spa)> +%<*!(c19|c70|ctexspa)> +%<*driver|package|class> +\NeedsTeXFormat{LaTeX2e} +\RequirePackage{expl3} +% +%<.!(readme|install|zhmap|spa|c19|c70|ctexspa)>\ctexPutVersion +%<*driver> +\InputIfFileExists{ctex.ver}{}{ + \def\ctexGetVersionInfo{\GetIdInfo$Id$}} +\ctexGetVersionInfo + {ctex source file} +\ProvidesExplFile{\ExplFileName.\ExplFileExtension} +% +% +% \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} +% +% \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} +% +% \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} +% +% \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} +% +% \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: +% + } +\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 +% +% \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 + } + } + } +% +% \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 } +% +% \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 } +% +% \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 } } +% +% \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 } +% +% \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} +%\RequirePackage { CJKfntef } \normalem +%\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 } +% +\clist_map_inline:nn + { underdot , underline , underdblline , underwave , sout , xout } +%<*pdftex|xetex> + { +% \tl_clear:c { CJK#1color } +% \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 } +% +%<*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: +% +%<*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 } } + } +% +% \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@ } + } +% +%<*luatex> + { \skip_set:Nn \ccwd { \ltjgetparameter { kanjiskip } + \zw } } +% +\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 } + } +% +%<*xetex> + { \xeCJKsetup { CJKglue = { \skip_horizontal:N \l_@@_ccglue_skip } } } +% +%<*luatex> + { \ltjsetkanjiskip \l_@@_ccglue_skip } +% +\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: +% +%<*luatex> + \skip_if_eq:nnTF { \l_@@_ccglue_skip } { \ltjgetparameter { kanjiskip } } + { \prg_return_false: } { \prg_return_true: } +% + } +% \end{macrocode} +% 注意下面的标记不能用 \verb"%",它会导致旧版本的 \pkg{l3docstrip} +% 不能替换 \texttt{@@}。 +% \begin{macrocode} +%<*pdftex|xetex> +\ctex_at_end:n { \cs_new_eq:NN \@@_ccglue: \CJKglue } +% +% \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: +% { \dim_set:Nn \ccwd { \f@size \p@ } } +% { \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 } } +% +%<*xetex|luatex> +\EverySelectfont { \CTEX@selectfont@hook } +% +% \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 +% +% \end{macrocode} +% +% \begin{macro}{space} +% 在导言区或正文中设置忽略空格方式。 +% \pdfTeX{} 和 \XeTeX{} 下初始设置为 \opt{auto},\LuaTeX{} 下是无效选项。 +% \begin{macrocode} +\keys_define:nn { ctex } + { +%<*pdftex|xetex> + space .choice: , + space / true .code:n = +% { \ctex_ignorespaces_case:N \prg_do_nothing: } , +% { \xeCJKsetup { CJKspace = true } } , + space / auto .code:n = +% { \ctex_ignorespaces_case:N \ctex_auto_ignorespaces: } , +% { \xeCJKsetup { CJKspace = false } } , + space / false .code:n = +% { \ctex_ignorespaces_case:N \tex_ignorespaces:D } , +% { \xeCJKsetup { CJKspace = false } } , + space .default:n = { true } , + space .initial:n = { auto } +% +%<*luatex> + space .code:n = + { \msg_warning:nn { ctex } { invalid-option } } +% + } +% \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 } +% \punctstyle { \l_@@_punct_tl } +% \xeCJKsetup { PunctStyle = \l_@@_punct_tl } +% \ctex_mono_jfm:o { \l_@@_punct_tl } + } , + punct .default:n = { quanjiao } , + } +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +% +%<*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 , +%
bibname .tl_set:N = \refname +% 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 } + } + } +% +% \end{macrocode} +% +% \begin{macrocode} +% +% \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 + { +%
part , section , subsection , subsubsection , +% 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 + } +% +% \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} +%
+% \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} +%
+% \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} +% +% \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} +% +%<*book|report> +\def\@spart#1{% + {\interlinepenalty \@M +% \normalfont \centering + \normalfont \CTEX@part@format +% \Huge \bfseries #1\par}% + \CTEX@part@titleformat{#1}\par}% + \@endpart} +% +% \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 +% \if@mainmatter + \refstepcounter{chapter}% +% \typeout{\@chapapp\space\thechapter.}% + \typeout{\CTEXthechapter}% + \addcontentsline{toc}{chapter} +% {\protect\numberline{\thechapter}#1}% + {\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} +% \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 +% \if@mainmatter +% \huge\bfseries\@chapapp\space\thechapter\par\nobreak\vskip 20\p@ + \CTEX@chaptername +% \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} +% +% \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 } +% +%<*book|report> + \gdef \CTEX@prechapter { \CTEX@preappendix } + \gdef \CTEX@thechapter { \CTEX@appendixnumber } + \gdef \CTEX@postchapter { \CTEX@postappendix } +% + } +% \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: +% +%<*book|report> +\ctex_patch_cmd:Nnn \ps@headings + { \@chapapp\ \thechapter.~\ } { \CTEXthechapter \quad } +\if@twoside + \ctex_patch_cmd:Nnn \ps@headings { \thesection.~\ } { \CTEXthesection \quad } +\fi: +% +% \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 } +% +%<*book|report> + \ctex_patch_cmd:Nnn \ps@fancy +% { \@chapapp\ \thechapter.~\ } { \if@mainmatter \CTEXthechapter \quad \fi } +% { \@chapapp\ \thechapter.~\ } { \CTEXthechapter \quad } + \ctex_patch_cmd:Nnn \ps@fancy + { \thesection.~\ } { \CTEXthesection \quad } +% + } +% \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} +% +% \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 , +% +%<*article> + nameformat = \Large \bfseries , + afterskip = 3ex , +%<*plain> + format = \raggedright , + aftername = \par \nobreak , + titleformat = \huge \bfseries , + beforeskip = -4ex +% +%<*chinese> + number = \chinese { part } , + format = \centering , + aftername = \quad , + titleformat = \Large \bfseries , + beforeskip = 4ex +% +% +%<*book|report> + format = \centering , + nameformat = \huge \bfseries , + aftername = \par \vskip 20 \p@ , + pagestyle = plain , +%<*plain> + titleformat = \Huge \bfseries +% +%<*chinese> + titleformat = \huge \bfseries +% +% + } +% \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@ +% +%<*chinese> + number = \chinese { chapter } , + format = \centering , + aftername = \quad , + titleformat = \huge \bfseries , + beforeskip = 50 \p@ +% + } +% +% \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 +% +%<*chinese> + format = \Large \bfseries \centering , + beforeskip = 3.5ex \@plus 1ex \@minus .2ex +% + } +% \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 +% +%<*chinese> + beforeskip = 3.25ex \@plus 1ex \@minus .2ex +% + } +% \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 +% +%<*chinese> + beforeskip = 3.25ex \@plus 1ex \@minus .2ex +% + } +% \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 , +% +%<*chinese> + 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_@@_section_depth_flag > \c_three + { + \keys_set:nn { ctex / subparagraph } + { +%<*plain> + beforeskip = -3.25ex \@plus -1ex \@minus -.2ex , +% +%<*chinese> + 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_@@_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 } +% +%<*book|report> + { + name = \appendixname \space , + number = \@Alph \c@chapter + } +% +% \end{macrocode} +% +% \begin{macrocode} +% +% \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} +% +% \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} +% +% \end{macrocode} +% +% \subsection{\opt{chinese} 方案的其他设置} +% +% \begin{macrocode} +%<*scheme&chinese> +% \end{macrocode} +% +% \opt{chinese} 在标准文档类下的页面格式总采用 \texttt{headings}。 +% \begin{macrocode} +%\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} +% +% \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} +% +% \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 } { } +% +%<*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 } { } +% +% \end{macrocode} +% +% \begin{macrocode} +%\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} +% +% \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 } +% +% \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} +% +% \end{macrocode} +% +% \begin{macrocode} +%<*config> +%% +% +% \end{macrocode} +% +% \subsubsection{\pkg{ctexopts.cfg}} +% +% 这里仅为配置文件示例:使用 Windows Vista 或以后版本的字体设置。 +% \begin{macrocode} +%<*ctexopts> +%% +%% \keys_set:nn { ctex / option } { fontset = windowsnew } +% +% \end{macrocode} +% +% \subsection{字体定义文件} +% +% \subsubsection{传统定义方式} +% +% \begin{macrocode} +%<*c19|c70> +%% +%% Chinese characters +%% +%%% character set: GBK (extension of GB 2312) +%%% character set: Unicode +%% font encoding: Unicode +%% +% +% \end{macrocode} +% +% \begin{macrocode} +%\DeclareFontFamily{C19}{rm}{\hyphenchar\font\m@ne} +%\DeclareFontFamily{C70}{rm}{\hyphenchar\font\m@ne} +%\DeclareFontFamily{C19}{sf}{\hyphenchar\font\m@ne} +%\DeclareFontFamily{C70}{sf}{\hyphenchar\font\m@ne} +%\DeclareFontFamily{C19}{tt}{\hyphenchar\font\m@ne} +%\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} +% +%<*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} +% +% +% \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} +% +%<*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} +% +% +% \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} +% +%<*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} +% +% +% \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 } } +% +% \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 } +% +% \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 } +% + \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 } +% +%<*windowsnew> + \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 } +%<*windowsnew> + \setCJKfamilyfont { zhyahei } + [ BoldFont = { *~Bold } ] { Microsoft~YaHei } +% + } +% +% \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} +% +%<*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} +% +%<*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} +% +%<*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} +% +%<*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} +% +% \end{macrocode} +% +% \subsubsection{中文字体命令} +% +% \begin{macrocode} +%<*!windows> +% \end{macrocode} +% +% \begin{macrocode} +\NewDocumentCommand \songti { } { \CJKfamily { zhsong } } +\NewDocumentCommand \heiti { } { \CJKfamily { zhhei } } +%\NewDocumentCommand \fangsong { } { \CJKfamily { zhfs } } +\NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } } +%<*windowsnew|windowsold|founder> +\NewDocumentCommand \lishu { } { \CJKfamily { zhli } } +\NewDocumentCommand \youyuan { } { \CJKfamily { zhyou } } +% +%\NewDocumentCommand \yahei { } { \CJKfamily { zhyahei } } +% \end{macrocode} +% +% \begin{macrocode} +% +% +%<*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@ +% \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} + +% +% \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} + +% +% \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@ +% \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@ +% \end{macrocode} +% +% \begin{macrocode} +\fi + +\ctex@zhmap@endinput +% +% \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 +% +% \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 +% +% +% \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@ 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 $ + {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 $ + {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 $ + {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 $ + {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 $ + {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 $ + {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 $ + {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 $ + {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 $ + {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 $ + {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 $ + {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 $ + {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 $ + {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 $ + {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 $ + {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 $ + {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 $ + {(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 $ + {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 $ + {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 $ + {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 $ + {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 $ + {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 $ + {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 $ + {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 $ + {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 $ + {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 $ + {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 $ + {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 $ + {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 $ + {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 $ + {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 $ + {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 $ + {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 $ + {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'", -- cgit v1.2.3