diff options
author | Karl Berry <karl@freefriends.org> | 2016-05-15 22:08:12 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-05-15 22:08:12 +0000 |
commit | a7d586c95a2abcb15eac95c2a2531b158fe19a1b (patch) | |
tree | 4f717671246a1eff3c111c43171d6b4fac5c305c /Master/texmf-dist/source/latex/ctex | |
parent | f36e4b262397fbc107ecd9c73f0366fb286c4857 (diff) |
ctex (15may16)
git-svn-id: svn://tug.org/texlive/trunk@41156 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/ctex')
-rw-r--r-- | Master/texmf-dist/source/latex/ctex/ctex.dtx | 102 |
1 files changed, 66 insertions, 36 deletions
diff --git a/Master/texmf-dist/source/latex/ctex/ctex.dtx b/Master/texmf-dist/source/latex/ctex/ctex.dtx index cf14799e05d..ca15d4b916f 100644 --- a/Master/texmf-dist/source/latex/ctex/ctex.dtx +++ b/Master/texmf-dist/source/latex/ctex/ctex.dtx @@ -502,7 +502,7 @@ Copyright and Licence %<founder>\ProvidesExplFile{ctex-fontset-founder.def} %<ubuntu> {Ubuntu fonts definition (CTEX)} %<ubuntu>\ProvidesExplFile{ctex-fontset-ubuntu.def} -%<!driver> {\ExplFileDate}{2.4.1}{\ExplFileDescription} +%<!driver> {\ExplFileDate}{2.4.2}{\ExplFileDescription} %</!(c19|c70|ctexspa|dict)> %<c19&rm>\ProvidesFile{c19rm.fd}% %<c19&sf>\ProvidesFile{c19sf.fd}% @@ -513,9 +513,9 @@ Copyright and Licence %<ctexspa>\ProvidesFile{ctexspa.def}% %<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)] +%<c19|c70> [2016/05/16 v2.4.2 Chinese font definition (CTEX)] +%<ctexspa> [2016/05/16 v2.4.2 Space info for CJKpunct (CTEX)] +%<dict&theorem> [2016/05/16 v2.4.2 Chinese translation for theorem name (CTEX)] %</!(driver|readme|install|zhmap|spa|docstrip)> %<*driver> \documentclass{ctxdoc} @@ -537,7 +537,7 @@ Copyright and Licence % \changes{v2.4}{2015/02/19}{加强 \pkg{beamer} 宏包支持。} % % -% \CheckSum{5581} +% \CheckSum{5600} % % \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 @@ -4152,9 +4152,14 @@ Copyright and Licence } \AtEndUTFCommand { \group_end: } % \end{macrocode} -% 对 \pkg{fontspec} 沿用 \pkg{LuaTeX-ja} 的补丁。 +% \changes{v2.4.2}{2016/05/15}{恢复 \pkg{luatexja} 对 \tn{emshape} 和 +% \tn{eminnershape} 的重定义。} +% 对 \pkg{fontspec} 沿用 \pkg{LuaTeX-ja} 的补丁。但恢复对 \tn{emshape} 和 +% \tn{eminnershape} 的修改。 % \begin{macrocode} \RequirePackage { lltjp-fontspec } +\cs_set:Npn \emshape { \itshape } +\cs_set:Npn \eminnershape { \upshape } % \end{macrocode} % \pkg{lltjp-unicode-math} 让数学符号命令成为普通的文字宏。为了避免它被展开,应该 % 用 \tn{protected} 来定义。 @@ -5554,13 +5559,23 @@ Copyright and Licence % \end{macrocode} % % \begin{macro}{\em} +% \changes{v2.4.2}{2016/05/15}{兼容 \upLaTeX{} 2016/05/07u00 的定义。} % 取消 \upLaTeX{} 对 \tn{em} 使用 |\mcfamily|、|\gtfamily| 命令的重定义,恢复 % \LaTeXe{} 对 \tn{em} 的原始定义。如果用户已经重定义了 \tn{em},则新定义保持 -% 不变。 +% 不变。\upLaTeX{} 2016/05/07u00 的定义有所变化,这一行为可以由用户通过 \pkg{platexrelease} +% 包改变,需要分支处理。 % \begin{macrocode} -\ctex_patch_cmd:Nnn \em - { \mcfamily \upshape \else \gtfamily \itshape } +\ctex_patch_cmd_once:NnnnTF \em + { \ExplSyntaxOff } + { \eminnershape \else \gtfamily \itshape } { \eminnershape \else \itshape } + { } + { + \ctex_patch_cmd:Nnn \em + { \mcfamily \upshape \else \gtfamily \itshape } + { \eminnershape \else \itshape } + } +\cs_set_nopar:Npn \eminnershape { \upshape } % \end{macrocode} % \end{macro} % @@ -9452,7 +9467,7 @@ Copyright and Licence % \begin{macrocode} %<*windows> \ProvidesFile{zhwindowsfonts.tex}% - [2016/04/23 v2.4 Windows font map loader for pdfTeX and DVIPDFMx (CTEX)] + [2016/05/16 v2.4.2 Windows font map loader for pdfTeX and DVIPDFMx (CTEX)] \ifzhmappdf \pdfmapline{=gbk@UGBK@ <simsun.ttc} @@ -9524,7 +9539,7 @@ Copyright and Licence % \begin{macrocode} %<*adobe> \ProvidesFile{zhadobefonts.tex}% - [2016/04/23 v2.4 Adobe font map loader for DVIPDFMx (CTEX)] + [2016/05/16 v2.4.2 Adobe font map loader for DVIPDFMx (CTEX)] \ifzhmappdf %% pdfTeX does not support OTF fonts @@ -9560,7 +9575,7 @@ Copyright and Licence % \begin{macrocode} %<*fandol> \ProvidesFile{zhfandolfonts.tex}% - [2016/04/23 v2.4 Fandol font map loader for DVIPDFMx (CTEX)] + [2016/05/16 v2.4.2 Fandol font map loader for DVIPDFMx (CTEX)] \ifzhmappdf %% pdfTeX does not support OTF fonts @@ -9596,7 +9611,7 @@ Copyright and Licence % \begin{macrocode} %<*founder> \ProvidesFile{zhfounderfonts.tex}% - [2016/04/23 v2.4 Founder font map loader for pdfTeX and DVIPDFMx (CTEX)] + [2016/05/16 v2.4.2 Founder font map loader for pdfTeX and DVIPDFMx (CTEX)] \ifzhmappdf \pdfmapline{=gbk@UGBK@ <FZSSK.TTF} @@ -9668,7 +9683,7 @@ Copyright and Licence % \begin{macrocode} %<*ubuntu> \ProvidesFile{zhubuntufonts.tex}% - [2016/04/23 v2.4 Ubuntu font map loader for pdfTeX and DVIPDFMx (CTEX)] + [2016/05/16 v2.4.2 Ubuntu font map loader for pdfTeX and DVIPDFMx (CTEX)] \ifzhmappdf \pdfmapline{=gbk@UGBK@ <uming.ttc} @@ -10597,15 +10612,7 @@ Copyright and Licence \newcounter{ctexexam} \BeforeBeginEnvironment{function}{\par\nointerlineskip} \AtEndEnvironment{function}{% - \par\xdef\ctexfixprevdepth{\prevdepth=\the\prevdepth\space}% - \ctexfixdescrcoffinyoffset} -%% l3doc 会在 function 环境的 syntax 和 descr 盒子中间加上 \medskipamount 的距离。 -%% 但是若 syntax 盒子为空(未使用 syntax 环境),就会显得不好看。 -%% 此时我们通过将 \medskipamount 设置为零来修正。 -\def\ctexfixdescrcoffinyoffset{% - \aftergroup\aftergroup\aftergroup\ctexzeromedskipamount} -\def\ctexzeromedskipamount{\setlength\medskipamount{\z@skip}} -\AfterEndEnvironment{syntax}{\let\ctexfixdescrcoffinyoffset\relax} + \par\xdef\ctexfixprevdepth{\prevdepth=\the\prevdepth\space}} \AfterEndEnvironment{function}{\ctexfixprevdepth} \AtBeginEnvironment{syntax}{\linespread{1}\ctexplainps\ctexdisableecglue} \BeforeBeginEnvironment{SideBySideExample}{\par\addvspace{\medskipamount}} @@ -10625,21 +10632,44 @@ Copyright and Licence \cs_new_nopar:Npn \zihaopt #1 { \exp_last_unbraced:Nf \tl_head:w - { \prop_item:Nn \c__ctex_font_size_prop {#1} } { } \q_stop + { \prop_item:Nn \c_@@_font_size_prop {#1} } { } \q_stop + } +%% 抑制首段的 \parskip +\ctex_patch_cmd_once:NnnnTF \__codedoc_function_descr_start:w + { } + { \noindent } + { \skip_vertical:n { -\parskip } \noindent } + { \iow_term:n { *** ~ SUCCESS ~ *** } } + { \iow_term:n { *** ~ FAIL ~ *** } } +%% l3doc 会在 function 环境的 syntax 和 descr 盒子中间加上 \medskipamount 的距离。 +%% 但是若 syntax 盒子为空(未使用 syntax 环境),就会显得不好看。 +%% 此时我们通过将 \medskipamount 设置为零来修正。若盒子非空,则将 \parskip 还回去。 +\ctex_preto_cmd:NnnTF \__codedoc_function_assemble: + { } + { \ctex_doc_fix_yoffset: } + { \iow_term:n { *** ~ SUCCESS ~ *** } } + { \iow_term:n { *** ~ FAIL ~ *** } } +\cs_new_protected_nopar:Npn \ctex_doc_fix_yoffset: + { + \box_if_empty:NTF \g__codedoc_syntax_box + { \skip_zero:N \medskipamount } + { \skip_add:Nn \medskipamount { \parskip } } } %% 用 \vtop 让函数名字和语法盒子首行对齐 -\patchcmd \__codedoc_syntax:w +\ctex_patch_cmd_once:NnnnTF \__codedoc_syntax:w + { } { { minipage } { \l__codedoc_syntax_dim } } { { minipage } [t] { \l__codedoc_syntax_dim } } { \iow_term:n { *** ~ SUCCESS ~ *** } } { \iow_term:n { *** ~ FAIL ~ *** } } %% 左侧边注的函数列表采用单倍行距 -\cs_set_protected_nopar:Npx \__codedoc_typeset_names: - { - \exp_not:N \linespread { 1 } - \exp_not:o { \__codedoc_typeset_names: } - } -\patchcmd \__codedoc_macro_typeset_one:n +\ctex_preto_cmd:NnnTF \__codedoc_typeset_names: + { } + { \linespread { 1 } } + { \iow_term:n { *** ~ SUCCESS ~ *** } } + { \iow_term:n { *** ~ FAIL ~ *** } } +\ctex_patch_cmd_once:NnnnTF \__codedoc_macro_typeset_one:n + { } { \vbox_unpack_clear:N } { \linespread { 1 } \selectfont \vbox_unpack_clear:N } { \iow_term:n { *** ~ SUCCESS ~ *** } } @@ -10705,16 +10735,16 @@ Copyright and Licence \DeclareDocumentCommand \GetFileId { m } { \GetFileInfo {#1} - \ior_open:NnTF \g_ctxdoc_ior { \c_sys_jobname_str .id } + \ior_open:NnTF \g_@@_doc_ior { \c_sys_jobname_str .id } { - \ior_get:NN \g_ctxdoc_ior \l_tmpa_tl - \ior_close:N \g_ctxdoc_ior - \exp_after:wN \GetIdInfo \l_tmpa_tl + \ior_get:NN \g_@@_doc_ior \l_@@_tmp_tl + \ior_close:N \g_@@_doc_ior + \exp_after:wN \GetIdInfo \l_@@_tmp_tl } { \GetIdInfo $Id$ } { \fileinfo } } -\iow_new:N \g_ctxdoc_ior +\ior_new:N \g_@@_doc_ior \ExplSyntaxOff \AtBeginDocument{\addtocontents{toc}{\StopSpecialIndexModule}} \pdfstringdefDisableCommands{% |