From 43cc6b933ec42794dc802aed3ef8ca8dbec6c70e Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 3 May 2018 21:02:36 +0000 Subject: ctex[.tds.zip] (3may18) git-svn-id: svn://tug.org/texlive/trunk@47595 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/latex/ctex/ctex.dtx | 157 +++++++++++++++++++++------ Master/texmf-dist/source/latex/ctex/ctex.ins | 6 + 2 files changed, 127 insertions(+), 36 deletions(-) (limited to 'Master/texmf-dist/source/latex/ctex') diff --git a/Master/texmf-dist/source/latex/ctex/ctex.dtx b/Master/texmf-dist/source/latex/ctex/ctex.dtx index 9853d60f19a..d60ea249e4f 100644 --- a/Master/texmf-dist/source/latex/ctex/ctex.dtx +++ b/Master/texmf-dist/source/latex/ctex/ctex.dtx @@ -123,6 +123,8 @@ Copyright and Licence ctex-fontset-adobe.def, ctex-fontset-fandol.def, ctex-fontset-mac.def, + ctex-fontset-macnew.def, + ctex-fontset-macold.def, ctex-fontset-founder.def, ctex-fontset-ubuntu.def, ctexspa.def, @@ -226,6 +228,8 @@ Copyright and Licence ctex-fontset-adobe.def, ctex-fontset-fandol.def, ctex-fontset-mac.def, + ctex-fontset-macnew.def, + ctex-fontset-macold.def, ctex-fontset-founder.def, ctex-fontset-ubuntu.def, ctexspa.def, @@ -295,6 +299,8 @@ Copyright and Licence \file{ctex-fontset-adobe.def} {\from{\jobname.dtx}{fontset,adobe}} \file{ctex-fontset-fandol.def} {\from{\jobname.dtx}{fontset,fandol}} \file{ctex-fontset-mac.def} {\from{\jobname.dtx}{fontset,mac}} + \file{ctex-fontset-macold.def} {\from{\jobname.dtx}{fontset,macold}} + \file{ctex-fontset-macnew.def} {\from{\jobname.dtx}{fontset,macnew}} \file{ctex-fontset-founder.def} {\from{\jobname.dtx}{fontset,founder}} \file{ctex-fontset-ubuntu.def} {\from{\jobname.dtx}{fontset,ubuntu}} \file{translator-theorem-dictionary-ChineseGBK.dict} @@ -383,6 +389,8 @@ Copyright and Licence \Msg{* ctex-fontset-adobe.def *} \Msg{* ctex-fontset-fandol.def *} \Msg{* ctex-fontset-mac.def *} +\Msg{* ctex-fontset-macold.def *} +\Msg{* ctex-fontset-macnew.def *} \Msg{* ctex-fontset-founder.def *} \Msg{* ctex-fontset-ubuntu.def *} \Msg{* ctexspa.def *} @@ -413,7 +421,7 @@ Copyright and Licence %<*!(c19|c70|ctexspa|dict)> %\NeedsTeXFormat{LaTeX2e} %\RequirePackage{expl3} -%<+!driver>\GetIdInfo$Id: ctex.dtx dd8349e 2018-01-28 19:10:52 +0800 Qing Lee $ +%<+!driver>\GetIdInfo$Id: ctex.dtx 096f319 2018-05-02 19:51:41 +0800 Liam Huang $ % {ctex documentation (CTEX)} %\ProvidesExplClass{ctxdoc} % {Chinese adapter in LaTeX (CTEX)} @@ -498,11 +506,15 @@ Copyright and Licence %\ProvidesExplFile{ctex-fontset-fandol.def} % {Mac OS X fonts definition (CTEX)} %\ProvidesExplFile{ctex-fontset-mac.def} +% {Mac OS X fonts definition for El Capitan or later version (CTEX)} +%\ProvidesExplFile{ctex-fontset-macnew.def} +% {Mac OS X fonts definition for Yosemite or earlier version (CTEX)} +%\ProvidesExplFile{ctex-fontset-macold.def} % {Founder fonts definition (CTEX)} %\ProvidesExplFile{ctex-fontset-founder.def} % {Ubuntu fonts definition (CTEX)} %\ProvidesExplFile{ctex-fontset-ubuntu.def} -% {\ExplFileDate}{2.4.12}{\ExplFileDescription} +% {\ExplFileDate}{2.4.14}{\ExplFileDescription} % %\ProvidesFile{c19rm.fd}% %\ProvidesFile{c19sf.fd}% @@ -513,9 +525,9 @@ Copyright and Licence %\ProvidesFile{ctexspa.def}% %\ProvidesDictionary{translator-theorem-dictionary}{ChineseGBK}% %\ProvidesDictionary{translator-theorem-dictionary}{ChineseUTF8}% -% [2018/01/28 v2.4.12 Chinese font definition (CTEX)] -% [2018/01/28 v2.4.12 Space info for CJKpunct (CTEX)] -% [2018/01/28 v2.4.12 Chinese translation for theorem name (CTEX)] +% [2018/05/01 v2.4.14 Chinese font definition (CTEX)] +% [2018/05/01 v2.4.14 Space info for CJKpunct (CTEX)] +% [2018/05/01 v2.4.14 Chinese translation for theorem name (CTEX)] % %<*driver> \documentclass{ctxdoc} @@ -538,7 +550,7 @@ Copyright and Licence % \changes{v2.4.12}{2018/01/13}{同步 \LaTeXiii{} 2017/12/16。} % % -% \CheckSum{5909} +% \CheckSum{5933} % % \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 @@ -955,7 +967,7 @@ Copyright and Licence % \begin{function}[added=2014-03-08]{fontset} % \begin{syntax} % fontset =^^A -% +% % \end{syntax} % 指定 \CTeX{} 宏集加载的字库。 % @@ -969,7 +981,9 @@ Copyright and Licence % \item[adobe] 使用 Adobe 公司的四款中文字体,\emph{不支持 \pdfLaTeX}。 % \item[fandol] 使用 Fandol 中文字体,\emph{不支持 \pdfLaTeX}。 % \item[founder] 使用方正公司的中文字体。 -% \item[mac] 使用 Mac OS X 系统下的华文字体,\emph{不支持 (pdf)\LaTeX}。 +% \item[mac] 使用 Mac OS X 系统下的字体,\emph{不支持 (pdf)\LaTeX}。 +% \item[macnew] 使用 El Capitan 或之后的多字重宋体、苹方黑体。 +% \item[macold] 使用 Yosemite 或之前的华文字库。 % \item[ubuntu] 使用 Ubuntu 系统下的文泉驿和文鼎字体。 % \item[windows] 使用简体中文 Windows 系统下的中文字体,自动判断 Windows 系 % 统版本,采用 |windowsnew| 或 |windowsold| 的设置。 @@ -1008,7 +1022,8 @@ Copyright and Licence % \end{document} % \end{ctexexam} % -% \CTeX{} 宏集预定义的中文字库还定义了一些字体命令。 +% \CTeX{} 宏集预定义的中文字库还定义了一些字体命令。除了在 \opt{ubuntu} 字库中没有 +% \tn{fangsong} 的定义外,所有字库都有以下四个字体命令。 % % \begin{optdesc} % \item[\tn{songti}] 宋体,CJK 等价命令 |\CJKfamily{zhsong}|。 @@ -1016,17 +1031,23 @@ Copyright and Licence % \item[\tn{fangsong}] 仿宋,CJK 等价命令 |\CJKfamily{zhfs}|。 % \item[\tn{kaishu}] 楷书,CJK 等价命令 |\CJKfamily{zhkai}|。 % \end{optdesc} -% 其中 \tn{fangsong} 在 \opt{ubuntu} 字库中没有定义。在 -% \opt{windows} 和 \opt{founder} 字库中,还有 \tn{lishu} 和 \tn{youyuan}。 +% +% 在 \opt{windows} 和 \opt{founder} 字库中,额外定义了 \tn{lishu} 和 \tn{youyuan}。 % \begin{optdesc} % \item[\tn{lishu}] 隶书,CJK 等价命令 |\CJKfamily{zhli}|。 % \item[\tn{youyuan}] 圆体,CJK 等价命令 |\CJKfamily{zhyou}|。 % \end{optdesc} -% 在 \opt{windowsnew} 字库中,还有 \tn{yahei}。 +% 在 \opt{windowsnew} 和 \opt{macnew} 字库中,还有 \tn{yahei}。 +% 其中在 \opt{macnew} 字库中,\tn{yahei} 实际调用苹方黑体。此举乃是为了更好的兼容性而设。 % \begin{optdesc} % \item[\tn{yahei}] 微软雅黑,CJK 等价命令 |\CJKfamily{zhyahei}|。 % \end{optdesc} % +% 在 \opt{macnew} 字库中,还定义了 \tn{pingfang}。 +% \begin{optdesc} +% \item[\tn{pingfang}] 苹方黑体,CJK 等价命令 |\CJKfamily{zhpf}|。 +% \end{optdesc} +% % \section{排版格式设定} % \label{sec:format-settings} % \subsection{文档默认字号} @@ -2866,30 +2887,32 @@ Copyright and Licence % \item \pkg{zhmCJK} 宏包,它还依赖 \pkg{oberdiek} 宏集。 % \item[\ding{229}] 以上是使用 \pdfLaTeX{} 或 \LaTeX{} + \dvipdfmx{} 的编译方式所需要 % 的依赖项,其中 \pkg{zhmCJK} 是可选的。 -% \item \pkg{xeCJK} 宏包,它还依赖 +% \item \pkg{xeCJK} 宏集,它还依赖 % \begin{itemize} -% \item \pkg{fontspec} 宏包,它还依赖 -% \begin{itemize} -% \item \pkg{euenc} 宏包。 -% \item \pkg{xunicode} 宏包,它还依赖 -% \begin{itemize} -% \item \pkg{graphics} 宏集。 -% \item \pkg{graphics-cfg} 宏包。 -% \item \pkg{graphics-def} 宏包。 -% \end{itemize} -% \end{itemize} +% \item \pkg{xtemplate} 宏包,它属于 \pkg{l3packages} 宏集。 +% \item \pkg{fontspec} 宏包。 % \end{itemize} % \item \pkg{environ} 宏包,它还依赖 \pkg{trimspaces} 宏包。 % \item[\ding{229}] 以上是使用 \XeLaTeX{} 编译时的依赖项。 -% \item \pkg{LuaTeX-ja} 宏集,它还依赖 +% \item \pkg{luatexja} 宏包,它还依赖 % \begin{itemize} % \item \pkg{adobemapping} 宏包。 -% \item \pkg{fontspec} 宏包。 % \item \pkg{lualibs} 宏包。 % \item \pkg{luaotfload} 宏包。 % \item \pkg{luatexbase} 宏包,它还依赖 \pkg{ctablestack} 宏包。 % \item \pkg{oberdiek} 宏集。 % \item \pkg{xkeyval} 宏包。 +% \item \pkg{etoolbox} 宏包。 +% \end{itemize} +% \item \pkg{fontspec} 宏包。 +% \item \pkg{xunicode-addon} 宏包,属于 \pkg{xeCJK} 宏集,它还依赖 +% \begin{itemize} +% \item \pkg{xunicode} 宏包,它还依赖 +% \begin{itemize} +% \item \pkg{graphics} 宏集。 +% \item \pkg{graphics-cfg} 宏包。 +% \item \pkg{graphics-def} 宏包。 +% \end{itemize} % \end{itemize} % \item[\ding{229}] 以上是使用 \LuaLaTeX{} 编译时的依赖项。 % \item \pkg{pxeverysel} 宏包,属于 \pkg{platex-tools} 宏集。 @@ -5763,6 +5786,11 @@ Copyright and Licence \ctex_at_end_preamble:n { \ctex_update_default_family: } % \end{macrocode} % +% 使修改立刻生效,保证导言区字体族正确。 +% \begin{macrocode} +\normalfont +% \end{macrocode} +% % \begin{macro}[int]{\em} % \changes{v2.4.2}{2016/05/15}{兼容 \upLaTeX{} 2016/05/07u00 的定义。} % 取消 \upLaTeX{} 对 \tn{em} 使用 |\mcfamily|、|\gtfamily| 命令的重定义,恢复 @@ -6281,6 +6309,8 @@ Copyright and Licence % % \subsubsection{其它} % +% \changes{v2.4.13}{2018/03/23}{修正导言区 \tn{selectfont} 钩子位置。} +% % \begin{macro}[int]{\ctex_add_to_selectfont:n,\CTEX@selectfont@hook} % \tn{EverySelectfont} 直到文档开始时才有效。为了 \tn{ccwd} 和 \pkg{LuaTeX-ja} 的 % 字体设置在导言区也可用,我们还需要在这里手工修改 \tn{selectfont}。\pkg{everysel} @@ -6309,8 +6339,10 @@ Copyright and Licence } \ctex_parse_name:NN \@@_tmp:N \selectfont \exp_last_unbraced:NNo \group_end: - \ctex_preto_cmd:NnnTF { \l_@@_tmp_tl } { \ExplSyntaxOff } - { \CTEX@selectfont@hook } + \ctex_patch_cmd_once:NnnnTF { \l_@@_tmp_tl } + { \ExplSyntaxOff } + { \size@update } + { \CTEX@selectfont@hook \size@update } { \@@_restore_selectfont: } { \ctex_patch_failure:N \selectfont } \fi: @@ -9740,10 +9772,24 @@ Copyright and Licence % % \begin{macrocode} % -%<*mac> % \end{macrocode} % % \subsubsection{\pkg{ctex-fontset-mac.def}} +% \changes{v2.4.14}{2018/05/01}{区分 \texttt{macold} 及 \texttt{macnew}。} +% +% 按 \href{https://github.com/CTeX-org/ctex-kit/issues/351}{Issue 351} +% 的讨论,以 El Capitan 为分界,分别设置 |macold|(El Capitan 之前) +% 和 |macnew|(El Capitan 及之后)。检测方式则以 El Capitan 及之后 +% 的苹方字体为准。 +% \begin{macrocode} +%<*mac> +\file_if_exist:nTF { /System/Library/Fonts/PingFang.ttc } + { \ctex_file_input:n { ctex-fontset-macnew.def } } + { \ctex_file_input:n { ctex-fontset-macold.def } } +% +% \end{macrocode} +% +% \subsubsection{\pkg{ctex-fontset-macold.def}} % % OS X Mavericks (10.9) 预装的主要简体中文字体如下^^A % \footnote{\url{http://support.apple.com/kb/HT5944}}: @@ -9813,6 +9859,7 @@ Copyright and Licence % \begingroup\makeatletter\@makeother\#\@firstofone{\endgroup % \footnote{\url{https://github.com/clerkma/ptex-ng/blob/master/texk/libdpx/cidtype2.c#L597}}}。 % \begin{macrocode} +%<*macold> \sys_if_engine_pdftex:TF { \ctex_fontset_error:n { mac } } { @@ -9828,10 +9875,45 @@ Copyright and Licence \setCJKfamilyfont { zhkai } { STKaiti } } } +% +% \end{macrocode} +% +% \subsubsection{\pkg{ctex-fontset-macnew.def}} +% \changes{v2.4.14}{2018/05/01}{配置 \texttt{macnew} 的默认字体设置。} +% +% |macnew| 在默认字体设置方面,引入了多字重的宋体作为罗马字族, +% 以及引入了苹方黑体作为无衬线字族。 +% +% \begin{macrocode} +%<*macnew> +\sys_if_engine_pdftex:TF + { \ctex_fontset_error:n { mac } } + { + \sys_if_engine_uptex:TF + { \ctex_fontset_error:n { mac } } + { + \setCJKmainfont + [ + UprightFont = Songti~SC~Light, + ItalicFont = Kaiti~SC, + BoldItalicFont = Kaiti~SC~Bold + ] { Songti~SC } + \setCJKsansfont { PingFang~SC } + \setCJKmonofont { STFangsong } + \setCJKfamilyfont { zhsong } + [ + UprightFont = Songti~SC~Light, + ] { Songti~SC } + \setCJKfamilyfont { zhhei } { Heiti~SC } + \setCJKfamilyfont { zhpf } { PingFang~SC } + \setCJKfamilyfont { zhfs } { STFangsong } + \setCJKfamilyfont { zhkai } { Kaiti~SC } + } + } +% % \end{macrocode} % % \begin{macrocode} -% %<*founder> % \end{macrocode} % @@ -9983,9 +10065,10 @@ Copyright and Licence % \end{macrocode} % % \subsubsection{中文字体命令} +% \changes{v2.4.14}{2018/05/01}{为 \texttt{macnew} 配置字体命令。} % % \begin{macrocode} -%<*!windows> +%<*!windows&!mac> % \end{macrocode} % % \begin{macrocode} @@ -9998,10 +10081,12 @@ Copyright and Licence \NewDocumentCommand \youyuan { } { \CJKfamily { zhyou } } % %\NewDocumentCommand \yahei { } { \CJKfamily { zhyahei } } +%\NewDocumentCommand \yahei { } { \CJKfamily { zhpf } } +%\NewDocumentCommand \pingfang { } { \CJKfamily { zhpf } } % \end{macrocode} % % \begin{macrocode} -% +% % %<*zhmap> % \end{macrocode} @@ -10073,7 +10158,7 @@ Copyright and Licence % \begin{macrocode} %<*windows> \ProvidesFile{zhwindowsfonts.tex}% - [2018/01/28 v2.4.12 Windows font map loader for pdfTeX and DVIPDFMx (CTEX)] + [2018/05/01 v2.4.14 Windows font map loader for pdfTeX and DVIPDFMx (CTEX)] \ifzhmappdf \pdfmapline{=gbk@UGBK@ \ProvidesFile{zhadobefonts.tex}% - [2018/01/28 v2.4.12 Adobe font map loader for DVIPDFMx (CTEX)] + [2018/05/01 v2.4.14 Adobe font map loader for DVIPDFMx (CTEX)] \ifzhmappdf %% pdfTeX does not support OTF fonts @@ -10181,7 +10266,7 @@ Copyright and Licence % \begin{macrocode} %<*fandol> \ProvidesFile{zhfandolfonts.tex}% - [2018/01/28 v2.4.12 Fandol font map loader for DVIPDFMx (CTEX)] + [2018/05/01 v2.4.14 Fandol font map loader for DVIPDFMx (CTEX)] \ifzhmappdf %% pdfTeX does not support OTF fonts @@ -10217,7 +10302,7 @@ Copyright and Licence % \begin{macrocode} %<*founder> \ProvidesFile{zhfounderfonts.tex}% - [2018/01/28 v2.4.12 Founder font map loader for pdfTeX and DVIPDFMx (CTEX)] + [2018/05/01 v2.4.14 Founder font map loader for pdfTeX and DVIPDFMx (CTEX)] \ifzhmappdf \pdfmapline{=gbk@UGBK@ \ProvidesFile{zhubuntufonts.tex}% - [2018/01/28 v2.4.12 Ubuntu font map loader for pdfTeX and DVIPDFMx (CTEX)] + [2018/05/01 v2.4.14 Ubuntu font map loader for pdfTeX and DVIPDFMx (CTEX)] \ifzhmappdf \pdfmapline{=gbk@UGBK@