diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/ctex/ctex.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/ctex/ctex.dtx | 1202 |
1 files changed, 982 insertions, 220 deletions
diff --git a/Master/texmf-dist/source/latex/ctex/ctex.dtx b/Master/texmf-dist/source/latex/ctex/ctex.dtx index 8a702ca8d30..42507c1bb6a 100644 --- a/Master/texmf-dist/source/latex/ctex/ctex.dtx +++ b/Master/texmf-dist/source/latex/ctex/ctex.dtx @@ -60,6 +60,7 @@ This package consists of the file ctex.dtx, and the derived files ctexart.cls, ctexbook.cls, ctexrep.cls, + ctexbeamer.cls, ctexcap.sty, ctexhook.sty, ctexpatch.sty, @@ -68,14 +69,17 @@ This package consists of the file ctex.dtx, and the derived files ctex-article.def, ctex-book.def, ctex-report.def, + ctex-beamer.def, ctex-scheme-plain.def, ctex-scheme-plain-article.def, ctex-scheme-plain-book.def, ctex-scheme-plain-report.def, + ctex-scheme-plain-beamer.def, ctex-scheme-chinese.def, ctex-scheme-chinese-article.def, ctex-scheme-chinese-book.def, ctex-scheme-chinese-report.def, + ctex-scheme-chinese-beamer.def, ctex-name-gbk.cfg, ctex-name-utf8.cfg, ctex.cfg, @@ -83,6 +87,7 @@ This package consists of the file ctex.dtx, and the derived files ctex-engine-pdftex.def, ctex-engine-xetex.def, ctex-engine-luatex.def, + ctex-engine-uptex.def, c19rm.fd, c19sf.fd, c19tt.fd, @@ -105,7 +110,9 @@ This package consists of the file ctex.dtx, and the derived files zhfandolfonts.tex, zhfounderfonts.tex, zhubuntufonts.tex, - zhwindowsfonts.tex, and + zhwindowsfonts.tex, + translator-theorem-dictionary-ChineseGBK.dict, + translator-theorem-dictionary-ChineseUTF8.dict, and README (this file). %</readme> @@ -165,7 +172,7 @@ This package consists of the file ctex.dtx, and the derived files \preamble - Copyright (C) 2003--2015 + Copyright (C) 2003--2016 CTEX.ORG and any individual authors listed in the documentation. ------------------------------------------------------------------------------ @@ -198,6 +205,7 @@ This package consists of the file ctex.dtx, and the derived files ctexart.cls, ctexbook.cls, ctexrep.cls, + ctexbeamer.cls, ctexcap.sty, ctexhook.sty, ctexpatch.sty, @@ -206,14 +214,17 @@ This package consists of the file ctex.dtx, and the derived files ctex-article.def, ctex-book.def, ctex-report.def, + ctex-beamer.def, ctex-scheme-plain.def, ctex-scheme-plain-article.def, ctex-scheme-plain-book.def, ctex-scheme-plain-report.def, + ctex-scheme-plain-beamer.def, ctex-scheme-chinese.def, ctex-scheme-chinese-article.def, ctex-scheme-chinese-book.def, ctex-scheme-chinese-report.def, + ctex-scheme-chinese-beamer.def, ctex-name-gbk.cfg, ctex-name-utf8.cfg, ctex.cfg, @@ -221,6 +232,7 @@ This package consists of the file ctex.dtx, and the derived files ctex-engine-pdftex.def, ctex-engine-xetex.def, ctex-engine-luatex.def, + ctex-engine-uptex.def, c19rm.fd, c19sf.fd, c19tt.fd, @@ -243,7 +255,9 @@ This package consists of the file ctex.dtx, and the derived files zhfandolfonts.tex, zhfounderfonts.tex, zhubuntufonts.tex, - zhwindowsfonts.tex, and + zhwindowsfonts.tex, + translator-theorem-dictionary-ChineseGBK.dict, + translator-theorem-dictionary-ChineseUTF8.dict, and README. \endpostamble @@ -260,6 +274,7 @@ This package consists of the file ctex.dtx, and the derived files \file{ctexart.cls} {\from{\jobname.dtx}{class,article}} \file{ctexbook.cls} {\from{\jobname.dtx}{class,book}} \file{ctexrep.cls} {\from{\jobname.dtx}{class,report}} + \file{ctexbeamer.cls} {\from{\jobname.dtx}{class,beamer}} \usepostamble\emptypostamble \file{ctexcap.sty} {\from{\jobname.dtx}{ctexcap}} \file{ctexhook.sty} {\from{\jobname.dtx}{ctexhook}} @@ -269,21 +284,25 @@ This package consists of the file ctex.dtx, and the derived files \file{ctex-article.def} {\from{\jobname.dtx}{heading,article}} \file{ctex-book.def} {\from{\jobname.dtx}{heading,book}} \file{ctex-report.def} {\from{\jobname.dtx}{heading,report}} + \file{ctex-beamer.def} {\from{\jobname.dtx}{heading,beamer}} \file{ctex-scheme-plain.def} {\from{\jobname.dtx}{scheme,generic,plain}} \file{ctex-scheme-plain-article.def} {\from{\jobname.dtx}{scheme,article,plain}} \file{ctex-scheme-plain-book.def} {\from{\jobname.dtx}{scheme,book,plain}} \file{ctex-scheme-plain-report.def} {\from{\jobname.dtx}{scheme,report,plain}} + \file{ctex-scheme-plain-beamer.def} {\from{\jobname.dtx}{scheme,beamer,plain}} \file{ctex-scheme-chinese.def} {\from{\jobname.dtx}{scheme,generic,chinese}} \file{ctex-scheme-chinese-article.def} {\from{\jobname.dtx}{scheme,article,chinese}} \file{ctex-scheme-chinese-book.def} {\from{\jobname.dtx}{scheme,book,chinese}} \file{ctex-scheme-chinese-report.def} {\from{\jobname.dtx}{scheme,report,chinese}} - \file{ctex-name-gbk.cfg} {\from{\jobname.dtx}{GBK}} - \file{ctex-name-utf8.cfg} {\from{\jobname.dtx}{UTF8}} + \file{ctex-scheme-chinese-beamer.def} {\from{\jobname.dtx}{scheme,beamer,chinese}} + \file{ctex-name-gbk.cfg} {\from{\jobname.dtx}{name,GBK}} + \file{ctex-name-utf8.cfg} {\from{\jobname.dtx}{name,UTF8}} \file{ctex.cfg} {\from{\jobname.dtx}{config}} \file{ctexopts.cfg} {\from{\jobname.dtx}{ctexopts}} \file{ctex-engine-pdftex.def} {\from{\jobname.dtx}{pdftex}} \file{ctex-engine-xetex.def} {\from{\jobname.dtx}{xetex}} \file{ctex-engine-luatex.def} {\from{\jobname.dtx}{luatex}} + \file{ctex-engine-uptex.def} {\from{\jobname.dtx}{uptex}} \file{c19rm.fd} {\from{\jobname.dtx}{rm,c19}} \file{c19sf.fd} {\from{\jobname.dtx}{sf,c19}} \file{c19tt.fd} {\from{\jobname.dtx}{tt,c19}} @@ -310,6 +329,10 @@ This package consists of the file ctex.dtx, and the derived files \file{zhfounderfonts.tex} {\from{\jobname.dtx}{zhmap,founder}} \file{zhubuntufonts.tex} {\from{\jobname.dtx}{zhmap,ubuntu}} \file{zhwindowsfonts.tex} {\from{\jobname.dtx}{zhmap,windows}} + \file{translator-theorem-dictionary-ChineseGBK.dict} + {\from{\jobname.dtx}{dict,theorem,GBK}} + \file{translator-theorem-dictionary-ChineseUTF8.dict} + {\from{\jobname.dtx}{dict,theorem,UTF8}} \usedir{source/latex/ctex} \file{\jobname.ins} {\from{\jobname.dtx}{install}} \nopreamble\nopostamble @@ -332,6 +355,7 @@ This package consists of the file ctex.dtx, and the derived files \Msg{* ctexart.cls *} \Msg{* ctexbook.cls *} \Msg{* ctexrep.cls *} +\Msg{* ctexbeamer.cls *} \Msg{* ctexcap.sty *} \Msg{* ctexhook.sty *} \Msg{* ctexpatch.sty *} @@ -340,14 +364,17 @@ This package consists of the file ctex.dtx, and the derived files \Msg{* ctex-article.def *} \Msg{* ctex-book.def *} \Msg{* ctex-report.def *} +\Msg{* ctex-beamer.def *} \Msg{* ctex-scheme-plain.def *} \Msg{* ctex-scheme-plain-article.def *} \Msg{* ctex-scheme-plain-book.def *} \Msg{* ctex-scheme-plain-report.def *} +\Msg{* ctex-scheme-plain-beamer.def *} \Msg{* ctex-scheme-chinese.def *} \Msg{* ctex-scheme-chinese-article.def *} \Msg{* ctex-scheme-chinese-book.def *} \Msg{* ctex-scheme-chinese-report.def *} +\Msg{* ctex-scheme-chinese-beamer.def *} \Msg{* ctex-name-gbk.cfg *} \Msg{* ctex-name-utf8.cfg *} \Msg{* ctex.cfg *} @@ -355,6 +382,7 @@ This package consists of the file ctex.dtx, and the derived files \Msg{* ctex-engine-pdftex.def *} \Msg{* ctex-engine-xetex.def *} \Msg{* ctex-engine-luatex.def *} +\Msg{* ctex-engine-uptex.def *} \Msg{* c19rm.fd *} \Msg{* c19sf.fd *} \Msg{* c19tt.fd *} @@ -377,6 +405,8 @@ This package consists of the file ctex.dtx, and the derived files \Msg{* zhfounderfonts.tex *} \Msg{* zhubuntufonts.tex *} \Msg{* zhwindowsfonts.tex *} +\Msg{* translator-theorem-dictionary-ChineseGBK.dict *} +\Msg{* translator-theorem-dictionary-ChineseUTF8.dict *} \Msg{* *} \Msg{* To produce the documentation run the file ctex.dtx *} \Msg{* through XeLaTeX. *} @@ -391,7 +421,7 @@ This package consists of the file ctex.dtx, and the derived files \fi %</internal> %<*!(readme|install|zhmap|spa)> -%<*!(c19|c70|ctexspa)> +%<*!(c19|c70|ctexspa|dict)> %<*driver|class|style|ctexcap|ctexhook|ctexpatch> \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} @@ -416,6 +446,8 @@ This package consists of the file ctex.dtx, and the derived files %<class&book>\ProvidesExplClass{ctexbook} %<class&report> {Chinese adapter for class report (CTEX)} %<class&report>\ProvidesExplClass{ctexrep} +%<class&beamer> {Chinese adapter for class beamer (CTEX)} +%<class&beamer>\ProvidesExplClass{ctexbeamer} %<ctexcap> {Chinese adapter in LaTeX (CTEX)} %<ctexcap>\ProvidesExplPackage{ctexcap} %<ctexhook> {Document and package hooks (CTEX)} @@ -432,6 +464,8 @@ This package consists of the file ctex.dtx, and the derived files %<heading&book>\ProvidesExplFile{ctex-book.def} %<heading&report> {Heading modification for report (CTEX)} %<heading&report>\ProvidesExplFile{ctex-report.def} +%<heading&beamer> {Heading modification for beamer (CTEX)} +%<heading&beamer>\ProvidesExplFile{ctex-beamer.def} %<scheme&plain&generic> {Plain scheme for generic (CTEX)} %<scheme&plain&generic>\ProvidesExplFile{ctex-scheme-plain.def} %<scheme&plain&article> {Plain scheme for article (CTEX)} @@ -440,6 +474,8 @@ This package consists of the file ctex.dtx, and the derived files %<scheme&plain&book>\ProvidesExplFile{ctex-scheme-plain-book.def} %<scheme&plain&report> {Plain scheme for report (CTEX)} %<scheme&plain&report>\ProvidesExplFile{ctex-scheme-plain-report.def} +%<scheme&plain&beamer> {Plain scheme for beamer (CTEX)} +%<scheme&plain&beamer>\ProvidesExplFile{ctex-scheme-plain-beamer.def} %<scheme&chinese&generic> {Chinese scheme for generic (CTEX)} %<scheme&chinese&generic>\ProvidesExplFile{ctex-scheme-chinese.def} %<scheme&chinese&article> {Chinese scheme for article (CTEX)} @@ -448,10 +484,12 @@ This package consists of the file ctex.dtx, and the derived files %<scheme&chinese&book>\ProvidesExplFile{ctex-scheme-chinese-book.def} %<scheme&chinese&report> {Chinese scheme for report (CTEX)} %<scheme&chinese&report>\ProvidesExplFile{ctex-scheme-chinese-report.def} -%<GBK> {Caption with encoding GBK (CTEX)} -%<GBK>\ProvidesExplFile{ctex-name-gbk.cfg} -%<UTF8> {Caption with encoding UTF8 (CTEX)} -%<UTF8>\ProvidesExplFile{ctex-name-utf8.cfg} +%<scheme&chinese&beamer> {Chinese scheme for beamer (CTEX)} +%<scheme&chinese&beamer>\ProvidesExplFile{ctex-scheme-chinese-beamer.def} +%<name&GBK> {Caption with encoding GBK (CTEX)} +%<name&GBK>\ProvidesExplFile{ctex-name-gbk.cfg} +%<name&UTF8> {Caption with encoding UTF8 (CTEX)} +%<name&UTF8>\ProvidesExplFile{ctex-name-utf8.cfg} %<config> {Configuration file (CTEX)} %<config>\ProvidesExplFile{\ExplFileName.cfg} %<ctexopts> {Option configuration file (CTEX)} @@ -462,6 +500,8 @@ This package consists of the file ctex.dtx, and the derived files %<xetex>\ProvidesExplFile{ctex-engine-xetex.def} %<luatex> {LuaLaTeX adapter (CTEX)} %<luatex>\ProvidesExplFile{ctex-engine-luatex.def} +%<uptex> {upTeX adapter (CTEX)} +%<uptex>\ProvidesExplFile{ctex-engine-uptex.def} %<windows> {Windows fonts definition (CTEX)} %<windows>\ProvidesExplFile{ctex-fontset-windows.def} %<windowsnew> {Windows fonts definition for Vista or later version (CTEX)} @@ -478,8 +518,8 @@ 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.3}{\ExplFileDescription} -%</!(c19|c70|ctexspa)> + {\ExplFileDate}{2.4}{\ExplFileDescription} +%</!(c19|c70|ctexspa|dict)> %<rm&c19>\ProvidesFile{c19rm.fd}% %<sf&c19>\ProvidesFile{c19sf.fd}% %<tt&c19>\ProvidesFile{c19tt.fd}% @@ -487,8 +527,11 @@ 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> [2016/02/02 v2.3 Chinese font definition (CTEX)] -%<ctexspa> [2016/02/02 v2.3 Space info for CJKpunct (CTEX)] +%<dict&theorem&GBK>\ProvidesDictionary{translator-theorem-dictionary}{ChineseGBK}% +%<dict&theorem&UTF8>\ProvidesDictionary{translator-theorem-dictionary}{ChineseUTF8}% +%<c19|c70> [2016/04/23 v2.4 Chinese font definition (CTEX)] +%<ctexspa> [2016/04/23 v2.4 Space info for CJKpunct (CTEX)] +%<dict&theorem> [2016/02/20 v1.0 Chinese translation for theorem name (CTEX)] %</!(readme|install|zhmap|spa)> %<*driver> \ExplSyntaxOff @@ -516,9 +559,7 @@ This package consists of the file ctex.dtx, and the derived files \setcounter{tocdepth}{2} \newcommand*\email{\nolinkurl} \setmainfont{TeX Gyre Pagella} -\setsansfont[ - BoldFont = * Semibold, - BoldItalicFont = * Semibold Italic]{Source Sans Pro} +\setsansfont{TeX Gyre Heros} \setmonofont[ UprightFont=* Light, BoldFont=* Bold, SlantedFont=* Light Oblique]{CMU Typewriter Text} @@ -686,7 +727,9 @@ This package consists of the file ctex.dtx, and the derived files \cs_generate_variant:Nn \__codedoc_cmd_aux:nn { no } \AtBeginEnvironment { syntax } { + \char_set_catcode_active:N \| \char_set_active_eq:NN \| \orbar + \char_set_catcode_active:N \( \char_set_active_eq:NN \( \defaultvalaux } %% 不对目录中出现的 \cs 和 \tn 等编索引 @@ -718,6 +761,8 @@ This package consists of the file ctex.dtx, and the derived files \def\LaTeXe{\hologo{LaTeX2e}} \def\LaTeXiii{\hologo{LaTeX3}} \def\dvipdfmx{DVIPDFM\textit{x}} +\def\upTeX{up\TeX} +\def\upLaTeX{up\LaTeX} \def\ctexkitrev#1{% \href{https://github.com/CTeX-org/ctex-kit/commit/#1}{\texttt{ctex-kit} rev. #1}} \patchcmd\theCodelineNo{\sffamily\tiny}{\normalfont\sffamily\tiny}{}{} @@ -738,6 +783,8 @@ This package consists of the file ctex.dtx, and the derived files \input{ctex-name-utf8.cfg}% \ExplSyntaxOff \MakePercentIgnore}{} +\newcommand*\BSTACK{\begin{tabular}[t]{@{}l@{}}} +\newcommand*\ESTACK{\end{tabular}} \makeatother \EnableCrossrefs \CodelineIndex @@ -749,6 +796,7 @@ This package consists of the file ctex.dtx, and the derived files \textit{意大利体的数字表示描述对应索引项的页码; 带下划线的数字表示定义对应索引项的代码行号; 罗马字体的数字表示使用对应索引项的代码行号。}} +\setlength\IndexMin{.4\textheight} \usepackage{makecell} \newcommand{\bashcmd}{\texttt} \newcommand{\TeXLive}{\TeX\ Live} @@ -770,9 +818,10 @@ This package consists of the file ctex.dtx, and the derived files % \changes{v2.1}{2015/05/18}{将章节标题设置功能提取到可以独立使用的宏包 % \pkg{ctexheading} 中。} % \changes{v2.2}{2015/06/24}{不再依赖 \pkg{etoolbox} 宏包。} +% \changes{v2.4}{2015/02/19}{加强 \pkg{beamer} 宏包支持。} % % -% \CheckSum{5056} +% \CheckSum{5506} % % \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 @@ -802,9 +851,9 @@ This package consists of the file ctex.dtx, and the derived files % 提供了汉字输出支持、标点压缩、字体字号命令、标题文字汉化、中文版式调整、数字 % 日期转换等支持功能,可适应论文、报告、书籍、幻灯片等不同类型的中文文档。 % -% \CTeX{} 宏集支持 \LaTeX{}、\pdfLaTeX{}、\XeLaTeX{} 和 \LuaLaTeX{} 等多种不同 +% \CTeX{} 宏集支持 \LaTeX、\pdfLaTeX、\XeLaTeX、\LuaLaTeX、\upLaTeX{} 等多种不同 % 的编译方式,并为它们提供了统一的界面。主要功能由宏包 \pkg{ctex} 和中文文档类 -% \cls{ctexart}、\cls{ctexrep}、\cls{ctexbook} 实现。 +% \cls{ctexart}、\cls{ctexrep}、\cls{ctexbook} 和 \cls{ctexbeamer} 实现。 % \end{abstract} % % \tableofcontents @@ -879,8 +928,8 @@ This package consists of the file ctex.dtx, and the derived files % % \subsection{\CTeX{} 宏集的组成} % -% 为了适应用户不同的需求,我们将 \CTeX{} 宏集的主要功能分散在三个中文文档类和 -% 四个宏包当中,具体的组成见表~\ref{tab:ctex}。 +% 为了适应用户不同的需求,我们将 \CTeX{} 宏集的主要功能分散在四个中文文档类和 +% 三个宏包当中,具体的组成见表~\ref{tab:ctex}。 % % \begin{table}[htbp] % \centering @@ -895,14 +944,14 @@ This package consists of the file ctex.dtx, and the derived files % 中篇幅的报告 \\ % & \file{ctexbook.cls} & 标准文档类 \cls{book} 的汉化版本,一般适用于 % 长篇幅的书籍 \\ +% & \file{ctexbeamer.cls} & 文档类 \cls{beamer} 的汉化版本,适用于 +% 幻灯片演示 \\ % \midrule % 宏包 & \file{ctex.sty} & 提供全部功能,但\emph{默认不开启章节标题设置功能}, % 需要使用 \opt{heading} 选项来开启 \\ -% & \file{ctexcap.sty} & \emph{过时宏包,仅作兼容使用},相当于开启章节标题 -% 设置功能的 \file{ctex.sty} \\ % & \file{ctexsize.sty} & 定义和调整中文字号,在 \pkg{ctex} 宏包 % 或 \CTeX{} 中文文档类之外单独调用 \\ -% & \file{ctexheading.sty} & 提供章节标题设置功能的(见 \ref{sec:secstyle} +% & \file{ctexheading.sty} & 提供章节标题设置功能(见 \ref{sec:secstyle} % 节),在 \pkg{ctex} 宏包或 \CTeX{} 中文 % 文档类之外单独调用 \\ % \bottomrule @@ -957,38 +1006,32 @@ This package consists of the file ctex.dtx, and the derived files % \subsection{使用 \CTeX{} 文档类} % % \emph{如果用户需要在标准文档类的基础上添加中文支持和中文版式支持,我们建议用户使用 \CTeX{} -% 宏集提供的三个中文文档类。} +% 宏集提供的四个中文文档类。} % -% \CTeX{} 宏集提供了三个中文文档类:\cls{ctexart}、\cls{ctexrep} 和 \cls{ctexbook}, -% 分别对应 \LaTeX{} 的标准文档类 \cls{article}、\cls{report} 和 \cls{book}。使用它们 -% 的时候,需要将涉及到的所有源文件使用 UTF-8 编码保存^^A -% \footnote{使用 (pdf)\LaTeX{} 时也能够使用 GBK 编码,但不推荐。 -% (见 \ref{subs:encoding}~节)}。 +% \CTeX{} 宏集提供了四个中文文档类:\cls{ctexart}、\cls{ctexrep}、\cls{ctexbook} 和 +% \cls{ctexbeamer},分别对应 \LaTeX{} 的标准文档类 \cls{article}、\cls{report}、 +% \cls{book} 和 \cls{beamer}。使用它们的时候,需要将涉及到的所有源文件使用 UTF-8 +% 编码保存\footnote{使用 (pdf)\LaTeX{} 时也能够使用 GBK 编码,但不推荐。(见 +% \ref{subs:encoding}~节)}。 % % \begin{ctexexam} % \documentclass[UTF8]{ctexart} % \begin{document} % 中文文档类测试。你需要将所有源文件保存为 UTF-8 编码。 % -% 你可以使用 XeLaTeX 或 LuaLaTeX 编译,也可以使用 (pdf)LaTeX 编译。 +% 你可以使用 XeLaTeX、LuaLaTeX 或 upLaTeX 编译,也可以使用 (pdf)LaTeX 编译。 % 推荐使用 XeLaTeX 或 LuaLaTeX 编译。 % \end{document} % \end{ctexexam} % -% \subsection{使用 \pkg{ctex} 宏包} -% -% \emph{用户在使用非标准文档类时,如果需要添加中文支持或中文版式支持,则可以使用 \pkg{ctex} -% 宏包。} -% -% 以下是使用 \cls{beamer} 文档类编写中文演示文稿的一个示例。 +% 以下是使用 \cls{ctexbeamer} 文档类编写中文演示文稿的一个示例。 % \begin{ctexexam} -% \documentclass{beamer} -% \usepackage[UTF8]{ctex} +% \documentclass[UTF8]{ctexbeamer} % \begin{document} % \begin{frame}{中文演示文档} % \begin{itemize} % \item 你需要将所有源文件保存为 UTF-8 编码 -% \item 你可以使用 XeLaTeX 或 LuaLaTeX 编译 +% \item 你可以使用 XeLaTeX、LuaLaTeX 或 upLaTeX 编译 % \item 也可以使用 (pdf)LaTeX 编译 % \item 推荐使用 XeLaTeX 或 LuaLaTeX 编译 % \end{itemize} @@ -996,6 +1039,11 @@ This package consists of the file ctex.dtx, and the derived files % \end{document} % \end{ctexexam} % +% \subsection{使用 \pkg{ctex} 宏包} +% +% \emph{用户在使用非标准文档类时,如果需要添加中文支持或中文版式支持,则可以使用 \pkg{ctex} +% 宏包。} +% % 有些文档类是建立在 \LaTeX{} 标准文档类之上开发的。这时,给 \pkg{ctex} 宏包 % 加上 \opt{heading} 选项,可以将章节标题设置为中文风格。 % \begin{ctexexam} @@ -1012,7 +1060,7 @@ This package consists of the file ctex.dtx, and the derived files % % \CTeX{} 宏集已经尽可能就中文的行文和版式习惯做了调整和配置,通常而言,这些配置 % 已经够用。因此,除非必要,我们不建议普通用户修改这些默认配置。如果你认为 \CTeX{} 宏集 -% 的默认配置还可以完善,可以在项目主页上 +% 的默认配置还可以完善,可以在项目主页上% % \href{https://github.com/CTeX-org/ctex-kit/issues}{提交 issue}, % 向我们反映,我们会酌情在后续版本中予以改进。 % @@ -1059,25 +1107,37 @@ This package consists of the file ctex.dtx, and the derived files % \subsection{编译方式} % \label{subs:compile} % -% \CTeX{} 宏集会根据用户使用的编译方式\footnote{\LaTeX、\pdfLaTeX、\XeLaTeX 以及 -% \LuaLaTeX。},在底层选择不同的中文支持方式(见表 \ref{tab:chinese-support})。 +% \CTeX{} 宏集会根据用户使用的编译方式\footnote{\LaTeX、\pdfLaTeX、\XeLaTeX、 +% \LuaLaTeX{} 及 \upLaTeX。},在底层选择不同的中文支持方式(见 +% 表~\ref{tab:chinese-support})。 % % \begin{table}[htbp] % \centering +% \begin{threeparttable} % \caption{\CTeX{} 宏集的中文支持方式} -% \begin{tabular}{ccc} +% \label{tab:chinese-support} +% \begin{tabular}{ll} % \toprule -% (pdf)\LaTeX & \XeLaTeX & \LuaLaTeX \\ +% 编译方式 & 支持宏包 \\ % \midrule -% \pkg{CJK} & \pkg{xeCJK} & \pkg{LuaTeX-ja} \\ +% (pdf)\LaTeX & \pkg{CJK} \\ +% \XeLaTeX & \pkg{xeCJK} \\ +% \LuaLaTeX & \pkg{LuaTeX-ja} \\ +% \upLaTeX\tnote{*} & 原生 \\ % \bottomrule % \end{tabular} -% \label{tab:chinese-support} +% \smallskip +% \begin{tablenotes} +% \item[*] p\LaTeX-ng(或称 Ap\LaTeX)与 \upLaTeX{} 兼容。使用 p\LaTeX-ng 编译 +% 时,\pkg{ctex} 采用与 \upLaTeX{} 相同的设置。 +% \end{tablenotes} +% \end{threeparttable} % \end{table} % -% 不同的编译方式和中文支持方式会在一定程度上影响 \CTeX{} 宏集的行为,比如宏包对编码的处理。 -% 在用户使用 \XeLaTeX{} 及 \LuaLaTeX{} 编译时,\CTeX{} 宏集使用(且仅能 -% 使用)UTF-8 编码;而因为历史原因,在用户使用 \LaTeX{} 及 \pdfLaTeX{} 编译 +% 不同的编译方式和中文支持方式会在一定程度上影响 \CTeX{} 宏集的行为,比如宏包对 +% 编码的处理。 +% 在用户使用 \XeLaTeX、\LuaLaTeX{} 及 \upLaTeX{} 编译时,\CTeX{} 宏集使用(且仅 +% 能使用)UTF-8 编码;而因为历史原因,在用户使用 \LaTeX{} 及 \pdfLaTeX{} 编译 % 时,宏包默认使用 GBK 编码。用户需要\emph{保证编译方式、 % 源文件编码、宏包编码选项三者一致}。 % 关于宏包编码选项,可以参考 \ref{subs:encoding}~节。 @@ -1091,10 +1151,10 @@ This package consists of the file ctex.dtx, and the derived files % \begin{function}[rEXP]{GBK, UTF8} % 指明编写文档时使用的编码格式。\CTeX{} 宏集无法检测用户编写文档时使用的编码格式,因此 % 需要用户自行指定编码。\emph{我们建议用户总是使用 UTF-8 编码,并显式指定 \opt{UTF8} -% 选项,并使用 \XeLaTeX{} 或 \LuaLaTeX{} 编译。} +% 选项,并使用 \XeLaTeX、\LuaLaTeX{} 或 \upLaTeX{} 编译。} % -% 使用 \XeLaTeX{} 或 \LuaLaTeX{} 编译时,\CTeX{} 宏集强制使用 UTF-8 编码, -% 此时 \opt{GBK} 选项无效。 +% 使用 \XeLaTeX、\LuaLaTeX{} 或 \upLaTeX{} 编译时,\CTeX{} 宏集强制使用 UTF-8 +% 编码,此时 \opt{GBK} 选项无效。 % 使用 (pdf)\LaTeX{} 编译时,\CTeX{} 宏集默认启用 \opt{GBK} 选项;不过,用户也可以 % 显式声明 \opt{UTF8} 选项,使 \CTeX{} 宏集工作在 UTF-8 编码下。 % \end{function} @@ -1127,14 +1187,19 @@ This package consists of the file ctex.dtx, and the derived files % \makecell{\pkg{LuaTeX-ja}\\中易字库} & % \makecell{\pkg{LuaTeX-ja}\\Fandol 字库} \\ % \cmidrule(lr){1-5} -% \pdfLaTeX{} & 不可用 & +% \pdfLaTeX{} & 不可用\tnote{5} & % \makecell{\pkg{CJK} + \pkg{zhmetrics}\\中易字库 + 微软雅黑} & -% \makecell{\pkg{CJK} + \pkg{zhmetrics}\\中易字库} & 不可用 \\ +% \makecell{\pkg{CJK} + \pkg{zhmetrics}\\中易字库} & 不可用\tnote{5} \\ % \cmidrule(lr){1-5} -% \makecell{\LaTeX{} + \\\dvipdfmx{}} & 不可用 & +% \makecell{\LaTeX{} + \\\dvipdfmx{}} & 不可用\tnote{6} & % \makecell{\pkg{CJK} + \pkg{zhmetrics}\\中易字库 + 微软雅黑} & % \makecell{\pkg{CJK} + \pkg{zhmetrics}\\中易字库} & % \makecell{\pkg{CJK} + \pkg{zhmetrics}\\Fandol 字库} \\ +% \cmidrule(lr){1-5} +% \makecell{\upLaTeX{} + \\\dvipdfmx{}} & 不可用\tnote{6} & +% \makecell{\pkg{zhmetrics-uptex}\\中易字库 + 微软雅黑} & +% \makecell{\pkg{zhmetrics-uptex}\\中易字库} & +% \makecell{\pkg{zhmetrics-uptex}\\Fandol 字库} \\ % \bottomrule % \end{tabular} % \smallskip @@ -1145,6 +1210,8 @@ This package consists of the file ctex.dtx, and the derived files % 参见:\url{https://github.com/clerkma/fandol-fonts}。 % \item [4] \LuaLaTeX{} 编译时使用 \pkg{LuaTeX-ja} 宏包。对此, % 第 \ref{sec:lualatex-chinese}~节有特别说明。 +% \item [5] 受 \pdfTeX{} 的限制,无法嵌入 OpenType 字体。 +% \item [6] 目前受 \dvipdfmx{} 的限制,Mac OS X 系统上的黑体和仿宋无法读取。 % \end{tablenotes} % \end{threeparttable} % \end{table} @@ -1259,7 +1326,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{syntax} % 将文章默认字号(\tn{normalsize})设置为小四号字或五号字, % 具体情况见表 \ref{tab:fontsize}。\opt{false} 禁用本功能。 -% 本选项可以用于三个 \CTeX{} 文档类和 \pkg{ctex} 宏包, +% 本选项可以用于四个 \CTeX{} 文档类和 \pkg{ctex} 宏包, % 也可以用于 \pkg{ctexsize} 宏包。 % % \opt{scheme = chinese} 时,默认值为 |5|,即设置 \tn{normalsize} 为五号字。 @@ -1321,10 +1388,10 @@ This package consists of the file ctex.dtx, and the derived files % \ref{sec:secstyle}~节和 \ref{subs:pagestyle}~节。 % \end{function} % -% \CTeX{} 宏集提供的三个文档类总是启用该功能。如果在 \pkg{ctex.sty} 下启用该选项, +% \CTeX{} 宏集提供的四个文档类总是启用该功能。如果在 \pkg{ctex.sty} 下启用该选项, % 将会检查当前是否使用 \LaTeX{} 标准文档类。 % 若然,则该选项将会使得 \pkg{ctex.sty} 宏包的行为和 \CTeX{} 宏集提供的 -% 三个中文文档类\emph{完全}一致;若不然,则会根据 \tn{chapter} +% 四个中文文档类\emph{完全}一致;若不然,则会根据 \tn{chapter} % 是否有定义来使用 \cls{ctexbook} 或者 \cls{ctexart} 的标题设置。 % % \begin{function}[rEXP]{sub3section, sub4section} @@ -1338,10 +1405,11 @@ This package consists of the file ctex.dtx, and the derived files % % 启用该选项通常需要将计数器 |secnumdepth| 的值为设置为 4 或 5。 % -% 具体格式可参考 \ref{sec:secstyle}~节中的 \opt{afterskip} 等选项。 +% 具体格式可参考 \ref{sec:secstyle}~节中的 \opt{runin} 和 \opt{afterskip} 选项。 % -% 注意,上述两个选项只有在 \opt{heading} 选项启用的时候才有意义。亦即,只有在使用 -% 三个 \CTeX{} 文档类或启用了 \opt{heading} 的 \pkg{ctex.sty} 的时候才有意义。 +% 注意,上述两个选项只有在非 \cls{beamer} 文档类下 \opt{heading} 选项启用的时候 +% 才有意义。亦即,只有在使用除了 \cls{ctexbeamer} 的三个 \CTeX{} 文档类或启用了 +% \opt{heading} 的 \pkg{ctex.sty} 的时候才有意义。 % \end{function} % % \subsection{排版方案选项} @@ -1355,7 +1423,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{function} % \begin{optdesc}[itemsep=\medskipamount] % \item[chinese] 调整默认字号为五号字,并调整行距为 |1.3|; -% 汉化文档中的标题名字(如“图”、“表”、“目录”和“参考文献”, +% 汉化文档中的标题名字(如“图”、“表”、“目录”和“参考文献”等, % 见 \ref{subs:capname}~节); % 在 \opt{heading = true} 的情况下^^A % \footnote{使用 \CTeX{} 文档类,或者使用 \pkg{ctex} 宏包且开启该选项时。}^^A @@ -1416,8 +1484,9 @@ This package consists of the file ctex.dtx, and the derived files % \end{ctexexam} % 则会得到“{\ctexset{space=auto}汉字 分词 技术 English}”。 % -% \emph{使用 \textup{\LuaLaTeX} 编译的时候,该选项无效:汉字间的空格以及汉字与西文字符 -% 之间的空格总是有效,不会被忽略,但可以自动忽略掉由换行产生的空格。} +% \emph{使用 \textup{\LuaLaTeX{} 及 \upLaTeX} 编译的时候,该选项无效:汉字间的 +% 空格以及汉字与西文字符之间的空格总是有效,不会被忽略,但可以自动忽略掉由换行 +% 产生的空格。} % % \begin{function}[rEXP,added=2014-04-23]{linespread} % \begin{syntax} @@ -1578,7 +1647,40 @@ This package consists of the file ctex.dtx, and the derived files % bibname = <名字> % \end{syntax} % 设置参考文献标题名 \tn{refname}(对 \cls{article})或 \tn{bibname}(对 -% \cls{report} 和 \cls{book})。中文默认为“\refname”。 +% \cls{report}、\cls{book} 和 \cls{beamer})。中文默认为“\refname”。 +% \end{function} +% +% \begin{function}[EXP]{proofname} +% \begin{syntax} +% proofname = <名字> +% \end{syntax} +% 设置证明环境的名称 \tn{proofname}。中文默认为“\proofname”。 +% \end{function} +% +% 如果使用 \cls{ctexbeamer} 文档类或者在 \cls{beamer} 文档类下使用 \pkg{ctex} 包, +% 还会汉化常用定理类环境的诸如“定义”、“定理”和“引理”等名称。此时,还有下列 +% 三个选项。 +% +% \begin{function}[EXP]{refname} +% \begin{syntax} +% refname = <名字> +% \end{syntax} +% 设置参考文献标题名 \tn{refname}。中文默认为“\refname”。 +% \end{function} +% +% \begin{function}[EXP]{algorithmname} +% \begin{syntax} +% algorithmname = <名字> +% \end{syntax} +% 设置算法环境标题名 \tn{algorithmname}。中文默认为“算法”。 +% \end{function} +% +% \begin{function}[EXP]{continuation} +% \begin{syntax} +% continuation = <名字> +% \end{syntax} +% 设置 \cls{beamer} 可断页的帧在续页标题中的延续标识 \tn{insertcontinuationtext}。 +% 中文默认为“(续)”。 % \end{function} % % \end{defaultcapconfig} @@ -1683,8 +1785,8 @@ This package consists of the file ctex.dtx, and the derived files % \label{sec:secstyle} % % \CTeX 宏包对 \LaTeX 的标准文档类(\cls{article}、\cls{report} 和 -% \cls{book})进行了扩充。当以 \opt{heading} 选项调用 \CTeX 宏包时 -% (\ref{subs:options-heading}~节),则会启用章 +% \cls{book})和 \cls{beamer} 进行了扩充。当以 \opt{heading} 选项调用 \CTeX +% 宏包时(\ref{subs:options-heading}~节),则会启用章 % 节标题的格式设置功能。本节就来介绍有关章节标题的格式选项,所有选项使用 % \tn{ctexset} 命令设置。 % @@ -1699,8 +1801,13 @@ This package consists of the file ctex.dtx, and the derived files % \opt{name}, \opt{number}, \opt{format}, \opt{nameformat}, \opt{numberformat}, % \opt{aftername}, \opt{titleformat}, \opt{aftertitle}, \opt{runin}, % \opt{afterindent}, \opt{beforeskip}, \opt{afterskip}, \opt{indent}, -% \opt{pagestyle} 等。但注意,对 \cls{article} 及其衍生的 -% \cls{ctexart} 等文档类,没有 |chapter| 级别的标题。 +% \opt{pagestyle} 等。 +% +% 注意,对 \cls{article} 及其衍生的 \cls{ctexart} 等文档类,没有 |chapter| +% 级别的标题。而对于 \cls{beamer} 文档类,这些选项控制的是由 \tn{partpage}、 +% \tn{sectionpage} 和 \tn{subsectionpage} 产生的标题格式,此时只有 |part|、 +% |section| 和 |subsection| 这三层级别,并且 \opt{runin} 和 \opt{afterindent} +% 这两个格式无效。 % % 多级选项之间用斜线分开,例如,\opt{part/name} 选项设置 \tn{part} 标题的在数 % 字前后的名称,而 \opt{section/number} 选项设置 \tn{section} 标题的数字类型。 @@ -1770,7 +1877,11 @@ This package consists of the file ctex.dtx, and the derived files % part & |{第,部分}| & |{\partname\space}| & 原 \tn{partname} 为 Part \\ % chapter & |{第,章}| & |{\chaptername\space}| % & 原 \tn{chaptername} 为 Chapter \\ +% section (beamer) & |{}| & |{\sectionname\space}| +% & \BSTACK 原 \tn{sectionname} 为\\ |\translate{Section}| \ESTACK \\ % section & 同右 & |{}| & \\ +% subsection (beamer) & |{}| & |{\subsectionname\space}| +% & \BSTACK 原 \tn{subsectionname} 为\\ |\translate{Subsection}| \ESTACK \\ % subsection & 同右 & |{}| & \\ % subsubsection & 同右 & |{}| & \\ % paragraph & 同右 & |{}| & \\ @@ -1790,6 +1901,7 @@ This package consists of the file ctex.dtx, and the derived files % section/number = \Roman{section} % } % \end{ctexexam} +% \end{function} % % \opt{number} 选项的定义同时将控制对章节计数器的交叉引用。在引用计数器时, % 记录在 \LaTeX{} 辅助文件中的是 \opt{number} 选项的定义。 @@ -1797,7 +1909,6 @@ This package consists of the file ctex.dtx, and the derived files % 但是,\opt{number} 选项不会影响计数器本身的输出。即设置 |section/number| % 不会影响 \tn{thesection} 的定义。(但该选项会影响 \tn{CTEXthesection} 的定 % 义,见后。) -% \end{function} % % \begin{table}[htbp] % \small\centering @@ -1808,9 +1919,14 @@ This package consists of the file ctex.dtx, and the derived files % 标题名 & \opt{scheme = chinese} & \opt{scheme = plain} % & 原 |\the|\meta{标题} 等价定义 \\ % \midrule +% part (beamer) & |\chinese{part}| & |\insertromanpartnumber| & 意义为 |\Roman{part}| \\ % part & |\chinese{part}| & |\thepart| & |\Roman{part}| \\ % chapter & |\chinese{chapter}| & |\thechapter| & |\arabic{chapter}| \\ +% section (beamer) & 同右 & |\insertsectionnumber| & 意义为 |\arabic{section}| \\ % section & 同右 & |\thesection| & |\arabic{section}| \\ +% subsection (beamer) +% & \BSTACK |\arabic{section}.|\\ |\arabic{subsection}| \ESTACK +% & |\insertsubsectionnumber| & 意义为 |\arabic{subsection}| \\ % subsection & 同右 & |\thesubsection| & |\thesection.\arabic{subsection}| \\ % subsubsection & 同右 & |\thesubsubsection| % & |\thesubsection.\arabic{subsubsection}| \\ @@ -1860,9 +1976,12 @@ This package consists of the file ctex.dtx, and the derived files % 标题名 & \opt{scheme = chinese} & \opt{scheme = plain} \\ % \midrule % part (article) & |\Large\bfseries\centering| & |\raggedright| \\ +% part (beamer) & 同右 & |\centering| \\ % part & |\huge\bfseries\centering| & |\centering| \\ % chapter & |\huge\bfseries\centering| & |\raggedright| \\ +% section (beamer) & 同右 & |\centering| \\ % section & |\Large\bfseries\centering| & |\Large\bfseries| \\ +% subsection (beamer) & 同右 & |\centering| \\ % subsection & 同右 & |\large\bfseries| \\ % subsubsection & 同右 & |\normalsize\bfseries| \\ % paragraph & 同右 & |\normalsize\bfseries| \\ @@ -1896,9 +2015,18 @@ This package consists of the file ctex.dtx, and the derived files % 标题名 & \opt{scheme = chinese} & \opt{scheme = plain} \\ % \midrule % part (article) & |{}| & |\Large\bfseries| \\ +% part (beamer) & 同右 +% & \BSTACK |\usebeamerfont{part name}| \\ +% |\usebeamercolor[fg]{part name}| \ESTACK \\ % part & |{}| & |\huge\bfseries| \\ % chapter & |{}| & |\huge\bfseries| \\ +% section (beamer) & 同右 +% & \BSTACK |\usebeamerfont{section name}| \\ +% |\usebeamercolor[fg]{section name}| \ESTACK \\ % section & 同右 & |{}| \\ +% subsection (beamer) & 同右 +% & \BSTACK |\usebeamerfont{subsection name}| \\ +% |\usebeamercolor[fg]{subsection name}| \ESTACK \\ % subsection & 同右 & |{}| \\ % subsubsection & 同右 & |{}| \\ % paragraph & 同右 & |{}| \\ @@ -1953,9 +2081,12 @@ This package consists of the file ctex.dtx, and the derived files % 标题名 & \opt{scheme = chinese} & \opt{scheme = plain} \\ % \midrule % part (article) & |\quad| & |\par\nobreak| \\ +% part (beamer) & 同右 & |\vskip 1em \par| \\ % part & 同右 & |\par\vskip 20pt| \\ % chapter & |\quad| & |\par\nobreak\vskip 20pt| \\ +% section (beamer) & 同右 & |\vskip 1em \par| \\ % section & 同右 & |\quad| \\ +% subsection (beamer) & 同右 & |\vskip 1em \par| \\ % subsection & 同右 & |\quad| \\ % subsubsection & 同右 & |\quad| \\ % paragraph & 同右 & |\quad| \\ @@ -2005,9 +2136,12 @@ This package consists of the file ctex.dtx, and the derived files % 标题名 & \opt{scheme = chinese} & \opt{scheme = plain} \\ % \midrule % part (article) & |{}| & |\huge\bfseries| \\ +% part (beamer) & 同右 & |\usebeamerfont{part title}| \\ % part & |{}| & |\Huge\bfseries| \\ % chapter & |{}| & |\Huge\bfseries| \\ +% section (beamer) & 同右 & |\usebeamerfont{section title}| \\ % section & 同右 & |{}| \\ +% subsection (beamer) & 同右 & |\usebeamerfont{subsection title}| \\ % subsection & 同右 & |{}| \\ % subsubsection & 同右 & |{}| \\ % paragraph & 同右 & |{}| \\ @@ -2139,9 +2273,12 @@ This package consists of the file ctex.dtx, and the derived files % 标题名 & 默认值 \\ % \midrule % part (article) & |4ex| \\ +% part (beamer) & |0pt| \\ % part & |0pt plus 1fil| \\ % chapter & |50pt| \\ +% section (beamer) & |0pt| \\ % section & |3.5ex plus 1ex minus .2ex| \\ +% subsection (beamer) & |0pt| \\ % subsection & |3.25ex plus 1ex minus .2ex| \\ % subsubsection & |3.25ex plus 1ex minus .2ex| \\ % paragraph & |3.25ex plus 1ex minus .2ex| \\ @@ -2175,9 +2312,12 @@ This package consists of the file ctex.dtx, and the derived files % 标题名 & 默认值 \\ % \midrule % part (article) & |3ex| \\ +% part (beamer) & |0pt| \\ % part & |0pt plus 1fil| \\ % chapter & |40pt| \\ +% section (beamer) & |0pt| \\ % section & |2.3ex plus .2ex| \\ +% subsection (beamer) & |0pt| \\ % subsection & |1.5ex plus .2ex| \\ % subsubsection & |1.5ex plus .2ex| \\ % paragraph & |1em| \\ @@ -2196,6 +2336,7 @@ This package consists of the file ctex.dtx, and the derived files % 标题名 & 默认值 \\ % \midrule % part (article) & |0pt| \\ +% part (beamer) & |0pt| \\ % part & 无效 \\ % chapter & |0pt| \\ % section & |0pt| \\ @@ -2895,6 +3036,8 @@ This package consists of the file ctex.dtx, and the derived files % \item \pkg{luaotfload} 宏包,它还依赖 \pkg{luatexbase} 宏包。 % \end{itemize} % \item[\ding{229}] 以上是使用 \LuaLaTeX{} 编译时的依赖项。 +% \item \pkg{zhmetrics-uptex} 宏包。 +% \item[\ding{229}] 以上是使用 \upLaTeX{} 编译时的依赖项。 % \end{itemize} % % 出于一些原因,\pkg{zhmCJK} 尚未被收入 \TeXLive{} 和 \MiKTeX。因此,若 @@ -3119,7 +3262,9 @@ This package consists of the file ctex.dtx, and the derived files % 若大于 |3|,则 \tn{paragraph} 和 \tn{subparagraph} 标题单独占一行;若为 |3|,则 % \tn{paragraph} 单独占一行。 % \begin{macrocode} +%<*!beamer> \cs_new_eq:NN \g_@@_section_depth_flag \c_two +%</!beamer> % \end{macrocode} % \end{variable} % @@ -3520,12 +3665,14 @@ This package consists of the file ctex.dtx, and the derived files % % \begin{macro}{sub3section,sub4section} % \begin{macrocode} +%<*!beamer> 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:n = true , sub4section .value_forbidden:n = true , +%</!beamer> % \end{macrocode} % \end{macro} % @@ -3692,6 +3839,11 @@ This package consists of the file ctex.dtx, and the derived files \PassOptionsToClass { \g_@@_std_options_clist } { report } \LoadClass { report } %</report> +%<*beamer> +\tl_const:Nn \c_@@_class_tl { beamer } +\PassOptionsToClass { \g_@@_std_options_clist } { beamer } +\LoadClass { beamer } +%</beamer> % \end{macrocode} % % \begin{macrocode} @@ -3735,6 +3887,22 @@ This package consists of the file ctex.dtx, and the derived files % % \subsubsection{\pkg{ctex-engine-pdftex.def}} % +% \begin{macro}[int]{\ctex_set_zhmap:n} +% 设置 \upTeX{} 字体映射,同时作用于 \tn{AtBeginDvi} 与 +% \tn{AtBeginShipoutFirst}。该宏对 \pdfTeX{} 和 \upTeX{} 均有用。 +% \begin{macrocode} +%<*pdftex|uptex> +\cs_new_protected_nopar:Npn \ctex_set_zhmap:n #1 + { + \AtBeginDvi { #1 } + \ctex_at_end_package:nn { atbegshi } + { \AtBeginShipoutFirst { #1 } } + } +\@onlypreamble \ctex_set_zhmap:n +%</pdftex|uptex> +% \end{macrocode} +% \end{macro} +% % \begin{macrocode} %<*pdftex> % \end{macrocode} @@ -3783,11 +3951,11 @@ This package consists of the file ctex.dtx, and the derived files \cs_new_protected_nopar:Npn \@@_save_cmap:Nn #1#2 { \tl_set:Nx \l_@@_tmp_tl { \str_lower_case:n {#2} \CJK@plane } - \tex_immediate:D \pdfobj stream ~ file { \l_@@_tmp_tl .cmap } + \tex_immediate:D \pdftex_pdfobj:D 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 } + \exp_not:N \pdftex_pdffontattr:D \exp_not:N \tex_font:D + { /ToUnicode ~ \int_use:N \pdftex_pdflastobj:D \c_space_tl 0 ~ R } } } % \end{macrocode} @@ -3836,11 +4004,9 @@ This package consists of the file ctex.dtx, and the derived files \tl_set:Nn \CJKrmdefault {#1} \tl_set:Nn \CJKsfdefault {#2} \tl_set:Nn \CJKttdefault {#3} - \AtBeginDvi { \file_input:n {#4} } - \ctex_at_end_package:nn { atbegshi } - { \AtBeginShipoutFirst { \file_input:n {#4} } } + \ctex_set_zhmap:n { \file_input:n {#4} } } - \@onlypreamble \ctex_load_zhmap:n + \@onlypreamble \ctex_load_zhmap:nnnn % \end{macrocode} % \end{macro} % @@ -3938,6 +4104,11 @@ This package consists of the file ctex.dtx, and the derived files } % \end{macrocode} % +% 在导言区末尾更新 \tn{CJKfamilydefault},注意要在 \tn{CJK@envStart} 之前使用。 +% \begin{macrocode} +\ctex_at_end_preamble:n { \ctex_update_default_family: } +% \end{macrocode} +% % 启用中文字符功能。\texttt{GBK} 编码时,将汉字的首字节设置为活动字符,并对这些 % 字符初始化;\texttt{UTF8} 编码时,上游宏包已经处理好。 % \tn{CJK@makeActive} 应该先于 \file{ctex-name-gbk.cfg} 等文件的载入。 @@ -3981,6 +4152,7 @@ This package consists of the file ctex.dtx, and the derived files % \tn{CJK@upperReset} 可能会有一定风险,因此我们直到导言区末尾才使用 % \tn{CJK@envStart}。这样可以避免将 \env{CJK} 环境内置入 \env{document} 环境的 % 最里层,最后也就不需要 \tn{clearpage}。\pkg{zhmCJK} 已经提供类似功能。 +% 注意先使用 \cs{ctex_update_default_family:} 更新 \tn{CJKfamilydefault}。 % \begin{macrocode} \exp_args:Nx \ctex_at_end_preamble:n { @@ -5067,6 +5239,11 @@ This package consists of the file ctex.dtx, and the derived files { \ctex_patch_failure:N \normalfont } % \end{macrocode} % +% 在导言区末尾更新 \tn{CJKfamilydefault}。 +% \begin{macrocode} +\ctex_at_end_preamble:n { \ctex_update_default_family: } +% \end{macrocode} +% % \begin{macro}[int]{\ctex_ltj_ensure_default_family:} % 在导言区结束确认 \tn{CJKfamilydefault} 确实存在。 % \begin{macrocode} @@ -5640,8 +5817,139 @@ This package consists of the file ctex.dtx, and the derived files %</luatex> % \end{macrocode} % +% \subsubsection{\pkg{ctex-engine-uptex.def}} +% +% \begin{macrocode} +%<*uptex> +% \end{macrocode} +% +% \changes{v2.4}{2016/02/28}{初步支持 \upLaTeX。} +% +% 按 \pkg{CJK} 的命名习惯模拟部分命令,并设置默认字体。 +% \begin{macrocode} +\tl_set:Nn \CJKrmdefault { rm } +\tl_set:Nn \CJKsfdefault { sf } +\tl_set:Nn \CJKttdefault { tt } +\tl_set:Nn \CJKfamilydefault { \CJKrmdefault } +\tl_put_left:Nn \rmfamily { \kanjifamily { \CJKrmdefault } } +\tl_put_left:Nn \sffamily { \kanjifamily { \CJKsfdefault } } +\tl_put_left:Nn \ttfamily { \kanjifamily { \CJKttdefault } } +\NewDocumentCommand \CJKfamily { m } + { + \kanjifamily { #1 } + \selectfont + } +\tl_set:Nn \kanjifamilydefault { \CJKfamilydefault } +% \end{macrocode} +% +% \begin{macro}{\em} +% 取消 \upLaTeX{} 对 \tn{em} 使用 |\mcfamily|、|\gtfamily| 命令的重定义,恢复 +% \LaTeXe{} 对 \tn{em} 的原始定义。如果用户已经重定义了 \tn{em},则新定义保持 +% 不变。 +% \begin{macrocode} +\ctex_patch_cmd:Nnn \em + { \mcfamily \upshape \else \gtfamily \itshape } + { \eminnershape \else \itshape } +% \end{macrocode} +% \end{macro} +% +% \changes{v2.4}{2016/04/24}{正确设置 \upTeX{} 下字体命令。} +% \begin{macro}[int]{\ctex_set_upfamily:nnn} +% 将 NFSS 字体族 |#1| 设置为 JFM 字体名 |#2|,粗体形式字体名 |#3|。其中字体名 +% 形如 |upzhserif|,不包括表示方向的后缀 |-h| 与 |-v|。粗体字体名为空时不设置该 +% 字形。本命令不设置字体映射,需要复用已有的字体映射或另行设置。 +% \begin{macrocode} +\cs_new_protected_nopar:Npn \ctex_set_upfamily:nnn #1 #2 #3 + { + \DeclareKanjiFamily{JY2}{#1}{} + \DeclareKanjiFamily{JT2}{#1}{} + \DeclareFontShape{JY2}{#1}{m}{n}{<->~ #2-h}{} + \DeclareFontShape{JT2}{#1}{m}{n}{<->~ #2-v}{} + \tl_if_empty:nF { #3 } + { + \DeclareFontShape{JY2}{#1}{bx}{n}{<->~ #3-h}{} + \DeclareFontShape{JT2}{#1}{bx}{n}{<->~ #3-v}{} + } + } +\@onlypreamble \ctex_set_upfamily:nnn +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[int]{\ctex_set_upmap:nnn} +% 设置 \upTeX{} 字体映射。|#1| 是形如 |upserif| 的 PS TFM 字体名,不带表示粗体 +% 的后缀 |b| 与表示排版方向的后缀 |-h| 与 |-v|。|#2| 与 |#3| 是普通与粗体的实际 +% 字体名。 +% \begin{macrocode} +\cs_new_protected_nopar:Npn \ctex_set_upmap:nnn #1 #2 #3 + { + \ctex_set_zhmap:n + { + \special{ pdf:mapline~ #1-h~ UniGB-UTF16-H~ #2 } + \special{ pdf:mapline~ #1-v~ UniGB-UTF16-V~ #2 } + \tl_if_empty:nF { #3 } + { + \special{ pdf:mapline~ #1b-h~ UniGB-UTF16-H~ #3 } + \special{ pdf:mapline~ #1b-v~ UniGB-UTF16-V~ #3 } + } + } + } +\@onlypreamble \ctex_set_upmap:nnn +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[int]{\ctex_set_upfonts:nnnnnn} +% 设置 \upTeX{} 基本字体映射,按 \pkg{zhmetrics-uptex} 的定义,依次设置衬线体 +% 正、粗、意大利,无衬线体正、粗,等宽体正——共 6 种字体,并分横排及直排。 +% \begin{macrocode} +\cs_new_protected_nopar:Npn \ctex_set_upfonts:nnnnnn #1 #2 #3 #4 #5 #6 + { + \ctex_set_upmap:nnn { upserif } { #1 } { #2 } + \ctex_set_upmap:nnn { upserifit } { #3 } {} + \ctex_set_upmap:nnn { upsans } { #4 } { #5 } + \ctex_set_upmap:nnn { upmono } { #6 } {} + } +\@onlypreamble \ctex_set_upfonts:nnnnnn +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[int]{\@EverySelectfont@Init} +% \pkg{everysel} 宏包(2011/10/28)未考虑 \upLaTeX{} 对 \tn{selectfont} 的修 +% 改,因此这里需要对其给出正确的定义。因为不会使用 \pkg{CJK},这里忽略有关 +% \pkg{CJK} 的定义。 +% \begin{macrocode} +\cs_set_nopar:Npn \@EverySelectfont@Init + { + \ctex_patch_cmd:Nnn \selectfont + { \enc@update } + { + \@EverySelectfont@EveryHook + \@EverySelectfont@AtNextHook + \gdef \@EverySelectfont@AtNextHook { } + \enc@update + } + \@ifpackageloaded { tracefnt } + { + \EverySelectfont + { + \ifnum \tracingfonts > \tw@ + \@font@info { Switching~ to~ \font@name } + \fi + } + } + { } + \let \@EverySelectfont@Init \undefined + } +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +%</uptex> +% \end{macrocode} +% % \subsubsection{调整 \tn{CJKfamilydefault}} % +% \changes{v2.4}{2016/02/15}{正确更新 \pkg{CJK} 包的 \tn{CJKfamilydefault}。} +% % \begin{macro}[int]{\ctex_update_default_family:} % 在导言区结束,如果 \tn{CJKfamilydefault} 没有被更改,则在此时根据西文字体的情况 % 更新 \tn{CJKfamilydefault}。\pkg{xeCJK} 已经有这个功能,不需要再调整。 @@ -5673,7 +5981,6 @@ This package consists of the file ctex.dtx, and the derived files \ctex_ltj_ensure_default_family: %</luatex> } -\ctex_at_end_preamble:n { \ctex_update_default_family: } % \end{macrocode} % \end{macro} % @@ -5722,7 +6029,7 @@ This package consists of the file ctex.dtx, and the derived files % 文件系统的大小写敏感性来判断。Mac~OS~X 的大小写敏感性在安装时是可选的。为了 % 保险起见,这里的判断很繁琐,最多要进行 4 次文件操作! % \begin{macrocode} -%<*xetex|pdftex> +%<*xetex|pdftex|uptex> \cs_new_protected_nopar:Npn \ctex_detected_platform: { \file_if_exist:nTF { /dev/null } @@ -5753,7 +6060,7 @@ This package consists of the file ctex.dtx, and the derived files { \tl_gset:Nn \g_@@_fontset_tl {#2} } } \str_const:Nn \c_@@_macosx_file_str { /Library/Fonts/Songti.ttc } -%</xetex|pdftex> +%</xetex|pdftex|uptex> % \end{macrocode} % \end{macro} % @@ -5860,7 +6167,17 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % % \begin{macrocode} -%<*pdftex|xetex|luatex> +%<*uptex> +\PassOptionsToPackage { dvipdfmx } { hyperref } +\ctex_at_end_package:nn { hyperref } + { + \AtBeginShipoutFirst{ \special{ pdf:tounicode~ UTF8-UTF16 } } + } +%</uptex> +% \end{macrocode} +% +% \begin{macrocode} +%<*pdftex|xetex|luatex|uptex> % \end{macrocode} % % \subsubsection{\pkg{CJKfntef}、\pkg{xeCJKfntef} 相关设置} @@ -5921,11 +6238,11 @@ This package consists of the file ctex.dtx, and the derived files } \cs_new_protected_nopar:Npn { \endCTEXfilltwosides } { \endCJKfilltwosides } %</pdftex|xetex> -%<*luatex> +%<*luatex|uptex> { \cs_new_eq:cN { CTEX#1 } \use:n } \cs_new_eq:NN \CTEXfilltwosides \use_none:n \cs_new_eq:NN \endCTEXfilltwosides \prg_do_nothing: -%</luatex> +%</luatex|uptex> %<*pdftex> \clist_map_inline:nn { @@ -5956,6 +6273,9 @@ This package consists of the file ctex.dtx, and the derived files %<*luatex> { \skip_set:Nn \ccwd { \ltjgetparameter { kanjiskip } + \zw } } %</luatex> +%<*uptex> + { \skip_set:Nn \ccwd { 1zw } } +%</uptex> \dim_new:N \ccwd % \end{macrocode} % \end{macro} @@ -5976,6 +6296,9 @@ This package consists of the file ctex.dtx, and the derived files %<*luatex> { \ltjsetkanjiskip \l_@@_ccglue_skip } %</luatex> +%<*uptex> + { \kanjiskip \l_@@_ccglue_skip } +%</uptex> \skip_new:N \l_@@_ccglue_skip % \end{macrocode} % \end{macro} @@ -5993,6 +6316,10 @@ This package consists of the file ctex.dtx, and the derived files \skip_if_eq:nnTF { \l_@@_ccglue_skip } { \ltjgetparameter { kanjiskip } } { \prg_return_false: } { \prg_return_true: } %</luatex> +%<*uptex> + \skip_if_eq:nnTF { \l_@@_ccglue_skip } { \kanjiskip } + { \prg_return_false: } { \prg_return_true: } +%</uptex> } % \end{macrocode} % 注意下面的标记不能用 \verb"%<pdftex|xetex>",它会导致旧版本的 \pkg{l3docstrip} @@ -6012,11 +6339,12 @@ This package consists of the file ctex.dtx, and the derived files % 的特殊字体。在 \XeTeX{} 可以用 \tn{fontcharwd} 来改进。而在 \pdfTeX{} 下,若使用 % \pkg{zhmetrics} 技术,所有的汉字共享同一个 \file{.tfm},\tn{fontcharwd} 也就没有 % 意义。在 \LuaTeX{} 下,\pkg{LuaTeX-ja} 总是按照 JFM 中的设置输出汉字的宽度,可以 -% 直接用 \tn{zw} 作为汉字宽度。 +% 直接用 \tn{zw} 作为汉字宽度。\upTeX{} 可以直接使用原生的长度单位 |zw|。 % \begin{macrocode} \cs_new_protected_nopar:Npn \ctex_update_em_unit: %<pdftex|xetex> { \dim_set:Nn \ccwd { \f@size \p@ } } %<luatex> { \dim_set:Nn \ccwd { \zw } } +%<uptex> { \dim_set:Nn \ccwd { 1zw } } % \end{macrocode} % \end{macro} % @@ -6051,9 +6379,9 @@ This package consists of the file ctex.dtx, and the derived files %<*pdftex> \EverySelectfont { \cs_if_exist:NF \CJK@plane { \CTEX@selectfont@hook } } %</pdftex> -%<*xetex|luatex> +%<*xetex|luatex|uptex> \EverySelectfont { \CTEX@selectfont@hook } -%</xetex|luatex> +%</xetex|luatex|uptex> % \end{macrocode} % % Attribute 寄存器 \tn{ltj@curjfnt} 的初始值是 $-1$,必须把它设置为一个有效的 @@ -6073,7 +6401,8 @@ This package consists of the file ctex.dtx, and the derived files % % \begin{macro}{space} % 在导言区或正文中设置忽略空格方式。 -% \pdfTeX{} 和 \XeTeX{} 下初始设置为 \opt{auto},\LuaTeX{} 下是无效选项。 +% \pdfTeX{} 和 \XeTeX{} 下初始设置为 \opt{auto},\LuaTeX{}、\upTeX{} 下是无效 +% 选项。 % \begin{macrocode} \keys_define:nn { ctex } { @@ -6091,17 +6420,17 @@ This package consists of the file ctex.dtx, and the derived files space .default:n = { true } , space .initial:n = { auto } %</pdftex|xetex> -%<*luatex> +%<*luatex|uptex> space .code:n = { \msg_warning:nn { ctex } { invalid-option } } -%</luatex> +%</luatex|uptex> } % \end{macrocode} % \end{macro} % % \begin{macro}{punct} % 在导言区或正文中设置标点符号输出格式。\pkg{LuaTeX-ja} 设置的是字体的默认 \texttt{JFM}, -% 只会影响到之后设置的字体。 +% 只会影响到之后设置的字体。\upTeX{} 暂时无效。 % \begin{macrocode} \keys_define:nn { ctex } { @@ -6111,21 +6440,22 @@ This package consists of the file ctex.dtx, and the derived files %<pdftex> \punctstyle { \l_@@_punct_tl } %<xetex> \xeCJKsetup { PunctStyle = \l_@@_punct_tl } %<luatex> \ctex_mono_jfm:o { \l_@@_punct_tl } +%<uptex> \msg_warning:nn { ctex } { invalid-option } } , punct .default:n = { quanjiao } , } % \end{macrocode} % \end{macro} % -% \XeLaTeX{} 和 \LuaLaTeX{} 总是使用 \texttt{UTF8} 编码。 +% \XeLaTeX{}、\LuaLaTeX{} 和 \upLaTeX{} 总是使用 \texttt{UTF8} 编码。 % \begin{macrocode} -%<*xetex|luatex> +%<*xetex|luatex|uptex> \tl_set:Nn \l_@@_encoding_tl { UTF8 } -%</xetex|luatex> +%</xetex|luatex|uptex> % \end{macrocode} % % \begin{macrocode} -%</pdftex|xetex|luatex> +%</pdftex|xetex|luatex|uptex> %<*class|ctex> % \end{macrocode} % @@ -6440,8 +6770,15 @@ This package consists of the file ctex.dtx, and the derived files abstractname .tl_set:N = \abstractname , indexname .tl_set:N = \indexname , appendixname .tl_set:N = \appendixname , + proofname .tl_set:N = \proofname , %<article> bibname .tl_set:N = \refname %<book|report> bibname .tl_set:N = \bibname +%<*beamer> + algorithmname .tl_set:N = \algorithmname , + bibname .tl_set:N = \bibname , + refname .tl_set:N = \refname , + continuation .tl_set:N = \insertcontinuationtext +%</beamer> } % \end{macrocode} % @@ -6452,14 +6789,26 @@ This package consists of the file ctex.dtx, and the derived files Neither~`\token_to_str:N \bibname'~nor~`\token_to_str:N \refname'~can~be~found.\\ The~key~`bibname'~will~set~`\token_to_str:N \ctexbibname'~to~the~given~value. } -\tl_if_exist:NTF \bibname - { \keys_define:nn { ctex } { bibname .tl_set:N = \bibname } } +\tl_if_exist:NTF \insertcontinuationtext { - \tl_if_exist:NTF \refname - { \keys_define:nn { ctex } { bibname .tl_set:N = \refname } } + \keys_define:nn { ctex } { - \msg_warning:nn { ctex } { ctexbibname } - \keys_define:nn { ctex } { bibname .tl_set:N = \ctexbibname } + algorithmname .tl_set:N = \algorithmname , + bibname .tl_set:N = \bibname , + refname .tl_set:N = \refname , + continuation .tl_set:N = \insertcontinuationtext + } + } + { + \tl_if_exist:NTF \bibname + { \keys_define:nn { ctex } { bibname .tl_set:N = \bibname } } + { + \tl_if_exist:NTF \refname + { \keys_define:nn { ctex } { bibname .tl_set:N = \refname } } + { + \msg_warning:nn { ctex } { ctexbibname } + \keys_define:nn { ctex } { bibname .tl_set:N = \ctexbibname } + } } } %</ctex> @@ -6481,18 +6830,26 @@ This package consists of the file ctex.dtx, and the derived files % \begin{variable}[int]{\c_@@_section_headings_seq} % 保存 \tn{section} 级以下标题名字。 % \begin{macrocode} +%<*article|book|report> \seq_new:N \c_@@_section_headings_seq \seq_gset_from_clist:Nn \c_@@_section_headings_seq { section , subsection , subsubsection , paragraph , subparagraph } +%</article|book|report> % \end{macrocode} % \end{variable} % % \begin{variable}[int]{\c_@@_headings_seq} % \begin{macrocode} \seq_new:N \c_@@_headings_seq +%<*article|book|report> \seq_gset_eq:NN \c_@@_headings_seq \c_@@_section_headings_seq %<book|report>\seq_gput_left:Nn \c_@@_headings_seq { chapter } \seq_gput_left:Nn \c_@@_headings_seq { part } +%</article|book|report> +%<*beamer> +\seq_gset_from_clist:Nn \c_@@_headings_seq + { part , section , subsection } +%</beamer> % \end{macrocode} % \end{variable} % @@ -6563,8 +6920,10 @@ This package consists of the file ctex.dtx, and the derived files #1 / afterskip .tl_set:N = \exp_not:c { CTEX@#1@afterskip} , #1 / indent .tl_set:N = \exp_not:c { CTEX@#1@indent } , #1 / numbering .bool_set:N = \exp_not:c { CTEX@#1@numbering } , +%<*article|book|report> #1 / afterindent .bool_set:N = \exp_not:c { CTEX@#1@afterindent } , #1 / runin .bool_set:N = \exp_not:c { CTEX@#1@runin } , +%</article|book|report> #1 / format+ .code:n = { \tl_put_right:Nn \exp_not:c { CTEX@#1@format } { ####1 } } , #1 / nameformat+ .code:n = @@ -6635,6 +6994,9 @@ This package consists of the file ctex.dtx, and the derived files \tl_clear:N \l_@@_tmp_tl % \end{macrocode} % +% \begin{macrocode} +%<*article|book|report> +% \end{macrocode} % % \subsubsection{标准标题命令的修改} % @@ -7404,6 +7766,101 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % +% \begin{macrocode} +%</article|book|report> +% \end{macrocode} +% +% \subsubsection{\cls{beamer} 标题页模板的修改} +% +% \begin{macrocode} +%<*beamer> +% \end{macrocode} +% +% \begin{macrocode} +\ExplSyntaxOff +% \end{macrocode} +% +% 对应 \tn{partpage}。 +% \begin{macrocode} +\defbeamertemplate*{part page}{CTEX}[1][]{ + \begingroup +% \centering +% {\usebeamerfont{part name}\usebeamercolor[fg]{part name}\partname~\insertromanpartnumber} +% \vskip1em\par + \par \addvspace{\glueexpr\CTEX@part@beforeskip\relax}% + \parindent \dimexpr \CTEX@part@indent \relax + \CTEX@part@format + \ifodd \CTEX@part@numbering + \CTEX@partname \CTEX@part@aftername + \fi + \begin{beamercolorbox}[sep=16pt,center,#1]{part title} +% \usebeamerfont{part title}\insertpart\par + \CTEX@part@titleformat \insertpart \CTEX@part@aftertitle + \end{beamercolorbox} + \par \addvspace{\glueexpr\CTEX@part@afterskip\relax}% + \endgroup +} +% \end{macrocode} +% +% 对应 \tn{sectionpage}。 +% \begin{macrocode} +\defbeamertemplate*{section page}{CTEX}[1][]{ + \begingroup +% \centering +% {\usebeamerfont{section name}\usebeamercolor[fg]{section name}\sectionname~\insertsectionnumber} +% \vskip1em\par + \par \addvspace{\glueexpr\CTEX@section@beforeskip\relax}% + \parindent \dimexpr \CTEX@section@indent \relax + \CTEX@section@format + \ifodd \CTEX@section@numbering + \CTEX@sectionname \CTEX@section@aftername + \fi + \begin{beamercolorbox}[sep=12pt,center,#1]{part title} +% \usebeamerfont{section title}\insertsection\par + \CTEX@section@titleformat \insertsection \CTEX@section@aftertitle + \end{beamercolorbox} + \par \addvspace{\glueexpr\CTEX@section@afterskip\relax}% + \endgroup +} +% \end{macrocode} +% +% 对应 \tn{subsectionpage}。 +% \begin{macrocode} +\defbeamertemplate*{subsection page}{CTEX}[1][]{ + \begingroup +% \centering +% {\usebeamerfont{subsection name}\usebeamercolor[fg]{subsection name}\subsectionname~\insertsubsectionnumber} +% \vskip1em\par + \par \addvspace{\glueexpr\CTEX@subsection@beforeskip\relax}% + \parindent \dimexpr \CTEX@subsection@indent \relax + \CTEX@subsection@format + \ifodd \CTEX@subsection@numbering + \CTEX@subsectionname \CTEX@subsection@aftername + \fi + \begin{beamercolorbox}[sep=8pt,center,#1]{part title} +% \usebeamerfont{subsection title}\insertsubsection\par + \CTEX@subsection@titleformat \insertsubsection \CTEX@subsection@aftertitle + \end{beamercolorbox} + \par \addvspace{\glueexpr\CTEX@subsection@afterskip\relax}% + \endgroup +} +% \end{macrocode} +% +% 将 \cls{beamer} 的默认模板重定向为 \texttt{CTEX} 模板。 +% \begin{macrocode} +\defbeamertemplatealias{part page}{default}{CTEX} +\defbeamertemplatealias{section page}{default}{CTEX} +\defbeamertemplatealias{subsection page}{default}{CTEX} +% \end{macrocode} +% +% \begin{macrocode} +\ExplSyntaxOn +% \end{macrocode} +% +% \begin{macrocode} +%</beamer> +% \end{macrocode} +% % \subsubsection{标签引用数字的汉化} % % \begin{macro}[int]{\refstepcounter} @@ -7485,7 +7942,7 @@ This package consists of the file ctex.dtx, and the derived files % \tn{@startsection} 设定的章节标题格式,\opt{chinese} 汉化的标题格式。 % % \begin{macrocode} -%<*scheme&(article|book|report)> +%<*scheme&(article|book|report|beamer)> % \end{macrocode} % % \changes{v2.1}{2015/05/30}{修复 \cls{ctexbook} 和 \cls{ctexrep} 类的中文 @@ -7499,7 +7956,12 @@ This package consists of the file ctex.dtx, and the derived files aftertitle = \par , %<*plain> name = \partname \space , +%<*article|book|report> number = \thepart , +%</article|book|report> +%<*beamer> + number = \insertromanpartnumber , +%</beamer> %</plain> %<*chinese> number = \chinese { part } , @@ -7534,6 +7996,13 @@ This package consists of the file ctex.dtx, and the derived files format = \huge \bfseries \centering %</chinese> %</book|report> +%<*beamer> + format = \centering , + nameformat = \usebeamerfont { part ~ name } + \usebeamercolor [fg] { part ~ name } , + aftername = \vskip 1em \par , + titleformat = \usebeamerfont { part ~ title } +%</beamer> } % \end{macrocode} % @@ -7571,6 +8040,7 @@ This package consists of the file ctex.dtx, and the derived files % \begin{macrocode} \keys_set:nn { ctex / section } { +%<*article|book|report> number = \thesection , aftername = \quad , aftertitle = \@@par , @@ -7585,12 +8055,26 @@ This package consists of the file ctex.dtx, and the derived files format = \Large \bfseries \centering , afterindent = true %</chinese> +%</article|book|report> +%<*beamer> +%<*plain> + name = \sectionname \space , +%</plain> + format = \centering , + number = \insertsectionnumber , + nameformat = \usebeamerfont { section ~ name } + \usebeamercolor [fg] { section ~ name } , + aftername = \vskip 1em \par , + titleformat = \usebeamerfont { section ~ title } , + aftertitle = \par +%</beamer> } % \end{macrocode} % % \begin{macrocode} \keys_set:nn { ctex / subsection } { +%<*article|book|report> number = \thesubsection , format = \large \bfseries , aftername = \quad , @@ -7604,10 +8088,30 @@ This package consists of the file ctex.dtx, and the derived files %<*chinese> afterindent = true %</chinese> +%</article|book|report> +%<*beamer> +%<*plain> + name = \subsectionname \space , + number = \insertsubsectionnumber , +%</plain> +%<*chinese> + number = \arabic { section } . \arabic { subsection } , +%</chinese> + format = \centering , + nameformat = \usebeamerfont { subsection ~ name } + \usebeamercolor [fg] { subsection ~ name } , + aftername = \vskip 1em \par , + titleformat = \usebeamerfont { subsection ~ title } , + aftertitle = \par +%</beamer> } % \end{macrocode} % % \begin{macrocode} +%<*article|book|report> +% \end{macrocode} +% +% \begin{macrocode} \keys_set:nn { ctex / subsubsection } { number = \thesubsubsection , @@ -7716,7 +8220,11 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % % \begin{macrocode} -%</scheme&(article|book|report)> +%</article|book|report> +% \end{macrocode} +% +% \begin{macrocode} +%</scheme&(article|book|report|beamer)> % \end{macrocode} % % \subsubsection{\pkg{ctex.sty} 的 \opt{heading} 选项} @@ -7728,7 +8236,7 @@ This package consists of the file ctex.dtx, and the derived files % \begin{variable}[int]{\c_@@_std_class_tl} % 用于记录被引入的标准文档类。 % \begin{macrocode} -\clist_map_inline:nn { article , book , report } +\clist_map_inline:nn { article , book , report , beamer } { \@ifclassloaded {#1} { \clist_map_break:n { \tl_const:Nn \c_@@_std_class_tl {#1} } } @@ -7773,11 +8281,11 @@ This package consists of the file ctex.dtx, and the derived files % \subsubsection{标题配置文件} % % \begin{macrocode} -%<*UTF8|GBK> +%<*name> % \end{macrocode} % % \begin{macrocode} -\keys_set:nn { ctex } +\keys_set_known:nn { ctex } { contentsname = 目录 , listfigurename = 插图 , @@ -7787,21 +8295,18 @@ This package consists of the file ctex.dtx, and the derived files abstractname = 摘要 , indexname = 索引 , bibname = 参考文献 , - appendixname = 附录 + appendixname = 附录 , + proofname = 证明 , + algorithmname = 算法 , + refname = 参考文献 , + continuation = (续) , + part / name = { 第 , 部分 } , + chapter / name = { 第 , 章 } } % \end{macrocode} % % \begin{macrocode} -\keys_if_exist:nnT { ctex / part } { name } - { - \keys_set:nn { ctex / part } { name = { 第 , 部分 } } - \keys_if_exist:nnT { ctex / chapter } { name } - { \keys_set:nn { ctex / chapter } { name = { 第 , 章 } } } - } -% \end{macrocode} -% -% \begin{macrocode} -%</UTF8|GBK> +%</name> % \end{macrocode} % % \subsection{\opt{chinese} 方案的其他设置} @@ -7817,9 +8322,63 @@ This package consists of the file ctex.dtx, and the derived files % % 汉化标题名字。 % \begin{macrocode} +%<*generic> +\tl_if_exist:NTF \c_@@_std_class_tl + { + \str_if_eq:onTF { \c_@@_std_class_tl } { beamer } + { + \str_if_eq:onTF { \l_@@_encoding_tl } { GBK } + { + \uselanguage { ChineseGBK } + \languagealias { chinese } { ChineseGBK } + \ctex_file_input:n { ctex-name-gbk.cfg } + } + { + \uselanguage { ChineseUTF8 } + \languagealias { chinese } { ChineseUTF8 } + \ctex_file_input:n { ctex-name-utf8.cfg } + } + \clist_put_left:Nn \trans@languagepath { chinese } + } + { + \str_if_eq:onTF { \l_@@_encoding_tl } { GBK } + { \ctex_file_input:n { ctex-name-gbk.cfg } } + { \ctex_file_input:n { ctex-name-utf8.cfg } } +% \end{macrocode} +% \changes{v2.0.2}{2015/05/16}{修复加载 \pkg{ctex} 宏包后章节标题后第一段 +% 无段首缩进的问题。} +% 若 \pkg{ctex} 宏包与标准文档类及其衍生文档类联用,则将载入 \pkg{indentfirst} 宏包, +% 实现章节标题后首个段落的段首缩进。 +% \begin{macrocode} + \RequirePackage { indentfirst } + } + } + { + \str_if_eq:onTF { \l_@@_encoding_tl } { GBK } + { \ctex_file_input:n { ctex-name-gbk.cfg } } + { \ctex_file_input:n { ctex-name-utf8.cfg } } + } +%</generic> +%<*!generic> \str_if_eq:onTF { \l_@@_encoding_tl } { GBK } +%<*article|book|report> { \ctex_file_input:n { ctex-name-gbk.cfg } } { \ctex_file_input:n { ctex-name-utf8.cfg } } +%</article|book|report> +%<*beamer> + { + \uselanguage { ChineseGBK } + \languagealias { chinese } { ChineseGBK } + \ctex_file_input:n { ctex-name-gbk.cfg } + } + { + \uselanguage { ChineseUTF8 } + \languagealias { chinese } { ChineseUTF8 } + \ctex_file_input:n { ctex-name-utf8.cfg } + } +\clist_put_left:Nn \trans@languagepath { chinese } +%</beamer> +%</!generic> % \end{macrocode} % % 日期格式。 @@ -7846,17 +8405,6 @@ This package consists of the file ctex.dtx, and the derived files { \keys_set:nn { ctex } { autoindent = true } } % \end{macrocode} % -% \changes{v2.0.2}{2015/05/16}{修复加载 \pkg{ctex} 宏包后章节标题后第一段 -% 无段首缩进的问题。} -% 若 \pkg{ctex} 宏包与标准文档类及其衍生文档类联用,则将载入 \pkg{indentfirst} 宏包, -% 实现章节标题后首个段落的段首缩进。 -% \begin{macrocode} -%<*generic> -\tl_if_exist:NT \c_@@_std_class_tl - { \RequirePackage { indentfirst } } -%</generic> -% \end{macrocode} -% % \begin{macrocode} %</scheme&chinese> % \end{macrocode} @@ -8174,11 +8722,11 @@ This package consists of the file ctex.dtx, and the derived files % \begin{macro}[int]{\verse,\quotation} % 只在使用文档类的时候修改诗歌和引用环境的缩进。 % \begin{macrocode} -%<*scheme&!generic&chinese> +%<*scheme&chinese&(article|book|report)> \ctex_patch_cmd:Nnn \verse { -1.5em } { -2 \ccwd } \ctex_patch_cmd:Nnn \verse { 1.5em } { 2 \ccwd } \ctex_patch_cmd:Nnn \quotation { 1.5em } { 2 \ccwd } -%</scheme&!generic&chinese> +%</scheme&chinese&(article|book|report)> % \end{macrocode} % \end{macro} % @@ -8325,6 +8873,7 @@ This package consists of the file ctex.dtx, and the derived files %</c19|c70> % \end{macrocode} % +% \pkg{CJK} 宏包使用的字体族。 % \begin{macrocode} %<rm&c19>\DeclareFontFamily{C19}{rm}{\hyphenchar\font\m@ne} %<rm&c70>\DeclareFontFamily{C70}{rm}{\hyphenchar\font\m@ne} @@ -8334,6 +8883,21 @@ This package consists of the file ctex.dtx, and the derived files %<tt&c70>\DeclareFontFamily{C70}{tt}{\hyphenchar\font\m@ne} % \end{macrocode} % +% \changes{v2.4}{2016/04/25}{提供 \upLaTeX{} 的 NFSS 字体定义。} +% \upTeX{} 使用的字体族。\upLaTeX 在 NFSS 下使用字体编码 |JY2| 和 |JT2| 来分别 +% 表示横排与直排的日文。 +% \begin{macrocode} +%<*uptex> +\DeclareKanjiFamily{JY2}{rm}{} +\DeclareKanjiFamily{JY2}{sf}{} +\DeclareKanjiFamily{JY2}{tt}{} +\DeclareKanjiFamily{JT2}{rm}{} +\DeclareKanjiFamily{JT2}{sf}{} +\DeclareKanjiFamily{JT2}{tt}{} +%</uptex> +% \end{macrocode} +% +% % \begin{macrocode} %<*rm> %<*c19> @@ -8359,6 +8923,14 @@ This package consists of the file ctex.dtx, and the derived files \DeclareFontShape{C70}{rm}{bx}{it}{<-> CJKb * unikai}{\CJKbold} %</c70> %</rm> +%<*uptex> +\DeclareFontShape{JY2}{rm}{m}{n}{<-> upzhserif-h}{} +\DeclareFontShape{JY2}{rm}{m}{it}{<-> upzhserifit-h}{} +\DeclareFontShape{JY2}{rm}{bx}{n}{<-> upzhserifb-h}{} +\DeclareFontShape{JT2}{rm}{m}{n}{<-> upzhserif-v}{} +\DeclareFontShape{JT2}{rm}{m}{it}{<-> upzhserifit-v}{} +\DeclareFontShape{JT2}{rm}{bx}{n}{<-> upzhserifb-v}{} +%</uptex> % \end{macrocode} % % \begin{macrocode} @@ -8386,6 +8958,12 @@ This package consists of the file ctex.dtx, and the derived files \DeclareFontShape{C70}{sf}{bx}{it}{<-> CJKb * uniyou}{\CJKbold} %</c70> %</sf> +%<*uptex> +\DeclareFontShape{JY2}{sf}{m}{n}{<-> upzhsans-h}{} +\DeclareFontShape{JY2}{sf}{bx}{n}{<-> upzhsansb-h}{} +\DeclareFontShape{JT2}{sf}{m}{n}{<-> upzhsans-v}{} +\DeclareFontShape{JT2}{sf}{bx}{n}{<-> upzhsansb-v}{} +%</uptex> % \end{macrocode} % % \begin{macrocode} @@ -8413,6 +8991,10 @@ This package consists of the file ctex.dtx, and the derived files \DeclareFontShape{C70}{tt}{bx}{it}{<-> CJKb * unifs}{\CJKbold} %</c70> %</tt> +%<*uptex> +\DeclareFontShape{JY2}{tt}{m}{n}{<-> upzhmono-h}{} +\DeclareFontShape{JT2}{tt}{m}{n}{<-> upzhmono-v}{} +%</uptex> % \end{macrocode} % % \begin{macrocode} @@ -8434,7 +9016,18 @@ This package consists of the file ctex.dtx, and the derived files % % 旧的 Windows 字体设置使用黑体作为无衬线体,楷体和仿宋是 GB2312 编码;新的 % Windows 字体设置使用微软雅黑作为无衬线体,楷体和仿宋是大字库。 +% Windows 8 以后,微软雅黑由原来的 \file{.ttf} 后缀改为 \file{.ttc} 后缀,需要 +% 加以区分。 % \begin{macrocode} +%<*windowsnew> +\tl_new:N \l_@@_msyh_suffix +\tl_set:Nn \l_@@_msyh_suffix { .ttc } +\file_if_exist:nF { C:/Windows/Fonts/msyh.ttc } + { + \file_if_exist:nF { msyh.ttc } + { \tl_set:Nn \l_@@_msyh_suffix { .ttf } } + } +%</windowsnew> %<*windowsnew|windowsold> \sys_if_engine_pdftex:TF { @@ -8447,22 +9040,10 @@ This package consists of the file ctex.dtx, and the derived files \setCJKsansfont { simhei.ttf } \ctex_punct_map_family:nn { \CJKsfdefault } { zhhei } %</windowsold> -% \end{macrocode} -% Windows 8 以后,微软雅黑由原来的 \file{.ttf} 后缀改为 \file{.ttc} 后缀,需要 -% 加以区分。 -% \begin{macrocode} %<*windowsnew> - \file_if_exist:nTF { C:/Windows/Fonts/msyh.ttc } - { - \setCJKsansfont [ BoldFont = msyhbd.ttc ] { msyh.ttc } - \setCJKfamilyfont { zhyahei } - [ BoldFont = msyhbd.ttc ] { msyh.ttc } - } - { - \setCJKsansfont [ BoldFont = msyhbd.ttf ] { msyh.ttf } - \setCJKfamilyfont { zhyahei } - [ BoldFont = msyhbd.ttf ] { msyh.ttf } - } + \setCJKsansfont [ BoldFont = msyhbd\l_@@_msyh_suffix ] { msyh\l_@@_msyh_suffix } + \setCJKfamilyfont { zhyahei } + [ BoldFont = msyhbd\l_@@_msyh_suffix ] { msyh\l_@@_msyh_suffix } \ctex_punct_map_family:nn { \CJKsfdefault } { zhyahei } \ctex_punct_map_bfseries:nn { \CJKsfdefault , zhyahei } { zhyaheib } %</windowsnew> @@ -8492,31 +9073,50 @@ This package consists of the file ctex.dtx, and the derived files } } { + \sys_if_engine_uptex:TF + { + \ctex_set_upfonts:nnnnnn + {simsun.ttc} {simhei.ttf} {simkai.ttf} +%<windowsnew> {msyh\l_@@_msyh_suffix} {msyhbd\l_@@_msyh_suffix} +%<windowsold> {simhei.ttf} {simhei.ttf} + {simfang.ttf} + \ctex_set_upfamily:nnn { zhsong } { upzhserif } {} + \ctex_set_upfamily:nnn { zhhei } { upzhserifb } {} + \ctex_set_upfamily:nnn { zhfs } { upzhmono} {} + \ctex_set_upfamily:nnn { zhkai } { upzhserifit } {} +%<windowsnew> \ctex_set_upfamily:nnn { zhyahei } { upzhsans } { upzhsansb } + \ctex_set_upfamily:nnn { zhli } { upschrm } {} + \ctex_set_upmap:nnn { upstsl } { simli.ttf } {} + \ctex_set_upfamily:nnn { zhyou } { upschgt } {} + \ctex_set_upmap:nnn { upstht } { simyou.ttf } {} + } + { %<*windowsold> - \setCJKmainfont - [ BoldFont = SimHei , ItalicFont = KaiTi_GB2312 ] { SimSun } - \setCJKsansfont { SimHei } - \setCJKmonofont { FangSong_GB2312 } - \setCJKfamilyfont { zhkai } { KaiTi_GB2312 } - \setCJKfamilyfont { zhfs } { FangSong_GB2312 } + \setCJKmainfont + [ BoldFont = SimHei , ItalicFont = KaiTi_GB2312 ] { SimSun } + \setCJKsansfont { SimHei } + \setCJKmonofont { FangSong_GB2312 } + \setCJKfamilyfont { zhkai } { KaiTi_GB2312 } + \setCJKfamilyfont { zhfs } { FangSong_GB2312 } %</windowsold> %<*windowsnew> - \setCJKmainfont - [ BoldFont = SimHei , ItalicFont = KaiTi ] { SimSun } - \setCJKsansfont - [ BoldFont = { *~Bold } ] { Microsoft~YaHei } - \setCJKmonofont { FangSong } - \setCJKfamilyfont { zhkai } { KaiTi } - \setCJKfamilyfont { zhfs } { FangSong } + \setCJKmainfont + [ BoldFont = SimHei , ItalicFont = KaiTi ] { SimSun } + \setCJKsansfont + [ BoldFont = { *~Bold } ] { Microsoft~YaHei } + \setCJKmonofont { FangSong } + \setCJKfamilyfont { zhkai } { KaiTi } + \setCJKfamilyfont { zhfs } { FangSong } %</windowsnew> - \setCJKfamilyfont { zhsong } { SimSun } - \setCJKfamilyfont { zhhei } { SimHei } - \setCJKfamilyfont { zhli } { LiSu } - \setCJKfamilyfont { zhyou } { YouYuan } + \setCJKfamilyfont { zhsong } { SimSun } + \setCJKfamilyfont { zhhei } { SimHei } + \setCJKfamilyfont { zhli } { LiSu } + \setCJKfamilyfont { zhyou } { YouYuan } %<*windowsnew> - \setCJKfamilyfont { zhyahei } - [ BoldFont = { *~Bold } ] { Microsoft~YaHei } + \setCJKfamilyfont { zhyahei } + [ BoldFont = { *~Bold } ] { Microsoft~YaHei } %</windowsnew> + } } %</windowsnew|windowsold> % \end{macrocode} @@ -8571,17 +9171,30 @@ This package consists of the file ctex.dtx, and the derived files } } { - \setCJKmainfont - [ - BoldFont = AdobeHeitiStd-Regular , - ItalicFont = AdobeKaitiStd-Regular - ] { AdobeSongStd-Light } - \setCJKsansfont { AdobeHeitiStd-Regular} - \setCJKmonofont { AdobeFangsongStd-Regular} - \setCJKfamilyfont { zhsong } { AdobeSongStd-Light } - \setCJKfamilyfont { zhhei } { AdobeHeitiStd-Regular } - \setCJKfamilyfont { zhfs } { AdobeFangsongStd-Regular } - \setCJKfamilyfont { zhkai } { AdobeKaitiStd-Regular } + \sys_if_engine_uptex:TF + { + \ctex_set_upfonts:nnnnnn + {AdobeSongStd-Light.otf} {AdobeHeitiStd-Regular.otf} {AdobeKaitiStd-Regular.otf} + {AdobeHeitiStd-Regular.otf} {AdobeHeitiStd-Regular.otf} + {AdobeFangsongStd-Regular.otf} + \ctex_set_upfamily:nnn { zhsong } { upzhserif } {} + \ctex_set_upfamily:nnn { zhhei } { upzhsans } {} + \ctex_set_upfamily:nnn { zhfs } { upzhmono} {} + \ctex_set_upfamily:nnn { zhkai } { upzhserifit } {} + } + { + \setCJKmainfont + [ + BoldFont = AdobeHeitiStd-Regular , + ItalicFont = AdobeKaitiStd-Regular + ] { AdobeSongStd-Light } + \setCJKsansfont { AdobeHeitiStd-Regular} + \setCJKmonofont { AdobeFangsongStd-Regular} + \setCJKfamilyfont { zhsong } { AdobeSongStd-Light } + \setCJKfamilyfont { zhhei } { AdobeHeitiStd-Regular } + \setCJKfamilyfont { zhfs } { AdobeFangsongStd-Regular } + \setCJKfamilyfont { zhkai } { AdobeKaitiStd-Regular } + } } % \end{macrocode} % @@ -8645,17 +9258,30 @@ This package consists of the file ctex.dtx, and the derived files } } { - \setCJKmainfont - [ Extension = .otf , BoldFont = FandolSong-Bold , ItalicFont = FandolKai-Regular ] - { FandolSong-Regular } - \setCJKsansfont [ Extension = .otf , BoldFont = FandolHei-Bold ] { FandolHei-Regular } - \setCJKmonofont [ Extension = .otf ] { FandolFang-Regular } - \setCJKfamilyfont { zhsong } - [ Extension = .otf , BoldFont = FandolSong-Bold ] { FandolSong-Regular } - \setCJKfamilyfont { zhhei } - [ Extension = .otf , BoldFont = FandolHei-Bold ] { FandolHei-Regular } - \setCJKfamilyfont { zhfs } [ Extension = .otf ] { FandolFang-Regular } - \setCJKfamilyfont { zhkai } [ Extension = .otf ] { FandolKai-Regular } + \sys_if_engine_uptex:TF + { + \ctex_set_upfonts:nnnnnn + {FandolSong-Regular.otf} {FandolSong-Bold.otf} {FandolKai-Regular.otf} + {FandolHei-Regular.otf} {FandolHei-Bold.otf} + {FandolFang-Regular.otf} + \ctex_set_upfamily:nnn { zhsong } { upzhserif } { upzhserifb } + \ctex_set_upfamily:nnn { zhhei } { upzhsans } { upzhsansb } + \ctex_set_upfamily:nnn { zhfs } { upzhmono} {} + \ctex_set_upfamily:nnn { zhkai } { upzhserifit } {} + } + { + \setCJKmainfont + [ Extension = .otf , BoldFont = FandolSong-Bold , ItalicFont = FandolKai-Regular ] + { FandolSong-Regular } + \setCJKsansfont [ Extension = .otf , BoldFont = FandolHei-Bold ] { FandolHei-Regular } + \setCJKmonofont [ Extension = .otf ] { FandolFang-Regular } + \setCJKfamilyfont { zhsong } + [ Extension = .otf , BoldFont = FandolSong-Bold ] { FandolSong-Regular } + \setCJKfamilyfont { zhhei } + [ Extension = .otf , BoldFont = FandolHei-Bold ] { FandolHei-Regular } + \setCJKfamilyfont { zhfs } [ Extension = .otf ] { FandolFang-Regular } + \setCJKfamilyfont { zhkai } [ Extension = .otf ] { FandolKai-Regular } + } } % \end{macrocode} % @@ -8730,17 +9356,24 @@ This package consists of the file ctex.dtx, and the derived files % 在 \pdfTeX{} 下生成的 PDF 只有方框^^A % \footnote{\url{http://www.newsmth.net/bbscon.php?bid=460&id=312640}}。 % 华文细黑和华文仿宋的情况类似。 +% 这确认为 \dvipdfmx{} 的 bug^^A +% \begingroup\makeatletter\@makeother\#\@firstofone{\endgroup +% \footnote{\url{https://github.com/clerkma/ptex-ng/blob/master/texk/libdpx/cidtype2.c#L597}}}。 % \begin{macrocode} \sys_if_engine_pdftex:TF { \ctex_fontset_error:n { mac } } { - \setCJKmainfont [ BoldFont = STHeiti , ItalicFont = STKaiti ] { STSong } - \setCJKsansfont [ BoldFont = STHeiti ] { STXihei } - \setCJKmonofont { STFangsong } - \setCJKfamilyfont { zhsong } { STSong } - \setCJKfamilyfont { zhhei } { STHeiti } - \setCJKfamilyfont { zhfs } { STFangsong } - \setCJKfamilyfont { zhkai } { STKaiti } + \sys_if_engine_uptex:TF + { \ctex_fontset_error:n { mac } } + { + \setCJKmainfont [ BoldFont = STHeiti , ItalicFont = STKaiti ] { STSong } + \setCJKsansfont [ BoldFont = STHeiti ] { STXihei } + \setCJKmonofont { STFangsong } + \setCJKfamilyfont { zhsong } { STSong } + \setCJKfamilyfont { zhhei } { STHeiti } + \setCJKfamilyfont { zhfs } { STFangsong } + \setCJKfamilyfont { zhkai } { STKaiti } + } } % \end{macrocode} % @@ -8785,8 +9418,24 @@ This package consists of the file ctex.dtx, and the derived files { \ctex_fontset_error:n { founder } } } { - \setCJKmainfont - [ BoldFont = FZXiaoBiaoSong-B05 , ItalicFont = FZKai-Z03 ] { FZShuSong-Z01 } + \sys_if_engine_uptex:TF + { + \ctex_set_upfonts:nnnnnn + { FZSSK.TTF } { FZXBSK.TTF } { FZKTK.TTF } + { FZXH1K.TTF } { FZHTK.TTF } + { FZFSK.TTF } + \ctex_set_upfamily:nnn { zhsong } { upzhserif } { upzhserifb } + \ctex_set_upfamily:nnn { zhhei } { upzhsans } { upzhsansb } + \ctex_set_upfamily:nnn { zhfs } { upzhmono} {} + \ctex_set_upfamily:nnn { zhkai } { upzhserifit } {} + \ctex_set_upfamily:nnn { zhli } { upschrm } {} + \ctex_set_upmap:nnn { upstsl } { FZLSK.TTF } {} + \ctex_set_upfamily:nnn { zhyou } { upschgt } {} + \ctex_set_upmap:nnn { upstht } { FZY1K.TTF } {} + } + { + \setCJKmainfont + [ BoldFont = FZXiaoBiaoSong-B05 , ItalicFont = FZKai-Z03 ] { FZShuSong-Z01 } % \end{macrocode} % % 在 WPS For Linux 附带的 5.00 版和家庭版 5.20 版的“方正细黑一\_GBK”的字体名称 @@ -8797,15 +9446,16 @@ This package consists of the file ctex.dtx, and the derived files % 遂采用汉字名称。由于 \pkg{luaotfload} 不支持汉字名称,故使用 Postscript 名字, % 速度不受影响。 % \begin{macrocode} - \setCJKsansfont [ BoldFont = FZHei-B01 ] - { \sys_if_engine_xetex:TF { 方正细黑一_GBK } { FZXH1K--GBK1-0 } } - \setCJKmonofont { FZFangSong-Z02 } - \setCJKfamilyfont { zhsong } [ BoldFont = FZXiaoBiaoSong-B05 ] { FZShuSong-Z01 } - \setCJKfamilyfont { zhhei } { FZHei-B01 } - \setCJKfamilyfont { zhkai } { FZKai-Z03 } - \setCJKfamilyfont { zhfs } { FZFangSong-Z02 } - \setCJKfamilyfont { zhli } { FZLiShu-S01 } - \setCJKfamilyfont { zhyou } [ BoldFont = FZZhunYuan-M02 ] { FZXiYuan-M01 } + \setCJKsansfont [ BoldFont = FZHei-B01 ] + { \sys_if_engine_xetex:TF { 方正细黑一_GBK } { FZXH1K--GBK1-0 } } + \setCJKmonofont { FZFangSong-Z02 } + \setCJKfamilyfont { zhsong } [ BoldFont = FZXiaoBiaoSong-B05 ] { FZShuSong-Z01 } + \setCJKfamilyfont { zhhei } { FZHei-B01 } + \setCJKfamilyfont { zhkai } { FZKai-Z03 } + \setCJKfamilyfont { zhfs } { FZFangSong-Z02 } + \setCJKfamilyfont { zhli } { FZLiShu-S01 } + \setCJKfamilyfont { zhyou } [ BoldFont = FZZhunYuan-M02 ] { FZXiYuan-M01 } + } } % \end{macrocode} % @@ -8853,13 +9503,25 @@ This package consists of the file ctex.dtx, and the derived files { \ctex_fontset_error:n { ubuntu } } } { - \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 } - \setCJKfamilyfont { zhhei } { WenQuanYi~Zen~Hei } - \setCJKfamilyfont { zhkai } { AR~PL~UKai~CN } + \sys_if_engine_uptex:TF + { + \ctex_set_upfonts:nnnnnn + { uming.ttc } { wqy-zenhei.ttc } { ukai.ttc } + { wqy-zenhei.ttc } { wqy-zenhei.ttc } + { uming.ttc } + \ctex_set_upfamily:nnn { zhsong } { upzhserif } {} + \ctex_set_upfamily:nnn { zhhei } { upzhsans } {} + \ctex_set_upfamily:nnn { zhkai } { upzhserifit } {} + } + { + \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 } + \setCJKfamilyfont { zhhei } { WenQuanYi~Zen~Hei } + \setCJKfamilyfont { zhkai } { AR~PL~UKai~CN } + } } % \end{macrocode} % @@ -8958,7 +9620,7 @@ This package consists of the file ctex.dtx, and the derived files % \begin{macrocode} %<*windows> \ProvidesFile{zhwindowsfonts.tex}% - [2016/02/02 v2.3 Windows font map loader for pdfTeX and DVIPDFMx (CTEX)] + [2016/04/23 v2.4 Windows font map loader for pdfTeX and DVIPDFMx (CTEX)] \ifzhmappdf \pdfmapline{=gbk@UGBK@ <simsun.ttc} @@ -9030,7 +9692,7 @@ This package consists of the file ctex.dtx, and the derived files % \begin{macrocode} %<*adobe> \ProvidesFile{zhadobefonts.tex}% - [2016/02/02 v2.3 Adobe font map loader for DVIPDFMx (CTEX)] + [2016/04/23 v2.4 Adobe font map loader for DVIPDFMx (CTEX)] \ifzhmappdf %% pdfTeX does not support OTF fonts @@ -9066,7 +9728,7 @@ This package consists of the file ctex.dtx, and the derived files % \begin{macrocode} %<*fandol> \ProvidesFile{zhfandolfonts.tex}% - [2016/02/02 v2.3 Fandol font map loader for DVIPDFMx (CTEX)] + [2016/04/23 v2.4 Fandol font map loader for DVIPDFMx (CTEX)] \ifzhmappdf %% pdfTeX does not support OTF fonts @@ -9102,7 +9764,7 @@ This package consists of the file ctex.dtx, and the derived files % \begin{macrocode} %<*founder> \ProvidesFile{zhfounderfonts.tex}% - [2016/02/02 v2.3 Founder font map loader for pdfTeX and DVIPDFMx (CTEX)] + [2016/04/23 v2.4 Founder font map loader for pdfTeX and DVIPDFMx (CTEX)] \ifzhmappdf \pdfmapline{=gbk@UGBK@ <FZSSK.TTF} @@ -9174,7 +9836,7 @@ This package consists of the file ctex.dtx, and the derived files % \begin{macrocode} %<*ubuntu> \ProvidesFile{zhubuntufonts.tex}% - [2016/02/02 v2.3 Ubuntu font map loader for pdfTeX and DVIPDFMx (CTEX)] + [2016/04/23 v2.4 Ubuntu font map loader for pdfTeX and DVIPDFMx (CTEX)] \ifzhmappdf \pdfmapline{=gbk@UGBK@ <uming.ttc} @@ -9379,6 +10041,105 @@ This package consists of the file ctex.dtx, and the derived files %</spa> % \end{macrocode} % +% \subsection{\pkg{translator} 宏包的中文字典} +% +% \begin{macrocode} +%<*dict> +% \end{macrocode} +% +% \changes{v2.4}{2016/02/19}{提供 \pkg{translator} 宏包的中文定理名称翻译。} +% +% 包括 \pkg{ChineseGBK} 和 \pkg{ChineseUTF8} 两种形式,目前只翻译 \pkg{beamer} +% 宏包需要的定理环境名称。 +% +% \begin{macrocode} +%<*theorem> +\providetranslation{Comments}{评论} +\providetranslation{comments}{评论} +\providetranslation{Comment}{评论} +\providetranslation{comment}{评论} +\providetranslation{Corollaries}{推论} +\providetranslation{corollaries}{推论} +\providetranslation{Corollary}{推论} +\providetranslation{corollary}{推论} +\providetranslation{Definitions}{定义} +\providetranslation{definitions}{定义} +\providetranslation{Definition}{定义} +\providetranslation{definition}{定义} +\providetranslation{Examples}{例} +\providetranslation{examples}{例} +\providetranslation{Example}{例} +\providetranslation{example}{例} +\providetranslation{Exercises}{练习} +\providetranslation{exercises}{练习} +\providetranslation{Exercise}{练习} +\providetranslation{exercise}{练习} +\providetranslation{Facts}{事实} +\providetranslation{facts}{事实} +\providetranslation{Fact}{事实} +\providetranslation{fact}{事实} +\providetranslation{Key Lemmas}{关键引理} +\providetranslation{key lemmas}{关键引理} +\providetranslation{Key Lemma}{关键引理} +\providetranslation{key lemma}{关键引理} +\providetranslation{Key Observations}{关键观察} +\providetranslation{key observations}{关键观察} +\providetranslation{Key Observation}{关键观察} +\providetranslation{key observation}{关键观察} +\providetranslation{Lemmas}{引理} +\providetranslation{lemmas}{引理} +\providetranslation{Lemma}{引理} +\providetranslation{lemma}{引理} +\providetranslation{Main Theorems}{主要定理} +\providetranslation{main theorems}{主要定理} +\providetranslation{Main Theorem}{主要定理} +\providetranslation{main theorem}{主要定理} +\providetranslation{Observations}{观察} +\providetranslation{observations}{观察} +\providetranslation{Observation}{观察} +\providetranslation{observation}{观察} +\providetranslation{Problems}{问题} +\providetranslation{problems}{问题} +\providetranslation{Problem}{问题} +\providetranslation{problem}{问题} +\providetranslation{Proofs}{证明} +\providetranslation{proofs}{证明} +\providetranslation{Proof}{证明} +\providetranslation{proof}{证明} +\providetranslation{Proof Sketch}{证明提要} +\providetranslation{Proof sketch}{证明提要} +\providetranslation{proof sketch}{证明提要} +\providetranslation{Proof Sketches}{证明提要} +\providetranslation{Proof sketches}{证明提要} +\providetranslation{proof sketches}{证明提要} +\providetranslation{Sketch of Proof}{证明提要} +\providetranslation{Sketch of Proofs}{证明提要} +\providetranslation{Sketch of proof}{证明提要} +\providetranslation{Sketch of proofs}{证明提要} +\providetranslation{sketch of proof}{证明提要} +\providetranslation{sketch of proofs}{证明提要} +\providetranslation{Propositions}{命题} +\providetranslation{propositions}{命题} +\providetranslation{Proposition}{命题} +\providetranslation{proposition}{命题} +\providetranslation{Remarks}{注} +\providetranslation{remarks}{注} +\providetranslation{Remark}{注} +\providetranslation{remark}{注} +\providetranslation{Solutions}{解} +\providetranslation{solutions}{解} +\providetranslation{Solution}{解} +\providetranslation{solution}{解} +\providetranslation{Theorems}{定理} +\providetranslation{theorems}{定理} +\providetranslation{Theorem}{定理} +\providetranslation{theorem}{定理} +%</theorem> +% \end{macrocode} +% +% \begin{macrocode} +%</dict> +% \end{macrocode} % % \subsection{\pkg{ctexcap} 宏包} % @@ -9588,6 +10349,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{macro} % % \begin{macro}[int]{\ctex_parse_name:NN} +% \changes{v2.4}{2016/04/11}{修复宏名解析错误。} % 用 \tn{DeclareRobustCommand} 定义的宏或者由 \tn{newcommand} 或 \tn{newrobustcmd} % 定义的带一个可选参数的宏第一次展开的结果都不是其实际定义,实际定义被保存在另外的 % 宏中。由这些命令定义的宏的第一次展开结果可以有下面的形式(细节可查阅 \pkg{xpatch} @@ -9647,12 +10409,12 @@ This package consists of the file ctex.dtx, and the derived files { \exp_not:n { #1@protected@ ##3 #1##3 } } { \exp_last_unbraced:Nf \@@_parse_name:w - \token_get_replacement_spec:N ##3 #2 ~ #1 \q_stop + \token_get_replacement_spec:N ##3 #3 ~ #2 \q_stop } { #1##5 ~ } { ##5 ~ } } { - \str_case:onTF { \@@_parse_name:w ##1 #2 ~ #1 \q_stop } + \str_case:onTF { \@@_parse_name:w ##1 #3 ~ #2 \q_stop } { { #1@protected@ ##2 ##4 } { } { #1@ ##4 } { } @@ -9661,7 +10423,7 @@ This package consists of the file ctex.dtx, and the derived files } } } - \cs_new:Npn \@@_parse_name:w ##1 #2 ~ ##2 #1 ##3 \q_stop { ##1##2 } + \cs_new:Npn \@@_parse_name:w ##1 #3 ~ ##2 #2 ##3 \q_stop { ##1##2 } } \use:x { |