summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-06-19 22:32:36 +0000
committerKarl Berry <karl@freefriends.org>2015-06-19 22:32:36 +0000
commit24a26d6f89a97e7ba548a2c42c0e6a6c80e6fb2a (patch)
treec87c15ce0105a3b7f9dfef8548ea2b0bb368d91c
parent28cb2b214ad9bcb5ac65fdf512b438f388a68b1e (diff)
ctex (19jun15)
git-svn-id: svn://tug.org/texlive/trunk@37615 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/ctex/README1
-rw-r--r--Master/texmf-dist/doc/latex/ctex/ctex.pdfbin973893 -> 889512 bytes
-rw-r--r--Master/texmf-dist/source/latex/ctex/ctex.dtx1414
-rw-r--r--Master/texmf-dist/tex/generic/ctex/zhadobefonts.tex12
-rw-r--r--Master/texmf-dist/tex/generic/ctex/zhfandolfonts.tex12
-rw-r--r--Master/texmf-dist/tex/generic/ctex/zhfounderfonts.tex12
-rw-r--r--Master/texmf-dist/tex/generic/ctex/zhubuntufonts.tex12
-rw-r--r--Master/texmf-dist/tex/generic/ctex/zhwindowsfonts.tex12
-rw-r--r--Master/texmf-dist/tex/latex/ctex/config/ctex-name-gbk.cfg4
-rw-r--r--Master/texmf-dist/tex/latex/ctex/config/ctex-name-utf8.cfg4
-rw-r--r--Master/texmf-dist/tex/latex/ctex/config/ctex.cfg4
-rw-r--r--Master/texmf-dist/tex/latex/ctex/config/ctexopts.cfg4
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctex-article.def74
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctex-book.def92
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctex-c5size.clo4
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctex-cs4size.clo4
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctex-report.def92
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctex.sty159
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctexart.cls199
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctexbook.cls217
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctexcap.sty7
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctexheading.sty278
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctexrep.cls217
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctexsize.sty7
-rw-r--r--Master/texmf-dist/tex/latex/ctex/ctexspa.def2
-rw-r--r--Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-luatex.def6
-rw-r--r--Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-pdftex.def64
-rw-r--r--Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-xetex.def18
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fd/c19rm.fd2
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fd/c19sf.fd2
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fd/c19tt.fd2
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fd/c70rm.fd2
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fd/c70sf.fd2
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fd/c70tt.fd2
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-adobe.def4
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-fandol.def4
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-founder.def4
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-mac.def4
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-ubuntu.def7
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windows.def4
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsnew.def4
-rw-r--r--Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsold.def4
-rw-r--r--Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-article.def12
-rw-r--r--Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-book.def12
-rw-r--r--Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-report.def12
-rw-r--r--Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese.def11
-rw-r--r--Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-article.def10
-rw-r--r--Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-book.def11
-rw-r--r--Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-report.def11
-rw-r--r--Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain.def4
50 files changed, 2015 insertions, 1046 deletions
diff --git a/Master/texmf-dist/doc/latex/ctex/README b/Master/texmf-dist/doc/latex/ctex/README
index abf637a8f09..e4c1135eef3 100644
--- a/Master/texmf-dist/doc/latex/ctex/README
+++ b/Master/texmf-dist/doc/latex/ctex/README
@@ -29,6 +29,7 @@ This package consists of the file ctex.dtx, and the derived files
ctex.sty,
ctexcap.sty,
ctexsize.sty,
+ ctexheading.sty,
ctexart.cls,
ctexbook.cls,
ctexrep.cls,
diff --git a/Master/texmf-dist/doc/latex/ctex/ctex.pdf b/Master/texmf-dist/doc/latex/ctex/ctex.pdf
index caf11940a3d..c67685ec9cc 100644
--- a/Master/texmf-dist/doc/latex/ctex/ctex.pdf
+++ b/Master/texmf-dist/doc/latex/ctex/ctex.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/ctex/ctex.dtx b/Master/texmf-dist/source/latex/ctex/ctex.dtx
index af7f077cb5b..b635785a8d9 100644
--- a/Master/texmf-dist/source/latex/ctex/ctex.dtx
+++ b/Master/texmf-dist/source/latex/ctex/ctex.dtx
@@ -57,6 +57,7 @@ This package consists of the file ctex.dtx, and the derived files
ctex.sty,
ctexcap.sty,
ctexsize.sty,
+ ctexheading.sty,
ctexart.cls,
ctexbook.cls,
ctexrep.cls,
@@ -192,6 +193,7 @@ This package consists of the file ctex.dtx, and the derived files
ctex.sty,
ctexcap.sty,
ctexsize.sty,
+ ctexheading.sty,
ctexart.cls,
ctexbook.cls,
ctexrep.cls,
@@ -248,9 +250,10 @@ This package consists of the file ctex.dtx, and the derived files
\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{ctex.sty} {\from{\jobname.dtx}{style,ctex}}
+ \file{ctexcap.sty} {\from{\jobname.dtx}{ctexcap}}
+ \file{ctexsize.sty} {\from{\jobname.dtx}{style,ctexsize}}
+ \file{ctexheading.sty} {\from{\jobname.dtx}{style,ctexheading}}
\file{ctexart.cls} {\from{\jobname.dtx}{class,article}}
\file{ctexbook.cls} {\from{\jobname.dtx}{class,book}}
\file{ctexrep.cls} {\from{\jobname.dtx}{class,report}}
@@ -320,6 +323,7 @@ This package consists of the file ctex.dtx, and the derived files
\Msg{* ctex.sty *}
\Msg{* ctexcap.sty *}
\Msg{* ctexsize.sty *}
+\Msg{* ctexheading.sty *}
\Msg{* ctexart.cls *}
\Msg{* ctexbook.cls *}
\Msg{* ctexrep.cls *}
@@ -380,10 +384,10 @@ This package consists of the file ctex.dtx, and the derived files
%</internal>
%<*!(readme|install|zhmap|spa)>
%<*!(c19|c70|ctexspa)>
-%<*driver|package|class>
+%<*driver|class|style|ctexcap>
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-%</driver|package|class>
+%</driver|class|style|ctexcap>
%<.!(readme|install|zhmap|spa|c19|c70|ctexspa)>\ctexPutVersion
%<*driver>
\InputIfFileExists{ctex.ver}{}{
@@ -392,12 +396,14 @@ This package consists of the file ctex.dtx, and the derived files
{ctex source file}
\ProvidesExplFile{\ExplFileName.\ExplFileExtension}
%</driver>
-%<style> {Chinese adapter in LaTeX (CTEX)}
-%<style>\ProvidesExplPackage{\ExplFileName}
+%<ctex> {Chinese adapter in LaTeX (CTEX)}
+%<ctex>\ProvidesExplPackage{\ExplFileName}
%<ctexcap> {Chinese adapter in LaTeX (CTEX)}
%<ctexcap>\ProvidesExplPackage{ctexcap}
%<ctexsize> {Chinese font size definition (CTEX)}
%<ctexsize>\ProvidesExplPackage{ctexsize}
+%<ctexheading> {Heading style modification (CTEX)}
+%<ctexheading>\ProvidesExplPackage{ctexheading}
%<class&article> {Chinese adapter for class article (CTEX)}
%<class&article>\ProvidesExplClass{ctexart}
%<class&book> {Chinese adapter for class book (CTEX)}
@@ -460,7 +466,7 @@ This package consists of the file ctex.dtx, and the derived files
%<founder>\ProvidesExplFile{ctex-fontset-founder.def}
%<ubuntu> {Ubuntu fonts definition (CTEX)}
%<ubuntu>\ProvidesExplFile{ctex-fontset-ubuntu.def}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
%</!(c19|c70|ctexspa)>
%<rm&c19>\ProvidesFile{c19rm.fd}%
%<sf&c19>\ProvidesFile{c19sf.fd}%
@@ -469,8 +475,8 @@ This package consists of the file ctex.dtx, and the derived files
%<sf&c70>\ProvidesFile{c70sf.fd}%
%<tt&c70>\ProvidesFile{c70tt.fd}%
%<ctexspa>\ProvidesFile{ctexspa.def}%
-%<c19|c70> [2015/05/15 v2.0.2 Chinese font definition (CTEX)]
-%<ctexspa> [2015/05/15 v2.0.2 Space info for CJKpunct (CTEX)]
+%<c19|c70> [2015/05/15 v2.1 Chinese font definition (CTEX)]
+%<ctexspa> [2015/05/15 v2.1 Space info for CJKpunct (CTEX)]
%</!(readme|install|zhmap|spa)>
%<*driver>
\ExplSyntaxOff
@@ -491,14 +497,17 @@ This package consists of the file ctex.dtx, and the derived files
\usepackage[toc]{multitoc}
\usepackage{geometry}
\usepackage{tabularx}
+\usepackage{siunitx}
\usepackage{unicode-math}
\geometry{includemp,hmargin={0mm,15mm},vmargin={25mm,15mm},footskip=7mm}
-\hypersetup{pdfstartview=FitH,bookmarksdepth=subsubsection}
+\hypersetup{pdfstartview=FitH,bookmarksdepth=subparagraph}
\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{2}
\newcommand*\email{\nolinkurl}
\setmainfont{TeX Gyre Pagella}
-\setsansfont{CMU Sans Serif}
+\setsansfont[
+ BoldFont = * Semibold,
+ BoldItalicFont = * Semibold Italic]{Source Sans Pro}
\setmonofont[
UprightFont=* Light, BoldFont=* Bold,
SlantedFont=* Light Oblique]{CMU Typewriter Text}
@@ -535,6 +544,11 @@ This package consists of the file ctex.dtx, and the derived files
\patchcmd{\@getpen}{\@M}{\@Mi}
{\typeout{*** SUCCESS ***}}{\typeout{*** FAIL ***}}
%% --->
+%% 不对代码实现的 \section 以下标题编目录。
+\AtBeginEnvironment{implementation}{%
+ \ifnum\value{tocdepth}>\@ne
+ \addtocontents{toc}{\noexpand\value{tocdepth}=1\relax}%
+ \fi}
\ifxetex
\let\ctexdocverbaddon\xeCJKVerbAddon
\def\ctexdisableecglue{\xeCJKsetup{CJKecglue}}
@@ -545,10 +559,12 @@ This package consists of the file ctex.dtx, and the derived files
\appto\meta@font@select{\ctexdisableecglue}
\fi
\setlist{noitemsep,topsep=\smallskipamount}
+\setlist[1]{labelindent=\parindent}
+\setlist[itemize]{leftmargin=*}
\newlist{optdesc}{description}{3}
%% 设置间距为 \marginparsep,与 l3doc 一致
\setlist[optdesc]{%
- font=\mdseries\ttfamily,align=right,
+ font=\mdseries\small\ttfamily,align=right,
labelsep=\marginparsep,labelindent=-\marginparsep,leftmargin=*}
\fvset{
fontsize=\small,baselinestretch=1,numbersep=5pt,
@@ -559,6 +575,7 @@ This package consists of the file ctex.dtx, and the derived files
frame=single,framesep=10pt,
label=\rule{0pt}{12pt}\textnormal{\bfseries 例 \arabic{ctexexam}},
listparameters=
+ \setlength\topsep{\bigskipamount}%
\refstepcounter{ctexexam}\ctexexamlabelref
\appto\FV@EndList{\nointerlineskip}}
\define@key{FV}{labelref}{\def\ctexexamlabelref{\label{#1}}}
@@ -581,8 +598,14 @@ This package consists of the file ctex.dtx, and the derived files
\appto\MacroFont{\hyphenchar\font\m@ne\ctexdocverbaddon}
\preto\AltMacroFont{\linespread{1}}
\appto\AltMacroFont{\hyphenchar\font\m@ne\ctexdocverbaddon}
-\def\Module#1{\mbox{\normalfont\sffamily\textlangle#1\textrangle}}
+\def\Module#1{\mbox{%
+ \color{purple}\footnotesize\normalfont\sffamily\textlangle#1\textrangle}}
\ExplSyntaxOn
+\cs_new_nopar:Npn \zihaopt #1
+ {
+ \exp_last_unbraced:Nf \tl_head:w
+ { \prop_item:Nn \c__ctex_font_size_prop {#1} } { } \q_stop
+ }
%% 用 \vtop 让函数名字和语法盒子首行对齐
\patchcmd \__codedoc_syntax:w
{ { minipage } { \l__codedoc_syntax_dim } }
@@ -680,7 +703,11 @@ This package consists of the file ctex.dtx, and the derived files
\patchcmd\l@section{2.5em}{1.5em}{}{}
\patchcmd\l@subsection{2.5em}{1.5em}{}{}
\patchcmd\changes@{\space}{\lbrack}{}{}
-\patchcmd\@wrglossary{hdpindex}{hdclindex{\the\c@HD@hypercount}}{}{}
+\patchcmd\@wrglossary{hdpindex}{%
+ \ifnum\c@HD@hypercount=\z@
+ hdpindex%
+ \else
+ hdclindex{\the\c@HD@hypercount}\fi}{}{}
\newenvironment{defaultcapconfig}{%
\MakePercentComment
\input{ctex-name-utf8.cfg}%
@@ -719,9 +746,11 @@ This package consists of the file ctex.dtx, and the derived files
%
% \changes{v2.0}{2014/03/06}{应用 \LTXIII{} 重新整理代码。}
% \changes{v2.0}{2014/03/12}{删除 \file{c19gbsn.fd} 和 \file{c19gkai.fd}。}
+% \changes{v2.1}{2015/05/18}{将章节标题设置功能提取到可以独立使用的宏包
+% \pkg{ctexheading} 中。}
%
%
-% \CheckSum{4369}
+% \CheckSum{4523}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -741,23 +770,23 @@ This package consists of the file ctex.dtx, and the derived files
%
% \GetFileInfo{\jobname.dtx}%
%
-% \title{\bfseries \CTeX{} 套件手册}
+% \title{\bfseries \CTeX{} 宏集手册}
% \author{\href{http://www.ctex.org}{ctex.org}}
% \date{\filedate\qquad\fileversion\thanks{\ctexkitrev{\ctexrevnum}.}}
% \maketitle
%
% \begin{abstract}
-% \CTeX{} 套件是面向中文排版的通用 \LaTeX{} 排版框架,为中文 \LaTeX{} 文档
+% \CTeX{} 宏集是面向中文排版的通用 \LaTeX{} 排版框架,为中文 \LaTeX{} 文档
% 提供了汉字输出支持、标点压缩、字体字号命令、标题文字汉化、中文版式调整、数字
% 日期转换等支持功能,可适应论文、报告、书籍、幻灯片等不同类型的中文文档。
%
-% \CTeX{} 套件支持 \LaTeX{}、\pdfLaTeX{}、\XeLaTeX{} 和 \LuaLaTeX{} 等多种不同
+% \CTeX{} 宏集支持 \LaTeX{}、\pdfLaTeX{}、\XeLaTeX{} 和 \LuaLaTeX{} 等多种不同
% 的编译方式,并为它们提供了统一的界面。主要功能由宏包 \pkg{ctex} 和中文文档类
% \cls{ctexart}、\cls{ctexrep}、\cls{ctexbook} 实现。
% \end{abstract}
%
-% \clearpage
% \tableofcontents
+%
% \clearpage
% \setlength{\parskip}{0.8ex}
%
@@ -767,7 +796,7 @@ This package consists of the file ctex.dtx, and the derived files
%
% \subsection*{历史}
%
-% \CTeX{} 套件的源头有两个:一是王磊编写的 \cls{cjkbook} 文档类,二是吴凌云编写的
+% \CTeX{} 宏集的源头有两个:一是王磊编写的 \cls{cjkbook} 文档类,二是吴凌云编写的
% \file{GB.cap}。
% 这些工作没有经过认真、系统的设计,也没有用户文档,不利于维护和改进。
%
@@ -783,7 +812,7 @@ This package consists of the file ctex.dtx, and the derived files
%
% 2014 年 3 月,为了适应 \LaTeX{} 的最新发展,特别是 \LTXIII{} 的逐渐成熟,李清用
% \LTXIII{} 重构了整个宏包的代码,并重新使用 \pkg{doc} 和 \pkg{DocStrip} 工具进行代码
-% 的管理,升级版本号为 2.0,并改称 \CTeX{} 套件。
+% 的管理,升级版本号为 2.0,并改称 \CTeX{} 宏集。
%
% 2015 年 3 月,由于 Google Code 即将停止服务,ctex-kit 项目迁移至
% \href{https://github.com/CTeX-org/ctex-kit}{GitHub}^^A
@@ -796,60 +825,64 @@ This package consists of the file ctex.dtx, and the derived files
% 这些困难里,以章节标题的中文化为最。由于中文和西文语言习惯的差异,用户很难使用标准
% 文档类中的代码结构来表达中文标题。于是,用户不得不对标准文档类做较大的修改。
% 除此之外,日期格式、首行缩进、中文字号和字距等细节问题,也需要精细的调校。
-% 我们设计 \CTeX{} 套件的目的之一就是解决这些 \LaTeX{} 文档的汉化难题。
+% 我们设计 \CTeX{} 宏集的目的之一就是解决这些 \LaTeX{} 文档的汉化难题。
%
% 另一方面,随着 \TeX{} 引擎和 \LaTeX{} 宏包的不断发展,\LaTeX{} 的中文支持方式从早期的
% 专用系统(如 \pkg{CCT})发展为适用于不同引擎的多种方式^^A
% \footnote{比如:\pdfTeX{} 引擎下的 \pkg{CJK}、\pkg{zhmCJK}宏包、
% \XeTeX{} 引擎下的 \pkg{xeCJK} 宏包和 \LuaTeX{} 引擎下的 \pkg{LuaTeX-ja} 宏
% 包}。这些方式的适用情况和使用方式有不少细节上的差异,同时操作系统的不同、语言环境的不同等
-% 客观情况又进一步带来了更多的细节差异。我们设计 \CTeX{} 套件的另一个主要目的就是
+% 客观情况又进一步带来了更多的细节差异。我们设计 \CTeX{} 宏集的另一个主要目的就是
% 尽可能消除这些差异带来的影响,使用户能够以一个统一的接口来使用不同的中文支持方式,
% 使得同一份文档能够在不同环境下交换使用。
%
-% \CTeX{} 套件的许多实现细节离不开热心朋友们在 \url{bbs.ctex.org} 论坛上的讨论,
+% \CTeX{} 宏集的许多实现细节离不开热心朋友们在 \url{bbs.ctex.org} 论坛上的讨论,
% 在此对参与讨论的朋友们表示感谢。
%
-% \subsection*{关于套件名字的说明}
+% \subsection*{关于宏集名字的说明}
%
% \CTeX{} 之名是英文单词 China(中国)或 Chinese(中文)的首字母“C”与 “\TeX{}”
% 结合而成的。在纯文本环境下,该名字应写作“CTeX”。
%
-% \CTeX{} 套件是由 \href{http://bbs.ctex.org}{\CTeX{} 社区} 发起并维护的
-% LaTeX 宏包和文档类的集合。
+% \CTeX{} 宏集是由 \href{http://bbs.ctex.org}{\CTeX{} 社区} 发起并维护的
+% LaTeX \emph{宏包和文档类的集合}。
% 社区另有发布名为 \href{http://www.ctex.org/CTeX}{\CTeX{} 套装}
-% 的 \TeX{} 发行版,与本文档所述的 \CTeX{} 套件并非是同一事物。
+% 的 \TeX{} 发行版,与本文档所述的 \CTeX{} 宏集并非是同一事物。
%
-% ctex 则是本套件中的 \pkg{ctex.sty} 的名字。这一完全小写的名称,在过去也被用来指代
-% 整个 \CTeX{} 套件,不过现在则特指 \pkg{ctex.sty} 这一宏包。
+% \pkg{ctex} 则是本宏集中的 \pkg{ctex.sty} 的名字。这一完全小写的名称,在过去
+% 也被用来指代整个 \CTeX{} 宏集,不过现在则特指 \pkg{ctex.sty} 这一宏包。
+% 在不引起歧义的情况下,它也可以沿用过去的习惯,代指整个宏集。
%
% \section{简明教程}
%
-% \subsection{\CTeX{} 套件的组成}
+% \subsection{\CTeX{} 宏集的组成}
%
-% 为了适应用户不同的需求,我们将 \CTeX{} 套件的主要功能分散在三个中文文档类和三个宏包当中,
-% 具体的组成见表~\ref{tab:ctex}。
+% 为了适应用户不同的需求,我们将 \CTeX{} 宏集的主要功能分散在三个中文文档类和
+% 四个宏包当中,具体的组成见表~\ref{tab:ctex}。
%
% \begin{table}[htbp]
% \centering
-% \caption{\CTeX{} 套件的组成}\label{tab:ctex}
+% \caption{\CTeX{} 宏集的组成}\label{tab:ctex}
% \begin{tabularx}{\linewidth}{llX}
% \toprule
% 类别 & 文件 & 说明 \\
% \midrule
-% 文档类 & \file{ctexart.cls} & 标准文档类 \cls{article} 的中文化版本,一般适用于
+% 文档类 & \file{ctexart.cls} & 标准文档类 \cls{article} 的汉化版本,一般适用于
% 短篇幅的文章 \\
-% & \file{ctexrep.cls} & 标准文档类 \cls{report} 的中文化版本,一般适用于
+% & \file{ctexrep.cls} & 标准文档类 \cls{report} 的汉化版本,一般适用于
% 中篇幅的报告 \\
-% & \file{ctexbook.cls} & 标准文档类 \cls{book} 的中文化版本,一般适用于
+% & \file{ctexbook.cls} & 标准文档类 \cls{book} 的汉化版本,一般适用于
% 长篇幅的书籍 \\
% \midrule
% 宏包 & \file{ctex.sty} & 提供全部功能,但\emph{默认不开启章节标题设置功能},
% 需要使用 \opt{heading} 选项来开启 \\
% & \file{ctexcap.sty} & \emph{过时宏包,仅作兼容使用},相当于开启章节标题
% 设置功能的 \file{ctex.sty} \\
-% & \file{ctexsize.sty} & 定义和调整中文字号,可在 \pkg{ctex} 宏包
-% 或 \CTeX{} 中文文档类之外单独调用 \\
+% & \file{ctexsize.sty} & 定义和调整中文字号,在 \pkg{ctex} 宏包
+% 或 \CTeX{} 中文文档类之外单独调用 \\
+% & \file{ctexheading.sty} & 提供章节标题设置功能的(见 \ref{sec:secstyle}
+% 节),在 \pkg{ctex} 宏包或 \CTeX{} 中文
+% 文档类之外单独调用 \\
% \bottomrule
% \end{tabularx}
% \end{table}
@@ -857,9 +890,9 @@ This package consists of the file ctex.dtx, and the derived files
% \subsection{使用 \CTeX{} 文档类}
%
% \emph{如果用户需要在标准文档类的基础上添加中文支持和中文版式支持,我们建议用户使用 \CTeX{}
-% 套件提供的三个中文文档类。}
+% 宏集提供的三个中文文档类。}
%
-% \CTeX{} 套件提供了三个中文文档类:\cls{ctexart}、\cls{ctexrep} 和 \cls{ctexbook},
+% \CTeX{} 宏集提供了三个中文文档类:\cls{ctexart}、\cls{ctexrep} 和 \cls{ctexbook},
% 分别对应 \LaTeX{} 的标准文档类 \cls{article}、\cls{report} 和 \cls{book}。使用它们
% 的时候,需要将涉及到的所有源文件使用 UTF-8 编码保存^^A
% \footnote{使用 (pdf)\LaTeX{} 时也能够使用 GBK 编码,但不推荐。
@@ -910,25 +943,26 @@ This package consists of the file ctex.dtx, and the derived files
% \section{依赖与安装}
%
% \CTeX{} 是一个 \LaTeX{} 宏包,只有一个源文件 \file{ctex.dtx}。
-% 使用不同的编译方式时,\CTeX{} 依赖的宏包略有不同。在安装 \CTeX{} 套件之前,请确保
+% 使用不同的编译方式时,\CTeX{} 依赖的宏包略有不同。在安装 \CTeX{} 宏集之前,请确保
% 你的系统里已经正确安装了这些宏包。\CTeX{} 依赖宏包的详情叙述如下:
%
% \begin{itemize}
% \item \pkg{expl3}、\pkg{xparse} 和 \pkg{l3keys2e} 宏包。它们属于 \pkg{l3kernel}
-% 和 \pkg{l3packages} 套件,它们还依赖
+% 和 \pkg{l3packages} 宏集,它们还依赖
% \begin{itemize}
% \item \pkg{etex} 宏包。
% \end{itemize}
-% \item \pkg{ifpdf} 宏包,属于 \pkg{oberdiek} 套件。
+% \item \pkg{indentfirst} 宏包,属于 \pkg{tools} 宏集。
% \item \pkg{etoolbox} 宏包。
-% \item \pkg{everysel} 宏包,属于 \pkg{ms} 套件。
+% \item \pkg{everysel} 宏包,属于 \pkg{ms} 宏集。
% \item \pkg{zhnumber} 宏包。
-% \item[$\Rightarrow$] 以上是各种编译方式都必需的依赖项。
-% \item \pkg{CJK} 套件,它的下划线功能依赖 \pkg{ulem} 宏包。
+% \item[\ding{229}] 以上是各种编译方式都必需的依赖项。
+% \item \pkg{CJK} 宏集,它的下划线功能依赖 \pkg{ulem} 宏包。
% \item \pkg{CJKpunct} 宏包。
+% \item \pkg{xCJK2uni} 宏包。
% \item \pkg{zhmetrics} 宏包。
% \item \pkg{zhmCJK} 宏包。
-% \item[$\Rightarrow$] 以上是使用 \pdfLaTeX{} 或 \LaTeX{} + \dvipdfmx{} 的编译方式所需要
+% \item[\ding{229}] 以上是使用 \pdfLaTeX{} 或 \LaTeX{} + \dvipdfmx{} 的编译方式所需要
% 的依赖项,其中 \pkg{zhmCJK} 是可选的。
% \item \pkg{xeCJK} 宏包,它还依赖
% \begin{itemize}
@@ -938,22 +972,22 @@ This package consists of the file ctex.dtx, and the derived files
% \item \pkg{xunicode} 宏包,它还依赖 \pkg{tipa} 宏包。
% \end{itemize}
% \end{itemize}
-% \item[$\Rightarrow$] 以上是使用 \XeLaTeX{} 编译时的依赖项。
-% \item \pkg{LuaTeX-ja} 套件,它还依赖
+% \item[\ding{229}] 以上是使用 \XeLaTeX{} 编译时的依赖项。
+% \item \pkg{LuaTeX-ja} 宏集,它还依赖
% \begin{itemize}
% \item \pkg{luaotfload} 宏包,它还依赖 \pkg{luatexbase} 宏包。
% \item \pkg{xkeyval} 宏包。
% \end{itemize}
-% \item[$\Rightarrow$] 以上是使用 \LuaLaTeX{} 编译时的依赖项。
+% \item[\ding{229}] 以上是使用 \LuaLaTeX{} 编译时的依赖项。
% \end{itemize}
%
-% \CTeX{} 依赖的各个宏包和套件均已被 \TeXLive{} 和 \hologo{MiKTeX} 收录。如果
+% \CTeX{} 依赖的各个宏包和宏集均已被 \TeXLive{} 和 \hologo{MiKTeX} 收录。如果
% 你是这两个 \TeX{} 发行版的用户,可以使用他们提供的宏包管理器来安装这些宏包,或将他们
% 更新到最新版本。如果你不使用这两个发行版,请参考你使用的 \TeX{} 发行版和相关宏包
% 的说明文档。
%
% 出于一些原因,\pkg{zhmCJK} 尚未被收入 \TeXLive{} 和 \hologo{MiKTeX}。因此,若
-% 你希望使用 \pkg{zhmCJK} 作为 \CTeX{} 套件的底层中文支持方式,需要自行安装该宏包。
+% 你希望使用 \pkg{zhmCJK} 作为 \CTeX{} 宏集的底层中文支持方式,需要自行安装该宏包。
% \pkg{zhmCJK} 的安装较为复杂。我们建议你从 CTAN 下载 \pkg{zhmCJK} 的
% \href{http://mirrors.ctan.org/install/language/chinese/zhmcjk.tds.zip}{TDS
% 安装包},按目录结构将文件复制到 \TeX{} 发行版的本地 TDS 根目录,然后刷新文件
@@ -971,19 +1005,19 @@ This package consists of the file ctex.dtx, and the derived files
% \section{宏包选项与 \tn{ctexset} 命令}
% \label{sec:options}
%
-% \CTeX{} 套件已经尽可能就中文的行文和版式习惯做了调整和配置,通常而言,这些配置
-% 已经够用。因此,除非必要,我们不建议普通用户修改这些默认配置。如果你认为 \CTeX{} 套件
+% \CTeX{} 宏集已经尽可能就中文的行文和版式习惯做了调整和配置,通常而言,这些配置
+% 已经够用。因此,除非必要,我们不建议普通用户修改这些默认配置。如果你认为 \CTeX{} 宏集
% 的默认配置还可以完善,可以在项目主页上
% \href{https://github.com/CTeX-org/ctex-kit/issues}{提交 issue},
% 向我们反映,我们会酌情在后续版本中予以改进。
%
-% 不过,\CTeX{} 套件也提供了一系列选项。用户可以使用这些选项来控制 \CTeX{} 套件的行为。
+% 不过,\CTeX{} 宏集也提供了一系列选项。用户可以使用这些选项来控制 \CTeX{} 宏集的行为。
% 具体来说,这些选项里,有的以传统的方式提供,
% 也有的以 \meta{key}|=|\meta{value} 的形式提供。对于以键值对形式提供的选项,
% 在下面的说明中使用\textbf{粗体}来表示 \CTeX{} 的默认设置。
%
% 另一方面,在这些选项里,有些选项只能作为宏包/文档类选项,需要在引入宏包/文档类的时候指定;
-% 有些选项只能通过 \CTeX{} 套件提供的用户接口 \tn{ctexset} 来设定;
+% 有些选项只能通过 \CTeX{} 宏集提供的用户接口 \tn{ctexset} 来设定;
% 也有一些选项既可以作为宏包/文档类选项,也可以通过 \tn{ctexset} 来设定。
% 后续文档中将在使用说明中对每个选项的使用方式做说明。
%
@@ -991,7 +1025,7 @@ This package consists of the file ctex.dtx, and the derived files
% \begin{syntax}
% \tn{ctexset} \Arg{键值列表}
% \end{syntax}
-% 是 \CTeX{} 套件的通用控制命令,用来在宏包载入后控制宏包的各项功能。
+% 是 \CTeX{} 宏集的通用控制命令,用来在宏包载入后控制宏包的各项功能。
% \tn{ctexset} 的参数是一个键值列表,以通用的接口完成各项设置。
% \end{function}
%
@@ -1014,12 +1048,12 @@ This package consists of the file ctex.dtx, and the derived files
% \subsection{编译方式}
% \label{subs:compile}
%
-% \CTeX{} 套件会根据用户使用的编译方式\footnote{\LaTeX、\pdfLaTeX、\XeLaTeX 以及
+% \CTeX{} 宏集会根据用户使用的编译方式\footnote{\LaTeX、\pdfLaTeX、\XeLaTeX 以及
% \LuaLaTeX。},在底层选择不同的中文支持方式(见表 \ref{tab:chinese-support})。
%
% \begin{table}[htbp]
% \centering
-% \caption{\CTeX{} 套件的中文支持方式}
+% \caption{\CTeX{} 宏集的中文支持方式}
% \begin{tabular}{ccc}
% \toprule
% (pdf)\LaTeX & \XeLaTeX & \LuaLaTeX \\
@@ -1030,14 +1064,14 @@ This package consists of the file ctex.dtx, and the derived files
% \label{tab:chinese-support}
% \end{table}
%
-% 不同的编译方式和中文支持方式会在一定程度上影响 \CTeX{} 套件的行为,比如宏包对编码的处理。
-% 在用户使用 \XeLaTeX{} 及 \LuaLaTeX{} 编译时,\CTeX{} 套件使用(且仅能
+% 不同的编译方式和中文支持方式会在一定程度上影响 \CTeX{} 宏集的行为,比如宏包对编码的处理。
+% 在用户使用 \XeLaTeX{} 及 \LuaLaTeX{} 编译时,\CTeX{} 宏集使用(且仅能
% 使用)UTF-8 编码;而因为历史原因,在用户使用 \LaTeX{} 及 \pdfLaTeX{} 编译
% 时,宏包默认使用 GBK 编码。用户需要\emph{保证编译方式、
% 源文件编码、宏包编码选项三者一致}。
% 关于宏包编码选项,可以参考 \ref{subs:encoding}~节。
%
-% 除去文档编码之外,选择不同的编译方式还可能影响 \CTeX{} 套件对字体选择、空格处理、
+% 除去文档编码之外,选择不同的编译方式还可能影响 \CTeX{} 宏集对字体选择、空格处理、
% 标点处理的处理。具体的影响将在本文档后续内容中进行阐述。
%
% \subsection{中文编码}
@@ -1047,29 +1081,29 @@ This package consists of the file ctex.dtx, and the derived files
% \begin{syntax}
% \OPC
% \end{syntax}
-% 指明编写文档时使用的编码格式。\CTeX{} 套件无法检测用户编写文档时使用的编码格式,因此
+% 指明编写文档时使用的编码格式。\CTeX{} 宏集无法检测用户编写文档时使用的编码格式,因此
% 需要用户自行指定编码。\emph{我们建议用户总是使用 UTF-8 编码,并显式指定 \opt{UTF8}
% 选项,并使用 \XeLaTeX{} 或 \LuaLaTeX{} 编译。}
%
-% 使用 \XeLaTeX{} 或 \LuaLaTeX{} 编译时,\CTeX{} 套件强制使用 UTF-8 编码,
+% 使用 \XeLaTeX{} 或 \LuaLaTeX{} 编译时,\CTeX{} 宏集强制使用 UTF-8 编码,
% 此时 \opt{GBK} 选项无效。
-% 使用 (pdf)\LaTeX{} 编译时,\CTeX{} 套件默认启用 \opt{GBK} 选项;不过,用户也可以
-% 显式声明 \opt{UTF8} 选项,使 \CTeX{} 套件工作在 UTF-8 编码下。
+% 使用 (pdf)\LaTeX{} 编译时,\CTeX{} 宏集默认启用 \opt{GBK} 选项;不过,用户也可以
+% 显式声明 \opt{UTF8} 选项,使 \CTeX{} 宏集工作在 UTF-8 编码下。
% \end{function}
%
% \subsection{中文字库}
% \label{subs:options-CJK-font}
%
% 以往,为 \LaTeX{} 文档配置中文支持是一件相当繁琐的事情。默认情况下,
-% \CTeX{} 套件能自动检测用户使用的编译方式(参见 \ref{subs:compile}~节)和
-% 操作系统\footnote{\CTeX{} 套件现在能够识别 Mac~OS~X 系统以及 Windows 系统。},
+% \CTeX{} 宏集能自动检测用户使用的编译方式(参见 \ref{subs:compile}~节)和
+% 操作系统\footnote{\CTeX{} 宏集现在能够识别 Mac~OS~X 系统以及 Windows 系统。},
% 选择合适的底层支持和字库,从而简化配置过程。自动配置的情况参见
% 表~\ref{tab:default-font-select}。
%
% \begin{table}[htbp]
% \centering
% \begin{threeparttable}
-% \caption{\CTeX{} 套件自动配置字体策略}
+% \caption{\CTeX{} 宏集自动配置字体策略}
% \label{tab:default-font-select}
% \begin{tabular}{*{5}{c}}
% \toprule
@@ -1106,7 +1140,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{threeparttable}
% \end{table}
%
-% 通常,由 \CTeX{} 套件进行的自动配置已经足够使用,无需用户手工干预;但
+% 通常,由 \CTeX{} 宏集进行的自动配置已经足够使用,无需用户手工干预;但
% 是 \CTeX{} 仍然提供了一系列选项,供在 \CTeX{} 的自动选择机制因为
% 意外情况失效,或者在用户有特殊需求的情况下使用。\emph{除非必要,用户不
% 应使用这些选项。}
@@ -1118,15 +1152,18 @@ This package consists of the file ctex.dtx, and the derived files
% \end{syntax}
% 指定字体映射机制。
% \end{function}
+% \begin{optdesc}
+% \item[true] 使用 \pkg{zhmetrics} 宏包,将 CJK 字库通过 \tn{special}
+% 命令映射到 \file{.ttf} 文件。
%
-% 选项为 \opt{true} 时,使用 \pkg{zhmetrics} 宏包,将 CJK 字库
-% 通过 \tn{special} 命令映射到 \file{.ttf} 文件;
-% 选项为 \opt{false} 时,使用传统的 CJK 字库(Type 1)^^A
-% \footnote{如果需要使用自定义的字体映射文件,或者希望使用 Type1 字库,请禁用本选项。};
-% 选项为 \opt{zhmCJK} 时,将载入 \pkg{zhmCJK} 宏包^^A
+% \item[false] 使用传统的 CJK 字库(Type 1)^^A
+% \footnote{如果需要使用自定义的字体映射文件,或者希望使用 Type1 字库,请禁用本选项。}。
+%
+% \item[zhmCJK] 载入 \pkg{zhmCJK} 宏包^^A
% \footnote{\pkg{zhmCJK} 宏包基于 \pkg{zhmetrics} 和 \pkg{CJK} 宏包,提供与
% \pkg{xeCJK} 宏包类似的用户接口。}^^A
% ,由 \pkg{zhmCJK} 宏包提供从 CJK 字库到 \file{.ttf} 的映射。
+% \end{optdesc}
%
% \begin{function}{fontset}
% \begin{syntax}
@@ -1134,9 +1171,9 @@ This package consists of the file ctex.dtx, and the derived files
% <none|adobe|fandol|founder|mac|ubuntu|windows|windowsnew|windowsold...>
% \OBOTH
% \end{syntax}
-% 指定 \CTeX{} 套件加载的字库。
+% 指定 \CTeX{} 宏集加载的字库。
%
-% 如果没有指定 \opt{fontset} 的值,\CTeX{} 套件将自动检测用户使用的操作系统,配置
+% 如果没有指定 \opt{fontset} 的值,\CTeX{} 宏集将自动检测用户使用的操作系统,配置
% 相应的字体(参见表~\ref{tab:default-font-select})。
% \end{function}
%
@@ -1167,11 +1204,11 @@ This package consists of the file ctex.dtx, and the derived files
% \begin{optdesc}
% \item[none] 不配置中文字体,需要用户自己配置。
% \item[\meta{name}] 这里 \meta{name} 为自定义的名字。
-% \CTeX{} 套件将载入名为 |ctex-fontset-|\meta{name}|.def| 的文件作为字体配置
+% \CTeX{} 宏集将载入名为 |ctex-fontset-|\meta{name}|.def| 的文件作为字体配置
% 文件。因此,请先保证文件的存在。可以在当前工作目录或者本地 \texttt{TDS} 目录
% 树下合适位置建立一个名为 |ctex-fontset-|\meta{name}|.def| 的文件,在这个文件
% 里面自定义中文字体。然后通过使用 |fontset=|\meta{name} 选项来调用它。字体配置
-% 文件的具体写法可以参考 \CTeX{} 套件 \texttt{fontset} 目录下的字体配置文件。
+% 文件的具体写法可以参考 \CTeX{} 宏集 \texttt{fontset} 目录下的字体配置文件。
% \end{optdesc}
%
% 注意:\emph{如果希望使用 \tn{ctexset} 在导言区指定字库,则需要先在宏包/文档类选项中指定
@@ -1185,7 +1222,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{document}
% \end{ctexexam}
%
-% \CTeX{} 套件预定义的中文字库还定义了一些字体命令。
+% \CTeX{} 宏集预定义的中文字库还定义了一些字体命令。
%
% \begin{optdesc}
% \item[\tn{songti}] 宋体,CJK 等价命令 |\CJKfamily{zhsong}|。
@@ -1214,16 +1251,14 @@ This package consists of the file ctex.dtx, and the derived files
% zihao = <-4|5|false>
% \OPC
% \end{syntax}
-% 将文章默认字号(\tn{normalsize})设置为小四号字或五号字,\tn{false} 禁用本功能。
-% 这两个选项可以用于三个 \CTeX{} 文档类和 \pkg{ctex} 宏包,
+% 将文章默认字号(\tn{normalsize})设置为小四号字或五号字,
+% 具体情况见表 \ref{tab:fontsize}。\opt{false} 禁用本功能。
+% 本选项可以用于三个 \CTeX{} 文档类和 \pkg{ctex} 宏包,
% 也可以用于 \pkg{ctexsize} 宏包。
%
% \opt{scheme = chinese} 时,默认值为 |5|,即设置 \tn{normalsize} 为五号字。
% \end{function}
%
-% \opt{cs4size} 和 \opt{c5size} 选项还会将标准文档类中的字体大小命令调整为
-% 中文字号(见表 \ref{tab:fontsize})。
-%
% \begin{table}[htbp]
% \centering
% \setlength\tabcolsep{1em}
@@ -1277,14 +1312,14 @@ This package consists of the file ctex.dtx, and the derived files
% heading = <\TFF>
% \opos{该选项只能在调用 \pkg{ctex.sty} 时作为宏包选项使用}
% \end{syntax}
-% \CTeX{} 套件提供了一套用于修改文档章节标题格式的接口。该选项用于选择是否
+% \CTeX{} 宏集提供了一套用于修改文档章节标题格式的接口。该选项用于选择是否
% 启用该功能。详细的设置方法请参见
% \ref{sec:secstyle}~节和 \ref{subs:pagestyle}~节。
% \end{function}
%
-% \CTeX{} 套件提供的三个文档类总是启用该功能。如果在 \pkg{ctex.sty} 下启用该选项,
+% \CTeX{} 宏集提供的三个文档类总是启用该功能。如果在 \pkg{ctex.sty} 下启用该选项,
% 将会检查当前是否使用 \LaTeX{} 标准文档类。
-% 若然,则该选项将会使得 \pkg{ctex.sty} 宏包的行为和 \CTeX{} 套件提供的
+% 若然,则该选项将会使得 \pkg{ctex.sty} 宏包的行为和 \CTeX{} 宏集提供的
% 三个中文文档类\emph{完全}一致;若不然,则会根据 \tn{chapter}
% 是否有定义来使用 \cls{ctexbook} 或者 \cls{ctexart} 的标题设置。
%
@@ -1317,6 +1352,7 @@ This package consists of the file ctex.dtx, and the derived files
% \OPC
% \end{syntax}
% 选择文章的排版方案,预设有 \opt{chinese} 和 \opt{plain} 两种方案。%
+% \end{function}
% \begin{optdesc}
% \item[chinese] 调整默认字号为五号字,并调整行距为 |1.3|;
% 汉化文档中的标题名字(如“图”、“表”、“目录”和“参考文献”,
@@ -1327,11 +1363,10 @@ This package consists of the file ctex.dtx, and the derived files
% 中文样式(见 \ref{sec:secstyle}~节)。当 \pkg{ctex} 宏包与标准文档类及其
% 衍生文档类联用时,会载入 \pkg{indentfirst} 宏包,
% 以实现章节标题后的段首缩进。
-% \item[plain] 不调整默认字号和行距,不会汉化文档中的标题名字,也不会将章节标题风格
-% 修改为中文样式,同时不会 \tn{pagestyle},并禁用 \opt{autoindent}
-% 选项。事实上,此时的 \CTeX{} 套件只提供了中文支持功能,而不对文章版式进行任何修改。
+% \item[plain] 不调整默认字号和行距,不会汉化文档中的标题名字,也不会将章节
+% 标题风格修改为中文样式,同时不会调整 \tn{pagestyle},并禁用 \opt{autoindent}
+% 选项。事实上,此时的 \CTeX{} 宏集只提供了中文支持功能,而不对文章版式进行任何修改。
% \end{optdesc}
-% \end{function}
%
% \begin{function}{punct}
% \begin{syntax}
@@ -1340,7 +1375,6 @@ This package consists of the file ctex.dtx, and the derived files
% \end{syntax}
% 设置标点处理格式。预定义好的格式有:
% \end{function}
-%
% \begin{optdesc}
% \item[quanjiao] 全角式:所有标点占一个汉字宽度,相邻两个标点占 1.5 汉字宽度;
% \item[banjiao] 半角式:所有标点占半个汉字宽度;
@@ -1391,14 +1425,15 @@ This package consists of the file ctex.dtx, and the derived files
% linespread = <数值>
% \OPC
% \end{syntax}
-% 接受一个浮点数值,设置行距倍数。
-%
-% \opt{scheme = chinese} 时,默认值为 1.3,即 1.3 倍行距。此时,相邻两行的基线
+% 接受一个浮点数值,设置行距倍数。本选项的初始值与 \opt{scheme} 有关。
+% \end{function}
+% \begin{optdesc}
+% \item[scheme = chinese] 初始值为 $1.3$,即 $1.3$ 倍行距。此时,相邻两行的基线
% (\tn{baselineskip})距离为 $1.3\times 1.2=1.56$ 倍字体高度。
%
-% \opt{scheme = plain} 时,\CTeX{} 套件默认不调整行距倍数,文档中的行距由所选文档类和
+% \item[scheme = plain] \CTeX{} 宏集默认不调整行距倍数,文档中的行距由所选文档类和
% 其他宏包或用户设置决定。
-% \end{function}
+% \end{optdesc}
%
% \begin{function}{autoindent}
% \begin{syntax}
@@ -1406,19 +1441,19 @@ This package consists of the file ctex.dtx, and the derived files
% \OBOTH
% \end{syntax}
% 在字体大小发生变化时,是否自动调整段首缩进(\tn{parindent})的大小。
-%
-% \meta{数值 \orbar 带单位的数值} 用于设置段首缩进的长度。如果不带单位,则默认
+% \end{function}
+% \begin{optdesc}
+% \item[\meta{数值或带单位的数值}] 用于设置段首缩进的长度。如果不带单位,则默认
% 单位是单个汉字字宽 \tn{ccwd};如果带单位,则使用该单位。
%
-% \opt{autoindent = true} 等价于设置 \opt{autoindent = 2}。
+% \item[true] 等价于设置 \opt{autoindent = 2}。
%
-% 当 \opt{autoindent = false} 时,可以设置固定长度的段首缩进。如设
-% 置每段缩进 40 点:
+% \item[false] 禁用自动调整功能,可以设置固定长度的段首缩进。如设置每段缩进 40 点:
% \begin{ctexexam}
% \ctexset{autoindent=false}
% \setlength\parindent{40pt}
% \end{ctexexam}
-% \end{function}
+% \end{optdesc}
%
% \begin{function}{linestretch}
% \begin{syntax}
@@ -1428,6 +1463,7 @@ This package consists of the file ctex.dtx, and the derived files
% \opt{linestretch} 是一个比较特殊的选项,它用来设置汉字之间弹性间距的弹性程
% 度。如果有单位,则可以在选项中直接写;如果是数字,单位则是汉字宽度
% \tn{ccwd} 的倍数。
+% \end{function}
%
% 如果行宽不是汉字宽度的整数倍,为了让段落左右两端对齐,自然就要求伸展汉字之
% 间的间距,而 \opt{linestretch} 选项就是设置每行总的允许伸行量。初始值是允
@@ -1441,7 +1477,6 @@ This package consists of the file ctex.dtx, and the derived files
% 如果将 \opt{linestretch} 选项的值设置为 \tn{maxdimen},则可以禁止按字号自
% 动修改每行的允许伸长量。此时汉字间的弹性间距则固定为 \tn{baselineskip} 的
% $0.08$ 倍。
-% \end{function}
%
% \section{文档汉化}
% \label{sec:chinese-localization}
@@ -1667,6 +1702,10 @@ This package consists of the file ctex.dtx, and the derived files
% 节标题的格式设置功能。本节就来介绍有关章节标题的格式选项,所有选项使用
% \tn{ctexset} 命令设置。
%
+% 第 \ref{subs:pagestyle} 节和本节介绍的功能已经被提取到 \pkg{ctexheading}
+% 宏包之中,可以在 \pkg{ctex} 宏包和 \cls{ctexart} 等文档类之外独立使用。
+% 各选项的默认值与 \opt{scheme = plain} 时的情形相同。
+%
% \changes{v2.0}{2015/03/21}{\tn{CTEXsetup}, \tn{CTEXoptions} 是过时命令。}
% 章节标题的格式选项是分层设置的。顶层的选项是章节标题名称,次一级的选项是章节
% 标题的格式。章节标题名包括 |part|, |chapter|, |section|, |subsection|,
@@ -1678,6 +1717,7 @@ This package consists of the file ctex.dtx, and the derived files
%
% 多级选项之间用斜线分开,例如,\opt{part/name} 选项设置 \tn{part} 标题的在数
% 字前后的名称,而 \opt{section/number} 选项设置 \tn{section} 标题的数字类型。
+% 注意斜线前后都不要有空格。
%
% \begin{function}{part/name, chapter/name, section/name, subsection/name,
% subsubsection/name, paragraph/name, subparagraph/name}
@@ -1703,8 +1743,8 @@ This package consists of the file ctex.dtx, and the derived files
% \caption{\opt{name} 选项的默认设置}
% \begin{tabular}{llll}
% \toprule
-% 标题名 & \makecell{\opt{scheme = chinese} \\ 的默认值} &
-% \makecell{\opt{scheme = plain} \\ 的默认值} & 注 \\
+% 标题名 & \opt{scheme = chinese} &
+% \opt{scheme = plain} & 注 \\
% \midrule
% part & |{第,部分}| & |{\partname\space}| & 原 \tn{partname} 为 Part \\
% chapter & |{第,章}| & |{\chaptername\space}|
@@ -1746,8 +1786,8 @@ This package consists of the file ctex.dtx, and the derived files
% \setlength\leftskip{0pt plus 1 fil minus \marginparwidth}
% \begin{tabular}{llll}
% \toprule
-% 标题名 & \makecell{\opt{scheme = chinese} \\ 的默认值} &
-% \makecell{\opt{scheme = plain} \\ 的默认值}
+% 标题名 & \opt{scheme = chinese} &
+% \opt{scheme = plain}
% & 原 |\the|\meta{标题} 等价定义 \\
% \midrule
% part & |\chinese{part}| & |\thepart| & |\Roman{part}| \\
@@ -1815,8 +1855,8 @@ This package consists of the file ctex.dtx, and the derived files
% \caption{\opt{format} 选项的默认设置}
% \begin{tabular}{lll}
% \toprule
-% 标题名 & \makecell{\opt{scheme = chinese} \\ 的默认值} &
-% \makecell{\opt{scheme = plain} \\ 的默认值} \\
+% 标题名 & \opt{scheme = chinese} &
+% \opt{scheme = plain} \\
% \midrule
% part (article) & |\centering| & |\raggedright| \\
% part & 同右 & |\centering| \\
@@ -1844,6 +1884,9 @@ This package consists of the file ctex.dtx, and the derived files
% \opt{titleformat} 选项。
%
% \opt{nameformat+} 用于在已有的章节名字格式后附加内容。
+%
+% \opt{nameformat} 选项的最后一个格式命令可以是一个有一个参数的命令。
+% 这个命令的参数用于接受章节名字和编号,实现特殊效果(见例~\ref{exam:miscopt})。
% \end{function}
%
% \begin{table}[htbp]
@@ -1851,8 +1894,8 @@ This package consists of the file ctex.dtx, and the derived files
% \caption{\opt{nameformat} 选项的默认设置}
% \begin{tabular}{lll}
% \toprule
-% 标题名 & \makecell{\opt{scheme = chinese} \\ 的默认值} &
-% \makecell{\opt{scheme = plain} \\ 的默认值} \\
+% 标题名 & \opt{scheme = chinese} &
+% \opt{scheme = plain} \\
% \midrule
% part (article) & 同右 & |\Large\bfseries| \\
% part & 同右 & |\huge\bfseries| \\
@@ -1880,6 +1923,10 @@ This package consists of the file ctex.dtx, and the derived files
%
% \opt{numberformat+} 选项用于在原有编号格式后面附加格式命令。
%
+% \opt{numberformat} 选项的最后一个格式命令可以是一个有一个参数的命令。
+% 这个命令的参数用于接受编号数字。
+% \end{function}
+%
% 例如,我们可以使用 \opt{numberformat} 特别强调章标题中的数字:
% \begin{ctexexam}
% \ctexset{
@@ -1887,22 +1934,25 @@ This package consists of the file ctex.dtx, and the derived files
% chapter/numberformat = \color{blue}\zihao{0}\itshape,
% }
% \end{ctexexam}
-% 上面的代码在 |cap| 选项下可以做出类似这样的章标题效果:
+% 上面的代码在 \opt{scheme = chinese} 时可以做出类似这样的章标题效果:
% \begin{center}
% \huge\bfseries 第 \textit{\color{blue}\zihao{0}4} 章
% \end{center}
-% \end{function}
%
% \begin{function}{part/aftername, chapter/aftername, section/aftername,
% subsection/aftername, subsubsection/aftername, paragraph/aftername,
-% subparagraph/aftername}
+% subparagraph/aftername,
+% .../aftername+}
% \begin{syntax}
-% aftername=\Arg{代码}
+% aftername = \Arg{代码}
+% aftername+= \Arg{代码}
% \OSET
% \end{syntax}
% \opt{aftername} 选项的参数 \meta{代码} 将被插入到章节编号与其后的标题内容之
% 间,用于控制格式变换。常用于控制章节编号与标题内容之间的距离,或者控制标题
% 是否另起一行。
+%
+% \opt{aftername+} 选项用于在原有代码后面附加代码。
% \end{function}
%
% \begin{table}[htbp]
@@ -1910,8 +1960,8 @@ This package consists of the file ctex.dtx, and the derived files
% \caption{\opt{aftername} 选项的默认设置}
% \begin{tabular}{lll}
% \toprule
-% 标题名 & \makecell{\opt{scheme = chinese} \\ 的默认值} &
-% \makecell{\opt{scheme = plain} \\ 的默认值} \\
+% 标题名 & \opt{scheme = chinese} &
+% \opt{scheme = plain} \\
% \midrule
% part (article) & |\quad| & |\par\nobreak| \\
% part & 同右 & |\par\vskip 20pt| \\
@@ -1967,8 +2017,8 @@ This package consists of the file ctex.dtx, and the derived files
% \caption{\opt{titleformat} 选项的默认设置}
% \begin{tabular}{lll}
% \toprule
-% 标题名 & \makecell{\opt{scheme = chinese} \\ 的默认值} &
-% \makecell{\opt{scheme = plain} \\ 的默认值} \\
+% 标题名 & \opt{scheme = chinese} &
+% \opt{scheme = plain} \\
% \midrule
% part (article) & |\Large\bfseries| & |\huge\bfseries| \\
% part & |\huge\bfseries| & |\Huge\bfseries| \\
@@ -1982,6 +2032,27 @@ This package consists of the file ctex.dtx, and the derived files
% \end{tabular}
% \end{table}
%
+% \begin{function}{part/aftertitle, chapter/aftertitle, section/aftertitle,
+% subsection/aftertitle, subsubsection/aftertitle, paragraph/aftertitle,
+% subparagraph/aftertitle,
+% .../aftertitle+}
+% \begin{syntax}
+% aftertitle = \Arg{代码}
+% aftertitle+= \Arg{代码}
+% \OSET
+% \end{syntax}
+% \opt{aftertitle} 选项的参数 \meta{代码} 将被插入到章节标题内容之后。
+% 可用于控制标题内容结束后是否另起一段。
+%
+% \opt{aftertitle+} 选项用于在原有代码后面附加代码。
+%
+% \opt{aftertitle} 选项的默认值,在 \opt{scheme} 选项的不同取值下相同。
+%
+% 使用 \opt{sub3section} 或 \opt{sub4section} 宏包选项(见
+% \ref{subs:options-heading}~节)后,\tn{paragraph} 与 \tn{subparagraph}
+% 这两级标题会改为排在不同段,会影响 \opt{aftertitle} 选项的默认值。
+% \end{function}
+%
% \begin{function}{part/beforeskip, chapter/beforeskip, section/beforeskip,
% subsection/beforeskip, subsubsection/beforeskip, paragraph/beforeskip,
% subparagraph/beforeskip}
@@ -2005,8 +2076,8 @@ This package consists of the file ctex.dtx, and the derived files
% \caption{\opt{beforeskip} 选项的默认设置}
% \begin{tabular}{lll}
% \toprule
-% 标题名 & \makecell{\opt{scheme = chinese} \\ 的默认值} &
-% \makecell{\opt{scheme = plain} \\ 的默认值} \\
+% 标题名 & \opt{scheme = chinese} &
+% \opt{scheme = plain} \\
% \midrule
% part (article) & |4ex| & |-4ex| \\
% part & 无效 & 无效 \\
@@ -2046,6 +2117,26 @@ This package consists of the file ctex.dtx, and the derived files
% \begin{table}[htbp]
% \begin{minipage}[t]{.5\linewidth}
% \small\centering
+% \caption{\opt{aftertitle} 选项的默认设置}
+% \begin{tabular}{ll}
+% \toprule
+% 标题名 & 默认值 \\
+% \midrule
+% part & |\par| \\
+% chapter & |\par| \\
+% section & |\@@par| \\
+% subsection & |\@@par| \\
+% subsubsection & |\@@par| \\
+% paragraph & |{}| \\
+% \qquad(sub3section) & |\@@par| \\
+% \qquad(sub4section) & 同上 \\
+% subparagraph & |{}| \\
+% \qquad(sub4section) & |\@@par| \\
+% \bottomrule
+% \end{tabular}
+% \end{minipage}%
+% \begin{minipage}[t]{.5\linewidth}
+% \small\centering
% \caption{\opt{afterskip} 选项的默认设置}
% \begin{tabular}{ll}
% \toprule
@@ -2065,26 +2156,6 @@ This package consists of the file ctex.dtx, and the derived files
% \bottomrule
% \end{tabular}
% \end{minipage}%
-% \begin{minipage}[t]{.5\linewidth}
-% \small\centering
-% \caption{\opt{indent} 选项的默认设置}
-% \begin{tabular}{ll}
-% \toprule
-% 标题名 & 默认值 \\
-% \midrule
-% part (article) & |0pt| \\
-% part & 无效 \\
-% chapter & |0pt| \\
-% section & |0pt| \\
-% subsection & |0pt| \\
-% subsubsection & |0pt| \\
-% paragraph & |0pt| \\
-% subparagraph & |\parindent| \\
-% \qquad(sub3section) & |0pt| \\
-% \qquad(sub4section) & |0pt| \\
-% \bottomrule
-% \end{tabular}
-% \end{minipage}%
% \end{table}
%
% \begin{function}{part/indent, chapter/indent, section/indent,
@@ -2109,16 +2180,28 @@ This package consists of the file ctex.dtx, and the derived files
% \noindent 无缩进的正文。
% \end{ctexexam}
%
-% \begin{function}{part/pagestyle, chapter/pagestyle}
-% \begin{syntax}
-% pagestyle = \Arg{页面格式}
-% \OSET
-% \end{syntax}
-% 设置 \cls{book}/\cls{ctexbook} 或 \cls{report}/\cls{ctexrep} 文档类
-% 中,\tn{part} 与 \tn{chapter} 标题所在页的页面格式(page style)。
-% \end{function}
-%
% \begin{table}[htbp]
+% \begin{minipage}[t]{.5\linewidth}
+% \small\centering
+% \caption{\opt{indent} 选项的默认设置}
+% \begin{tabular}{ll}
+% \toprule
+% 标题名 & 默认值 \\
+% \midrule
+% part (article) & |0pt| \\
+% part & 无效 \\
+% chapter & |0pt| \\
+% section & |0pt| \\
+% subsection & |0pt| \\
+% subsubsection & |0pt| \\
+% paragraph & |0pt| \\
+% subparagraph & |\parindent| \\
+% \qquad(sub3section) & |0pt| \\
+% \qquad(sub4section) & |0pt| \\
+% \bottomrule
+% \end{tabular}
+% \end{minipage}%
+% \begin{minipage}[t]{.5\linewidth}
% \small\centering
% \caption{\opt{pagestyle} 选项的默认设置}
% \begin{tabular}{ll}
@@ -2130,8 +2213,17 @@ This package consists of the file ctex.dtx, and the derived files
% chapter & |plain| \\
% \bottomrule
% \end{tabular}
+% \end{minipage}%
% \end{table}
%
+% \begin{function}{part/pagestyle, chapter/pagestyle}
+% \begin{syntax}
+% pagestyle = \Arg{页面格式}
+% \OSET
+% \end{syntax}
+% 设置 \cls{book}/\cls{ctexbook} 或 \cls{report}/\cls{ctexrep} 文档类
+% 中,\tn{part} 与 \tn{chapter} 标题所在页的页面格式(page style)。
+% \end{function}
%
% \begin{function}{appendix/name}
% \begin{syntax}
@@ -2153,12 +2245,12 @@ This package consists of the file ctex.dtx, and the derived files
% \caption{\opt{appendix/name} 选项的默认设置}
% \begin{tabular}{llllll}
% \toprule
-% 文档类 & 影响命令 & \makecell{\opt{scheme = chinese} \\ 的默认值} & 实际定义
-% & \makecell{\opt{scheme = plain} \\ 的默认值} & 实际定义 \\
+% 文档类 & 影响命令 & \opt{scheme = chinese} & 实际定义
+% & \opt{scheme = plain} & 实际定义 \\
% \midrule
% article & \tn{section} & |{}| & & |{}| & \\
-% book, report & \tn{chapter} & |\appendixname| & |附录|
-% & |\appendixname| & |Appendix| \\
+% book, report & \tn{chapter} & |\appendixname\space| & \verb*|附录 |
+% & |\appendixname\space| & \verb*|Appendix | \\
% \bottomrule
% \end{tabular}
% \end{table}
@@ -2190,6 +2282,36 @@ This package consists of the file ctex.dtx, and the derived files
% \end{tabular}
% \end{table}
%
+% 我们最后举一个稍微复杂的例子,来看看上述选项的综合应用。
+%
+% \begin{ctexexam}[labelref=exam:miscopt]
+% \ctexset {
+% chapter = {
+% format = \Huge\bfseries,
+% nameformat = \hrule height 1bp \relax\bigskip\hfill\chapternamebox,
+% number = \arabic{chapter},
+% aftername = \par\medskip,
+% titleformat = {},
+% aftertitle = \bigskip\hrule height 2bp \relax
+% }
+% }
+% \newcommand\chapternamebox[1]{%
+% \parbox{\ccwd}{\linespread{1}\selectfont\centering #1}}
+% ......
+% \chapter{熟悉 \LaTeX}
+% \end{ctexexam}
+% 本例的设置效果大致如下:
+% \begin{center}
+% \begin{minipage}{.75\linewidth}\Large\bfseries
+% \hrule height .5bp \relax
+% \medskip
+% \hfill\parbox{\ccwd}{\linespread{1}\selectfont\centering 第 1 章}
+% \par\smallskip
+% \noindent 熟悉 \LaTeX
+% \medskip\hrule height 1bp \relax
+% \end{minipage}
+% \end{center}
+%
% \section{实用命令}
% \label{sec:useful-commands}
% \subsection{字号与间距}
@@ -2204,31 +2326,30 @@ This package consists of the file ctex.dtx, and the derived files
%
% \begin{table}[htbp]
% \centering
-% \catcode`*\active
-% \def*{\phantom{.}}
-% \def~{\phantom{0}}
+% \def\ZH#1{\zihaopt{#1} & \zihao{#1}}
% \tabcolsep=1em
% \caption{中文字号}\label{tab:zihao}
-% \begin{tabular}{>{\ttfamily}ccl}
+% \begin{tabular}{>{\ttfamily}S[mode=text,detect-family,table-format=-1]
+% S[table-format=2.1]S[table-format=2.5]l}
% \toprule
-% $\meta{字号}$ & 大小(bp) & 意义 \\
+% {\meta{字号}} & {大小(bp)} & {大小(pt)} & 意义 \\
% \midrule
-% ~0 & 42*~ & \zihao{0} 初号 \\
-% -0 & 36*~ & \zihao{-0} 小初号 \\
-% ~1 & 26*~ & \zihao{1} 一号 \\
-% -1 & 24*~ & \zihao{-1} 小一号 \\
-% ~2 & 22*~ & \zihao{2} 二号 \\
-% -2 & 18*~ & \zihao{-2} 小二号 \\
-% ~3 & 16*~ & \zihao{3} 三号 \\
-% -3 & 15*~ & \zihao{-3} 小三号 \\
-% ~4 & 14*~ & \zihao{4} 四号 \\
-% -4 & 12*~ & \zihao{-4} 小四号 \\
-% ~5 & 10.5 & \zihao{5} 五号 \\
-% -5 & ~9*~ & \zihao{-5} 小五号 \\
-% ~6 & ~7.5 & \zihao{6} 六号 \\
-% -6 & ~6.5 & \zihao{-6} 小六号 \\
-% ~7 & ~5.5 & \zihao{7} 七号 \\
-% ~8 & ~5*~ & \zihao{8} 八号 \\
+% 0 & 42 & \ZH{0} 初号 \\
+% {−0} & 36 & \ZH{-0} 小初号 \\
+% 1 & 26 & \ZH{1} 一号 \\
+% -1 & 24 & \ZH{-1} 小一号 \\
+% 2 & 22 & \ZH{2} 二号 \\
+% -2 & 18 & \ZH{-2} 小二号 \\
+% 3 & 16 & \ZH{3} 三号 \\
+% -3 & 15 & \ZH{-3} 小三号 \\
+% 4 & 14 & \ZH{4} 四号 \\
+% -4 & 12 & \ZH{-4} 小四号 \\
+% 5 & 10.5 & \ZH{5} 五号 \\
+% -5 & 9 & \ZH{-5} 小五号 \\
+% 6 & 7.5 & \ZH{6} 六号 \\
+% -6 & 6.5 & \ZH{-6} 小六号 \\
+% 7 & 5.5 & \ZH{7} 七号 \\
+% 8 & 5 & \ZH{8} 八号 \\
% \bottomrule
% \end{tabular}
% \end{table}
@@ -2256,7 +2377,7 @@ This package consists of the file ctex.dtx, and the derived files
%
% \subsection{中文数字转换}
%
-% \CTeX{} 套件的中文数字转换功能实际上是调用 \pkg{zhnumber} 宏包来完成。下面只
+% \CTeX{} 宏集的中文数字转换功能实际上是调用 \pkg{zhnumber} 宏包来完成。下面只
% 介绍一些基本的用法,更高级的用法可以查阅 \pkg{zhnumber} 宏包的文档。
%
% \begin{function}{\chinese}
@@ -2312,7 +2433,7 @@ This package consists of the file ctex.dtx, and the derived files
% \section{\LuaLaTeX{} 下的中文支持方式}
% \label{sec:lualatex-chinese}
%
-% 在 \LuaLaTeX{} 下,\CTeX{} 套件依赖 \pkg{LuaTeX-ja} 宏包来完成中文支持。
+% 在 \LuaLaTeX{} 下,\CTeX{} 宏集依赖 \pkg{LuaTeX-ja} 宏包来完成中文支持。
% 该宏包是日本 \TeX{} 社区的北川弘典、前田一贵、八登崇之等人开发的,设计目的主要
% 是在 \LuaTeX{} 引擎下实现日本 p\TeX{} 引擎的(大部分)功能。它为了兼容 p\LaTeX
% 的使用习惯,对 \LaTeXe 的 \pkg{NFSS} 作了不少修改和扩充。这对于简体中文用户来说
@@ -2401,13 +2522,13 @@ This package consists of the file ctex.dtx, and the derived files
% 当前 CJK 字体族。清除与重置操作总是全局的。
% \end{function}
%
-% \section{\CTeX{} 套件的配置文件}
+% \section{\CTeX{} 宏集的配置文件}
%
-% \CTeX{} 套件提供了不同的配置文件,可以通过修改配置文件来改变 \CTeX{} 套件的
+% \CTeX{} 宏集提供了不同的配置文件,可以通过修改配置文件来改变 \CTeX{} 宏集的
% 默认行为。
%
-% 在多数情况下,并不需要修改配置文件,\CTeX{} 套件的默认设置已经能满足大多数用
-% 户的需要。不恰当地修改 \CTeX{} 套件的默认行为也可能导致同一文件在别处无法正
+% 在多数情况下,并不需要修改配置文件,\CTeX{} 宏集的默认设置已经能满足大多数用
+% 户的需要。不恰当地修改 \CTeX{} 宏集的默认行为也可能导致同一文件在别处无法正
% 常编译或排版效果完全不同,因此修改应该慎重。
%
% 但在一些情况下,直接修改配置文件仍是必要的,例如:
@@ -2417,10 +2538,10 @@ This package consists of the file ctex.dtx, and the derived files
% 与本机不同。
% \end{itemize}
%
-% 与 \CTeX{} 套件的源代码一样,配置文件采用 \LaTeX3 的语法编写。
+% 与 \CTeX{} 宏集的源代码一样,配置文件采用 \LaTeX3 的语法编写。
%
-% \CTeX{} 套件的配置文件随宏包其他文件一起安装在 \TeX{} 系统 TDS 目录树中,文
-% 件后缀是 \file{.cfg}。为了避免本地配置文件内容因 \CTeX{} 套件的更新而丢失,
+% \CTeX{} 宏集的配置文件随宏包其他文件一起安装在 \TeX{} 系统 TDS 目录树中,文
+% 件后缀是 \file{.cfg}。为了避免本地配置文件内容因 \CTeX{} 宏集的更新而丢失,
% 不要直接修改系统 TDS 目录树中的配置文件,而应该将系统自带的配置文件复制到本
% 地的或用户私有的 TDS 目录树中修改,并运行 |texhash| 命令刷新文件名数据库。
%
@@ -2451,7 +2572,7 @@ This package consists of the file ctex.dtx, and the derived files
% 第一个参数是固定的子模块 |ctex/option|,第二个参数中是用户定义的新的默认宏包
% 选项。
%
-% \file{ctexopts.cfg} 中的设置将在 \CTeX{} 套件的开始处,定义过宏包选项之后,
+% \file{ctexopts.cfg} 中的设置将在 \CTeX{} 宏集的开始处,定义过宏包选项之后,
% \tn{ProcessKeysOptions} 命令之前生效。最好只使用此配置文件修改宏包默认选项。
%
% \subsection{宏包载入后的配置}
@@ -2482,7 +2603,7 @@ This package consists of the file ctex.dtx, and the derived files
%
% \subsection{配置标题中文翻译}
%
-% 由于 \CTeX{} 套件需要同时支持 GBK 和 UTF-8 两种编码,因此对标题的中文翻译写
+% 由于 \CTeX{} 宏集需要同时支持 GBK 和 UTF-8 两种编码,因此对标题的中文翻译写
% 在两个配置文件当中:\file{ctex-name-gbk.cfg} 和 \file{ctex-name-utf8.cfg}。
% 两个文件的设置相同,只是编码不同。
%
@@ -2491,7 +2612,7 @@ This package consists of the file ctex.dtx, and the derived files
% \subsection{自定义字体集}
%
% \ref{subs:options-CJK-font}~节介绍的用于 |fontset| 选项的自定义字库文件,
-% 类似于 \CTeX{} 套件的配置文件,也应该与其他本地配置文件一起保存在本地
+% 类似于 \CTeX{} 宏集的配置文件,也应该与其他本地配置文件一起保存在本地
% \texttt{TDS} 目录树下,并可以配合 \file{ctexopts.cfg} 等配置文件使用。
%
% \section{对旧版本的兼容性}
@@ -2598,7 +2719,7 @@ This package consists of the file ctex.dtx, and the derived files
%
% \begin{function}{fntef}
% 旧版本的 \opt{fntef} 选项用于统一 \pkg{CCTfntef} 与 \pkg{CJKfntef} 的界面,
-% 新版本 \CTeX{} 套件不再支持 \pkg{CCT},而是直接载入 \pkg{CJKfntef} 或
+% 新版本 \CTeX{} 宏集不再支持 \pkg{CCT},而是直接载入 \pkg{CJKfntef} 或
% \pkg{xeCJKfntef} 宏包并禁用其彩色设置。该选项是过时选项。
% \end{function}
%
@@ -2606,7 +2727,7 @@ This package consists of the file ctex.dtx, and the derived files
% \CTEXunderwave, \CTEXsout, \CTEXxout, \CTEXfilltwosides}
% 在调用 \opt{fntef} 宏包选项的同时,旧版本 \CTeX{} 宏包由于需要支持 \pkg{CCT}
% 系统,会将以 |\CJK| 开头的 \tn{CJKunderline} 等宏换名为以 |\CTEX| 开头的
-% \tn{CTEXunderline} 等宏。此功能在新版本的 \CTeX{} 套件中已失去意义。
+% \tn{CTEXunderline} 等宏。此功能在新版本的 \CTeX{} 宏集中已失去意义。
%
% 此外,在 \pdfTeX{} 引擎下,用于设置格式的 \tn{CJKunderdotbasesep} 等宏也被换
% 名为 \tn{CTEXunderdotbasesep} 等宏。
@@ -2642,9 +2763,9 @@ This package consists of the file ctex.dtx, and the derived files
%
% \begin{function}{\Chinese}
% \begin{syntax}
-% \tn{Chinese}\oarg{counter}
+% \tn{Chinese}\Arg{counter}
% \end{syntax}
-% 新版套件中 \tn{chinese} 统一了旧版本中 \tn{chinese} 和 \tn{Chinese} 的功能。因此,
+% 新版宏集中 \tn{chinese} 统一了旧版本中 \tn{chinese} 和 \tn{Chinese} 的功能。因此,
% 该命令已过时。
% \end{function}
%
@@ -2711,6 +2832,7 @@ This package consists of the file ctex.dtx, and the derived files
%<@@=ctex>
% \end{macrocode}
%
+% \pkg{ctexcap} 是默认打开 \opt{heading} 选项的 \pkg{ctex}。
% \begin{macrocode}
%<*ctexcap>
\PassOptionsToPackage { heading = true } { ctexcap }
@@ -2718,10 +2840,38 @@ This package consists of the file ctex.dtx, and the derived files
%</ctexcap>
% \end{macrocode}
%
+% 宏包载入检查。
+% \begin{macrocode}
+%<*class|ctex>
+\tl_const:Nx \c_@@_version_tl
+ { \cs_if_exist_use:cF { ver@ \@currname . \@currext } { 9999/99/99 } }
+%<*class>
+\cs_new_eq:cN { ver@ctex. \@pkgextension } \c_@@_version_tl
+\cs_new_eq:cN { ver@ctexcap. \@pkgextension } \c_@@_version_tl
+\cs_new_eq:cN { ver@ctexsize. \@pkgextension } \c_@@_version_tl
+\cs_new_eq:cN { ver@ctexheading. \@pkgextension } \c_@@_version_tl
+%</class>
+%<*ctex>
+\msg_new:nnnn { ctex } { subpackage-loaded }
+ { Package~`#1'~can~not~be~loaded~with~`ctex'. }
+ {
+ `#1'~is~actually~a~part~of~`ctex'.\\
+ It~is~not~necessary~to~load~it~separately.
+ }
+\@ifpackageloaded { ctexsize }
+ { \msg_error:nnn { ctex } { subpackage-loaded } { ctexsize } }
+ { \cs_new_eq:cN { ver@ctexsize. \@pkgextension } \c_@@_version_tl }
+\@ifpackageloaded { ctexheading }
+ { \msg_error:nnn { ctex } { subpackage-loaded } { ctexheading } }
+ { \cs_new_eq:cN { ver@ctexheading. \@pkgextension } \c_@@_version_tl }
+%</ctex>
+%</class|ctex>
+% \end{macrocode}
+%
% \begin{macrocode}
-%<*class|style|ctexsize>
+%<*class|style>
\RequirePackage { xparse , l3keys2e }
-%</class|style|ctexsize>
+%</class|style>
% \end{macrocode}
%
% 检查 \pkg{expl3} 和 \pkg{l3keys2e} 的版本。
@@ -2742,89 +2892,48 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
%
% \begin{macrocode}
-%<*class|style>
-\RequirePackage { etoolbox , ifpdf , fix-cm , everysel }
+%<*class|ctex|ctexheading>
+% \end{macrocode}
+%
+% \begin{macrocode}
+\RequirePackage { etoolbox }
+%<!ctexheading>\RequirePackage { fix-cm , everysel }
% \end{macrocode}
%
% \subsection{内部函数与变量}
%
-% \begin{variable}[internal]
+% \begin{variable}[int]
% {\l_@@_tmp_tl,\l_@@_tmp_int,\l_@@_tmp_dim,\l_@@_tmp_box}
% \begin{macrocode}
\tl_new:N \l_@@_tmp_tl
\int_new:N \l_@@_tmp_int
-\dim_new:N \l_@@_tmp_dim
+%<!ctexheading>\dim_new:N \l_@@_tmp_dim
\box_new:N \l_@@_tmp_box
% \end{macrocode}
% \end{variable}
%
-% 对旧版本的宏包给出错误信息。
-% \begin{macrocode}
-\msg_new:nnnn { ctex } { package-too-old }
- { Support~package~`#1'~too~old. }
- {
- Please~update~an~up~to~date~version~of~the~package~`#1'\\
- using~your~TeX~package~manager~or~from~CTAN.
- }
-% \end{macrocode}
-%
-% \begin{macro}[internal]{\ctex_lua_now_x:n}
-% 最新的 \pkg{expl3} 去掉了 \pkg{l3luatex} 模块,因而 \cs{lua_now_x:n} 不再有定义。
-% \begin{macrocode}
-\cs_new_eq:NN \ctex_lua_now_x:n \luatex_directlua:D
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}[internal]{\ctex_if_pdfmode:TF}
-% \tn{ifpdf} 的简单 wrapper。
-% \begin{macrocode}
-\ifpdf
- \cs_new_eq:NN \ctex_if_pdfmode:TF \use_i:nn
-\else:
- \cs_new_eq:NN \ctex_if_pdfmode:TF \use_ii:nn
-\fi:
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}[internal]{\ctex_if_preamble:TF}
-% 测试是否在 \LaTeXe{} 的导言区。\LaTeXe{} 中的 \tn{@onlypreamble} 命令可以处
-% 理宏参数,使其在 \env{document} 环境后被重定义为 \tn{@notprerr},而又由于
-% \tn{@onlypreamble} 本身也被这样处理过,因此可以测试 \tn{@onlypreamble} 是否
-% 与 \tn{@notprerr} 相同来确定是否在导言区。
-% \begin{macrocode}
-\prg_new_conditional:Npnn \ctex_if_preamble: { TF }
- {
- \if_meaning:w \@onlypreamble \@notprerr
- \prg_return_false:
- \else:
- \prg_return_true:
- \fi:
- }
-% \end{macrocode}
-% \end{macro}
-%
% \begin{macro}[int]{\ctex_at_end_package:nn}
% 与 \pkg{filehook} 的 \tn{AtEndOfPackageFile*} 类似,如果原来没有在载入宏包则
% 在宏包末尾执行语句,否则立即执行。
% \begin{macrocode}
\cs_new_protected:Npn \ctex_at_end_package:nn #1#2
{
- \@ifpackageloaded { #1 }
- { #2 }
- { \ctex_add_hook:cn { g_@@_at_end_ #1 _hook_tl } { #2 } }
+ \@ifpackageloaded {#1}
+ {#2}
+ { \ctex_gadd_hook:cn { g_@@_at_end_ #1 _hook_tl } {#2} }
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[int]{\ctex_add_hook:Nn, \ctex_add_hook:cn}
+% \begin{macro}[int]{\ctex_gadd_hook:Nn, \ctex_gadd_hook:cn}
% 给钩子附加内容。
% \begin{macrocode}
-\cs_new_protected:Npn \ctex_add_hook:Nn #1#2
+\cs_new_protected:Npn \ctex_gadd_hook:Nn #1#2
{
\tl_if_exist:NF #1 { \tl_new:N #1 }
- \tl_gput_right:Nn #1 { #2 }
+ \tl_gput_right:Nn #1 {#2}
}
-\cs_generate_variant:Nn \ctex_add_hook:Nn { c }
+\cs_generate_variant:Nn \ctex_gadd_hook:Nn { c }
% \end{macrocode}
% \end{macro}
%
@@ -2843,10 +2952,13 @@ This package consists of the file ctex.dtx, and the derived files
% 对 \tn{@popfilename} 做补丁来实现 \cs{ctex_at_end_package:nn} 的功能。
% \begin{macrocode}
\tl_put_left:Nn \@popfilename
- { \ctex_package_end_hook:o { \@currname } }
+ {
+ \cs_if_eq:NNT \@currext \@pkgextension
+ { \ctex_package_end_hook:o { \@currname } }
+ }
% \end{macrocode}
%
-% \begin{macro}[internal]{\ctex_file_wrapper:nnn}
+% \begin{macro}[int]{\ctex_file_wrapper:nnn}
% 设置文件操作的 \tn{catcode} 环境,参数 |#1| 是设置,|#2| 是文件操作,|#3| 是恢复。
% 默认关闭 \LTXIII{} 语法环境,并设置 |@| 的 \tn{catcode} 为 $11$。
% \begin{macrocode}
@@ -2868,7 +2980,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_file_input:n}
+% \begin{macro}[int]{\ctex_file_input:n}
% 输入文件。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \ctex_file_input:n #1
@@ -2876,7 +2988,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_scheme_input:n}
+% \begin{macro}[int]{\ctex_scheme_input:n}
% 输入 \opt{scheme} 文件。先查找当前文档类下的 \meta{scheme},找不到再查找一般的文件。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \ctex_scheme_input:n #1
@@ -2897,7 +3009,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_parse_name:NN}
+% \begin{macro}[int]{\ctex_parse_name:NN}
% 用 \tn{DeclareRobustCommand} 定义的宏或者由 \tn{newcommand} 或 \tn{newrobustcmd}
% 定义的带一个可选参数的宏第一次展开的结果都不是其实际定义,实际定义被保存在另外的
% 宏中。由这些命令定义的宏的第一次展开结果可以有下面的形式(细节可查阅 \pkg{xpatch}
@@ -2935,15 +3047,15 @@ This package consists of the file ctex.dtx, and the derived files
\group_begin:
\use:x
{
+ \group_end:
\@@_parse_name:nNNNnN { \token_get_replacement_spec:N #2 }
- \exp_not:N #2 \exp_not:c { #3 ~ } \exp_not:c { /#3 } {#3}
- } #1
+ \exp_not:N #2 \exp_not:c { #3 ~ } \exp_not:c { /#3 }
+ } {#3} #1
}
{ #1#2 }
}
\cs_new_protected:Npn \@@_parse_name:nNNNnN #1#2#3#4#5#6
{
- \group_end:
\exp_args:Nc #6
{
\str_case:nnTF {#1}
@@ -2975,17 +3087,17 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]
+% \begin{macro}[int]
% {\ctex_patch_cmd:NnnTF,\ctex_preto_cmd:NnTF,\ctex_appto_cmd:NnTF}
% 在打补丁前先解析实际名字。
% \begin{macrocode}
-\cs_new_protected:Npn \ctex_patch_cmd:NnnTF { \ctex_parse_name:NN \patchcmd }
-\cs_new_protected:Npn \ctex_preto_cmd:NnTF { \ctex_parse_name:NN \pretocmd }
-\cs_new_protected:Npn \ctex_appto_cmd:NnTF { \ctex_parse_name:NN \apptocmd }
+\cs_new_protected_nopar:Npn \ctex_patch_cmd:NnnTF { \ctex_parse_name:NN \patchcmd }
+\cs_new_protected_nopar:Npn \ctex_preto_cmd:NnTF { \ctex_parse_name:NN \pretocmd }
+\cs_new_protected_nopar:Npn \ctex_appto_cmd:NnTF { \ctex_parse_name:NN \apptocmd }
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_patch_cmd:Nnn}
+% \begin{macro}[int]{\ctex_patch_cmd:Nnn}
% 参数记号 |#| 作为宏的参数被读入时,总是会双写,会影响随后的字符串替换。需要先
% 将它转换为普通符号。并且在补丁的时候关闭 \LTXIII{} 语法。
% \begin{macrocode}
@@ -3019,7 +3131,68 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_set_default_ccwd:Nn}
+% \begin{variable}[int]{\g_@@_section_depth_flag}
+% 若大于 |3|,则 \tn{paragraph} 和 \tn{subparagraph} 标题单独占一行;若为 |3|,则
+% \tn{paragraph} 单独占一行。
+% \begin{macrocode}
+\cs_new_eq:NN \g_@@_section_depth_flag \c_two
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macrocode}
+%</class|ctex|ctexheading>
+%<*class|ctex>
+% \end{macrocode}
+%
+% 对旧版本的宏包给出错误信息。
+% \begin{macrocode}
+\msg_new:nnnn { ctex } { package-too-old }
+ { Support~package~`#1'~too~old. }
+ {
+ Please~update~an~up~to~date~version~of~the~package~`#1'\\
+ using~your~TeX~package~manager~or~from~CTAN.
+ }
+% \end{macrocode}
+%
+% \begin{macro}[int]{\ctex_lua_now_x:n}
+% 最新的 \pkg{expl3} 去掉了 \pkg{l3luatex} 模块,因而 \cs{lua_now_x:n} 不再有定义。
+% \begin{macrocode}
+\cs_new_eq:NN \ctex_lua_now_x:n \luatex_directlua:D
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v2.1}{2015/05/25}{不依赖 \pkg{ifpdf} 宏包。}
+%
+% \begin{macro}[int]{\ctex_if_pdfmode:TF}
+% \pkg{ifpdf} 宏包的简单实现。
+% \begin{macrocode}
+\cs_if_exist:NTF \pdftex_pdfoutput:D
+ {
+ \int_compare:nNnTF \pdftex_pdfoutput:D > \c_zero
+ {
+ \cs_new_eq:NN \ifctexpdf \tex_iftrue:D
+ \cs_new_eq:NN \ctex_if_pdfmode:TF \use_i:nn
+ }
+ }
+ { \use:n }
+ {
+ \cs_new_eq:NN \ifctexpdf \tex_iffalse:D
+ \cs_new_eq:NN \ctex_if_pdfmode:TF \use_ii:nn
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[int]{\ctex_if_preamble:TF}
+% 测试是否在 \LaTeXe{} 的导言区。在宏包内部初始为真,在 \tn{AfterEndPreamble}
+% 钩子中再设置为假。注意,\tn{AfterEndPreamble} 在 \tn{AtBeginDocument} 之后执行,
+% 可以与 \tn{@onlypreamble} 的行为一致。
+% \begin{macrocode}
+\cs_new_eq:NN \ctex_if_preamble:TF \use_i:nn
+\AfterEndPreamble { \cs_set_eq:NN \ctex_if_preamble:TF \use_ii:nn }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[int]{\ctex_set_default_ccwd:Nn}
% 若参数 |#2| 带长度单位,则设置它为 |tl| 变量 |#1| 的值,否则以 \tn{ccwd} 为单位。
% \begin{macrocode}
\cs_new:Npn \ctex_set_default_ccwd:Nn #1#2
@@ -3032,7 +3205,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_default_pt:n}
+% \begin{macro}[int]{\ctex_default_pt:n}
% 最新版本的 \pkg{expl3} 已经不允许 \cs{dim_to_decimal:n} 的参数带额外的单位。
% 然而我们需要这个特性实现可展的 \tn{@defaultunits}。
% \begin{macrocode}
@@ -3052,7 +3225,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{variable}[internal]{\l_@@_encoding_tl}
+% \begin{variable}[int]{\l_@@_encoding_tl}
% (pdf)\LaTeX{} 初始化编码为 GBK,其它则是 UTF8。
% \begin{macrocode}
\tl_new:N \l_@@_encoding_tl
@@ -3061,51 +3234,43 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}[internal]{\g_@@_section_depth_flag}
-% 若大于 |3|,则 \tn{paragraph} 和 \tn{subparagraph} 标题单独占一行;若为 |3|,则
-% \tn{paragraph} 单独占一行。
-% \begin{macrocode}
-\cs_new_eq:NN \g_@@_section_depth_flag \c_two
-% \end{macrocode}
-% \end{variable}
-%
-% \begin{variable}[internal]{\g_@@_zhmCJK_bool}
+% \begin{variable}[int]{\g_@@_zhmCJK_bool}
% 是否使用 \pkg{zhmCJK} 宏包。
% \begin{macrocode}
\bool_new:N \g_@@_zhmCJK_bool
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}[internal]{\l_@@_autoindent_tl}
+% \begin{variable}[int]{\l_@@_autoindent_tl}
% 保存 \opt{autoindent} 选项的值,空值表示不自动调整首行缩进。
% \begin{macrocode}
\tl_new:N \l_@@_autoindent_tl
% \end{macrocode}
% \end{variable}
%
-% \begin{macro}[internal]{\ctex_if_autoindent_touched:F}
+% \begin{macro}[int]{\ctex_if_autoindent_touched:F}
% 检查 \opt{autoindent} 选项是否被用户设置。
% \begin{macrocode}
\cs_new_eq:NN \ctex_if_autoindent_touched:F \use:n
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_zhmap_case:nnn}
+% \begin{macro}[int]{\ctex_zhmap_case:nnn}
% 参数 |#1| 是 \pkg{zhmCJK} 的内容,|#2| 是 \pkg{zhmetrics}。
% \begin{macrocode}
\cs_new_eq:NN \ctex_zhmap_case:nnn \use_ii:nnn
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_at_end:n}
+% \begin{macro}[int]{\ctex_at_end:n}
% 区分 \tn{AtEndOfClass} 和 \tn{AtEndOfPackage},虽然它们的意思都是一样的。
% \begin{macrocode}
%<class>\cs_new_protected_nopar:Npn \ctex_at_end:n { \AtEndOfClass }
-%<style>\cs_new_protected_nopar:Npn \ctex_at_end:n { \AtEndOfPackage }
+%<ctex>\cs_new_protected_nopar:Npn \ctex_at_end:n { \AtEndOfPackage }
% \end{macrocode}
% \end{macro}
%
-% \begin{variable}[internal]{\g_@@_std_options_clist}
+% \begin{variable}[int]{\g_@@_std_options_clist}
% 保存传递给标准文档类的选项。
% \begin{macrocode}
%<*class>
@@ -3133,22 +3298,25 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
%
% \begin{macrocode}
-%</class|style>
-%<*class|style|ctexsize>
+%</class|ctex>
% \end{macrocode}
%
-% \begin{variable}[internal]{\g_@@_font_size_flag}
+% \begin{variable}[int]{\g_@@_font_size_flag}
% |0| 表示修改默认字体大小为五号,|1| 为小四号,其它值则不作修改。
% \begin{macrocode}
+%<*class|ctex|ctexsize>
\cs_new_eq:NN \g_@@_font_size_flag \c_minus_one
+%</class|ctex|ctexsize>
% \end{macrocode}
% \end{variable}
%
% \subsection{宏包选项}
%
% \begin{macrocode}
+%<*class|style>
\keys_define:nn { ctex / option }
{
+%</class|style>
% \end{macrocode}
%
% \changes{v2.0}{2015/05/06}{新增 \opt{zihao} 选项。}
@@ -3156,14 +3324,15 @@ This package consists of the file ctex.dtx, and the derived files
%
% \begin{macro}{zihao}
% \begin{macrocode}
+%<*class|ctex|ctexsize>
zihao .choice: ,
zihao .default:n = { 5 } ,
zihao / 5 .code:n = { \cs_gset_eq:NN \g_@@_font_size_flag \c_zero } ,
zihao / -4 .code:n = { \cs_gset_eq:NN \g_@@_font_size_flag \c_one } ,
zihao / false .code:n = { \cs_gset_eq:NN \g_@@_font_size_flag \c_two } ,
%<ctexsize> }
-%</class|style|ctexsize>
-%<*class|style>
+%</class|ctex|ctexsize>
+%<*class|ctex>
c5size .code:n =
{
\msg_warning:nnn { ctex } { deprecated-option }
@@ -3278,7 +3447,7 @@ This package consists of the file ctex.dtx, and the derived files
Option~ `fontset=adobe'~ is~ set.~ It~ is~ better~ to~ use~
fontset~ option.
}
- \keys_set:nn { ctex / option } { fontset = none }
+ \keys_set:nn { ctex / option } { fontset = adobe }
} ,
winfonts .code:n =
{
@@ -3287,7 +3456,7 @@ This package consists of the file ctex.dtx, and the derived files
Option~ `fontset=windows'~ is~ set.~ It~ is~ better~ to~ use~
fontset~ option.
}
- \keys_set:nn { ctex / option } { fontset = none }
+ \keys_set:nn { ctex / option } { fontset = windows }
} ,
nofonts .value_forbidden: ,
winfonts .value_forbidden: ,
@@ -3374,13 +3543,44 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
+% \begin{macrocode}
+%</class|ctex>
+%<*class|ctex|ctexheading>
+% \end{macrocode}
+%
+% \begin{macro}{sub3section,sub4section}
+% \begin{macrocode}
+ sub3section .code:n =
+ { \cs_gset_eq:NN \g_@@_section_depth_flag \c_three } ,
+ sub4section .code:n =
+ { \cs_gset_eq:NN \g_@@_section_depth_flag \c_four } ,
+ sub3section .value_forbidden: ,
+ sub4section .value_forbidden: ,
+% \end{macrocode}
+% \end{macro}
+%
% \changes{v2.0}{2015/04/15}{新增 \opt{scheme} 选项,并将 \opt{cap} 和 \opt{nocap}
-% 列为过时选项}
+% 列为过时选项。}
% \begin{macro}{scheme}
% \begin{macrocode}
scheme .tl_set:N = \l_@@_scheme_tl ,
- scheme .default:n = { chinese },
- scheme .initial:n = { chinese },
+%<*ctexheading>
+ scheme .default:n = { plain } ,
+ scheme .initial:n = { plain }
+ }
+%</ctexheading>
+%<*!ctexheading>
+ scheme .default:n = { chinese } ,
+ scheme .initial:n = { chinese } ,
+%</!ctexheading>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</class|ctex|ctexheading>
+%<*class|ctex>
+% \end{macrocode}
+%
+% \begin{macrocode}
cap .code:n =
{
\msg_warning:nnn { ctex } { deprecated-option }
@@ -3398,21 +3598,12 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{sub3section,sub4section}
-% \begin{macrocode}
- sub3section .code:n =
- { \cs_gset_eq:NN \g_@@_section_depth_flag \c_three } ,
- sub4section .code:n =
- { \cs_gset_eq:NN \g_@@_section_depth_flag \c_four } ,
- sub3section .value_forbidden: ,
- sub4section .value_forbidden: ,
-% \end{macrocode}
-% \end{macro}
-%
% \changes{v2.0}{2015/04/20}{\opt{hyperref} 成为过时选项,原选项功能总是打开。}
% \changes{v2.0}{2015/04/20}{\opt{fancyhdr} 成为过时选项,原选项功能总是打开。}
% \changes{v2.0}{2015/04/20}{\opt{fntef} 成为过时选项,原选项功能总是打开。}
% \begin{macro}{fntef,fancyhdr,hyperref}
+% \changes{v2.1}{2015/06/03}{补充定义 \tn{hypersetup}。}
+% 这些都是过时的宏包兼容选项,原选项功能总是打开的。
% \begin{macrocode}
fntef .code:n =
{
@@ -3423,12 +3614,17 @@ This package consists of the file ctex.dtx, and the derived files
{
\msg_warning:nnn { ctex } { deprecated-option }
{ `fancyhdr'~ package~ is~ loaded. }
- \RequirePackage{ fancyhdr }
+ \RequirePackage { fancyhdr }
} ,
hyperref .code:n =
{
\msg_warning:nnn { ctex } { deprecated-option }
{ `hyperref'~ package~ will~ be~ loaded. }
+ \ctex_at_end:n
+ {
+ \cs_if_exist:NF \hypersetup
+ { \cs_new_eq:NN \hypersetup \ctex_hypersetup:n }
+ }
\AtEndPreamble { \RequirePackage { hyperref } }
} ,
}
@@ -3436,8 +3632,8 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macro}
%
% \begin{macrocode}
-%</class|style>
-%<*class|style|ctexsize>
+%</class|ctex>
+%<*class|ctex|ctexsize>
% \end{macrocode}
%
% \changes{v2.0}{2015/05/06}{兼容 \pkg{extsizes} 宏包、\cls{beamer}、\pkg{memoir}
@@ -3487,20 +3683,21 @@ This package consists of the file ctex.dtx, and the derived files
%
% \begin{macrocode}
%<!ctexsize>\ctex_file_input:n { ctexopts.cfg }
+%</class|ctex|ctexsize>
% \end{macrocode}
%
% \begin{macrocode}
+%<*class|style>
\ProcessKeysOptions { ctex / option }
+%</class|style>
% \end{macrocode}
%
% \begin{macrocode}
-%</class|style|ctexsize>
-%<*class|style>
+%<*class>
% \end{macrocode}
%
% 五号字使用标准文档类的 |10pt| 字体大小设置,小四号字则使用 |12pt|。
% \begin{macrocode}
-%<*class>
\if_case:w \g_@@_font_size_flag
\clist_gput_right:Nn \g_@@_std_options_clist { 10pt }
\or:
@@ -3525,27 +3722,10 @@ This package consists of the file ctex.dtx, and the derived files
\PassOptionsToClass { \g_@@_std_options_clist } { report }
\LoadClass { report }
%</report>
-%</class>
% \end{macrocode}
%
% \begin{macrocode}
-\tl_set_eq:Nc \l_@@_tmp_tl { ver@ \@currname . \@currext }
-%<*class>
-\cs_new_eq:cN { ver@ctex. \@pkgextension } \l_@@_tmp_tl
-\cs_new_eq:cN { ver@ctexcap. \@pkgextension } \l_@@_tmp_tl
-\cs_new_eq:cN { ver@ctexsize. \@pkgextension } \l_@@_tmp_tl
%</class>
-%<*style>
-\msg_new:nnnn { ctex } { ctexsize-loaded }
- { Package~`ctexsize'~can~not~be~loaded~before~`ctex'. }
- {
- `ctexsize'~is~actually~a~part~of~`ctex'.\\
- It~is~not~necessary~to~load~it~separately.
- }
-\@ifpackageloaded { ctexsize }
- { \msg_error:nn { ctex } { ctexsize-loaded } }
- { \cs_new_eq:cN { ver@ctexsize. \@pkgextension } \l_@@_tmp_tl }
-%</style>
% \end{macrocode}
%
% \subsection{用户设置接口}
@@ -3554,8 +3734,9 @@ This package consists of the file ctex.dtx, and the derived files
%
% \begin{macro}{\ctexset}
% \begin{macrocode}
-\NewDocumentCommand \ctexset { +m }
- { \keys_set:nn { ctex } {#1} }
+%<*class|ctex|ctexheading>
+\NewDocumentCommand \ctexset { } { \keys_set:nn { ctex } }
+%</class|ctex|ctexheading>
% \end{macrocode}
% \end{macro}
%
@@ -3563,6 +3744,7 @@ This package consists of the file ctex.dtx, and the derived files
% \begin{macro}{\CTEXsetup,\CTEXoptions}
% 过时命令。
% \begin{macrocode}
+%<*class|ctex>
\NewDocumentCommand \CTEXsetup { +o > { \TrimSpaces } m }
{
\msg_warning:nnnn { ctex } { deprecated-command } { \CTEXsetup }
@@ -3575,13 +3757,10 @@ This package consists of the file ctex.dtx, and the derived files
{ \ctexset~ {~ #1~ }~ is~ set. }
\IfNoValueF {#1} { \keys_set:nn { ctex } {#1} }
}
+%</class|ctex>
% \end{macrocode}
% \end{macro}
%
-% \begin{macrocode}
-%</class|style>
-% \end{macrocode}
-%
% \subsection{特定引擎支持与设置}
%
% \subsubsection{\pkg{ctex-engine-pdftex.def}}
@@ -3590,6 +3769,81 @@ This package consists of the file ctex.dtx, and the derived files
%<*pdftex>
% \end{macrocode}
%
+% \changes{v2.1}{2015/05/18}{给 \pdfLaTeX{} 下的非 UTF8 编码 CJK 字体族加上 CMap。}
+%
+% \begin{variable}[int]{\c_@@_cmap_encoding_seq}
+% 需要加上 CMap 的 CJK 字体编码。
+% \begin{macrocode}
+\seq_new:N \c_@@_cmap_encoding_seq
+\seq_set_from_clist:Nn \c_@@_cmap_encoding_seq
+ { C19 , C10 , C00 , C09 , C40 , C60 }
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[int]{\ctex_family_cmap:nn}
+% 在 \tn{DeclareFontFamily} 的 \meta{loading-settings} 中给 CJK 字体族加上 CMap。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ctex_family_cmap:nn #1#2
+ {
+ \cs_if_free:cF { #1 + #2 }
+ {
+ \seq_if_in:NnT \c_@@_cmap_encoding_seq {#1}
+ { \tl_gput_right:cn { #1 + #2 } { \ctex_add_cmap:n {#1} } }
+ }
+ }
+\cs_generate_variant:Nn \ctex_family_cmap:nn { x }
+\cs_new_eq:NN \CTEX@Family@CMap \ctex_family_cmap:xn
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[int]{\ctex_add_cmap:n}
+% 给 |#1| 编码的 CJK 字体加上 CMap。
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \ctex_add_cmap:n #1
+ {
+ \cs_if_free:NF \CJK@plane
+ { \ctex_add_cmap:cn { @@_add_cmap_ #1 \CJK@plane : } {#1} }
+ }
+\cs_new_protected_nopar:Npn \ctex_add_cmap:Nn #1#2
+ {
+ \cs_if_exist:NF #1 { \@@_save_cmap:Nn #1 {#2} }
+ #1
+ }
+\cs_generate_variant:Nn \ctex_add_cmap:Nn { c }
+\cs_new_protected_nopar:Npn \@@_save_cmap:Nn #1#2
+ {
+ \tex_lowercase:D { \tl_set:Nx \l_@@_tmp_tl { #2 \CJK@plane } }
+ \tex_immediate:D \pdfobj stream ~ file { \l_@@_tmp_tl .cmap }
+ \cs_new_protected_nopar:Npx #1
+ {
+ \exp_not:N \pdffontattr \exp_not:N \font
+ { /ToUnicode ~ \int_use:N \pdflastobj \c_space_tl 0 ~ R }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[int]{\DeclareFontFamily}
+% 只在 \pdfLaTeX{} 下加 CMap。如 \pkg{cmap} 宏包被引入,则不重复设置。
+% \begin{macrocode}
+\group_begin:
+\char_set_catcode_other:N \#
+\ctex_if_pdfmode:TF
+ {
+ \group_end:
+ \ExplSyntaxOff
+ \ctex_appto_cmd:NnTF \DeclareFontFamily { \CTEX@Family@CMap {#1} {#2} }
+ {
+ \ctex_at_end_package:nn { cmap }
+ { \cs_gset_eq:NN \CTEX@Family@CMap \use_none:nn }
+ }
+ { \ctex_patch_failure:N \DeclareFontFamily }
+ \ExplSyntaxOn
+ }
+ { \group_end: }
+% \end{macrocode}
+% \end{macro}
+%
% 首先检查选项,决定是否载入 \pkg{zhmCJK} 宏包。
% \begin{macrocode}
\if_bool:N \g_@@_zhmCJK_bool
@@ -3605,7 +3859,7 @@ This package consists of the file ctex.dtx, and the derived files
\RequirePackage { CJKpunct , CJKspace }
% \end{macrocode}
%
-% \begin{macro}[internal]{\ctex_load_zhmap:nnnn}
+% \begin{macro}[int]{\ctex_load_zhmap:nnnn}
% 载入 \pkg{zhmetrics} 的字体映射文件,同时设置 \tn{CJKrmdefault} 等。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \ctex_load_zhmap:nnnn #1#2#3#4
@@ -3643,7 +3897,7 @@ This package consists of the file ctex.dtx, and the derived files
\fi:
% \end{macrocode}
%
-% \begin{macro}[internal]{\ctex_CJK_input:n,\CJK@input}
+% \begin{macro}[int]{\ctex_CJK_input:n,\CJK@input}
% \pkg{breqn} 包可能会在正文中将 |^| 的 \tn{catcode} 改为 $12$ 或 $13$,这将
% 破坏 \pkg{CJK} 对汉字的首字节的定义(\tn{CJK@loadBinding} 和
% \tn{CJK@loadEncoding})。因此需要确保载入 \file{.enc} 和 \file{.bdg} 文件时,
@@ -3668,7 +3922,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_plane_to_utfxvibe:Nn,\CJK@surr}
+% \begin{macro}[int]{\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
@@ -3765,7 +4019,7 @@ This package consists of the file ctex.dtx, and the derived files
\fi:
% \end{macrocode}
%
-% \begin{macro}[internal]{\ctex_auto_ignorespaces:}
+% \begin{macro}[int]{\ctex_auto_ignorespaces:}
% 关闭名字空间,保存 \tn{CJK@@ignorespaces} 的定义,方便使用。
% \begin{macrocode}
%<@@=>
@@ -3777,7 +4031,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_ignorespaces_case:N,\ctex_set_ignorespaces:}
+% \begin{macro}[int]{\ctex_ignorespaces_case:N,\ctex_set_ignorespaces:}
% 设置忽略空格的的方式。根据 \opt{space} 选项的值重定义 \tn{CJK@ignorespaces},
% 并保存起来供 \tn{CJKhook} 备用。
% \begin{macrocode}
@@ -3792,16 +4046,16 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\CJKhook}
+% \begin{macro}[int]{\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: }
+\ctex_gadd_hook:Nn \CJKhook { \ctex_set_ignorespaces: }
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_punct_set:n}
+% \begin{macro}[int]{\ctex_punct_set:n}
% 设置 CJK 族对应到实际的字体。|#1| 是 \opt{fontset} 的名字。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \ctex_punct_set:n #1
@@ -3824,7 +4078,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_punct_map_family:nn}
+% \begin{macro}[int]{\ctex_punct_map_family:nn}
% CJK 族 |#1| 使用族 |#2| 的边界信息。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \ctex_punct_map_family:nn #1#2
@@ -3835,7 +4089,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_punct_map_bfseries:nn}
+% \begin{macro}[int]{\ctex_punct_map_bfseries:nn}
% CJK 族 |#1| 的 \tn{bfseries} 使用族 |#2| 的边界信息。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \ctex_punct_map_bfseries:nn #1#2
@@ -3858,7 +4112,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_punct_map_itshape:nn}
+% \begin{macro}[int]{\ctex_punct_map_itshape:nn}
% CJK 族 |#1| 的 \tn{itshape} 使用族 |#2| 的边界信息。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \ctex_punct_map_itshape:nn #1#2
@@ -3873,7 +4127,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_punct_space:nn,\ctexspadef}
+% \begin{macro}[int]{\ctex_punct_space:nn,\ctexspadef}
% 定义标点的边界信息。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \ctex_punct_space:nn #1#2
@@ -4069,7 +4323,7 @@ This package consists of the file ctex.dtx, and the derived files
%
% \paragraph{字体切换方式}
%
-% \begin{macro}[internal]{\ctex_ltj_select_font:,\CJK@family}
+% \begin{macro}[int]{\ctex_ltj_select_font:,\CJK@family}
% \tn{CJK@family} 保存的是当前 CJK 实际的字体族名,如果为空表示没有设置过字体。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \ctex_ltj_select_font:
@@ -4084,7 +4338,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\@@_select_font_aux:}
+% \begin{macro}[int]{\@@_select_font_aux:}
% 使用 \tn{pickup@font} 取得字体名称前,总需要先设置 \tn{font@name}。在这里将
% \tn{f@family} 换成 CJK 字体族,并确保编码正确。
% \begin{macrocode}
@@ -4117,7 +4371,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_ltj_pickup_font:}
+% \begin{macro}[int]{\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:
@@ -4135,7 +4389,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_ltj_extract_font:}
+% \begin{macro}[int]{\ctex_ltj_extract_font:}
% \pkg{LuaTeX-ja} 的 \tn{globaljfont} 在 \pkg{luatexja-core} 中定义:
% \begin{verbatim}
% %%%%%%%% \jfont\CS={...:...;jfm=metric;...}, \globaljfont
@@ -4170,14 +4424,14 @@ This package consists of the file ctex.dtx, and the derived files
% 赋值总是全局的,不会受到分组的影响。
% \begin{macrocode}
\font@name
- \ctex_lua_now_x:n { font.current(tex.attribute['ltj@curjfnt']) }
+ \ctex_lua_now_x:n { font.current(tex.getattribute('ltj@curjfnt')) }
\use:c { \f@encoding + \f@family }
\use:c { \curr@fontshape }
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_ltj_subst_font:}
+% \begin{macro}[int]{\ctex_ltj_subst_font:}
% \tn{do@subst@correction} 在设置通过 \texttt{sub} 或者 \texttt{ssub} 函数定义的
% 字体时会用到。如果没有设置 \opt{SlantedFont},\pkg{fontspec} 会设置
% \tn{itdefault} 作为 \tn{sldefault} 的替代字形,因而会用到这个函数。它的本来定义是:
@@ -4217,7 +4471,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal,TF]{\ctex_ltj_if_alternate_shape_exist:n}
+% \begin{macro}[int,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 }
@@ -4245,7 +4499,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_ltj_select_alternate_font:}
+% \begin{macro}[int]{\ctex_ltj_select_alternate_font:}
% 在 \tn{selectfont} 中更新替代字体。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \ctex_ltj_select_alternate_font:
@@ -4266,7 +4520,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ltj@pickup@altfont@auxy}
+% \begin{macro}[int]{\ltj@pickup@altfont@auxy}
% 被用在函数 |output_alt_font_cmd| 中,作用是定义替代字体。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \ltj@pickup@altfont@auxy #1
@@ -4288,7 +4542,7 @@ This package consists of the file ctex.dtx, and the derived files
%<@@=>
% \end{macrocode}
%
-% \begin{macro}[internal]{\ltj@pickup@altfont@copy}
+% \begin{macro}[int]{\ltj@pickup@altfont@copy}
% 被用在函数 |pickup_alt_font_a| 中。\tn{ltj@@getjfontnumber} 的作用是将字体命令
% |#1| 对应的 \texttt{font.id} 保存到 \tn{ltj@tempcntc} 中。
% \begin{macrocode}
@@ -4355,7 +4609,7 @@ This package consists of the file ctex.dtx, and the derived files
\ExplSyntaxOn
% \end{macrocode}
%
-% \begin{macro}[internal]{\ctex_mono_jfm:n,\l_@@_jfm_tl}
+% \begin{macro}[int]{\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
@@ -4370,7 +4624,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\CJK@encoding,\@@_change_encoding:}
+% \begin{macro}[int]{\CJK@encoding,\@@_change_encoding:}
% 在 \LaTeX 下,\pkg{LuaTeX-ja} 依赖字体编码来实现特殊设置。例如上述的
% \tn{ltj@@IsFontJapanese} 就是通过判断编码来实现的,它在设置数学字体时会用到。所以
% 不应该与西文共用 \texttt{EU2}。定义字体族 song 为 \tn{CJK@encoding} 的默认替换
@@ -4416,7 +4670,7 @@ This package consists of the file ctex.dtx, and the derived files
\cs_new:Npn \@@_noembed_wrap:n #1 { psft: #1 }
% \end{macrocode}
%
-% \begin{macro}[internal]{\ctex_ltj_set_family:nnn}
+% \begin{macro}[int]{\ctex_ltj_set_family:nnn}
% 将自定义的字体族名与 \pkg{fontspec} 实际设置的名字对应起来。
% \begin{macrocode}
\cs_new_protected:Npn \ctex_ltj_set_family:nnn #1#2#3
@@ -4450,7 +4704,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{variable}[internal]
+% \begin{variable}[int]
% {\g_@@_family_name_prop,\g_@@_family_font_name_prop,\g_@@_family_font_options_prop}
% 分别保存 \pkg{fontspec} 设置的字体族名、字体名称和字体选项。
% \begin{macrocode}
@@ -4460,7 +4714,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{variable}
%
-% \begin{macro}[internal]{\@@_check_family:n}
+% \begin{macro}[int]{\@@_check_family:n}
% 删除重复的定义,清除替代字体的先前设置。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_check_family:n #1
@@ -4485,7 +4739,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\@@_gset_family_cs:nn}
+% \begin{macro}[int]{\@@_gset_family_cs:nn}
% 在设置字体时,实际上并不是马上就定义。而是只保存相关参数,在通过 \tn{CJKfamily}
% 第一次使用时才定义。需要注意将编码改为 \tn{CJK@encoding}。
% \begin{macrocode}
@@ -4520,7 +4774,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\CJKfamily}
+% \begin{macro}[int]{\CJKfamily}
% 切换字体。
% \begin{macrocode}
\NewDocumentCommand \CJKfamily { m }
@@ -4539,7 +4793,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal,TF]{\ctex_ltj_family_if_exist:n}
+% \begin{macro}[int,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 }
@@ -4559,7 +4813,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\@@_family_unknown_warning:n}
+% \begin{macro}[int]{\@@_family_unknown_warning:n}
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_family_unknown_warning:n #1
{
@@ -4602,7 +4856,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_ltj_fontspec:nn}
+% \begin{macro}[int]{\ctex_ltj_fontspec:nn}
% \begin{macrocode}
\cs_new_protected_nopar:Npn \ctex_ltj_fontspec:nn #1#2
{
@@ -4643,7 +4897,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]
+% \begin{macro}[int]
% {\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
@@ -4674,7 +4928,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]
+% \begin{macro}[int]
% {\setCJKfamilyfont,\newCJKfontfamily,\CJKfontspec,\addCJKfontfeatures}
% \begin{macrocode}
\NewDocumentCommand \setCJKfamilyfont { m O { } m }
@@ -4701,7 +4955,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]
+% \begin{macro}[int]
% {\setCJKmainfont,\setCJKsansfont,\setCJKmonofont,
% \setCJKmathfont,\defaultCJKfontfeatures}
% \begin{macrocode}
@@ -4752,7 +5006,7 @@ This package consists of the file ctex.dtx, and the derived files
{ \ctex_patch_failure:N \normalfont }
% \end{macrocode}
%
-% \begin{macro}[internal]{\ctex_ltj_ensure_default_family:}
+% \begin{macro}[int]{\ctex_ltj_ensure_default_family:}
% 在导言区结束确认 \tn{CJKfamilydefault} 确实存在。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \ctex_ltj_ensure_default_family:
@@ -4783,7 +5037,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_ltj_update_mathfont:}
+% \begin{macro}[int]{\ctex_ltj_update_mathfont:}
% 更新数学字体为实际的字体。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \ctex_ltj_update_mathfont:
@@ -4829,7 +5083,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_ltj_set_alternate_seq:n}
+% \begin{macro}[int]{\ctex_ltj_set_alternate_seq:n}
% 我们使用 \verb=||= 作为替代字体序列的分隔标志。它可能被设置为活动字符,为此
% 需要先“消毒”,同时过滤掉空元素。
% \begin{macrocode}
@@ -4858,7 +5112,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_ltj_set_alternate_family:nnF}
+% \begin{macro}[int]{\ctex_ltj_set_alternate_family:nnF}
% 如果在字体的选项中设置了 \opt{CharRange},则只设置替代字体。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \ctex_ltj_set_alternate_family:nnF #1#2#3
@@ -4875,7 +5129,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]
+% \begin{macro}[int]
% {\ctex_ltj_save_alternate_seq:Nn,\ctex_ltj_save_alternate_seq:Nnnwn}
% 保存由 \opt{AlternateFont} 设置的替代字体序列。
% \begin{macrocode}
@@ -4909,7 +5163,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_ltj_set_alternate_family:nn}
+% \begin{macro}[int]{\ctex_ltj_set_alternate_family:nn}
% 设置选项 \opt{CharRange} 范围内的替代字体。如果已经定义了主字体,我们也马上
% 定义替代字体,否则只保存起来备用。
% \begin{macrocode}
@@ -4932,7 +5186,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_ltj_save_alternate_family:Nnnn}
+% \begin{macro}[int]{\ctex_ltj_save_alternate_family:Nnnn}
% 保存替代字体序列的定义,以备定义主字体时使用。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \ctex_ltj_save_alternate_family:Nnnn #1#2#3#4
@@ -4944,7 +5198,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_ltj_set_alternate_family:nnn}
+% \begin{macro}[int]{\ctex_ltj_set_alternate_family:nnn}
% 实际定义替代字体族。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \ctex_ltj_set_alternate_family:nnn #1#2#3
@@ -4962,7 +5216,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_ltj_swap_cs:NN}
+% \begin{macro}[int]{\ctex_ltj_swap_cs:NN}
% 交换两个控制序列的意义。
% \begin{macrocode}
\cs_new_protected:Npn \ctex_ltj_swap_cs:NN #1#2
@@ -4975,7 +5229,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{LTJFONTUID,\@@_update_family_uid:N}
+% \begin{macro}[int]{LTJFONTUID,\@@_update_family_uid:N}
% \pkg{fontspec} 在一个字体族的选项和字体名称相同的时候,就不定义新字体。为了
% 避免混淆替代字体的设置,我们新定义一个虚拟的选项 \opt{LTJFONTUID},确保
% \pkg{fontspec} 对 CJK 字体族总是定义新字体。
@@ -4990,7 +5244,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_ltj_declare_alternate_shape:nnnnnn}
+% \begin{macro}[int]{\ctex_ltj_declare_alternate_shape:nnnnnn}
% 在定义替代字体的字形时,通过字符范围与主字体的对应字形关联起来。
% \tn{DeclareFontShape@} 一个有六个参数,我们只需要使用它的第三个参数 \meta{series}
% 和第四个参数 \meta{shape}。
@@ -5005,7 +5259,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_ltj_set_alternate_shape:Nnnnnnn}
+% \begin{macro}[int]{\ctex_ltj_set_alternate_shape:Nnnnnnn}
% 与 \pkg{LuaTeX-ja} 的 \tn{DeclareAlternateKanjiFont} 的功能类似,区别是固定编码
% 为 \tn{CJK@encoding}。这个设置总是全局的。
% \begin{macrocode}
@@ -5028,7 +5282,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_ltj_set_alternate_shape:nnn}
+% \begin{macro}[int]{\ctex_ltj_set_alternate_shape:nnn}
% 我们使用 \texttt{->} 而不是像 \pkg{LuaTeX-ja} 一样使用 \texttt{-} 作为区间的
% 分隔符。\pkg{LuaTeX-ja} 支持使用负数来引用由 \texttt{JFM} 设置的字符类。如果
% 使用 \texttt{-} 作为分隔符,那么负数单独使用时,就需要把它放在两层花括号之内
@@ -5061,7 +5315,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_ltj_set_alternate_shape:nnN}
+% \begin{macro}[int]{\ctex_ltj_set_alternate_shape:nnN}
% 若字符范围预先由 \texttt{declarecharrange} 声明,则可以直接使用。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \ctex_ltj_set_alternate_shape:nnN #1#2#3
@@ -5158,7 +5412,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_ltj_declare_char_range:nn,\g_@@_char_range_prop}
+% \begin{macro}[int]{\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
@@ -5174,7 +5428,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_ltj_save_char_range:n}
+% \begin{macro}[int]{\ctex_ltj_save_char_range:n}
% 预先解释字符区间的意义。
% \begin{macrocode}
\NewDocumentCommand \ctex_ltj_save_char_range:n
@@ -5195,7 +5449,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_ltj_def_char_range_key:n}
+% \begin{macro}[int]{\ctex_ltj_def_char_range_key:n}
% 在字体设置选项中定义字符范围键。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \ctex_ltj_def_char_range_key:n #1
@@ -5209,7 +5463,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_ltj_char_range_key:nn}
+% \begin{macro}[int]{\ctex_ltj_char_range_key:nn}
% 如果字符范围键没有值,则只设置的这个字符范围内的替代字体。
% \begin{macrocode}
\cs_new_protected:Npn \ctex_ltj_char_range_key:nn #1#2
@@ -5227,7 +5481,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\@@_char_range_parse_feature:w}
+% \begin{macro}[int]{\@@_char_range_parse_feature:w}
% 可以使用加方括号的方式,通过文件名来调用字体。这容易与字体选项混淆。例如,需要
% 将 |[simsun.ttc]| 设置为 \opt{range} 的主字体,就需要使用
% |range={{[simsun.ttc]}}| 或者 |[]{[simsun.ttc]}|。下面的目的是,支持直接使用
@@ -5252,7 +5506,7 @@ This package consists of the file ctex.dtx, and the derived files
%
% \paragraph{其它设置}
%
-% \begin{macro}[internal]{\ctex_ltj_update_xkanjiskip:,\l_@@_xkanjiskip_skip}
+% \begin{macro}[int]{\ctex_ltj_update_xkanjiskip:,\l_@@_xkanjiskip_skip}
% \tn{ltjsetparameter} 对 \opt{xkanjiskip} 是即时赋值。\tn{zw} 与字体相关,因此
% 需要每次 \tn{selectfont} 的时候更新一次 \opt{xkanjiskip}。如果用户设置过
% \opt{xkanjiskip},就不更新。注意,同 \TeX{} 的 \tn{baselineskip} 一样,如果在
@@ -5312,7 +5566,7 @@ This package consists of the file ctex.dtx, and the derived files
%
% \subsubsection{调整 \tn{CJKfamilydefault}}
%
-% \begin{macro}[internal]{\ctex_update_default_family:}
+% \begin{macro}[int]{\ctex_update_default_family:}
% 在导言区结束,如果 \tn{CJKfamilydefault} 没有被更改,则在此时根据西文字体的情况
% 更新 \tn{CJKfamilydefault}。\pkg{xeCJK} 已经有这个功能,不需要再调整。
% \begin{macrocode}
@@ -5347,7 +5601,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\l_@@_family_default_init_tl}
+% \begin{macro}[int]{\l_@@_family_default_init_tl}
% 往 \tn{CJKfamilydefault} 中加入标志,用于判断它是否被更改。
% \begin{macrocode}
\tl_new:N \l_@@_family_default_init_tl
@@ -5366,7 +5620,7 @@ This package consists of the file ctex.dtx, and the derived files
%
% \changes{v2.0}{2014/04/16}{自动检测操作系统,载入对应的字体配置。}
%
-% \begin{macro}[internal]{\ctex_detected_platform:}
+% \begin{macro}[int]{\ctex_detected_platform:}
% 在 \LuaTeX{} 下直接用调用 |os.name| 来判断。
% \begin{macrocode}
%<*luatex>
@@ -5415,8 +5669,9 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_if_macosx:TF}
-% 以 \file{/mach_kernel} 为特征文件判断 Mac~OS~X。
+% \begin{macro}[int]{\ctex_if_macosx:TF}
+% \changes{v2.1}{2015/06/17}{改用 \file{/Library/Fonts/Songti.ttc} 为特征文件。}
+% 以 \file{/Library/Fonts/Songti.ttc} 为特征文件判断 Mac~OS~X。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \ctex_if_macosx:TF #1#2
{
@@ -5424,23 +5679,25 @@ This package consists of the file ctex.dtx, and the derived files
{ \tl_gset:Nn \g_@@_fontset_tl {#1} }
{ \tl_gset:Nn \g_@@_fontset_tl {#2} }
}
-\tl_const:Nn \c_@@_macosx_file_tl { /mach_kernel }
+\tl_const:Nn \c_@@_macosx_file_tl { /Library/Fonts/Songti.ttc }
%</xetex|pdftex>
% \end{macrocode}
% \end{macro}
%
% \subsubsection{\pkg{hyperref} 兼容性处理}
%
+% \changes{v2.1}{2015/06/16}{不再设置 \pkg{hyperref} 宏包的 \opt{colorlinks} 选项。}
+%
% 现在处理各个引擎下的 PDF 中文书签问题。根据编译引擎与文件编码的不
% 同,\pkg{ctex} 向 \pkg{hyperref} 传递适当的参数,完成中文书签的正确设置。用
% 户仍需要自己载入 \pkg{hyperref} 宏包。
%
-% \begin{macro}[internal]{\ctex_hypersetup:n}
+% \begin{macro}[int]{\ctex_hypersetup:n}
% 如果已经载入 \pkg{hyperref} 宏包,则直接使用其定义设置选项;否则
% \cs{ctex_hypersetup:n} 的效果与 \tn{PassOptionsToPackage} 一致,只传递宏包参
% 数。如果用户不载入 \pkg{hyperref} 宏包,相关参数即被丢弃。
% \begin{macrocode}
-%<*class|style>
+%<*class|ctex>
\@ifpackageloaded { hyperref }
{
\cs_new_protected_nopar:Npn \ctex_hypersetup:n #1
@@ -5450,8 +5707,7 @@ This package consists of the file ctex.dtx, and the derived files
\cs_new_protected_nopar:Npn \ctex_hypersetup:n #1
{ \PassOptionsToPackage {#1} { hyperref } }
}
-\ctex_hypersetup:n { colorlinks = true }
-%</class|style>
+%</class|ctex>
% \end{macrocode}
% \end{macro}
%
@@ -5536,7 +5792,7 @@ This package consists of the file ctex.dtx, and the derived files
%
% \subsubsection{\pkg{CJKfntef}、\pkg{xeCJKfntef} 相关设置}
%
-% \CTeX{} 套件对 \pdfTeX{} 与 \XeTeX{} 引擎,分别载入 \pkg{CJKfntef} 或
+% \CTeX{} 宏集对 \pdfTeX{} 与 \XeTeX{} 引擎,分别载入 \pkg{CJKfntef} 或
% \pkg{xeCJKfntef} 宏包,并关闭宏包默认的彩色等多余格式。
%
% \changes{v2.0}{2015/03/25}{默认关闭 \pkg{CJKfntef} 或 \pkg{xeCJKfntef} 的彩
@@ -5549,8 +5805,25 @@ This package consists of the file ctex.dtx, and the derived files
% 的宏定义是过时命令,仅做兼容性保留。
%
% \begin{macrocode}
-%<pdftex>\RequirePackage { CJKfntef } \normalem
-%<xetex>\RequirePackage { xeCJKfntef }
+%<*pdftex>
+\RequirePackage { CJKfntef }
+\normalem
+\cs_new_protected_nopar:Npn \@@_clear_fntef_color:n #1
+ { \tl_clear:c { CJK#1color } }
+%</pdftex>
+%<*xetex>
+\RequirePackage { xeCJKfntef }
+\@ifpackagelater { xeCJKfntef } { 2014/11/04 }
+ {
+
+ \cs_new_protected_nopar:Npn \@@_clear_fntef_color:n #1
+ { \xeCJKsetup { #1 / format = { } } }
+ }
+ {
+ \cs_new_protected_nopar:Npn \@@_clear_fntef_color:n #1
+ { \tl_clear:c { CJK#1color } }
+ }
+%</xetex>
%<*luatex>
\msg_new:nnn { ctex } { fntef-not-available }
{ Functions~ of~ `CJKfntef'~ is~ not~ available~ in~ LuaLaTeX. }
@@ -5560,8 +5833,7 @@ This package consists of the file ctex.dtx, and the derived files
{ underdot , underline , underdblline , underwave , sout , xout }
%<*pdftex|xetex>
{
-%<pdftex> \tl_clear:c { CJK#1color }
-%<xetex> \keys_set:nn { xeCJK / options } { #1 / format = { } }
+ \@@_clear_fntef_color:n {#1}
\cs_new_protected_nopar:cpx { CTEX#1 }
{
\msg_warning:nnnn { ctex } { deprecated-command } { \exp_not:c { CTEX#1 } }
@@ -5600,7 +5872,7 @@ This package consists of the file ctex.dtx, and the derived files
%
% \subsubsection{\tn{ccwd} 的更新}
%
-% \begin{macro}[internal]{\ctex_update_ccwd:,\ccwd}
+% \begin{macro}[int]{\ctex_update_ccwd:,\ccwd}
% \begin{macrocode}
\cs_new_protected_nopar:Npn \ctex_update_ccwd:
%<*pdftex|xetex>
@@ -5616,7 +5888,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_update_ccglue:}
+% \begin{macro}[int]{\ctex_update_ccglue:}
% 更新字间距。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \ctex_update_ccglue:
@@ -5636,7 +5908,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal,pTF]{\ctex_if_ccglue_touched:}
+% \begin{macro}[int,pTF]{\ctex_if_ccglue_touched:}
% 检查用户是否修改过汉字间距。
% \begin{macrocode}
\prg_new_conditional:Npnn \ctex_if_ccglue_touched: { TF }
@@ -5660,7 +5932,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_update_em_unit:}
+% \begin{macro}[int]{\ctex_update_em_unit:}
% 将当前汉字的宽度保存到 \tn{ccwd} 中备用。不采用 \texttt{1 em},因为这时的
% \texttt{1 em} 实际上来自西文字体的信息,未必等于汉字的宽度,这似乎在传统的
% \file{.tfm} 字体上表现更明显。在 \pdfTeX{} 和 \XeTeX{} 下,直接使用 |\f@size\p@|
@@ -5678,7 +5950,7 @@ This package consists of the file ctex.dtx, and the derived files
%
% \subsubsection{其它}
%
-% \begin{macro}[internal]{\ctex_add_to_selectfont:n,\CTEX@selectfont@hook}
+% \begin{macro}[int]{\ctex_add_to_selectfont:n,\CTEX@selectfont@hook}
% \tn{EverySelectfont} 直到文档开始时才有效。为了 \tn{ccwd} 和 \pkg{LuaTeX-ja} 的
% 字体设置在导言区也可用,我们还需要在这里手工修改 \tn{selectfont}。\pkg{everysel}
% 宏包会用 \tn{CheckCommand} 来检查 \tn{selectfont} 是否为标准定义。我们修改了
@@ -5779,7 +6051,7 @@ This package consists of the file ctex.dtx, and the derived files
%
% \begin{macrocode}
%</pdftex|xetex|luatex>
-%<*class|style>
+%<*class|ctex>
% \end{macrocode}
%
% \subsubsection{载入引擎定义文件}
@@ -5833,7 +6105,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_update_size:}
+% \begin{macro}[int]{\ctex_update_size:}
% 在字号变化时更新 \tn{ccwd}、\tn{parindent} 和汉字间距。字距为零则恢复正常设置。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \ctex_update_size:
@@ -5876,7 +6148,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_update_stretch:}
+% \begin{macro}[int]{\ctex_update_stretch:}
% 首先计算一行上汉字的字数,\tn{CJKglue} 相当于将 \tn{linewidth} 与汉字总宽度之差
% 均匀地填充到汉字之间。\hologo{eTeX} 的除法是四舍五入,而我们这里应该用截断。由于
% 没有可展性的要求,直接用原语 \cs{tex_divide:D} 要比 \cs{int_div_truncate:nn}
@@ -5923,7 +6195,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_update_parindent:}
+% \begin{macro}[int]{\ctex_update_parindent:}
% 更新段落首行缩进。此函数在字号变化时调用。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \ctex_update_parindent:
@@ -5950,7 +6222,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_update_ziju:}
+% \begin{macro}[int]{\ctex_update_ziju:}
% 更新字距。若字距不大于 $-1$,即 \tn{ccwd} 为非正值,则不计算伸缩值。
% 否则,首先假定汉字的宽度为正常宽度加上字距,看一行上能正常放下多少个汉字。
% \begin{macrocode}
@@ -6092,7 +6364,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
%
% \begin{macrocode}
-%<*style>
+%<*ctex>
\msg_new:nnn { ctex } { ctexbibname }
{
Neither~`\token_to_str:N \bibname'~nor~`\token_to_str:N \refname'~can~be~found.\\
@@ -6108,11 +6380,11 @@ This package consists of the file ctex.dtx, and the derived files
\keys_define:nn { ctex } { bibname .tl_set:N = \ctexbibname }
}
}
-%</style>
+%</ctex>
% \end{macrocode}
%
% \begin{macrocode}
-%</class|style>
+%</class|ctex>
% \end{macrocode}
%
% \subsection{中文化的标题结构}
@@ -6124,7 +6396,7 @@ This package consists of the file ctex.dtx, and the derived files
%
% \subsubsection{定义标题格式选项}
%
-% \begin{variable}[internal]{\c_@@_headings_seq}
+% \begin{variable}[int]{\c_@@_headings_seq}
% \begin{macrocode}
\seq_new:N \c_@@_headings_seq
\seq_gset_from_clist:Nn \c_@@_headings_seq
@@ -6136,7 +6408,9 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{variable}
%
-% \begin{macro}[internal]{\@@_initial_heading:n}
+% \changes{v2.1}{2015/06/19}{\opt{nameformat} 可以接受章节名字为参数。}
+%
+% \begin{macro}[int]{\@@_initial_heading:n}
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_initial_heading:n #1
{
@@ -6151,23 +6425,29 @@ This package consists of the file ctex.dtx, and the derived files
\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@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@post#1 }
\exp_not:c { CTEX@#1@aftername }
}
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\@@_def_heading_keys:n}
+% \changes{v2.1}{2015/05/22}{\opt{format+}, \opt{nameformat+} 等带加号的选项,
+% 加号与前面的文字之间可以有可选的空格。}
+% \changes{v2.1}{2015/06/19}{新的标题格式选项 \opt{aftertitle}。}
+%
+% \begin{macro}[int]{\@@_def_heading_keys:n}
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_def_heading_keys:n #1
{
@@ -6182,19 +6462,34 @@ This package consists of the file ctex.dtx, and the derived files
#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 / aftertitle .tl_set:N = \exp_not:c { CTEX@#1@aftertitle } ,
#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 / 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 / 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 / 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 / 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 / titleformat~+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@titleformat } { ####1 } } ,
+ #1 / aftertitle+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftertitle } { ####1 } } ,
+ #1 / aftertitle~+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftertitle } { ####1 } } ,
#1 / beforeskip .initial:n = \c_zero_skip ,
#1 / afterskip .initial:n = \c_zero_skip ,
#1 / indent .initial:n = \c_zero_dim ,
@@ -6206,7 +6501,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_assign_heading_name:nn,\@@_assign_heading_name:nnn}
+% \begin{macro}[int]{\ctex_assign_heading_name:nn,\@@_assign_heading_name:nnn}
% \opt{name} 的值是一个至多两个元素的逗号分隔列表。由于 \LTXIII{} 的
% \texttt{clist} 总是会自动忽略空元素,所以设置 |name={,章}| 后,第一个元素将会
% 是“章”,必须用空的分组保护空元素:|name={{},章}|,这在使用中有些许不便。我们
@@ -6226,32 +6521,32 @@ This package consists of the file ctex.dtx, and the derived files
% \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}
+% \begin{macro}{part/pagestyle,chapter/pagestyle}
% 只在 \cls{ctexbook} 和 \cls{ctexrep} 下有定义。
% \begin{macrocode}
%<*book|report>
-\keys_define:nn { ctex }
+\tl_set:Nn \l_@@_tmp_tl
{
part / pagestyle .tl_set:N = \CTEX@part@pagestyle ,
- chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle
+ chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle ,
}
%</book|report>
% \end{macrocode}
% \end{macro}
%
+% 定义标题键值选项。
+% \begin{macrocode}
+\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}
+%
%
% \subsubsection{标准标题命令的修改}
%
@@ -6261,7 +6556,7 @@ This package consists of the file ctex.dtx, and the derived files
%<@@=>
% \end{macrocode}
%
-% \begin{macro}[internal]{\part}
+% \begin{macro}[int]{\part}
% \begin{macrocode}
%<*article>
\renewcommand\part{%
@@ -6280,7 +6575,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\@part}
+% \begin{macro}[int]{\@part}
% \begin{macrocode}
%<*article>
\def\@part[#1]#2{%
@@ -6300,7 +6595,8 @@ This package consists of the file ctex.dtx, and the derived files
\fi
% \huge\bfseries #2%
\CTEX@part@titleformat{#2}%
- \markboth{}{}\par}%
+ \markboth{}{}%
+ \CTEX@part@aftertitle}%
\nobreak
% \vskip 3ex
\vskip \CTEX@part@afterskip
@@ -6330,13 +6626,14 @@ This package consists of the file ctex.dtx, and the derived files
\CTEX@partname
\fi
% \Huge\bfseries #2\par}%
- \CTEX@part@titleformat{#2}\par}%
+ \CTEX@part@titleformat{#2}%
+ \CTEX@part@aftertitle}%
\@endpart}
%</book|report>
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\@spart}
+% \begin{macro}[int]{\@spart}
% \begin{macrocode}
%<*article>
\def\@spart#1{%
@@ -6344,7 +6641,8 @@ This package consists of the file ctex.dtx, and the derived files
% \normalfont \parindent \z@ \raggedright
\normalfont \parindent \CTEX@part@indent \CTEX@part@format
% \huge \bfseries #1\par}%
- \CTEX@part@titleformat{#1}\par}%
+ \CTEX@part@titleformat{#1}%
+ \CTEX@part@aftertitle}%
\nobreak
% \vskip 3ex
\vskip \CTEX@part@afterskip
@@ -6356,7 +6654,8 @@ This package consists of the file ctex.dtx, and the derived files
% \normalfont \centering
\normalfont \CTEX@part@format
% \Huge \bfseries #1\par}%
- \CTEX@part@titleformat{#1}\par}%
+ \CTEX@part@titleformat{#1}%
+ \CTEX@part@aftertitle}%
\@endpart}
%</book|report>
% \end{macrocode}
@@ -6368,7 +6667,7 @@ This package consists of the file ctex.dtx, and the derived files
%<*book|report>
% \end{macrocode}
%
-% \begin{macro}[internal]{\@chapter}
+% \begin{macro}[int]{\@chapter}
% \begin{macrocode}
\def\@chapter[#1]#2{%
\ifnum \c@secnumdepth >\m@ne
@@ -6397,7 +6696,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\@makechapterhead}
+% \begin{macro}[int]{\@makechapterhead}
% \begin{macrocode}
\def\@makechapterhead#1{%
\thispagestyle{\CTEX@chapter@pagestyle}%
@@ -6419,14 +6718,16 @@ This package consists of the file ctex.dtx, and the derived files
\fi
\interlinepenalty\@M
% \Huge \bfseries #1\par\nobreak
- \CTEX@chapter@titleformat{#1}\par\nobreak
+ \CTEX@chapter@titleformat{#1}%
+ \CTEX@chapter@aftertitle
+ \nobreak
% \vskip 40\p@
\vskip \CTEX@chapter@afterskip
}}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\@makeschapterhead}
+% \begin{macro}[int]{\@makeschapterhead}
% \begin{macrocode}
\def\@makeschapterhead#1{%
\thispagestyle{\CTEX@chapter@pagestyle}%
@@ -6442,7 +6743,9 @@ This package consists of the file ctex.dtx, and the derived files
{\normalfont \parindent \CTEX@chapter@indent \CTEX@chapter@format
\interlinepenalty\@M
% \Huge \bfseries #1\par\nobreak
- \CTEX@chapter@titleformat{#1}\par\nobreak
+ \CTEX@chapter@titleformat{#1}
+ \CTEX@chapter@aftertitle
+ \nobreak
% \vskip 40\p@
\vskip \CTEX@chapter@afterskip
}}
@@ -6455,7 +6758,7 @@ This package consists of the file ctex.dtx, and the derived files
%
% \paragraph{section 类的标题}
%
-% \begin{macro}[internal]{\@seccntformat}
+% \begin{macro}[int]{\@seccntformat}
% \begin{macrocode}
\def\@seccntformat#1{%
\@ifundefined{CTEX@#1name}%
@@ -6464,7 +6767,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\@sect}
+% \begin{macro}[int]{\@sect}
% \begin{macrocode}
\def\@sect#1#2#3#4#5#6[#7]#8{%
\ifnum #2>\c@secnumdepth
@@ -6480,7 +6783,8 @@ This package consists of the file ctex.dtx, and the derived files
\@hangfrom{\hskip #3\relax\@svsec}%
% \interlinepenalty \@M #8\@@par}%
\interlinepenalty \@M
- \csname CTEX@#1@titleformat\endcsname{#8}\@@par}%
+ \csname CTEX@#1@titleformat\endcsname{#8}%
+ \csname CTEX@#1@aftertitle\endcsname}%
\endgroup
\csname #1mark\endcsname{#7}%
\addcontentsline{toc}{#1}{%
@@ -6495,7 +6799,9 @@ This package consists of the file ctex.dtx, and the derived files
\def\@svsechd{%
#6{\hskip #3\relax
% \@svsec #8}%
- \@svsec \csname CTEX@#1@titleformat\endcsname{#8}}%
+ \@svsec
+ \csname CTEX@#1@titleformat\endcsname{#8}%
+ \csname CTEX@#1@aftertitle\endcsname}%
\csname #1mark\endcsname{#7}%
\addcontentsline{toc}{#1}{%
\ifnum #2>\c@secnumdepth \else
@@ -6510,7 +6816,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\@ssect}
+% \begin{macro}[int]{\@ssect}
% \tn{@ssect} 并没有参数给出当前标题的名字,扩展它的参数会与 \pkg{hyperref} 冲突。
% 它的第二个参数是 BEFORESKIP(\tn{@startsection} 的第四个参数),在定义中并没有
% 被用到,应该可以用它来传递名字。我们这里通过函数 \tn{CTEX@titleformat@n} 来传递,
@@ -6524,11 +6830,12 @@ This package consists of the file ctex.dtx, and the derived files
\@hangfrom{\hskip #1}%
% \interlinepenalty \@M #5\@@par}%
\interlinepenalty \@M
- \CTEX@titleformat@n{#5}\@@par}%
+ \CTEX@titleformat@n{#5}%
+ \CTEX@aftertitle}%
\endgroup
\else
% \def\@svsechd{#4{\hskip #1\relax #5}}%
- \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}}}%
+ \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}\CTEX@aftertitle}}%
\fi
\@xsect{#3}}
% \end{macrocode}
@@ -6538,12 +6845,16 @@ This package consists of the file ctex.dtx, and the derived files
%<@@=ctex>
% \end{macrocode}
%
-% \begin{macro}[internal]{\CTEX@set@titleformat@n, \CTEX@titleformat@n}
+% \begin{macro}[int]{\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_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat }
+ \cs_set_eq:Nc \CTEX@aftertitle { CTEX@#1@aftertitle }
+ }
\cs_new_eq:NN \CTEX@titleformat@n \use:n
+\cs_new_eq:NN \CTEX@aftertitle \prg_do_nothing:
% \end{macrocode}
% \end{macro}
%
@@ -6571,19 +6882,21 @@ This package consists of the file ctex.dtx, and the derived files
%
% \paragraph{附录标题}
%
+% \begin{macro}[int]{appendix/name,appendix/number}
% \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
+ appendix .meta:nn = { ctex / appendix } {#1} ,
+ appendix / name .code:n =
+ { \ctex_assign_heading_name:nn { appendix } {#1} } ,
+ appendix / number .tl_set:N = \CTEX@appendixnumber
}
+\tl_new:N \CTEX@preappendix
+\tl_new:N \CTEX@postappendix
% \end{macrocode}
+% \end{macro}
%
-% \begin{macro}[internal]{\appendix}
+% \begin{macro}[int]{\appendix}
% \begin{macrocode}
\cs_new_eq:NN \CTEX@save@appendix \appendix
\cs_gset_protected_nopar:Npn \appendix
@@ -6605,7 +6918,7 @@ This package consists of the file ctex.dtx, and the derived files
%
% \subsubsection{目录标签的宽度}
%
-% \begin{macro}[internal]{\numberline}
+% \begin{macro}[int]{\numberline}
% \begin{macrocode}
\cs_new_protected:Npn \CTEX@toc@width@n #1
{
@@ -6640,7 +6953,7 @@ This package consists of the file ctex.dtx, and the derived files
%
% \subsubsection{页眉信息的修改}
%
-% \begin{macro}[internal]{\ps@headings}
+% \begin{macro}[int]{\ps@headings}
% \begin{macrocode}
%<*article>
\ctex_patch_cmd:Nnn \ps@headings { \thesection } { \CTEXthesection }
@@ -6659,7 +6972,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macro}
%
%
-% \begin{macro}[internal]{\ps@fancy}
+% \begin{macro}[int]{\ps@fancy}
% 这里对 \pkg{fancyhdr} 宏包打补丁。原来 \pkg{fancyhdr} 宏包中使用
% \tn{thesection} 等宏表示页眉中的章节编号,这里改用 \pkg{ctex} 包所用的
% \tn{CTEXthesection} 系列宏。
@@ -6685,7 +6998,7 @@ This package consists of the file ctex.dtx, and the derived files
%
% \subsubsection{标签引用数字的汉化}
%
-% \begin{macro}[internal]{\refstepcounter}
+% \begin{macro}[int]{\refstepcounter}
% 对标题进行引用时,设置标签为通过 \opt{number} 选项设置的形式。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \CTEX@setcurrentlabel@n #1
@@ -6700,7 +7013,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_varioref_hook:}
+% \begin{macro}[int]{\ctex_varioref_hook:}
% 关于标签引用的宏包可能会修改 \tn{refstepcounter}。其中 \pkg{cleveref} 和
% \pkg{hyperref} 宏包都会保存之前的定义,并且它们都要求尽可能晚的被载入,所以
% 对我们上述的修改影响不大。需要注意的是 \pkg{varioref} 宏包,如果它在
@@ -6714,7 +7027,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\@@_fix_varioref_label:n}
+% \begin{macro}[int]{\@@_fix_varioref_label:n}
% \pkg{varioref} 宏包的 \tn{labelformat} 实际上是定义一个以 |\the<#1>| 为参数的宏
% |\p@<#1>|。\LaTeX{} 在定义计数器 |<#1>| 时,都会将 |\p@<#1>| 初始化为 \tn{@empty}。
% 如果这个宏非空,说明用户自定义了标签格式,我们就不再修改。这里不能使用
@@ -6767,13 +7080,19 @@ This package consists of the file ctex.dtx, and the derived files
%<*scheme&(article|book|report)>
% \end{macrocode}
%
+% \changes{v2.1}{2015/05/30}{修复 \cls{ctexbook} 和 \cls{ctexrep} 类的中文
+% \opt{part/number} 选项初值为空的错误。}
% \begin{macrocode}
\keys_set:nn { ctex / part }
{
+ aftertitle = \par ,
%<*plain>
name = \partname \space ,
number = \thepart ,
%</plain>
+%<*chinese>
+ number = \chinese { part } ,
+%</chinese>
%<*article>
nameformat = \Large \bfseries ,
afterskip = 3ex ,
@@ -6784,7 +7103,6 @@ This package consists of the file ctex.dtx, and the derived files
beforeskip = -4ex
%</plain>
%<*chinese>
- number = \chinese { part } ,
format = \centering ,
aftername = \quad ,
titleformat = \Large \bfseries ,
@@ -6812,6 +7130,7 @@ This package consists of the file ctex.dtx, and the derived files
{
pagestyle = plain ,
nameformat = \huge \bfseries ,
+ aftertitle = \par ,
afterskip = 40 \p@ ,
%<*plain>
name = \chaptername \space ,
@@ -6833,10 +7152,15 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
%
% \begin{macrocode}
+%<@@=>
+% \end{macrocode}
+%
+% \begin{macrocode}
\keys_set:nn { ctex / section }
{
number = \thesection ,
aftername = \quad ,
+ aftertitle = \@@par ,
afterskip = 2.3ex \@plus .2ex ,
%<*plain>
format = \Large \bfseries ,
@@ -6855,6 +7179,7 @@ This package consists of the file ctex.dtx, and the derived files
number = \thesubsection ,
format = \large \bfseries ,
aftername = \quad ,
+ aftertitle = \@@par ,
afterskip = 1.5ex \@plus .2ex ,
%<*plain>
beforeskip = -3.25ex \@plus -1ex \@minus -.2ex
@@ -6871,6 +7196,7 @@ This package consists of the file ctex.dtx, and the derived files
number = \thesubsubsection ,
format = \normalsize \bfseries ,
aftername = \quad ,
+ aftertitle = \@@par ,
afterskip = 1.5ex \@plus .2ex ,
%<*plain>
beforeskip = -3.25ex \@plus -1ex \@minus -.2ex
@@ -6901,10 +7227,11 @@ This package consists of the file ctex.dtx, and the derived files
%
% 处理 \opt{sub3section} 与 \opt{sub4section} 的格式。
% \begin{macrocode}
-\int_compare:nNnTF \g_@@_section_depth_flag > \c_two
+\int_compare:nNnTF \g__ctex_section_depth_flag > \c_two
{
\keys_set:nn { ctex / paragraph }
{
+ aftertitle = \@@par ,
%<*plain>
beforeskip = -3.25ex \@plus -1ex \@minus -.2ex ,
%</plain>
@@ -6921,10 +7248,11 @@ This package consists of the file ctex.dtx, and the derived files
afterskip = -1em
}
}
-\int_compare:nNnTF \g_@@_section_depth_flag > \c_three
+\int_compare:nNnTF \g__ctex_section_depth_flag > \c_three
{
\keys_set:nn { ctex / subparagraph }
{
+ aftertitle = \@@par ,
%<*plain>
beforeskip = -3.25ex \@plus -1ex \@minus -.2ex ,
%</plain>
@@ -6941,11 +7269,15 @@ This package consists of the file ctex.dtx, and the derived files
afterskip = -1em
}
}
-\int_compare:nNnTF \g_@@_section_depth_flag > \c_two
+\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 } }
% \end{macrocode}
%
+% \begin{macrocode}
+%<@@=ctex>
+% \end{macrocode}
+%
% 处理附录的格式。
% \begin{macrocode}
\keys_set:nn { ctex / appendix }
@@ -6967,9 +7299,23 @@ This package consists of the file ctex.dtx, and the derived files
% \subsubsection{\pkg{ctex.sty} 的 \opt{heading} 选项}
%
% \begin{macrocode}
-%<*style>
+%<*ctex|ctexheading>
+% \end{macrocode}
+%
+% \begin{variable}[int]{\c_@@_std_class_tl}
+% 用于记录被引入的标准文档类。
+% \begin{macrocode}
+\clist_map_inline:nn { article , book , report }
+ {
+ \@ifclassloaded {#1}
+ { \clist_map_break:n { \tl_const:Nn \c_@@_std_class_tl {#1} } }
+ { }
+ }
% \end{macrocode}
+% \end{variable}
%
+% 若标准文档类被引入,则载入对应的标题定义文件。否则视 \tn{chapter} 是否有定义来
+% 引入 \cls{book} 或者 \cls{article}。
% \begin{macrocode}
\msg_new:nnn { ctex } { not-standard-class }
{
@@ -6977,14 +7323,11 @@ This package consists of the file ctex.dtx, and the derived files
Heading~`#1'~is~selected.\\
ctex~may~not~work~as~expected.
}
-\bool_if:NTF \l_@@_heading_bool
+%<ctex>\bool_if:NTF \l_@@_heading_bool
+%<ctexheading>\use:n
{
- \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
+ \tl_if_exist:NTF \c_@@_std_class_tl
+ { \cs_new_eq:NN \c_@@_class_tl \c_@@_std_class_tl }
{
\cs_if_exist:NTF \chapter
{
@@ -6997,11 +7340,11 @@ This package consists of the file ctex.dtx, and the derived files
}
\ctex_file_input:n { ctex- \c_@@_class_tl .def }
}
- { \ctex_scheme_input:o { \l_@@_scheme_tl } }
+%<ctex> { \ctex_scheme_input:o { \l_@@_scheme_tl } }
% \end{macrocode}
%
% \begin{macrocode}
-%</style>
+%</ctex|ctexheading>
% \end{macrocode}
%
% \subsubsection{标题配置文件}
@@ -7081,17 +7424,14 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
%
% \changes{v2.0.2}{2015/05/16}{修复加载 \pkg{ctex} 宏包后章节标题后第一段
-% 无段首缩进的问题}
+% 无段首缩进的问题。}
% 若 \pkg{ctex} 宏包与标准文档类及其衍生文档类联用,则将载入 \pkg{indentfirst} 宏包,
% 实现章节标题后首个段落的段首缩进。
% \begin{macrocode}
-%<*!(article|book|report)>
-\clist_map_inline:nn { article , book , report }
- {
- \@ifclassloaded {#1}
- { \RequirePackage{ indentfirst } } { }
- }
-%</!(article|book|report)>
+%<*generic>
+\tl_if_exist:NT \c_@@_std_class_tl
+ { \RequirePackage{ indentfirst } }
+%</generic>
% \end{macrocode}
%
% \begin{macrocode}
@@ -7101,7 +7441,7 @@ This package consists of the file ctex.dtx, and the derived files
% \subsection{中文字号}
%
% \begin{macrocode}
-%<*class|style|ctexsize>
+%<*class|ctex|ctexsize>
% \end{macrocode}
%
% \changes{v2.0}{2014/03/08}{将中文字号功能提取到可以独立使用的 \pkg{ctexsize}。}
@@ -7113,7 +7453,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_zihao:n}
+% \begin{macro}[int]{\ctex_zihao:n}
% \begin{macrocode}
\cs_new_protected_nopar:Npn \ctex_zihao:n #1
{
@@ -7135,7 +7475,7 @@ This package consists of the file ctex.dtx, and the derived files
%
% \changes{v2.0}{2014/03/08}{中文字号不再采用近似值。}
%
-% \begin{variable}[internal]{\c_@@_font_size_prop}
+% \begin{variable}[int]{\c_@@_font_size_prop}
% \begin{macro}[aux]{\@@_save_font_size:nn}
% 基础行距是字号的 $1.2$ 倍,采用 \hologo{eTeX} 的 scaling 运算得到的结果
% 要比简单的 |1.2\dimexpr| 精确^^A
@@ -7179,7 +7519,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macro}
% \end{variable}
%
-% \begin{macro}[internal]{\ctex_declare_math_sizes:nnnn}
+% \begin{macro}[int]{\ctex_declare_math_sizes:nnnn}
% \begin{macrocode}
\cs_new_protected_nopar:Npn \ctex_declare_math_sizes:nnnn #1#2#3#4
{
@@ -7229,7 +7569,7 @@ This package consists of the file ctex.dtx, and the derived files
%
% \subsubsection{修改默认字号大小}
%
-% \begin{macro}[internal]{\ctex_set_font_size:Nnn}
+% \begin{macro}[int]{\ctex_set_font_size:Nnn}
% \begin{macrocode}
\cs_new_protected:Npn \ctex_set_font_size:Nnn #1#2#3
{
@@ -7251,7 +7591,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
%
% \begin{macrocode}
-%</class|style|ctexsize>
+%</class|ctex|ctexsize>
% \end{macrocode}
%
% \begin{macrocode}
@@ -7340,7 +7680,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
%
% \begin{macrocode}
-%<*class|style>
+%<*class|ctex>
% \end{macrocode}
%
% \subsection{更新行距}
@@ -7354,7 +7694,7 @@ This package consists of the file ctex.dtx, and the derived files
%
% \changes{v2.0}{2014/04/23}{调整 \tn{footnotesep} 的大小,以适合行距的变化。}
%
-% \begin{variable}[internal]{\footnotesep}
+% \begin{variable}[int]{\footnotesep}
% 我们调整了行距,可能导致脚注的间距与行距不协调,需要调整 \tn{footnotesep}。标准
% 文档类对 \tn{footnotesep} 的设置是,字体大小为 \tn{footnotesize} 时 \tn{strutbox}
% 的高度(默认值是 |.7\baselineskip|)。我们沿用这个设置方法,只需要更新具体的大小。
@@ -7382,16 +7722,13 @@ This package consists of the file ctex.dtx, and the derived files
% \begin{macrocode}
\NewDocumentCommand \CTeX { }
{ \ifincsname CTeX \else: C \TeX \fi: }
-\AtBeginDocument
- {
- \cs_if_exist_use:NT \pdfstringdefDisableCommands
- { { \tl_set:Nn \CTeX { CTeX } } }
- }
+\ctex_at_end_package:nn { hyperref }
+ { \pdfstringdefDisableCommands { \tl_set:Nn \CTeX { CTeX } } }
% \end{macrocode}
% \end{macro}
%
% \changes{v2.0}{2014/03/28}{\opt{captiondelimiter} 是过时选项。}
-% \begin{macro}[internal]{captiondelimiter}
+% \begin{macro}{captiondelimiter}
% 过时选项。
% \begin{macrocode}
\keys_define:nn { ctex }
@@ -7406,12 +7743,12 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macro}
%
% \begin{macrocode}
-%</class|style>
+%</class|ctex>
% \end{macrocode}
%
% \subsubsection{列表环境的缩进}
%
-% \begin{macro}[internal]{\verse,\quotation}
+% \begin{macro}[int]{\verse,\quotation}
% 只在使用文档类的时候修改诗歌和引用环境的缩进。
% \begin{macrocode}
%<*scheme&!generic&chinese>
@@ -7423,12 +7760,12 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macro}
%
% \begin{macrocode}
-%<*class|style>
+%<*class|ctex>
% \end{macrocode}
%
% \subsubsection{其他兼容性修改}
%
-% \begin{macro}[internal]{\end}
+% \begin{macro}[int]{\end}
% \changes{v2.0}{2014/03/09}
% {解决 \pkg{etoolbox} 与 \pkg{breqn} 关于 \tn{end} 的冲突。}
% \pkg{breqn} 宏包对 \tn{end} 作了如下处理,然而这个处理并不保险。
@@ -7469,7 +7806,7 @@ This package consists of the file ctex.dtx, and the derived files
%
% \subsection{载入中文字体}
%
-% \begin{macro}[internal]{\ctex_fontset_error:n}
+% \begin{macro}[int]{\ctex_fontset_error:n}
% 字库不可用时给出紧急错误信息,停止读取定义文件。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \ctex_fontset_error:n #1
@@ -7479,7 +7816,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ctex_load_fontset:}
+% \begin{macro}[int]{\ctex_load_fontset:}
% 如果用户没有指定字体,则探测操作系统,载入相应的字体配置。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \ctex_load_fontset:
@@ -7567,7 +7904,7 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
%
% \begin{macrocode}
-%</class|style>
+%</class|ctex>
% \end{macrocode}
%
% \begin{macrocode}
@@ -7712,7 +8049,7 @@ This package consists of the file ctex.dtx, and the derived files
% 旧的 Windows 字体设置使用黑体作为无衬线体,楷体和仿宋是 GB2312 编码;新的
% Windows 字体设置使用微软雅黑作为无衬线体,楷体和仿宋是大字库。
% \begin{macrocode}
-%<*windowsnew,windowsold>
+%<*windowsnew|windowsold>
\pdftex_if_engine:TF
{
\ctex_zhmap_case:nnn
@@ -7795,7 +8132,7 @@ This package consists of the file ctex.dtx, and the derived files
[ BoldFont = { *~Bold } ] { Microsoft~YaHei }
%</windowsnew>
}
-%</windowsnew,windowsold>
+%</windowsnew|windowsold>
% \end{macrocode}
%
% \subsubsection{\pkg{ctex-fontset-adobe.def}}
@@ -8130,7 +8467,8 @@ This package consists of the file ctex.dtx, and the derived files
{ \ctex_fontset_error:n { ubuntu } }
}
{
- \setCJKmainfont [ ItalicFont = AR~PL~UKai~CN ] { AR~PL~UMing~CN }
+ \setCJKmainfont
+ [ BoldFont = WenQuanYi~Zen~Hei , ItalicFont = AR~PL~UKai~CN ] { AR~PL~UMing~CN }
\setCJKsansfont { WenQuanYi~Zen~Hei }
\setCJKmonofont { AR~PL~UMing~CN }
\setCJKfamilyfont { zhsong } { AR~PL~UMing~CN }
@@ -8207,7 +8545,13 @@ This package consists of the file ctex.dtx, and the derived files
% \end{macrocode}
%
% \begin{macrocode}
-\input ifpdf.sty\relax
+\begingroup\expandafter\endgroup
+\expandafter\let\csname ifzhmappdf\expandafter\endcsname\csname
+ \expandafter\ifx\csname ifctexpdf\endcsname\relax
+ \expandafter\ifx\csname pdfoutput\endcsname\relax
+ iffalse\else\ifnum\pdfoutput < 1 iffalse\else iftrue\fi\fi
+ \else ifctexpdf\fi
+\endcsname
% \end{macrocode}
%
% 提供非 \LaTeX{} 格式下的 \tn{ProvidesFile}。
@@ -8228,9 +8572,9 @@ This package consists of the file ctex.dtx, and the derived files
% \begin{macrocode}
%<*windows>
\ProvidesFile{zhwindowsfonts.tex}%
- [2014/06/03 v2.0 Windows font map loader for pdfTeX and DVIPDFMx (CTEX)]
+ [2015/05/25 v2.1 Windows font map loader for pdfTeX and DVIPDFMx (CTEX)]
-\ifpdf
+\ifzhmappdf
\pdfmapline{=gbk@UGBK@ <simsun.ttc}
\pdfmapline{=gbksong@UGBK@ <simsun.ttc}
\pdfmapline{=gbkkai@UGBK@ <simkai.ttf}
@@ -8300,9 +8644,9 @@ This package consists of the file ctex.dtx, and the derived files
% \begin{macrocode}
%<*adobe>
\ProvidesFile{zhadobefonts.tex}%
- [2014/06/03 v2.0 Adobe font map loader for DVIPDFMx (CTEX)]
+ [2015/05/25 v2.1 Adobe font map loader for DVIPDFMx (CTEX)]
-\ifpdf
+\ifzhmappdf
%% pdfTeX does not support OTF fonts
\else
@@ -8336,9 +8680,9 @@ This package consists of the file ctex.dtx, and the derived files
% \begin{macrocode}
%<*fandol>
\ProvidesFile{zhfandolfonts.tex}%
- [2014/06/03 v2.0 Fandol font map loader for DVIPDFMx (CTEX)]
+ [2015/05/25 v2.1 Fandol font map loader for DVIPDFMx (CTEX)]
-\ifpdf
+\ifzhmappdf
%% pdfTeX does not support OTF fonts
\else
@@ -8372,9 +8716,9 @@ This package consists of the file ctex.dtx, and the derived files
% \begin{macrocode}
%<*founder>
\ProvidesFile{zhfounderfonts.tex}%
- [2014/06/03 v2.0 Founder font map loader for pdfTeX and DVIPDFMx (CTEX)]
+ [2015/05/25 v2.1 Founder font map loader for pdfTeX and DVIPDFMx (CTEX)]
-\ifpdf
+\ifzhmappdf
\pdfmapline{=gbk@UGBK@ <FZSSK.TTF}
\pdfmapline{=gbksong@UGBK@ <FZSSK.TTF}
\pdfmapline{=gbkkai@UGBK@ <FZKTK.TTF}
@@ -8444,9 +8788,9 @@ This package consists of the file ctex.dtx, and the derived files
% \begin{macrocode}
%<*ubuntu>
\ProvidesFile{zhubuntufonts.tex}%
- [2014/06/03 v2.0 Ubuntu font map loader for pdfTeX and DVIPDFMx (CTEX)]
+ [2015/05/25 v2.1 Ubuntu font map loader for pdfTeX and DVIPDFMx (CTEX)]
-\ifpdf
+\ifzhmappdf
\pdfmapline{=gbk@UGBK@ <uming.ttc}
\pdfmapline{=gbksong@UGBK@ <uming.ttc}
\pdfmapline{=gbkkai@UGBK@ <ukai.ttc}
@@ -8542,7 +8886,7 @@ This package consists of the file ctex.dtx, and the derived files
}
% \end{macrocode}
%
-% \begin{macro}[internal]{\ctex_make_spa:nn}
+% \begin{macro}[int]{\ctex_make_spa:nn}
% |#1| 是 \file{spa} 文件名,|#2| 是由 CJK 族名与字体构成的逗号列表。
% \begin{macrocode}
\cs_new_protected_nopar:Npn \ctex_make_spa:nn #1#2
diff --git a/Master/texmf-dist/tex/generic/ctex/zhadobefonts.tex b/Master/texmf-dist/tex/generic/ctex/zhadobefonts.tex
index bd63bc0c8af..15290ad2039 100644
--- a/Master/texmf-dist/tex/generic/ctex/zhadobefonts.tex
+++ b/Master/texmf-dist/tex/generic/ctex/zhadobefonts.tex
@@ -59,7 +59,13 @@
\noexpand\noexpand\noexpand\endinput}%
\the\toks2}%
\expandafter\x\csname ctex@zhmap@endinput\endcsname
-\input ifpdf.sty\relax
+\begingroup\expandafter\endgroup
+\expandafter\let\csname ifzhmappdf\expandafter\endcsname\csname
+ \expandafter\ifx\csname ifctexpdf\endcsname\relax
+ \expandafter\ifx\csname pdfoutput\endcsname\relax
+ iffalse\else\ifnum\pdfoutput < 1 iffalse\else iftrue\fi\fi
+ \else ifctexpdf\fi
+\endcsname
\begingroup
\expandafter\ifx\csname ProvidesFile\endcsname\relax
\long\def\x#1\ProvidesFile#2[#3]{%
@@ -70,9 +76,9 @@
\fi
\endgroup
\ProvidesFile{zhadobefonts.tex}%
- [2014/06/03 v2.0 Adobe font map loader for DVIPDFMx (CTEX)]
+ [2015/05/25 v2.1 Adobe font map loader for DVIPDFMx (CTEX)]
-\ifpdf
+\ifzhmappdf
%% pdfTeX does not support OTF fonts
\else
diff --git a/Master/texmf-dist/tex/generic/ctex/zhfandolfonts.tex b/Master/texmf-dist/tex/generic/ctex/zhfandolfonts.tex
index 3d2806f552d..301c2d9e893 100644
--- a/Master/texmf-dist/tex/generic/ctex/zhfandolfonts.tex
+++ b/Master/texmf-dist/tex/generic/ctex/zhfandolfonts.tex
@@ -59,7 +59,13 @@
\noexpand\noexpand\noexpand\endinput}%
\the\toks2}%
\expandafter\x\csname ctex@zhmap@endinput\endcsname
-\input ifpdf.sty\relax
+\begingroup\expandafter\endgroup
+\expandafter\let\csname ifzhmappdf\expandafter\endcsname\csname
+ \expandafter\ifx\csname ifctexpdf\endcsname\relax
+ \expandafter\ifx\csname pdfoutput\endcsname\relax
+ iffalse\else\ifnum\pdfoutput < 1 iffalse\else iftrue\fi\fi
+ \else ifctexpdf\fi
+\endcsname
\begingroup
\expandafter\ifx\csname ProvidesFile\endcsname\relax
\long\def\x#1\ProvidesFile#2[#3]{%
@@ -70,9 +76,9 @@
\fi
\endgroup
\ProvidesFile{zhfandolfonts.tex}%
- [2014/06/03 v2.0 Fandol font map loader for DVIPDFMx (CTEX)]
+ [2015/05/25 v2.1 Fandol font map loader for DVIPDFMx (CTEX)]
-\ifpdf
+\ifzhmappdf
%% pdfTeX does not support OTF fonts
\else
diff --git a/Master/texmf-dist/tex/generic/ctex/zhfounderfonts.tex b/Master/texmf-dist/tex/generic/ctex/zhfounderfonts.tex
index 763eb012fce..9295e4b5b0f 100644
--- a/Master/texmf-dist/tex/generic/ctex/zhfounderfonts.tex
+++ b/Master/texmf-dist/tex/generic/ctex/zhfounderfonts.tex
@@ -59,7 +59,13 @@
\noexpand\noexpand\noexpand\endinput}%
\the\toks2}%
\expandafter\x\csname ctex@zhmap@endinput\endcsname
-\input ifpdf.sty\relax
+\begingroup\expandafter\endgroup
+\expandafter\let\csname ifzhmappdf\expandafter\endcsname\csname
+ \expandafter\ifx\csname ifctexpdf\endcsname\relax
+ \expandafter\ifx\csname pdfoutput\endcsname\relax
+ iffalse\else\ifnum\pdfoutput < 1 iffalse\else iftrue\fi\fi
+ \else ifctexpdf\fi
+\endcsname
\begingroup
\expandafter\ifx\csname ProvidesFile\endcsname\relax
\long\def\x#1\ProvidesFile#2[#3]{%
@@ -70,9 +76,9 @@
\fi
\endgroup
\ProvidesFile{zhfounderfonts.tex}%
- [2014/06/03 v2.0 Founder font map loader for pdfTeX and DVIPDFMx (CTEX)]
+ [2015/05/25 v2.1 Founder font map loader for pdfTeX and DVIPDFMx (CTEX)]
-\ifpdf
+\ifzhmappdf
\pdfmapline{=gbk@UGBK@ <FZSSK.TTF}
\pdfmapline{=gbksong@UGBK@ <FZSSK.TTF}
\pdfmapline{=gbkkai@UGBK@ <FZKTK.TTF}
diff --git a/Master/texmf-dist/tex/generic/ctex/zhubuntufonts.tex b/Master/texmf-dist/tex/generic/ctex/zhubuntufonts.tex
index bd427a1464c..00e952ffa53 100644
--- a/Master/texmf-dist/tex/generic/ctex/zhubuntufonts.tex
+++ b/Master/texmf-dist/tex/generic/ctex/zhubuntufonts.tex
@@ -59,7 +59,13 @@
\noexpand\noexpand\noexpand\endinput}%
\the\toks2}%
\expandafter\x\csname ctex@zhmap@endinput\endcsname
-\input ifpdf.sty\relax
+\begingroup\expandafter\endgroup
+\expandafter\let\csname ifzhmappdf\expandafter\endcsname\csname
+ \expandafter\ifx\csname ifctexpdf\endcsname\relax
+ \expandafter\ifx\csname pdfoutput\endcsname\relax
+ iffalse\else\ifnum\pdfoutput < 1 iffalse\else iftrue\fi\fi
+ \else ifctexpdf\fi
+\endcsname
\begingroup
\expandafter\ifx\csname ProvidesFile\endcsname\relax
\long\def\x#1\ProvidesFile#2[#3]{%
@@ -70,9 +76,9 @@
\fi
\endgroup
\ProvidesFile{zhubuntufonts.tex}%
- [2014/06/03 v2.0 Ubuntu font map loader for pdfTeX and DVIPDFMx (CTEX)]
+ [2015/05/25 v2.1 Ubuntu font map loader for pdfTeX and DVIPDFMx (CTEX)]
-\ifpdf
+\ifzhmappdf
\pdfmapline{=gbk@UGBK@ <uming.ttc}
\pdfmapline{=gbksong@UGBK@ <uming.ttc}
\pdfmapline{=gbkkai@UGBK@ <ukai.ttc}
diff --git a/Master/texmf-dist/tex/generic/ctex/zhwindowsfonts.tex b/Master/texmf-dist/tex/generic/ctex/zhwindowsfonts.tex
index d7878965922..9b163944cbf 100644
--- a/Master/texmf-dist/tex/generic/ctex/zhwindowsfonts.tex
+++ b/Master/texmf-dist/tex/generic/ctex/zhwindowsfonts.tex
@@ -59,7 +59,13 @@
\noexpand\noexpand\noexpand\endinput}%
\the\toks2}%
\expandafter\x\csname ctex@zhmap@endinput\endcsname
-\input ifpdf.sty\relax
+\begingroup\expandafter\endgroup
+\expandafter\let\csname ifzhmappdf\expandafter\endcsname\csname
+ \expandafter\ifx\csname ifctexpdf\endcsname\relax
+ \expandafter\ifx\csname pdfoutput\endcsname\relax
+ iffalse\else\ifnum\pdfoutput < 1 iffalse\else iftrue\fi\fi
+ \else ifctexpdf\fi
+\endcsname
\begingroup
\expandafter\ifx\csname ProvidesFile\endcsname\relax
\long\def\x#1\ProvidesFile#2[#3]{%
@@ -70,9 +76,9 @@
\fi
\endgroup
\ProvidesFile{zhwindowsfonts.tex}%
- [2014/06/03 v2.0 Windows font map loader for pdfTeX and DVIPDFMx (CTEX)]
+ [2015/05/25 v2.1 Windows font map loader for pdfTeX and DVIPDFMx (CTEX)]
-\ifpdf
+\ifzhmappdf
\pdfmapline{=gbk@UGBK@ <simsun.ttc}
\pdfmapline{=gbksong@UGBK@ <simsun.ttc}
\pdfmapline{=gbkkai@UGBK@ <simkai.ttf}
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
index fe33f135e5d..445383b47fd 100644
--- a/Master/texmf-dist/tex/latex/ctex/config/ctex-name-gbk.cfg
+++ b/Master/texmf-dist/tex/latex/ctex/config/ctex-name-gbk.cfg
@@ -26,10 +26,10 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{Caption with encoding GBK (CTEX)}
\ProvidesExplFile{ctex-name-gbk.cfg}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
\keys_set:nn { ctex }
{
contentsname = Ŀ¼ ,
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
index 4f86d6bebf7..28f8903bb40 100644
--- a/Master/texmf-dist/tex/latex/ctex/config/ctex-name-utf8.cfg
+++ b/Master/texmf-dist/tex/latex/ctex/config/ctex-name-utf8.cfg
@@ -26,10 +26,10 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{Caption with encoding UTF8 (CTEX)}
\ProvidesExplFile{ctex-name-utf8.cfg}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
\keys_set:nn { ctex }
{
contentsname = 目录 ,
diff --git a/Master/texmf-dist/tex/latex/ctex/config/ctex.cfg b/Master/texmf-dist/tex/latex/ctex/config/ctex.cfg
index 1c91052f246..9441ebf9045 100644
--- a/Master/texmf-dist/tex/latex/ctex/config/ctex.cfg
+++ b/Master/texmf-dist/tex/latex/ctex/config/ctex.cfg
@@ -26,10 +26,10 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{Configuration file (CTEX)}
\ProvidesExplFile{\ExplFileName.cfg}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
%%
%%
%%
diff --git a/Master/texmf-dist/tex/latex/ctex/config/ctexopts.cfg b/Master/texmf-dist/tex/latex/ctex/config/ctexopts.cfg
index be98a7d9e94..0d1bf614b7e 100644
--- a/Master/texmf-dist/tex/latex/ctex/config/ctexopts.cfg
+++ b/Master/texmf-dist/tex/latex/ctex/config/ctexopts.cfg
@@ -26,10 +26,10 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{Option configuration file (CTEX)}
\ProvidesExplFile{ctexopts.cfg}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
%%
%% \keys_set:nn { ctex / option } { fontset = windowsnew }
%%
diff --git a/Master/texmf-dist/tex/latex/ctex/ctex-article.def b/Master/texmf-dist/tex/latex/ctex/ctex-article.def
index ba0af7ce82d..be98bfc12e0 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctex-article.def
+++ b/Master/texmf-dist/tex/latex/ctex/ctex-article.def
@@ -26,10 +26,10 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{Heading modification for article (CTEX)}
\ProvidesExplFile{ctex-article.def}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
\seq_new:N \c__ctex_headings_seq
\seq_gset_from_clist:Nn \c__ctex_headings_seq
{
@@ -49,16 +49,18 @@
\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@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@post#1 }
\exp_not:c { CTEX@#1@aftername }
}
}
@@ -75,19 +77,34 @@
#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 / aftertitle .tl_set:N = \exp_not:c { CTEX@#1@aftertitle } ,
#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 / 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 / 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 / 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 / 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 / titleformat~+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@titleformat } { ####1 } } ,
+ #1 / aftertitle+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftertitle } { ####1 } } ,
+ #1 / aftertitle~+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftertitle } { ####1 } } ,
#1 / beforeskip .initial:n = \c_zero_skip ,
#1 / afterskip .initial:n = \c_zero_skip ,
#1 / indent .initial:n = \c_zero_dim ,
@@ -106,7 +123,6 @@
{ \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}
@@ -138,14 +154,16 @@
\CTEX@partname
\fi
\CTEX@part@titleformat{#2}%
- \markboth{}{}\par}%
+ \markboth{}{}%
+ \CTEX@part@aftertitle}%
\nobreak
\vskip \CTEX@part@afterskip
\@afterheading}
\def\@spart#1{%
{\interlinepenalty \@M
\normalfont \parindent \CTEX@part@indent \CTEX@part@format
- \CTEX@part@titleformat{#1}\par}%
+ \CTEX@part@titleformat{#1}%
+ \CTEX@part@aftertitle}%
\nobreak
\vskip \CTEX@part@afterskip
\@afterheading}
@@ -166,7 +184,8 @@
#6{%
\@hangfrom{\hskip #3\relax\@svsec}%
\interlinepenalty \@M
- \csname CTEX@#1@titleformat\endcsname{#8}\@@par}%
+ \csname CTEX@#1@titleformat\endcsname{#8}%
+ \csname CTEX@#1@aftertitle\endcsname}%
\endgroup
\csname #1mark\endcsname{#7}%
\addcontentsline{toc}{#1}{%
@@ -179,7 +198,9 @@
\else
\def\@svsechd{%
#6{\hskip #3\relax
- \@svsec \csname CTEX@#1@titleformat\endcsname{#8}}%
+ \@svsec
+ \csname CTEX@#1@titleformat\endcsname{#8}%
+ \csname CTEX@#1@aftertitle\endcsname}%
\csname #1mark\endcsname{#7}%
\addcontentsline{toc}{#1}{%
\ifnum #2>\c@secnumdepth \else
@@ -197,15 +218,20 @@
#4{%
\@hangfrom{\hskip #1}%
\interlinepenalty \@M
- \CTEX@titleformat@n{#5}\@@par}%
+ \CTEX@titleformat@n{#5}%
+ \CTEX@aftertitle}%
\endgroup
\else
- \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}}}%
+ \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}\CTEX@aftertitle}}%
\fi
\@xsect{#3}}
\cs_new_protected_nopar:Npn \CTEX@set@titleformat@n #1
- { \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat } }
+ {
+ \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat }
+ \cs_set_eq:Nc \CTEX@aftertitle { CTEX@#1@aftertitle }
+ }
\cs_new_eq:NN \CTEX@titleformat@n \use:n
+\cs_new_eq:NN \CTEX@aftertitle \prg_do_nothing:
\int_zero:N \l__ctex_tmp_int
\clist_map_inline:nn
{ section , subsection , subsubsection , paragraph , subparagraph }
@@ -224,15 +250,15 @@
}
}
}
-\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
+ appendix .meta:nn = { ctex / appendix } {#1} ,
+ appendix / name .code:n =
+ { \ctex_assign_heading_name:nn { appendix } {#1} } ,
+ appendix / number .tl_set:N = \CTEX@appendixnumber
}
+\tl_new:N \CTEX@preappendix
+\tl_new:N \CTEX@postappendix
\cs_new_eq:NN \CTEX@save@appendix \appendix
\cs_gset_protected_nopar:Npn \appendix
{
diff --git a/Master/texmf-dist/tex/latex/ctex/ctex-book.def b/Master/texmf-dist/tex/latex/ctex/ctex-book.def
index 82bd4be7ebb..43125e9a69b 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctex-book.def
+++ b/Master/texmf-dist/tex/latex/ctex/ctex-book.def
@@ -26,10 +26,10 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{Heading modification for book (CTEX)}
\ProvidesExplFile{ctex-book.def}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
\seq_new:N \c__ctex_headings_seq
\seq_gset_from_clist:Nn \c__ctex_headings_seq
{
@@ -49,16 +49,18 @@
\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@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@post#1 }
\exp_not:c { CTEX@#1@aftername }
}
}
@@ -75,19 +77,34 @@
#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 / aftertitle .tl_set:N = \exp_not:c { CTEX@#1@aftertitle } ,
#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 / 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 / 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 / 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 / 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 / titleformat~+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@titleformat } { ####1 } } ,
+ #1 / aftertitle+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftertitle } { ####1 } } ,
+ #1 / aftertitle~+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftertitle } { ####1 } } ,
#1 / beforeskip .initial:n = \c_zero_skip ,
#1 / afterskip .initial:n = \c_zero_skip ,
#1 / indent .initial:n = \c_zero_dim ,
@@ -106,7 +123,11 @@
{ \tl_clear:c { CTEX@post#1 } }
{ \tl_set:cn { CTEX@post#1 } {#3} }
}
-\tl_clear:N \l__ctex_tmp_tl
+\tl_set:Nn \l__ctex_tmp_tl
+ {
+ part / pagestyle .tl_set:N = \CTEX@part@pagestyle ,
+ chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle ,
+ }
\seq_map_inline:Nn \c__ctex_headings_seq
{
\__ctex_initial_heading:n {#1}
@@ -114,11 +135,6 @@
}
\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
@@ -133,12 +149,14 @@
\ifnum \c@secnumdepth >-2\relax
\CTEX@partname
\fi
- \CTEX@part@titleformat{#2}\par}%
+ \CTEX@part@titleformat{#2}%
+ \CTEX@part@aftertitle}%
\@endpart}
\def\@spart#1{%
{\interlinepenalty \@M
\normalfont \CTEX@part@format
- \CTEX@part@titleformat{#1}\par}%
+ \CTEX@part@titleformat{#1}%
+ \CTEX@part@aftertitle}%
\@endpart}
\def\@chapter[#1]#2{%
\ifnum \c@secnumdepth >\m@ne
@@ -178,7 +196,9 @@
\fi
\fi
\interlinepenalty\@M
- \CTEX@chapter@titleformat{#1}\par\nobreak
+ \CTEX@chapter@titleformat{#1}%
+ \CTEX@chapter@aftertitle
+ \nobreak
\vskip \CTEX@chapter@afterskip
}}
\def\@makeschapterhead#1{%
@@ -192,7 +212,9 @@
\vspace*{\@tempskipa}%
{\normalfont \parindent \CTEX@chapter@indent \CTEX@chapter@format
\interlinepenalty\@M
- \CTEX@chapter@titleformat{#1}\par\nobreak
+ \CTEX@chapter@titleformat{#1}
+ \CTEX@chapter@aftertitle
+ \nobreak
\vskip \CTEX@chapter@afterskip
}}
\def\@seccntformat#1{%
@@ -212,7 +234,8 @@
#6{%
\@hangfrom{\hskip #3\relax\@svsec}%
\interlinepenalty \@M
- \csname CTEX@#1@titleformat\endcsname{#8}\@@par}%
+ \csname CTEX@#1@titleformat\endcsname{#8}%
+ \csname CTEX@#1@aftertitle\endcsname}%
\endgroup
\csname #1mark\endcsname{#7}%
\addcontentsline{toc}{#1}{%
@@ -225,7 +248,9 @@
\else
\def\@svsechd{%
#6{\hskip #3\relax
- \@svsec \csname CTEX@#1@titleformat\endcsname{#8}}%
+ \@svsec
+ \csname CTEX@#1@titleformat\endcsname{#8}%
+ \csname CTEX@#1@aftertitle\endcsname}%
\csname #1mark\endcsname{#7}%
\addcontentsline{toc}{#1}{%
\ifnum #2>\c@secnumdepth \else
@@ -243,15 +268,20 @@
#4{%
\@hangfrom{\hskip #1}%
\interlinepenalty \@M
- \CTEX@titleformat@n{#5}\@@par}%
+ \CTEX@titleformat@n{#5}%
+ \CTEX@aftertitle}%
\endgroup
\else
- \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}}}%
+ \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}\CTEX@aftertitle}}%
\fi
\@xsect{#3}}
\cs_new_protected_nopar:Npn \CTEX@set@titleformat@n #1
- { \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat } }
+ {
+ \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat }
+ \cs_set_eq:Nc \CTEX@aftertitle { CTEX@#1@aftertitle }
+ }
\cs_new_eq:NN \CTEX@titleformat@n \use:n
+\cs_new_eq:NN \CTEX@aftertitle \prg_do_nothing:
\int_zero:N \l__ctex_tmp_int
\clist_map_inline:nn
{ section , subsection , subsubsection , paragraph , subparagraph }
@@ -270,15 +300,15 @@
}
}
}
-\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
+ appendix .meta:nn = { ctex / appendix } {#1} ,
+ appendix / name .code:n =
+ { \ctex_assign_heading_name:nn { appendix } {#1} } ,
+ appendix / number .tl_set:N = \CTEX@appendixnumber
}
+\tl_new:N \CTEX@preappendix
+\tl_new:N \CTEX@postappendix
\cs_new_eq:NN \CTEX@save@appendix \appendix
\cs_gset_protected_nopar:Npn \appendix
{
diff --git a/Master/texmf-dist/tex/latex/ctex/ctex-c5size.clo b/Master/texmf-dist/tex/latex/ctex/ctex-c5size.clo
index d77593121a1..963071bf90b 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctex-c5size.clo
+++ b/Master/texmf-dist/tex/latex/ctex/ctex-c5size.clo
@@ -26,10 +26,10 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{c5size option (CTEX)}
\ProvidesExplFile{ctex-c5size.clo}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
\ctex_set_font_size:Nnn \normalsize { 5 }
{
\abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
diff --git a/Master/texmf-dist/tex/latex/ctex/ctex-cs4size.clo b/Master/texmf-dist/tex/latex/ctex/ctex-cs4size.clo
index a93c92bae43..36ea15530d6 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctex-cs4size.clo
+++ b/Master/texmf-dist/tex/latex/ctex/ctex-cs4size.clo
@@ -26,10 +26,10 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{cs4size option (CTEX)}
\ProvidesExplFile{ctex-cs4size.clo}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
\ctex_set_font_size:Nnn \normalsize { -4 }
{
\abovedisplayskip 12\p@ \@plus3\p@ \@minus7\p@
diff --git a/Master/texmf-dist/tex/latex/ctex/ctex-report.def b/Master/texmf-dist/tex/latex/ctex/ctex-report.def
index ed27e9c8adb..42b4b0b15bd 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctex-report.def
+++ b/Master/texmf-dist/tex/latex/ctex/ctex-report.def
@@ -26,10 +26,10 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{Heading modification for report (CTEX)}
\ProvidesExplFile{ctex-report.def}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
\seq_new:N \c__ctex_headings_seq
\seq_gset_from_clist:Nn \c__ctex_headings_seq
{
@@ -49,16 +49,18 @@
\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@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@post#1 }
\exp_not:c { CTEX@#1@aftername }
}
}
@@ -75,19 +77,34 @@
#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 / aftertitle .tl_set:N = \exp_not:c { CTEX@#1@aftertitle } ,
#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 / 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 / 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 / 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 / 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 / titleformat~+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@titleformat } { ####1 } } ,
+ #1 / aftertitle+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftertitle } { ####1 } } ,
+ #1 / aftertitle~+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftertitle } { ####1 } } ,
#1 / beforeskip .initial:n = \c_zero_skip ,
#1 / afterskip .initial:n = \c_zero_skip ,
#1 / indent .initial:n = \c_zero_dim ,
@@ -106,7 +123,11 @@
{ \tl_clear:c { CTEX@post#1 } }
{ \tl_set:cn { CTEX@post#1 } {#3} }
}
-\tl_clear:N \l__ctex_tmp_tl
+\tl_set:Nn \l__ctex_tmp_tl
+ {
+ part / pagestyle .tl_set:N = \CTEX@part@pagestyle ,
+ chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle ,
+ }
\seq_map_inline:Nn \c__ctex_headings_seq
{
\__ctex_initial_heading:n {#1}
@@ -114,11 +135,6 @@
}
\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
@@ -133,12 +149,14 @@
\ifnum \c@secnumdepth >-2\relax
\CTEX@partname
\fi
- \CTEX@part@titleformat{#2}\par}%
+ \CTEX@part@titleformat{#2}%
+ \CTEX@part@aftertitle}%
\@endpart}
\def\@spart#1{%
{\interlinepenalty \@M
\normalfont \CTEX@part@format
- \CTEX@part@titleformat{#1}\par}%
+ \CTEX@part@titleformat{#1}%
+ \CTEX@part@aftertitle}%
\@endpart}
\def\@chapter[#1]#2{%
\ifnum \c@secnumdepth >\m@ne
@@ -172,7 +190,9 @@
\CTEX@chaptername
\fi
\interlinepenalty\@M
- \CTEX@chapter@titleformat{#1}\par\nobreak
+ \CTEX@chapter@titleformat{#1}%
+ \CTEX@chapter@aftertitle
+ \nobreak
\vskip \CTEX@chapter@afterskip
}}
\def\@makeschapterhead#1{%
@@ -186,7 +206,9 @@
\vspace*{\@tempskipa}%
{\normalfont \parindent \CTEX@chapter@indent \CTEX@chapter@format
\interlinepenalty\@M
- \CTEX@chapter@titleformat{#1}\par\nobreak
+ \CTEX@chapter@titleformat{#1}
+ \CTEX@chapter@aftertitle
+ \nobreak
\vskip \CTEX@chapter@afterskip
}}
\def\@seccntformat#1{%
@@ -206,7 +228,8 @@
#6{%
\@hangfrom{\hskip #3\relax\@svsec}%
\interlinepenalty \@M
- \csname CTEX@#1@titleformat\endcsname{#8}\@@par}%
+ \csname CTEX@#1@titleformat\endcsname{#8}%
+ \csname CTEX@#1@aftertitle\endcsname}%
\endgroup
\csname #1mark\endcsname{#7}%
\addcontentsline{toc}{#1}{%
@@ -219,7 +242,9 @@
\else
\def\@svsechd{%
#6{\hskip #3\relax
- \@svsec \csname CTEX@#1@titleformat\endcsname{#8}}%
+ \@svsec
+ \csname CTEX@#1@titleformat\endcsname{#8}%
+ \csname CTEX@#1@aftertitle\endcsname}%
\csname #1mark\endcsname{#7}%
\addcontentsline{toc}{#1}{%
\ifnum #2>\c@secnumdepth \else
@@ -237,15 +262,20 @@
#4{%
\@hangfrom{\hskip #1}%
\interlinepenalty \@M
- \CTEX@titleformat@n{#5}\@@par}%
+ \CTEX@titleformat@n{#5}%
+ \CTEX@aftertitle}%
\endgroup
\else
- \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}}}%
+ \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}\CTEX@aftertitle}}%
\fi
\@xsect{#3}}
\cs_new_protected_nopar:Npn \CTEX@set@titleformat@n #1
- { \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat } }
+ {
+ \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat }
+ \cs_set_eq:Nc \CTEX@aftertitle { CTEX@#1@aftertitle }
+ }
\cs_new_eq:NN \CTEX@titleformat@n \use:n
+\cs_new_eq:NN \CTEX@aftertitle \prg_do_nothing:
\int_zero:N \l__ctex_tmp_int
\clist_map_inline:nn
{ section , subsection , subsubsection , paragraph , subparagraph }
@@ -264,15 +294,15 @@
}
}
}
-\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
+ appendix .meta:nn = { ctex / appendix } {#1} ,
+ appendix / name .code:n =
+ { \ctex_assign_heading_name:nn { appendix } {#1} } ,
+ appendix / number .tl_set:N = \CTEX@appendixnumber
}
+\tl_new:N \CTEX@preappendix
+\tl_new:N \CTEX@postappendix
\cs_new_eq:NN \CTEX@save@appendix \appendix
\cs_gset_protected_nopar:Npn \appendix
{
diff --git a/Master/texmf-dist/tex/latex/ctex/ctex.sty b/Master/texmf-dist/tex/latex/ctex/ctex.sty
index c7201874053..615e615d807 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctex.sty
+++ b/Master/texmf-dist/tex/latex/ctex/ctex.sty
@@ -4,7 +4,7 @@
%%
%% The original source files were:
%%
-%% ctex.dtx (with options: `package,style')
+%% ctex.dtx (with options: `style,ctex')
%%
%% Copyright (C) 2003--2015
%% CTEX.ORG and any individual authors listed in the documentation.
@@ -28,48 +28,43 @@
%%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{Chinese adapter in LaTeX (CTEX)}
\ProvidesExplPackage{\ExplFileName}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
+\tl_const:Nx \c__ctex_version_tl
+ { \cs_if_exist_use:cF { ver@ \@currname . \@currext } { 9999/99/99 } }
+\msg_new:nnnn { ctex } { subpackage-loaded }
+ { Package~`#1'~can~not~be~loaded~with~`ctex'. }
+ {
+ `#1'~is~actually~a~part~of~`ctex'.\\
+ It~is~not~necessary~to~load~it~separately.
+ }
+\@ifpackageloaded { ctexsize }
+ { \msg_error:nnn { ctex } { subpackage-loaded } { ctexsize } }
+ { \cs_new_eq:cN { ver@ctexsize. \@pkgextension } \c__ctex_version_tl }
+\@ifpackageloaded { ctexheading }
+ { \msg_error:nnn { ctex } { subpackage-loaded } { ctexheading } }
+ { \cs_new_eq:cN { ver@ctexheading. \@pkgextension } \c__ctex_version_tl }
\RequirePackage { xparse , l3keys2e }
-\RequirePackage { etoolbox , ifpdf , fix-cm , everysel }
+\RequirePackage { etoolbox }
+\RequirePackage { 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 } }
+ \@ifpackageloaded {#1}
+ {#2}
+ { \ctex_gadd_hook:cn { g__ctex_at_end_ #1 _hook_tl } {#2} }
}
-\cs_new_protected:Npn \ctex_add_hook:Nn #1#2
+\cs_new_protected:Npn \ctex_gadd_hook:Nn #1#2
{
\tl_if_exist:NF #1 { \tl_new:N #1 }
- \tl_gput_right:Nn #1 { #2 }
+ \tl_gput_right:Nn #1 {#2}
}
-\cs_generate_variant:Nn \ctex_add_hook:Nn { c }
+\cs_generate_variant:Nn \ctex_gadd_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 }
@@ -77,7 +72,10 @@
}
\cs_generate_variant:Nn \ctex_package_end_hook:n { o }
\tl_put_left:Nn \@popfilename
- { \ctex_package_end_hook:o { \@currname } }
+ {
+ \cs_if_eq:NNT \@currext \@pkgextension
+ { \ctex_package_end_hook:o { \@currname } }
+ }
\cs_new_protected:Npn \ctex_file_wrapper:nnn #1#2#3
{
\use:x
@@ -127,15 +125,15 @@
\group_begin:
\use:x
{
+ \group_end:
\__ctex_parse_name:nNNNnN { \token_get_replacement_spec:N #2 }
- \exp_not:N #2 \exp_not:c { #3 ~ } \exp_not:c { /#3 } {#3}
- } #1
+ \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}
@@ -164,9 +162,9 @@
\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_nopar:Npn \ctex_patch_cmd:NnnTF { \ctex_parse_name:NN \patchcmd }
+\cs_new_protected_nopar:Npn \ctex_preto_cmd:NnTF { \ctex_parse_name:NN \pretocmd }
+\cs_new_protected_nopar:Npn \ctex_appto_cmd:NnTF { \ctex_parse_name:NN \apptocmd }
\cs_new_protected:Npn \ctex_patch_cmd:Nnn
{
\group_begin:
@@ -194,6 +192,29 @@
Patching~command~`#1'~failed.\\
ctex~may~not~work~as~expected.
}
+\cs_new_eq:NN \g__ctex_section_depth_flag \c_two
+\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
+\cs_if_exist:NTF \pdftex_pdfoutput:D
+ {
+ \int_compare:nNnTF \pdftex_pdfoutput:D > \c_zero
+ {
+ \cs_new_eq:NN \ifctexpdf \tex_iftrue:D
+ \cs_new_eq:NN \ctex_if_pdfmode:TF \use_i:nn
+ }
+ }
+ { \use:n }
+ {
+ \cs_new_eq:NN \ifctexpdf \tex_iffalse:D
+ \cs_new_eq:NN \ctex_if_pdfmode:TF \use_ii:nn
+ }
+\cs_new_eq:NN \ctex_if_preamble:TF \use_i:nn
+\AfterEndPreamble { \cs_set_eq:NN \ctex_if_preamble:TF \use_ii:nn }
\cs_new:Npn \ctex_set_default_ccwd:Nn #1#2
{
\dim_compare:nNnTF
@@ -217,7 +238,6 @@
\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
@@ -316,7 +336,7 @@
Option~ `fontset=adobe'~ is~ set.~ It~ is~ better~ to~ use~
fontset~ option.
}
- \keys_set:nn { ctex / option } { fontset = none }
+ \keys_set:nn { ctex / option } { fontset = adobe }
} ,
winfonts .code:n =
{
@@ -325,7 +345,7 @@
Option~ `fontset=windows'~ is~ set.~ It~ is~ better~ to~ use~
fontset~ option.
}
- \keys_set:nn { ctex / option } { fontset = none }
+ \keys_set:nn { ctex / option } { fontset = windows }
} ,
nofonts .value_forbidden: ,
winfonts .value_forbidden: ,
@@ -379,9 +399,15 @@
} ,
nospace .value_forbidden: ,
heading .bool_set:N = \l__ctex_heading_bool ,
+ 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: ,
scheme .tl_set:N = \l__ctex_scheme_tl ,
- scheme .default:n = { chinese },
- scheme .initial:n = { chinese },
+ scheme .default:n = { chinese } ,
+ scheme .initial:n = { chinese } ,
cap .code:n =
{
\msg_warning:nnn { ctex } { deprecated-option }
@@ -396,12 +422,6 @@
} ,
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 }
@@ -411,12 +431,17 @@
{
\msg_warning:nnn { ctex } { deprecated-option }
{ `fancyhdr'~ package~ is~ loaded. }
- \RequirePackage{ fancyhdr }
+ \RequirePackage { fancyhdr }
} ,
hyperref .code:n =
{
\msg_warning:nnn { ctex } { deprecated-option }
{ `hyperref'~ package~ will~ be~ loaded. }
+ \ctex_at_end:n
+ {
+ \cs_if_exist:NF \hypersetup
+ { \cs_new_eq:NN \hypersetup \ctex_hypersetup:n }
+ }
\AtEndPreamble { \RequirePackage { hyperref } }
} ,
}
@@ -438,18 +463,7 @@
\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 \ctexset { } { \keys_set:nn { ctex } }
\NewDocumentCommand \CTEXsetup { +o > { \TrimSpaces } m }
{
\msg_warning:nnnn { ctex } { deprecated-command } { \CTEXsetup }
@@ -471,7 +485,6 @@
\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 }
@@ -677,6 +690,12 @@
\keys_define:nn { ctex } { bibname .tl_set:N = \ctexbibname }
}
}
+\clist_map_inline:nn { article , book , report }
+ {
+ \@ifclassloaded {#1}
+ { \clist_map_break:n { \tl_const:Nn \c__ctex_std_class_tl {#1} } }
+ { }
+ }
\msg_new:nnn { ctex } { not-standard-class }
{
None~of~the~standard~document~classes~was~loaded.\\
@@ -685,12 +704,8 @@
}
\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
+ \tl_if_exist:NTF \c__ctex_std_class_tl
+ { \cs_new_eq:NN \c__ctex_class_tl \c__ctex_std_class_tl }
{
\cs_if_exist:NTF \chapter
{
@@ -810,11 +825,8 @@
\normalsize
\NewDocumentCommand \CTeX { }
{ \ifincsname CTeX \else: C \TeX \fi: }
-\AtBeginDocument
- {
- \cs_if_exist_use:NT \pdfstringdefDisableCommands
- { { \tl_set:Nn \CTeX { CTeX } } }
- }
+\ctex_at_end_package:nn { hyperref }
+ { \pdfstringdefDisableCommands { \tl_set:Nn \CTeX { CTeX } } }
\keys_define:nn { ctex }
{
captiondelimiter .code:n =
@@ -918,6 +930,7 @@
%% ctex.sty,
%% ctexcap.sty,
%% ctexsize.sty,
+%% ctexheading.sty,
%% ctexart.cls,
%% ctexbook.cls,
%% ctexrep.cls,
diff --git a/Master/texmf-dist/tex/latex/ctex/ctexart.cls b/Master/texmf-dist/tex/latex/ctex/ctexart.cls
index ed34c9d861a..0af93272ce1 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctexart.cls
+++ b/Master/texmf-dist/tex/latex/ctex/ctexart.cls
@@ -28,10 +28,16 @@
%%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{Chinese adapter for class article (CTEX)}
\ProvidesExplClass{ctexart}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
+\tl_const:Nx \c__ctex_version_tl
+ { \cs_if_exist_use:cF { ver@ \@currname . \@currext } { 9999/99/99 } }
+\cs_new_eq:cN { ver@ctex. \@pkgextension } \c__ctex_version_tl
+\cs_new_eq:cN { ver@ctexcap. \@pkgextension } \c__ctex_version_tl
+\cs_new_eq:cN { ver@ctexsize. \@pkgextension } \c__ctex_version_tl
+\cs_new_eq:cN { ver@ctexheading. \@pkgextension } \c__ctex_version_tl
\RequirePackage { xparse , l3keys2e }
\msg_new:nnnn { ctex } { l3-too-old }
{ Support~package~`#1'~too~old. }
@@ -44,43 +50,24 @@
{ \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 }
+\RequirePackage { etoolbox }
+\RequirePackage { 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 } }
+ \@ifpackageloaded {#1}
+ {#2}
+ { \ctex_gadd_hook:cn { g__ctex_at_end_ #1 _hook_tl } {#2} }
}
-\cs_new_protected:Npn \ctex_add_hook:Nn #1#2
+\cs_new_protected:Npn \ctex_gadd_hook:Nn #1#2
{
\tl_if_exist:NF #1 { \tl_new:N #1 }
- \tl_gput_right:Nn #1 { #2 }
+ \tl_gput_right:Nn #1 {#2}
}
-\cs_generate_variant:Nn \ctex_add_hook:Nn { c }
+\cs_generate_variant:Nn \ctex_gadd_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 }
@@ -88,7 +75,10 @@
}
\cs_generate_variant:Nn \ctex_package_end_hook:n { o }
\tl_put_left:Nn \@popfilename
- { \ctex_package_end_hook:o { \@currname } }
+ {
+ \cs_if_eq:NNT \@currext \@pkgextension
+ { \ctex_package_end_hook:o { \@currname } }
+ }
\cs_new_protected:Npn \ctex_file_wrapper:nnn #1#2#3
{
\use:x
@@ -138,15 +128,15 @@
\group_begin:
\use:x
{
+ \group_end:
\__ctex_parse_name:nNNNnN { \token_get_replacement_spec:N #2 }
- \exp_not:N #2 \exp_not:c { #3 ~ } \exp_not:c { /#3 } {#3}
- } #1
+ \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}
@@ -175,9 +165,9 @@
\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_nopar:Npn \ctex_patch_cmd:NnnTF { \ctex_parse_name:NN \patchcmd }
+\cs_new_protected_nopar:Npn \ctex_preto_cmd:NnTF { \ctex_parse_name:NN \pretocmd }
+\cs_new_protected_nopar:Npn \ctex_appto_cmd:NnTF { \ctex_parse_name:NN \apptocmd }
\cs_new_protected:Npn \ctex_patch_cmd:Nnn
{
\group_begin:
@@ -205,6 +195,29 @@
Patching~command~`#1'~failed.\\
ctex~may~not~work~as~expected.
}
+\cs_new_eq:NN \g__ctex_section_depth_flag \c_two
+\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
+\cs_if_exist:NTF \pdftex_pdfoutput:D
+ {
+ \int_compare:nNnTF \pdftex_pdfoutput:D > \c_zero
+ {
+ \cs_new_eq:NN \ifctexpdf \tex_iftrue:D
+ \cs_new_eq:NN \ctex_if_pdfmode:TF \use_i:nn
+ }
+ }
+ { \use:n }
+ {
+ \cs_new_eq:NN \ifctexpdf \tex_iffalse:D
+ \cs_new_eq:NN \ctex_if_pdfmode:TF \use_ii:nn
+ }
+\cs_new_eq:NN \ctex_if_preamble:TF \use_i:nn
+\AfterEndPreamble { \cs_set_eq:NN \ctex_if_preamble:TF \use_ii:nn }
\cs_new:Npn \ctex_set_default_ccwd:Nn #1#2
{
\dim_compare:nNnTF
@@ -228,7 +241,6 @@
\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
@@ -328,7 +340,7 @@
Option~ `fontset=adobe'~ is~ set.~ It~ is~ better~ to~ use~
fontset~ option.
}
- \keys_set:nn { ctex / option } { fontset = none }
+ \keys_set:nn { ctex / option } { fontset = adobe }
} ,
winfonts .code:n =
{
@@ -337,7 +349,7 @@
Option~ `fontset=windows'~ is~ set.~ It~ is~ better~ to~ use~
fontset~ option.
}
- \keys_set:nn { ctex / option } { fontset = none }
+ \keys_set:nn { ctex / option } { fontset = windows }
} ,
nofonts .value_forbidden: ,
winfonts .value_forbidden: ,
@@ -391,9 +403,15 @@
} ,
nospace .value_forbidden: ,
heading .bool_set:N = \l__ctex_heading_bool ,
+ 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: ,
scheme .tl_set:N = \l__ctex_scheme_tl ,
- scheme .default:n = { chinese },
- scheme .initial:n = { chinese },
+ scheme .default:n = { chinese } ,
+ scheme .initial:n = { chinese } ,
cap .code:n =
{
\msg_warning:nnn { ctex } { deprecated-option }
@@ -408,12 +426,6 @@
} ,
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 }
@@ -423,12 +435,17 @@
{
\msg_warning:nnn { ctex } { deprecated-option }
{ `fancyhdr'~ package~ is~ loaded. }
- \RequirePackage{ fancyhdr }
+ \RequirePackage { fancyhdr }
} ,
hyperref .code:n =
{
\msg_warning:nnn { ctex } { deprecated-option }
{ `hyperref'~ package~ will~ be~ loaded. }
+ \ctex_at_end:n
+ {
+ \cs_if_exist:NF \hypersetup
+ { \cs_new_eq:NN \hypersetup \ctex_hypersetup:n }
+ }
\AtEndPreamble { \RequirePackage { hyperref } }
} ,
}
@@ -466,12 +483,7 @@
\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 \ctexset { } { \keys_set:nn { ctex } }
\NewDocumentCommand \CTEXsetup { +o > { \TrimSpaces } m }
{
\msg_warning:nnnn { ctex } { deprecated-command } { \CTEXsetup }
@@ -493,7 +505,6 @@
\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 }
@@ -704,16 +715,18 @@
\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@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@post#1 }
\exp_not:c { CTEX@#1@aftername }
}
}
@@ -730,19 +743,34 @@
#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 / aftertitle .tl_set:N = \exp_not:c { CTEX@#1@aftertitle } ,
#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 / 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 / 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 / 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 / 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 / titleformat~+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@titleformat } { ####1 } } ,
+ #1 / aftertitle+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftertitle } { ####1 } } ,
+ #1 / aftertitle~+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftertitle } { ####1 } } ,
#1 / beforeskip .initial:n = \c_zero_skip ,
#1 / afterskip .initial:n = \c_zero_skip ,
#1 / indent .initial:n = \c_zero_dim ,
@@ -761,7 +789,6 @@
{ \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}
@@ -793,14 +820,16 @@
\CTEX@partname
\fi
\CTEX@part@titleformat{#2}%
- \markboth{}{}\par}%
+ \markboth{}{}%
+ \CTEX@part@aftertitle}%
\nobreak
\vskip \CTEX@part@afterskip
\@afterheading}
\def\@spart#1{%
{\interlinepenalty \@M
\normalfont \parindent \CTEX@part@indent \CTEX@part@format
- \CTEX@part@titleformat{#1}\par}%
+ \CTEX@part@titleformat{#1}%
+ \CTEX@part@aftertitle}%
\nobreak
\vskip \CTEX@part@afterskip
\@afterheading}
@@ -821,7 +850,8 @@
#6{%
\@hangfrom{\hskip #3\relax\@svsec}%
\interlinepenalty \@M
- \csname CTEX@#1@titleformat\endcsname{#8}\@@par}%
+ \csname CTEX@#1@titleformat\endcsname{#8}%
+ \csname CTEX@#1@aftertitle\endcsname}%
\endgroup
\csname #1mark\endcsname{#7}%
\addcontentsline{toc}{#1}{%
@@ -834,7 +864,9 @@
\else
\def\@svsechd{%
#6{\hskip #3\relax
- \@svsec \csname CTEX@#1@titleformat\endcsname{#8}}%
+ \@svsec
+ \csname CTEX@#1@titleformat\endcsname{#8}%
+ \csname CTEX@#1@aftertitle\endcsname}%
\csname #1mark\endcsname{#7}%
\addcontentsline{toc}{#1}{%
\ifnum #2>\c@secnumdepth \else
@@ -852,15 +884,20 @@
#4{%
\@hangfrom{\hskip #1}%
\interlinepenalty \@M
- \CTEX@titleformat@n{#5}\@@par}%
+ \CTEX@titleformat@n{#5}%
+ \CTEX@aftertitle}%
\endgroup
\else
- \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}}}%
+ \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}\CTEX@aftertitle}}%
\fi
\@xsect{#3}}
\cs_new_protected_nopar:Npn \CTEX@set@titleformat@n #1
- { \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat } }
+ {
+ \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat }
+ \cs_set_eq:Nc \CTEX@aftertitle { CTEX@#1@aftertitle }
+ }
\cs_new_eq:NN \CTEX@titleformat@n \use:n
+\cs_new_eq:NN \CTEX@aftertitle \prg_do_nothing:
\int_zero:N \l__ctex_tmp_int
\clist_map_inline:nn
{ section , subsection , subsubsection , paragraph , subparagraph }
@@ -879,15 +916,15 @@
}
}
}
-\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
+ appendix .meta:nn = { ctex / appendix } {#1} ,
+ appendix / name .code:n =
+ { \ctex_assign_heading_name:nn { appendix } {#1} } ,
+ appendix / number .tl_set:N = \CTEX@appendixnumber
}
+\tl_new:N \CTEX@preappendix
+\tl_new:N \CTEX@postappendix
\cs_new_eq:NN \CTEX@save@appendix \appendix
\cs_gset_protected_nopar:Npn \appendix
{
@@ -1072,11 +1109,8 @@
\normalsize
\NewDocumentCommand \CTeX { }
{ \ifincsname CTeX \else: C \TeX \fi: }
-\AtBeginDocument
- {
- \cs_if_exist_use:NT \pdfstringdefDisableCommands
- { { \tl_set:Nn \CTeX { CTeX } } }
- }
+\ctex_at_end_package:nn { hyperref }
+ { \pdfstringdefDisableCommands { \tl_set:Nn \CTeX { CTeX } } }
\keys_define:nn { ctex }
{
captiondelimiter .code:n =
@@ -1180,6 +1214,7 @@
%% ctex.sty,
%% ctexcap.sty,
%% ctexsize.sty,
+%% ctexheading.sty,
%% ctexart.cls,
%% ctexbook.cls,
%% ctexrep.cls,
diff --git a/Master/texmf-dist/tex/latex/ctex/ctexbook.cls b/Master/texmf-dist/tex/latex/ctex/ctexbook.cls
index 9c713e37a3f..3e6a5d76736 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctexbook.cls
+++ b/Master/texmf-dist/tex/latex/ctex/ctexbook.cls
@@ -28,10 +28,16 @@
%%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{Chinese adapter for class book (CTEX)}
\ProvidesExplClass{ctexbook}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
+\tl_const:Nx \c__ctex_version_tl
+ { \cs_if_exist_use:cF { ver@ \@currname . \@currext } { 9999/99/99 } }
+\cs_new_eq:cN { ver@ctex. \@pkgextension } \c__ctex_version_tl
+\cs_new_eq:cN { ver@ctexcap. \@pkgextension } \c__ctex_version_tl
+\cs_new_eq:cN { ver@ctexsize. \@pkgextension } \c__ctex_version_tl
+\cs_new_eq:cN { ver@ctexheading. \@pkgextension } \c__ctex_version_tl
\RequirePackage { xparse , l3keys2e }
\msg_new:nnnn { ctex } { l3-too-old }
{ Support~package~`#1'~too~old. }
@@ -44,43 +50,24 @@
{ \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 }
+\RequirePackage { etoolbox }
+\RequirePackage { 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 } }
+ \@ifpackageloaded {#1}
+ {#2}
+ { \ctex_gadd_hook:cn { g__ctex_at_end_ #1 _hook_tl } {#2} }
}
-\cs_new_protected:Npn \ctex_add_hook:Nn #1#2
+\cs_new_protected:Npn \ctex_gadd_hook:Nn #1#2
{
\tl_if_exist:NF #1 { \tl_new:N #1 }
- \tl_gput_right:Nn #1 { #2 }
+ \tl_gput_right:Nn #1 {#2}
}
-\cs_generate_variant:Nn \ctex_add_hook:Nn { c }
+\cs_generate_variant:Nn \ctex_gadd_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 }
@@ -88,7 +75,10 @@
}
\cs_generate_variant:Nn \ctex_package_end_hook:n { o }
\tl_put_left:Nn \@popfilename
- { \ctex_package_end_hook:o { \@currname } }
+ {
+ \cs_if_eq:NNT \@currext \@pkgextension
+ { \ctex_package_end_hook:o { \@currname } }
+ }
\cs_new_protected:Npn \ctex_file_wrapper:nnn #1#2#3
{
\use:x
@@ -138,15 +128,15 @@
\group_begin:
\use:x
{
+ \group_end:
\__ctex_parse_name:nNNNnN { \token_get_replacement_spec:N #2 }
- \exp_not:N #2 \exp_not:c { #3 ~ } \exp_not:c { /#3 } {#3}
- } #1
+ \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}
@@ -175,9 +165,9 @@
\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_nopar:Npn \ctex_patch_cmd:NnnTF { \ctex_parse_name:NN \patchcmd }
+\cs_new_protected_nopar:Npn \ctex_preto_cmd:NnTF { \ctex_parse_name:NN \pretocmd }
+\cs_new_protected_nopar:Npn \ctex_appto_cmd:NnTF { \ctex_parse_name:NN \apptocmd }
\cs_new_protected:Npn \ctex_patch_cmd:Nnn
{
\group_begin:
@@ -205,6 +195,29 @@
Patching~command~`#1'~failed.\\
ctex~may~not~work~as~expected.
}
+\cs_new_eq:NN \g__ctex_section_depth_flag \c_two
+\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
+\cs_if_exist:NTF \pdftex_pdfoutput:D
+ {
+ \int_compare:nNnTF \pdftex_pdfoutput:D > \c_zero
+ {
+ \cs_new_eq:NN \ifctexpdf \tex_iftrue:D
+ \cs_new_eq:NN \ctex_if_pdfmode:TF \use_i:nn
+ }
+ }
+ { \use:n }
+ {
+ \cs_new_eq:NN \ifctexpdf \tex_iffalse:D
+ \cs_new_eq:NN \ctex_if_pdfmode:TF \use_ii:nn
+ }
+\cs_new_eq:NN \ctex_if_preamble:TF \use_i:nn
+\AfterEndPreamble { \cs_set_eq:NN \ctex_if_preamble:TF \use_ii:nn }
\cs_new:Npn \ctex_set_default_ccwd:Nn #1#2
{
\dim_compare:nNnTF
@@ -228,7 +241,6 @@
\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
@@ -328,7 +340,7 @@
Option~ `fontset=adobe'~ is~ set.~ It~ is~ better~ to~ use~
fontset~ option.
}
- \keys_set:nn { ctex / option } { fontset = none }
+ \keys_set:nn { ctex / option } { fontset = adobe }
} ,
winfonts .code:n =
{
@@ -337,7 +349,7 @@
Option~ `fontset=windows'~ is~ set.~ It~ is~ better~ to~ use~
fontset~ option.
}
- \keys_set:nn { ctex / option } { fontset = none }
+ \keys_set:nn { ctex / option } { fontset = windows }
} ,
nofonts .value_forbidden: ,
winfonts .value_forbidden: ,
@@ -391,9 +403,15 @@
} ,
nospace .value_forbidden: ,
heading .bool_set:N = \l__ctex_heading_bool ,
+ 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: ,
scheme .tl_set:N = \l__ctex_scheme_tl ,
- scheme .default:n = { chinese },
- scheme .initial:n = { chinese },
+ scheme .default:n = { chinese } ,
+ scheme .initial:n = { chinese } ,
cap .code:n =
{
\msg_warning:nnn { ctex } { deprecated-option }
@@ -408,12 +426,6 @@
} ,
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 }
@@ -423,12 +435,17 @@
{
\msg_warning:nnn { ctex } { deprecated-option }
{ `fancyhdr'~ package~ is~ loaded. }
- \RequirePackage{ fancyhdr }
+ \RequirePackage { fancyhdr }
} ,
hyperref .code:n =
{
\msg_warning:nnn { ctex } { deprecated-option }
{ `hyperref'~ package~ will~ be~ loaded. }
+ \ctex_at_end:n
+ {
+ \cs_if_exist:NF \hypersetup
+ { \cs_new_eq:NN \hypersetup \ctex_hypersetup:n }
+ }
\AtEndPreamble { \RequirePackage { hyperref } }
} ,
}
@@ -466,12 +483,7 @@
\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 \ctexset { } { \keys_set:nn { ctex } }
\NewDocumentCommand \CTEXsetup { +o > { \TrimSpaces } m }
{
\msg_warning:nnnn { ctex } { deprecated-command } { \CTEXsetup }
@@ -493,7 +505,6 @@
\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 }
@@ -704,16 +715,18 @@
\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@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@post#1 }
\exp_not:c { CTEX@#1@aftername }
}
}
@@ -730,19 +743,34 @@
#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 / aftertitle .tl_set:N = \exp_not:c { CTEX@#1@aftertitle } ,
#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 / 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 / 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 / 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 / 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 / titleformat~+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@titleformat } { ####1 } } ,
+ #1 / aftertitle+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftertitle } { ####1 } } ,
+ #1 / aftertitle~+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftertitle } { ####1 } } ,
#1 / beforeskip .initial:n = \c_zero_skip ,
#1 / afterskip .initial:n = \c_zero_skip ,
#1 / indent .initial:n = \c_zero_dim ,
@@ -761,7 +789,11 @@
{ \tl_clear:c { CTEX@post#1 } }
{ \tl_set:cn { CTEX@post#1 } {#3} }
}
-\tl_clear:N \l__ctex_tmp_tl
+\tl_set:Nn \l__ctex_tmp_tl
+ {
+ part / pagestyle .tl_set:N = \CTEX@part@pagestyle ,
+ chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle ,
+ }
\seq_map_inline:Nn \c__ctex_headings_seq
{
\__ctex_initial_heading:n {#1}
@@ -769,11 +801,6 @@
}
\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
@@ -788,12 +815,14 @@
\ifnum \c@secnumdepth >-2\relax
\CTEX@partname
\fi
- \CTEX@part@titleformat{#2}\par}%
+ \CTEX@part@titleformat{#2}%
+ \CTEX@part@aftertitle}%
\@endpart}
\def\@spart#1{%
{\interlinepenalty \@M
\normalfont \CTEX@part@format
- \CTEX@part@titleformat{#1}\par}%
+ \CTEX@part@titleformat{#1}%
+ \CTEX@part@aftertitle}%
\@endpart}
\def\@chapter[#1]#2{%
\ifnum \c@secnumdepth >\m@ne
@@ -833,7 +862,9 @@
\fi
\fi
\interlinepenalty\@M
- \CTEX@chapter@titleformat{#1}\par\nobreak
+ \CTEX@chapter@titleformat{#1}%
+ \CTEX@chapter@aftertitle
+ \nobreak
\vskip \CTEX@chapter@afterskip
}}
\def\@makeschapterhead#1{%
@@ -847,7 +878,9 @@
\vspace*{\@tempskipa}%
{\normalfont \parindent \CTEX@chapter@indent \CTEX@chapter@format
\interlinepenalty\@M
- \CTEX@chapter@titleformat{#1}\par\nobreak
+ \CTEX@chapter@titleformat{#1}
+ \CTEX@chapter@aftertitle
+ \nobreak
\vskip \CTEX@chapter@afterskip
}}
\def\@seccntformat#1{%
@@ -867,7 +900,8 @@
#6{%
\@hangfrom{\hskip #3\relax\@svsec}%
\interlinepenalty \@M
- \csname CTEX@#1@titleformat\endcsname{#8}\@@par}%
+ \csname CTEX@#1@titleformat\endcsname{#8}%
+ \csname CTEX@#1@aftertitle\endcsname}%
\endgroup
\csname #1mark\endcsname{#7}%
\addcontentsline{toc}{#1}{%
@@ -880,7 +914,9 @@
\else
\def\@svsechd{%
#6{\hskip #3\relax
- \@svsec \csname CTEX@#1@titleformat\endcsname{#8}}%
+ \@svsec
+ \csname CTEX@#1@titleformat\endcsname{#8}%
+ \csname CTEX@#1@aftertitle\endcsname}%
\csname #1mark\endcsname{#7}%
\addcontentsline{toc}{#1}{%
\ifnum #2>\c@secnumdepth \else
@@ -898,15 +934,20 @@
#4{%
\@hangfrom{\hskip #1}%
\interlinepenalty \@M
- \CTEX@titleformat@n{#5}\@@par}%
+ \CTEX@titleformat@n{#5}%
+ \CTEX@aftertitle}%
\endgroup
\else
- \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}}}%
+ \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}\CTEX@aftertitle}}%
\fi
\@xsect{#3}}
\cs_new_protected_nopar:Npn \CTEX@set@titleformat@n #1
- { \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat } }
+ {
+ \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat }
+ \cs_set_eq:Nc \CTEX@aftertitle { CTEX@#1@aftertitle }
+ }
\cs_new_eq:NN \CTEX@titleformat@n \use:n
+\cs_new_eq:NN \CTEX@aftertitle \prg_do_nothing:
\int_zero:N \l__ctex_tmp_int
\clist_map_inline:nn
{ section , subsection , subsubsection , paragraph , subparagraph }
@@ -925,15 +966,15 @@
}
}
}
-\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
+ appendix .meta:nn = { ctex / appendix } {#1} ,
+ appendix / name .code:n =
+ { \ctex_assign_heading_name:nn { appendix } {#1} } ,
+ appendix / number .tl_set:N = \CTEX@appendixnumber
}
+\tl_new:N \CTEX@preappendix
+\tl_new:N \CTEX@postappendix
\cs_new_eq:NN \CTEX@save@appendix \appendix
\cs_gset_protected_nopar:Npn \appendix
{
@@ -1119,11 +1160,8 @@
\normalsize
\NewDocumentCommand \CTeX { }
{ \ifincsname CTeX \else: C \TeX \fi: }
-\AtBeginDocument
- {
- \cs_if_exist_use:NT \pdfstringdefDisableCommands
- { { \tl_set:Nn \CTeX { CTeX } } }
- }
+\ctex_at_end_package:nn { hyperref }
+ { \pdfstringdefDisableCommands { \tl_set:Nn \CTeX { CTeX } } }
\keys_define:nn { ctex }
{
captiondelimiter .code:n =
@@ -1227,6 +1265,7 @@
%% ctex.sty,
%% ctexcap.sty,
%% ctexsize.sty,
+%% ctexheading.sty,
%% ctexart.cls,
%% ctexbook.cls,
%% ctexrep.cls,
diff --git a/Master/texmf-dist/tex/latex/ctex/ctexcap.sty b/Master/texmf-dist/tex/latex/ctex/ctexcap.sty
index 840c30bcb31..f899abbf14f 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctexcap.sty
+++ b/Master/texmf-dist/tex/latex/ctex/ctexcap.sty
@@ -4,7 +4,7 @@
%%
%% The original source files were:
%%
-%% ctex.dtx (with options: `package,ctexcap')
+%% ctex.dtx (with options: `ctexcap')
%%
%% Copyright (C) 2003--2015
%% CTEX.ORG and any individual authors listed in the documentation.
@@ -28,10 +28,10 @@
%%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{Chinese adapter in LaTeX (CTEX)}
\ProvidesExplPackage{ctexcap}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
\PassOptionsToPackage { heading = true } { ctexcap }
\RequirePackageWithOptions { ctex }
%%
@@ -41,6 +41,7 @@
%% ctex.sty,
%% ctexcap.sty,
%% ctexsize.sty,
+%% ctexheading.sty,
%% ctexart.cls,
%% ctexbook.cls,
%% ctexrep.cls,
diff --git a/Master/texmf-dist/tex/latex/ctex/ctexheading.sty b/Master/texmf-dist/tex/latex/ctex/ctexheading.sty
new file mode 100644
index 00000000000..efff90fbbdd
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ctex/ctexheading.sty
@@ -0,0 +1,278 @@
+%%
+%% This is file `ctexheading.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ctex.dtx (with options: `style,ctexheading')
+%%
+%% 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 ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
+ {Heading style modification (CTEX)}
+\ProvidesExplPackage{ctexheading}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
+\RequirePackage { xparse , l3keys2e }
+\RequirePackage { etoolbox }
+\tl_new:N \l__ctex_tmp_tl
+\int_new:N \l__ctex_tmp_int
+\box_new:N \l__ctex_tmp_box
+\cs_new_protected:Npn \ctex_at_end_package:nn #1#2
+ {
+ \@ifpackageloaded {#1}
+ {#2}
+ { \ctex_gadd_hook:cn { g__ctex_at_end_ #1 _hook_tl } {#2} }
+ }
+\cs_new_protected:Npn \ctex_gadd_hook:Nn #1#2
+ {
+ \tl_if_exist:NF #1 { \tl_new:N #1 }
+ \tl_gput_right:Nn #1 {#2}
+ }
+\cs_generate_variant:Nn \ctex_gadd_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
+ {
+ \cs_if_eq:NNT \@currext \@pkgextension
+ { \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
+ {
+ \group_end:
+ \__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
+ {
+ \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_nopar:Npn \ctex_patch_cmd:NnnTF { \ctex_parse_name:NN \patchcmd }
+\cs_new_protected_nopar:Npn \ctex_preto_cmd:NnTF { \ctex_parse_name:NN \pretocmd }
+\cs_new_protected_nopar: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_eq:NN \g__ctex_section_depth_flag \c_two
+\keys_define:nn { ctex / option }
+ {
+ 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: ,
+ scheme .tl_set:N = \l__ctex_scheme_tl ,
+ scheme .default:n = { plain } ,
+ scheme .initial:n = { plain }
+ }
+\ProcessKeysOptions { ctex / option }
+\NewDocumentCommand \ctexset { } { \keys_set:nn { ctex } }
+\clist_map_inline:nn { article , book , report }
+ {
+ \@ifclassloaded {#1}
+ { \clist_map_break:n { \tl_const:Nn \c__ctex_std_class_tl {#1} } }
+ { }
+ }
+\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.
+ }
+\use:n
+ {
+ \tl_if_exist:NTF \c__ctex_std_class_tl
+ { \cs_new_eq:NN \c__ctex_class_tl \c__ctex_std_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 }
+ }
+%%
+%% This package consists of the file ctex.dtx,
+%% and the derived files ctex.pdf,
+%% ctex.ins,
+%% ctex.sty,
+%% ctexcap.sty,
+%% ctexsize.sty,
+%% ctexheading.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 `ctexheading.sty'.
diff --git a/Master/texmf-dist/tex/latex/ctex/ctexrep.cls b/Master/texmf-dist/tex/latex/ctex/ctexrep.cls
index d32a3d7e999..0f7dfdeff5a 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctexrep.cls
+++ b/Master/texmf-dist/tex/latex/ctex/ctexrep.cls
@@ -28,10 +28,16 @@
%%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{Chinese adapter for class report (CTEX)}
\ProvidesExplClass{ctexrep}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
+\tl_const:Nx \c__ctex_version_tl
+ { \cs_if_exist_use:cF { ver@ \@currname . \@currext } { 9999/99/99 } }
+\cs_new_eq:cN { ver@ctex. \@pkgextension } \c__ctex_version_tl
+\cs_new_eq:cN { ver@ctexcap. \@pkgextension } \c__ctex_version_tl
+\cs_new_eq:cN { ver@ctexsize. \@pkgextension } \c__ctex_version_tl
+\cs_new_eq:cN { ver@ctexheading. \@pkgextension } \c__ctex_version_tl
\RequirePackage { xparse , l3keys2e }
\msg_new:nnnn { ctex } { l3-too-old }
{ Support~package~`#1'~too~old. }
@@ -44,43 +50,24 @@
{ \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 }
+\RequirePackage { etoolbox }
+\RequirePackage { 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 } }
+ \@ifpackageloaded {#1}
+ {#2}
+ { \ctex_gadd_hook:cn { g__ctex_at_end_ #1 _hook_tl } {#2} }
}
-\cs_new_protected:Npn \ctex_add_hook:Nn #1#2
+\cs_new_protected:Npn \ctex_gadd_hook:Nn #1#2
{
\tl_if_exist:NF #1 { \tl_new:N #1 }
- \tl_gput_right:Nn #1 { #2 }
+ \tl_gput_right:Nn #1 {#2}
}
-\cs_generate_variant:Nn \ctex_add_hook:Nn { c }
+\cs_generate_variant:Nn \ctex_gadd_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 }
@@ -88,7 +75,10 @@
}
\cs_generate_variant:Nn \ctex_package_end_hook:n { o }
\tl_put_left:Nn \@popfilename
- { \ctex_package_end_hook:o { \@currname } }
+ {
+ \cs_if_eq:NNT \@currext \@pkgextension
+ { \ctex_package_end_hook:o { \@currname } }
+ }
\cs_new_protected:Npn \ctex_file_wrapper:nnn #1#2#3
{
\use:x
@@ -138,15 +128,15 @@
\group_begin:
\use:x
{
+ \group_end:
\__ctex_parse_name:nNNNnN { \token_get_replacement_spec:N #2 }
- \exp_not:N #2 \exp_not:c { #3 ~ } \exp_not:c { /#3 } {#3}
- } #1
+ \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}
@@ -175,9 +165,9 @@
\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_nopar:Npn \ctex_patch_cmd:NnnTF { \ctex_parse_name:NN \patchcmd }
+\cs_new_protected_nopar:Npn \ctex_preto_cmd:NnTF { \ctex_parse_name:NN \pretocmd }
+\cs_new_protected_nopar:Npn \ctex_appto_cmd:NnTF { \ctex_parse_name:NN \apptocmd }
\cs_new_protected:Npn \ctex_patch_cmd:Nnn
{
\group_begin:
@@ -205,6 +195,29 @@
Patching~command~`#1'~failed.\\
ctex~may~not~work~as~expected.
}
+\cs_new_eq:NN \g__ctex_section_depth_flag \c_two
+\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
+\cs_if_exist:NTF \pdftex_pdfoutput:D
+ {
+ \int_compare:nNnTF \pdftex_pdfoutput:D > \c_zero
+ {
+ \cs_new_eq:NN \ifctexpdf \tex_iftrue:D
+ \cs_new_eq:NN \ctex_if_pdfmode:TF \use_i:nn
+ }
+ }
+ { \use:n }
+ {
+ \cs_new_eq:NN \ifctexpdf \tex_iffalse:D
+ \cs_new_eq:NN \ctex_if_pdfmode:TF \use_ii:nn
+ }
+\cs_new_eq:NN \ctex_if_preamble:TF \use_i:nn
+\AfterEndPreamble { \cs_set_eq:NN \ctex_if_preamble:TF \use_ii:nn }
\cs_new:Npn \ctex_set_default_ccwd:Nn #1#2
{
\dim_compare:nNnTF
@@ -228,7 +241,6 @@
\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
@@ -328,7 +340,7 @@
Option~ `fontset=adobe'~ is~ set.~ It~ is~ better~ to~ use~
fontset~ option.
}
- \keys_set:nn { ctex / option } { fontset = none }
+ \keys_set:nn { ctex / option } { fontset = adobe }
} ,
winfonts .code:n =
{
@@ -337,7 +349,7 @@
Option~ `fontset=windows'~ is~ set.~ It~ is~ better~ to~ use~
fontset~ option.
}
- \keys_set:nn { ctex / option } { fontset = none }
+ \keys_set:nn { ctex / option } { fontset = windows }
} ,
nofonts .value_forbidden: ,
winfonts .value_forbidden: ,
@@ -391,9 +403,15 @@
} ,
nospace .value_forbidden: ,
heading .bool_set:N = \l__ctex_heading_bool ,
+ 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: ,
scheme .tl_set:N = \l__ctex_scheme_tl ,
- scheme .default:n = { chinese },
- scheme .initial:n = { chinese },
+ scheme .default:n = { chinese } ,
+ scheme .initial:n = { chinese } ,
cap .code:n =
{
\msg_warning:nnn { ctex } { deprecated-option }
@@ -408,12 +426,6 @@
} ,
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 }
@@ -423,12 +435,17 @@
{
\msg_warning:nnn { ctex } { deprecated-option }
{ `fancyhdr'~ package~ is~ loaded. }
- \RequirePackage{ fancyhdr }
+ \RequirePackage { fancyhdr }
} ,
hyperref .code:n =
{
\msg_warning:nnn { ctex } { deprecated-option }
{ `hyperref'~ package~ will~ be~ loaded. }
+ \ctex_at_end:n
+ {
+ \cs_if_exist:NF \hypersetup
+ { \cs_new_eq:NN \hypersetup \ctex_hypersetup:n }
+ }
\AtEndPreamble { \RequirePackage { hyperref } }
} ,
}
@@ -466,12 +483,7 @@
\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 \ctexset { } { \keys_set:nn { ctex } }
\NewDocumentCommand \CTEXsetup { +o > { \TrimSpaces } m }
{
\msg_warning:nnnn { ctex } { deprecated-command } { \CTEXsetup }
@@ -493,7 +505,6 @@
\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 }
@@ -704,16 +715,18 @@
\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@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@post#1 }
\exp_not:c { CTEX@#1@aftername }
}
}
@@ -730,19 +743,34 @@
#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 / aftertitle .tl_set:N = \exp_not:c { CTEX@#1@aftertitle } ,
#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 / 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 / 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 / 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 / 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 / titleformat~+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@titleformat } { ####1 } } ,
+ #1 / aftertitle+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftertitle } { ####1 } } ,
+ #1 / aftertitle~+ .code:n =
+ { \tl_put_right:Nn \exp_not:c { CTEX@#1@aftertitle } { ####1 } } ,
#1 / beforeskip .initial:n = \c_zero_skip ,
#1 / afterskip .initial:n = \c_zero_skip ,
#1 / indent .initial:n = \c_zero_dim ,
@@ -761,7 +789,11 @@
{ \tl_clear:c { CTEX@post#1 } }
{ \tl_set:cn { CTEX@post#1 } {#3} }
}
-\tl_clear:N \l__ctex_tmp_tl
+\tl_set:Nn \l__ctex_tmp_tl
+ {
+ part / pagestyle .tl_set:N = \CTEX@part@pagestyle ,
+ chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle ,
+ }
\seq_map_inline:Nn \c__ctex_headings_seq
{
\__ctex_initial_heading:n {#1}
@@ -769,11 +801,6 @@
}
\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
@@ -788,12 +815,14 @@
\ifnum \c@secnumdepth >-2\relax
\CTEX@partname
\fi
- \CTEX@part@titleformat{#2}\par}%
+ \CTEX@part@titleformat{#2}%
+ \CTEX@part@aftertitle}%
\@endpart}
\def\@spart#1{%
{\interlinepenalty \@M
\normalfont \CTEX@part@format
- \CTEX@part@titleformat{#1}\par}%
+ \CTEX@part@titleformat{#1}%
+ \CTEX@part@aftertitle}%
\@endpart}
\def\@chapter[#1]#2{%
\ifnum \c@secnumdepth >\m@ne
@@ -827,7 +856,9 @@
\CTEX@chaptername
\fi
\interlinepenalty\@M
- \CTEX@chapter@titleformat{#1}\par\nobreak
+ \CTEX@chapter@titleformat{#1}%
+ \CTEX@chapter@aftertitle
+ \nobreak
\vskip \CTEX@chapter@afterskip
}}
\def\@makeschapterhead#1{%
@@ -841,7 +872,9 @@
\vspace*{\@tempskipa}%
{\normalfont \parindent \CTEX@chapter@indent \CTEX@chapter@format
\interlinepenalty\@M
- \CTEX@chapter@titleformat{#1}\par\nobreak
+ \CTEX@chapter@titleformat{#1}
+ \CTEX@chapter@aftertitle
+ \nobreak
\vskip \CTEX@chapter@afterskip
}}
\def\@seccntformat#1{%
@@ -861,7 +894,8 @@
#6{%
\@hangfrom{\hskip #3\relax\@svsec}%
\interlinepenalty \@M
- \csname CTEX@#1@titleformat\endcsname{#8}\@@par}%
+ \csname CTEX@#1@titleformat\endcsname{#8}%
+ \csname CTEX@#1@aftertitle\endcsname}%
\endgroup
\csname #1mark\endcsname{#7}%
\addcontentsline{toc}{#1}{%
@@ -874,7 +908,9 @@
\else
\def\@svsechd{%
#6{\hskip #3\relax
- \@svsec \csname CTEX@#1@titleformat\endcsname{#8}}%
+ \@svsec
+ \csname CTEX@#1@titleformat\endcsname{#8}%
+ \csname CTEX@#1@aftertitle\endcsname}%
\csname #1mark\endcsname{#7}%
\addcontentsline{toc}{#1}{%
\ifnum #2>\c@secnumdepth \else
@@ -892,15 +928,20 @@
#4{%
\@hangfrom{\hskip #1}%
\interlinepenalty \@M
- \CTEX@titleformat@n{#5}\@@par}%
+ \CTEX@titleformat@n{#5}%
+ \CTEX@aftertitle}%
\endgroup
\else
- \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}}}%
+ \def\@svsechd{#4{\hskip #1\relax \CTEX@titleformat@n{#5}\CTEX@aftertitle}}%
\fi
\@xsect{#3}}
\cs_new_protected_nopar:Npn \CTEX@set@titleformat@n #1
- { \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat } }
+ {
+ \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat }
+ \cs_set_eq:Nc \CTEX@aftertitle { CTEX@#1@aftertitle }
+ }
\cs_new_eq:NN \CTEX@titleformat@n \use:n
+\cs_new_eq:NN \CTEX@aftertitle \prg_do_nothing:
\int_zero:N \l__ctex_tmp_int
\clist_map_inline:nn
{ section , subsection , subsubsection , paragraph , subparagraph }
@@ -919,15 +960,15 @@
}
}
}
-\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
+ appendix .meta:nn = { ctex / appendix } {#1} ,
+ appendix / name .code:n =
+ { \ctex_assign_heading_name:nn { appendix } {#1} } ,
+ appendix / number .tl_set:N = \CTEX@appendixnumber
}
+\tl_new:N \CTEX@preappendix
+\tl_new:N \CTEX@postappendix
\cs_new_eq:NN \CTEX@save@appendix \appendix
\cs_gset_protected_nopar:Npn \appendix
{
@@ -1113,11 +1154,8 @@
\normalsize
\NewDocumentCommand \CTeX { }
{ \ifincsname CTeX \else: C \TeX \fi: }
-\AtBeginDocument
- {
- \cs_if_exist_use:NT \pdfstringdefDisableCommands
- { { \tl_set:Nn \CTeX { CTeX } } }
- }
+\ctex_at_end_package:nn { hyperref }
+ { \pdfstringdefDisableCommands { \tl_set:Nn \CTeX { CTeX } } }
\keys_define:nn { ctex }
{
captiondelimiter .code:n =
@@ -1221,6 +1259,7 @@
%% ctex.sty,
%% ctexcap.sty,
%% ctexsize.sty,
+%% ctexheading.sty,
%% ctexart.cls,
%% ctexbook.cls,
%% ctexrep.cls,
diff --git a/Master/texmf-dist/tex/latex/ctex/ctexsize.sty b/Master/texmf-dist/tex/latex/ctex/ctexsize.sty
index 575169b7625..59d56038732 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctexsize.sty
+++ b/Master/texmf-dist/tex/latex/ctex/ctexsize.sty
@@ -4,7 +4,7 @@
%%
%% The original source files were:
%%
-%% ctex.dtx (with options: `package,ctexsize')
+%% ctex.dtx (with options: `style,ctexsize')
%%
%% Copyright (C) 2003--2015
%% CTEX.ORG and any individual authors listed in the documentation.
@@ -28,10 +28,10 @@
%%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{Chinese font size definition (CTEX)}
\ProvidesExplPackage{ctexsize}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
\RequirePackage { xparse , l3keys2e }
\cs_new_eq:NN \g__ctex_font_size_flag \c_minus_one
\keys_define:nn { ctex / option }
@@ -164,6 +164,7 @@
%% ctex.sty,
%% ctexcap.sty,
%% ctexsize.sty,
+%% ctexheading.sty,
%% ctexart.cls,
%% ctexbook.cls,
%% ctexrep.cls,
diff --git a/Master/texmf-dist/tex/latex/ctex/ctexspa.def b/Master/texmf-dist/tex/latex/ctex/ctexspa.def
index 3f5c6a67a98..91048dd0a27 100644
--- a/Master/texmf-dist/tex/latex/ctex/ctexspa.def
+++ b/Master/texmf-dist/tex/latex/ctex/ctexspa.def
@@ -28,7 +28,7 @@
%% ------------------------------------------------------------------------------
%%
\ProvidesFile{ctexspa.def}%
- [2015/05/15 v2.0.2 Space info for CJKpunct (CTEX)]
+ [2015/05/15 v2.1 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,,,}
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
index 04434db1c8b..b8c8b3e325b 100644
--- a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-luatex.def
+++ b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-luatex.def
@@ -26,10 +26,10 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{LuaLaTeX adapter (CTEX)}
\ProvidesExplFile{ctex-engine-luatex.def}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
\msg_new:nnn { ctex } { luatexja-loaded }
{
Package~`luatexja'~can~not~be~loaded~before~`ctex'.\\
@@ -171,7 +171,7 @@
}
\exp_after:wN \globaljfont \font@name \external@font \scan_stop:
\font@name
- \ctex_lua_now_x:n { font.current(tex.attribute['ltj@curjfnt']) }
+ \ctex_lua_now_x:n { font.current(tex.getattribute('ltj@curjfnt')) }
\use:c { \f@encoding + \f@family }
\use:c { \curr@fontshape }
}
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
index acaafe40e19..8b8d9f876cb 100644
--- a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-pdftex.def
+++ b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-pdftex.def
@@ -26,10 +26,59 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{(pdf)LaTeX adapter (CTEX)}
\ProvidesExplFile{ctex-engine-pdftex.def}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
+\seq_new:N \c__ctex_cmap_encoding_seq
+\seq_set_from_clist:Nn \c__ctex_cmap_encoding_seq
+ { C19 , C10 , C00 , C09 , C40 , C60 }
+\cs_new_protected_nopar:Npn \ctex_family_cmap:nn #1#2
+ {
+ \cs_if_free:cF { #1 + #2 }
+ {
+ \seq_if_in:NnT \c__ctex_cmap_encoding_seq {#1}
+ { \tl_gput_right:cn { #1 + #2 } { \ctex_add_cmap:n {#1} } }
+ }
+ }
+\cs_generate_variant:Nn \ctex_family_cmap:nn { x }
+\cs_new_eq:NN \CTEX@Family@CMap \ctex_family_cmap:xn
+\cs_new_protected_nopar:Npn \ctex_add_cmap:n #1
+ {
+ \cs_if_free:NF \CJK@plane
+ { \ctex_add_cmap:cn { __ctex_add_cmap_ #1 \CJK@plane : } {#1} }
+ }
+\cs_new_protected_nopar:Npn \ctex_add_cmap:Nn #1#2
+ {
+ \cs_if_exist:NF #1 { \__ctex_save_cmap:Nn #1 {#2} }
+ #1
+ }
+\cs_generate_variant:Nn \ctex_add_cmap:Nn { c }
+\cs_new_protected_nopar:Npn \__ctex_save_cmap:Nn #1#2
+ {
+ \tex_lowercase:D { \tl_set:Nx \l__ctex_tmp_tl { #2 \CJK@plane } }
+ \tex_immediate:D \pdfobj stream ~ file { \l__ctex_tmp_tl .cmap }
+ \cs_new_protected_nopar:Npx #1
+ {
+ \exp_not:N \pdffontattr \exp_not:N \font
+ { /ToUnicode ~ \int_use:N \pdflastobj \c_space_tl 0 ~ R }
+ }
+ }
+\group_begin:
+\char_set_catcode_other:N \#
+\ctex_if_pdfmode:TF
+ {
+ \group_end:
+ \ExplSyntaxOff
+ \ctex_appto_cmd:NnTF \DeclareFontFamily { \CTEX@Family@CMap {#1} {#2} }
+ {
+ \ctex_at_end_package:nn { cmap }
+ { \cs_gset_eq:NN \CTEX@Family@CMap \use_none:nn }
+ }
+ { \ctex_patch_failure:N \DeclareFontFamily }
+ \ExplSyntaxOn
+ }
+ { \group_end: }
\if_bool:N \g__ctex_zhmCJK_bool
\PassOptionsToPackage { encoding = \l__ctex_encoding_tl } { zhmCJK }
\RequirePackage { zhmCJK }
@@ -127,7 +176,7 @@
}
\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: }
+\ctex_gadd_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
@@ -233,7 +282,7 @@
{ \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 }
+\tl_const:Nn \c__ctex_macosx_file_tl { /Library/Fonts/Songti.ttc }
\ctex_hypersetup:n { driverfallback = dvipdfmx }
\str_if_eq:onTF { \l__ctex_encoding_tl } { GBK }
{
@@ -253,11 +302,14 @@
}
}
{ \ctex_hypersetup:n { pdfencoding = unicode } }
-\RequirePackage { CJKfntef } \normalem
+\RequirePackage { CJKfntef }
+\normalem
+\cs_new_protected_nopar:Npn \__ctex_clear_fntef_color:n #1
+ { \tl_clear:c { CJK#1color } }
\clist_map_inline:nn
{ underdot , underline , underdblline , underwave , sout , xout }
{
- \tl_clear:c { CJK#1color }
+ \__ctex_clear_fntef_color:n {#1}
\cs_new_protected_nopar:cpx { CTEX#1 }
{
\msg_warning:nnnn { ctex } { deprecated-command } { \exp_not:c { CTEX#1 } }
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
index 138f0e14797..11f036799e0 100644
--- a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-xetex.def
+++ b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-xetex.def
@@ -26,10 +26,10 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{XeLaTeX adapter (CTEX)}
\ProvidesExplFile{ctex-engine-xetex.def}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
\RequirePackage { xeCJK }
\exp_args:Nx \xeCJKsetup
{
@@ -64,13 +64,23 @@
{ \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 }
+\tl_const:Nn \c__ctex_macosx_file_tl { /Library/Fonts/Songti.ttc }
\ctex_hypersetup:n { pdfencoding = unicode }
\RequirePackage { xeCJKfntef }
+\@ifpackagelater { xeCJKfntef } { 2014/11/04 }
+ {
+
+ \cs_new_protected_nopar:Npn \__ctex_clear_fntef_color:n #1
+ { \xeCJKsetup { #1 / format = { } } }
+ }
+ {
+ \cs_new_protected_nopar:Npn \__ctex_clear_fntef_color:n #1
+ { \tl_clear:c { CJK#1color } }
+ }
\clist_map_inline:nn
{ underdot , underline , underdblline , underwave , sout , xout }
{
- \keys_set:nn { xeCJK / options } { #1 / format = { } }
+ \__ctex_clear_fntef_color:n {#1}
\cs_new_protected_nopar:cpx { CTEX#1 }
{
\msg_warning:nnnn { ctex } { deprecated-command } { \exp_not:c { CTEX#1 } }
diff --git a/Master/texmf-dist/tex/latex/ctex/fd/c19rm.fd b/Master/texmf-dist/tex/latex/ctex/fd/c19rm.fd
index a2f2a1b9831..30d2f7fce75 100644
--- a/Master/texmf-dist/tex/latex/ctex/fd/c19rm.fd
+++ b/Master/texmf-dist/tex/latex/ctex/fd/c19rm.fd
@@ -27,7 +27,7 @@
%% ------------------------------------------------------------------------------
%%
\ProvidesFile{c19rm.fd}%
- [2015/05/15 v2.0.2 Chinese font definition (CTEX)]
+ [2015/05/15 v2.1 Chinese font definition (CTEX)]
%%
%% Chinese characters
%%
diff --git a/Master/texmf-dist/tex/latex/ctex/fd/c19sf.fd b/Master/texmf-dist/tex/latex/ctex/fd/c19sf.fd
index ddd788a1e39..704ad030883 100644
--- a/Master/texmf-dist/tex/latex/ctex/fd/c19sf.fd
+++ b/Master/texmf-dist/tex/latex/ctex/fd/c19sf.fd
@@ -27,7 +27,7 @@
%% ------------------------------------------------------------------------------
%%
\ProvidesFile{c19sf.fd}%
- [2015/05/15 v2.0.2 Chinese font definition (CTEX)]
+ [2015/05/15 v2.1 Chinese font definition (CTEX)]
%%
%% Chinese characters
%%
diff --git a/Master/texmf-dist/tex/latex/ctex/fd/c19tt.fd b/Master/texmf-dist/tex/latex/ctex/fd/c19tt.fd
index dc38700e6bc..0986f6b8be2 100644
--- a/Master/texmf-dist/tex/latex/ctex/fd/c19tt.fd
+++ b/Master/texmf-dist/tex/latex/ctex/fd/c19tt.fd
@@ -27,7 +27,7 @@
%% ------------------------------------------------------------------------------
%%
\ProvidesFile{c19tt.fd}%
- [2015/05/15 v2.0.2 Chinese font definition (CTEX)]
+ [2015/05/15 v2.1 Chinese font definition (CTEX)]
%%
%% Chinese characters
%%
diff --git a/Master/texmf-dist/tex/latex/ctex/fd/c70rm.fd b/Master/texmf-dist/tex/latex/ctex/fd/c70rm.fd
index 263726b5cff..914baac86f3 100644
--- a/Master/texmf-dist/tex/latex/ctex/fd/c70rm.fd
+++ b/Master/texmf-dist/tex/latex/ctex/fd/c70rm.fd
@@ -27,7 +27,7 @@
%% ------------------------------------------------------------------------------
%%
\ProvidesFile{c70rm.fd}%
- [2015/05/15 v2.0.2 Chinese font definition (CTEX)]
+ [2015/05/15 v2.1 Chinese font definition (CTEX)]
%%
%% Chinese characters
%%
diff --git a/Master/texmf-dist/tex/latex/ctex/fd/c70sf.fd b/Master/texmf-dist/tex/latex/ctex/fd/c70sf.fd
index 198ceb4f04f..492cf166309 100644
--- a/Master/texmf-dist/tex/latex/ctex/fd/c70sf.fd
+++ b/Master/texmf-dist/tex/latex/ctex/fd/c70sf.fd
@@ -27,7 +27,7 @@
%% ------------------------------------------------------------------------------
%%
\ProvidesFile{c70sf.fd}%
- [2015/05/15 v2.0.2 Chinese font definition (CTEX)]
+ [2015/05/15 v2.1 Chinese font definition (CTEX)]
%%
%% Chinese characters
%%
diff --git a/Master/texmf-dist/tex/latex/ctex/fd/c70tt.fd b/Master/texmf-dist/tex/latex/ctex/fd/c70tt.fd
index a1a2a6fb968..305df75675f 100644
--- a/Master/texmf-dist/tex/latex/ctex/fd/c70tt.fd
+++ b/Master/texmf-dist/tex/latex/ctex/fd/c70tt.fd
@@ -27,7 +27,7 @@
%% ------------------------------------------------------------------------------
%%
\ProvidesFile{c70tt.fd}%
- [2015/05/15 v2.0.2 Chinese font definition (CTEX)]
+ [2015/05/15 v2.1 Chinese font definition (CTEX)]
%%
%% Chinese characters
%%
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
index 801dacb47f1..5fd609c3abf 100644
--- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-adobe.def
+++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-adobe.def
@@ -26,10 +26,10 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{Adobe fonts definition (CTEX)}
\ProvidesExplFile{ctex-fontset-adobe.def}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
\pdftex_if_engine:TF
{
\ctex_if_pdfmode:TF
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
index 90d7e04c293..bcdabfb49ff 100644
--- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-fandol.def
+++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-fandol.def
@@ -26,10 +26,10 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{Fandol fonts definition (CTEX)}
\ProvidesExplFile{ctex-fontset-fandol.def}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
\pdftex_if_engine:TF
{
\ctex_if_pdfmode:TF
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
index cbf9434afd2..715bd19771b 100644
--- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-founder.def
+++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-founder.def
@@ -26,10 +26,10 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{Founder fonts definition (CTEX)}
\ProvidesExplFile{ctex-fontset-founder.def}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
\pdftex_if_engine:TF
{
\ctex_zhmap_case:nnn
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
index a8038e84f00..041926b2c35 100644
--- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-mac.def
+++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-mac.def
@@ -26,10 +26,10 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{Mac OS X fonts definition (CTEX)}
\ProvidesExplFile{ctex-fontset-mac.def}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
\pdftex_if_engine:TF
{ \ctex_fontset_error:n { mac } }
{
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
index 0c930c754b3..b24ab4be269 100644
--- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-ubuntu.def
+++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-ubuntu.def
@@ -26,10 +26,10 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{Ubuntu fonts definition (CTEX)}
\ProvidesExplFile{ctex-fontset-ubuntu.def}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
\pdftex_if_engine:TF
{
\ctex_zhmap_case:nnn
@@ -58,7 +58,8 @@
{ \ctex_fontset_error:n { ubuntu } }
}
{
- \setCJKmainfont [ ItalicFont = AR~PL~UKai~CN ] { AR~PL~UMing~CN }
+ \setCJKmainfont
+ [ BoldFont = WenQuanYi~Zen~Hei , ItalicFont = AR~PL~UKai~CN ] { AR~PL~UMing~CN }
\setCJKsansfont { WenQuanYi~Zen~Hei }
\setCJKmonofont { AR~PL~UMing~CN }
\setCJKfamilyfont { zhsong } { AR~PL~UMing~CN }
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
index f3b7dfb6b47..296514caca3 100644
--- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windows.def
+++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windows.def
@@ -26,10 +26,10 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{Windows fonts definition (CTEX)}
\ProvidesExplFile{ctex-fontset-windows.def}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
\file_if_exist:nTF { C:/boot.ini }
{ \ctex_file_input:n { ctex-fontset-windowsold.def } }
{ \ctex_file_input:n { ctex-fontset-windowsnew.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
index 2a00e97336c..bd52407f505 100644
--- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsnew.def
+++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsnew.def
@@ -26,10 +26,10 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{Windows fonts definition for Vista or later version (CTEX)}
\ProvidesExplFile{ctex-fontset-windowsnew.def}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
\pdftex_if_engine:TF
{
\ctex_zhmap_case:nnn
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
index 1a45fc950c4..6156c9e30e8 100644
--- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsold.def
+++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsold.def
@@ -26,10 +26,10 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{Windows fonts definition for XP or earlier version (CTEX)}
\ProvidesExplFile{ctex-fontset-windowsold.def}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
\pdftex_if_engine:TF
{
\ctex_zhmap_case:nnn
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
index 3a0fa752e60..b21208988d8 100644
--- 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
@@ -26,15 +26,16 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{Chinese scheme for article (CTEX)}
\ProvidesExplFile{ctex-scheme-chinese-article.def}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
\keys_set:nn { ctex / part }
{
+ aftertitle = \par ,
+ number = \chinese { part } ,
nameformat = \Large \bfseries ,
afterskip = 3ex ,
- number = \chinese { part } ,
format = \centering ,
aftername = \quad ,
titleformat = \Large \bfseries ,
@@ -44,6 +45,7 @@
{
number = \thesection ,
aftername = \quad ,
+ aftertitle = \@@par ,
afterskip = 2.3ex \@plus .2ex ,
format = \Large \bfseries \centering ,
beforeskip = 3.5ex \@plus 1ex \@minus .2ex
@@ -53,6 +55,7 @@
number = \thesubsection ,
format = \large \bfseries ,
aftername = \quad ,
+ aftertitle = \@@par ,
afterskip = 1.5ex \@plus .2ex ,
beforeskip = 3.25ex \@plus 1ex \@minus .2ex
}
@@ -61,6 +64,7 @@
number = \thesubsubsection ,
format = \normalsize \bfseries ,
aftername = \quad ,
+ aftertitle = \@@par ,
afterskip = 1.5ex \@plus .2ex ,
beforeskip = 3.25ex \@plus 1ex \@minus .2ex
}
@@ -80,6 +84,7 @@
{
\keys_set:nn { ctex / paragraph }
{
+ aftertitle = \@@par ,
beforeskip = 3.25ex \@plus 1ex \@minus .2ex ,
afterskip = 1ex \@plus .2ex
}
@@ -95,6 +100,7 @@
{
\keys_set:nn { ctex / subparagraph }
{
+ aftertitle = \@@par ,
beforeskip = 3.25ex \@plus 1ex \@minus .2ex ,
afterskip = 1ex \@plus .2ex
}
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
index d44baaf59f3..2d83f7e708f 100644
--- 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
@@ -26,12 +26,14 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{Chinese scheme for book (CTEX)}
\ProvidesExplFile{ctex-scheme-chinese-book.def}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
\keys_set:nn { ctex / part }
{
+ aftertitle = \par ,
+ number = \chinese { part } ,
format = \centering ,
nameformat = \huge \bfseries ,
aftername = \par \vskip 20 \p@ ,
@@ -42,6 +44,7 @@
{
pagestyle = plain ,
nameformat = \huge \bfseries ,
+ aftertitle = \par ,
afterskip = 40 \p@ ,
number = \chinese { chapter } ,
format = \centering ,
@@ -53,6 +56,7 @@
{
number = \thesection ,
aftername = \quad ,
+ aftertitle = \@@par ,
afterskip = 2.3ex \@plus .2ex ,
format = \Large \bfseries \centering ,
beforeskip = 3.5ex \@plus 1ex \@minus .2ex
@@ -62,6 +66,7 @@
number = \thesubsection ,
format = \large \bfseries ,
aftername = \quad ,
+ aftertitle = \@@par ,
afterskip = 1.5ex \@plus .2ex ,
beforeskip = 3.25ex \@plus 1ex \@minus .2ex
}
@@ -70,6 +75,7 @@
number = \thesubsubsection ,
format = \normalsize \bfseries ,
aftername = \quad ,
+ aftertitle = \@@par ,
afterskip = 1.5ex \@plus .2ex ,
beforeskip = 3.25ex \@plus 1ex \@minus .2ex
}
@@ -89,6 +95,7 @@
{
\keys_set:nn { ctex / paragraph }
{
+ aftertitle = \@@par ,
beforeskip = 3.25ex \@plus 1ex \@minus .2ex ,
afterskip = 1ex \@plus .2ex
}
@@ -104,6 +111,7 @@
{
\keys_set:nn { ctex / subparagraph }
{
+ aftertitle = \@@par ,
beforeskip = 3.25ex \@plus 1ex \@minus .2ex ,
afterskip = 1ex \@plus .2ex
}
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
index 0b723c70b6d..0bf4aa05931 100644
--- 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
@@ -26,12 +26,14 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{Chinese scheme for report (CTEX)}
\ProvidesExplFile{ctex-scheme-chinese-report.def}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
\keys_set:nn { ctex / part }
{
+ aftertitle = \par ,
+ number = \chinese { part } ,
format = \centering ,
nameformat = \huge \bfseries ,
aftername = \par \vskip 20 \p@ ,
@@ -42,6 +44,7 @@
{
pagestyle = plain ,
nameformat = \huge \bfseries ,
+ aftertitle = \par ,
afterskip = 40 \p@ ,
number = \chinese { chapter } ,
format = \centering ,
@@ -53,6 +56,7 @@
{
number = \thesection ,
aftername = \quad ,
+ aftertitle = \@@par ,
afterskip = 2.3ex \@plus .2ex ,
format = \Large \bfseries \centering ,
beforeskip = 3.5ex \@plus 1ex \@minus .2ex
@@ -62,6 +66,7 @@
number = \thesubsection ,
format = \large \bfseries ,
aftername = \quad ,
+ aftertitle = \@@par ,
afterskip = 1.5ex \@plus .2ex ,
beforeskip = 3.25ex \@plus 1ex \@minus .2ex
}
@@ -70,6 +75,7 @@
number = \thesubsubsection ,
format = \normalsize \bfseries ,
aftername = \quad ,
+ aftertitle = \@@par ,
afterskip = 1.5ex \@plus .2ex ,
beforeskip = 3.25ex \@plus 1ex \@minus .2ex
}
@@ -89,6 +95,7 @@
{
\keys_set:nn { ctex / paragraph }
{
+ aftertitle = \@@par ,
beforeskip = 3.25ex \@plus 1ex \@minus .2ex ,
afterskip = 1ex \@plus .2ex
}
@@ -104,6 +111,7 @@
{
\keys_set:nn { ctex / subparagraph }
{
+ aftertitle = \@@par ,
beforeskip = 3.25ex \@plus 1ex \@minus .2ex ,
afterskip = 1ex \@plus .2ex
}
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
index fbe8be476d4..b3be5572070 100644
--- a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese.def
+++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese.def
@@ -26,10 +26,10 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{Chinese scheme for generic (CTEX)}
\ProvidesExplFile{ctex-scheme-chinese.def}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\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 } }
@@ -40,11 +40,8 @@
{ \keys_set:nn { ctex / option } { linespread = 1.3 } }
\ctex_if_autoindent_touched:F
{ \keys_set:nn { ctex } { autoindent = true } }
-\clist_map_inline:nn { article , book , report }
- {
- \@ifclassloaded {#1}
- { \RequirePackage{ indentfirst } } { }
- }
+\tl_if_exist:NT \c__ctex_std_class_tl
+ { \RequirePackage{ indentfirst } }
%%
%%
%% 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
index 0596bf66e9e..752fefd584d 100644
--- 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
@@ -26,12 +26,13 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{Plain scheme for article (CTEX)}
\ProvidesExplFile{ctex-scheme-plain-article.def}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
\keys_set:nn { ctex / part }
{
+ aftertitle = \par ,
name = \partname \space ,
number = \thepart ,
nameformat = \Large \bfseries ,
@@ -45,6 +46,7 @@
{
number = \thesection ,
aftername = \quad ,
+ aftertitle = \@@par ,
afterskip = 2.3ex \@plus .2ex ,
format = \Large \bfseries ,
beforeskip = -3.5ex \@plus -1ex \@minus -.2ex
@@ -54,6 +56,7 @@
number = \thesubsection ,
format = \large \bfseries ,
aftername = \quad ,
+ aftertitle = \@@par ,
afterskip = 1.5ex \@plus .2ex ,
beforeskip = -3.25ex \@plus -1ex \@minus -.2ex
}
@@ -62,6 +65,7 @@
number = \thesubsubsection ,
format = \normalsize \bfseries ,
aftername = \quad ,
+ aftertitle = \@@par ,
afterskip = 1.5ex \@plus .2ex ,
beforeskip = -3.25ex \@plus -1ex \@minus -.2ex
}
@@ -81,6 +85,7 @@
{
\keys_set:nn { ctex / paragraph }
{
+ aftertitle = \@@par ,
beforeskip = -3.25ex \@plus -1ex \@minus -.2ex ,
afterskip = 1ex \@plus .2ex
}
@@ -96,6 +101,7 @@
{
\keys_set:nn { ctex / subparagraph }
{
+ aftertitle = \@@par ,
beforeskip = -3.25ex \@plus -1ex \@minus -.2ex ,
afterskip = 1ex \@plus .2ex
}
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
index 9f0898b3b42..202db21f8c7 100644
--- 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
@@ -26,12 +26,13 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{Plain scheme for book (CTEX)}
\ProvidesExplFile{ctex-scheme-plain-book.def}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
\keys_set:nn { ctex / part }
{
+ aftertitle = \par ,
name = \partname \space ,
number = \thepart ,
format = \centering ,
@@ -44,6 +45,7 @@
{
pagestyle = plain ,
nameformat = \huge \bfseries ,
+ aftertitle = \par ,
afterskip = 40 \p@ ,
name = \chaptername \space ,
number = \thechapter ,
@@ -56,6 +58,7 @@
{
number = \thesection ,
aftername = \quad ,
+ aftertitle = \@@par ,
afterskip = 2.3ex \@plus .2ex ,
format = \Large \bfseries ,
beforeskip = -3.5ex \@plus -1ex \@minus -.2ex
@@ -65,6 +68,7 @@
number = \thesubsection ,
format = \large \bfseries ,
aftername = \quad ,
+ aftertitle = \@@par ,
afterskip = 1.5ex \@plus .2ex ,
beforeskip = -3.25ex \@plus -1ex \@minus -.2ex
}
@@ -73,6 +77,7 @@
number = \thesubsubsection ,
format = \normalsize \bfseries ,
aftername = \quad ,
+ aftertitle = \@@par ,
afterskip = 1.5ex \@plus .2ex ,
beforeskip = -3.25ex \@plus -1ex \@minus -.2ex
}
@@ -92,6 +97,7 @@
{
\keys_set:nn { ctex / paragraph }
{
+ aftertitle = \@@par ,
beforeskip = -3.25ex \@plus -1ex \@minus -.2ex ,
afterskip = 1ex \@plus .2ex
}
@@ -107,6 +113,7 @@
{
\keys_set:nn { ctex / subparagraph }
{
+ aftertitle = \@@par ,
beforeskip = -3.25ex \@plus -1ex \@minus -.2ex ,
afterskip = 1ex \@plus .2ex
}
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
index e7fa5adda1e..fac90d7aea7 100644
--- 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
@@ -26,12 +26,13 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{Plain scheme for report (CTEX)}
\ProvidesExplFile{ctex-scheme-plain-report.def}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
\keys_set:nn { ctex / part }
{
+ aftertitle = \par ,
name = \partname \space ,
number = \thepart ,
format = \centering ,
@@ -44,6 +45,7 @@
{
pagestyle = plain ,
nameformat = \huge \bfseries ,
+ aftertitle = \par ,
afterskip = 40 \p@ ,
name = \chaptername \space ,
number = \thechapter ,
@@ -56,6 +58,7 @@
{
number = \thesection ,
aftername = \quad ,
+ aftertitle = \@@par ,
afterskip = 2.3ex \@plus .2ex ,
format = \Large \bfseries ,
beforeskip = -3.5ex \@plus -1ex \@minus -.2ex
@@ -65,6 +68,7 @@
number = \thesubsection ,
format = \large \bfseries ,
aftername = \quad ,
+ aftertitle = \@@par ,
afterskip = 1.5ex \@plus .2ex ,
beforeskip = -3.25ex \@plus -1ex \@minus -.2ex
}
@@ -73,6 +77,7 @@
number = \thesubsubsection ,
format = \normalsize \bfseries ,
aftername = \quad ,
+ aftertitle = \@@par ,
afterskip = 1.5ex \@plus .2ex ,
beforeskip = -3.25ex \@plus -1ex \@minus -.2ex
}
@@ -92,6 +97,7 @@
{
\keys_set:nn { ctex / paragraph }
{
+ aftertitle = \@@par ,
beforeskip = -3.25ex \@plus -1ex \@minus -.2ex ,
afterskip = 1ex \@plus .2ex
}
@@ -107,6 +113,7 @@
{
\keys_set:nn { ctex / subparagraph }
{
+ aftertitle = \@@par ,
beforeskip = -3.25ex \@plus -1ex \@minus -.2ex ,
afterskip = 1ex \@plus .2ex
}
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
index ef554f86843..7823ef28251 100644
--- a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain.def
+++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain.def
@@ -26,10 +26,10 @@
%%
%% ------------------------------------------------------------------------------
%%
-\GetIdInfo$Id: ctex.dtx 3216ced 2015-05-16 11:29:03 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: ctex.dtx ca75f0e 2015-06-19 17:39:23 +0800 Qing Lee <sobenlee@gmail.com> $
{Plain scheme for generic (CTEX)}
\ProvidesExplFile{ctex-scheme-plain.def}
- {\ExplFileDate}{2.0.2}{\ExplFileDescription}
+ {\ExplFileDate}{2.1}{\ExplFileDescription}
%%
%%
%% End of file `ctex-scheme-plain.def'.