From 1ffd29c330984928904e5f95a4033d334fba974b Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 14 May 2016 22:03:09 +0000 Subject: ctex (14may16) git-svn-id: svn://tug.org/texlive/trunk@41120 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/ctex/README | 89 -- Master/texmf-dist/doc/latex/ctex/README.md | 112 ++ Master/texmf-dist/doc/latex/ctex/ctex.pdf | Bin 1043213 -> 1053660 bytes Master/texmf-dist/source/latex/ctex/ctex.dtx | 1461 +++++++++++--------- Master/texmf-dist/source/latex/ctex/ctex.ins | 283 ++++ Master/texmf-dist/tex/generic/ctex/ctxdocstrip.tex | 69 + .../tex/latex/ctex/config/ctex-name-gbk.cfg | 4 +- .../tex/latex/ctex/config/ctex-name-utf8.cfg | 4 +- Master/texmf-dist/tex/latex/ctex/config/ctex.cfg | 4 +- .../texmf-dist/tex/latex/ctex/config/ctexopts.cfg | 4 +- Master/texmf-dist/tex/latex/ctex/ctex-article.def | 13 +- Master/texmf-dist/tex/latex/ctex/ctex-beamer.def | 13 +- Master/texmf-dist/tex/latex/ctex/ctex-book.def | 45 +- Master/texmf-dist/tex/latex/ctex/ctex-c5size.clo | 4 +- Master/texmf-dist/tex/latex/ctex/ctex-cs4size.clo | 4 +- Master/texmf-dist/tex/latex/ctex/ctex-report.def | 45 +- Master/texmf-dist/tex/latex/ctex/ctex.sty | 29 +- Master/texmf-dist/tex/latex/ctex/ctexart.cls | 38 +- Master/texmf-dist/tex/latex/ctex/ctexbeamer.cls | 38 +- Master/texmf-dist/tex/latex/ctex/ctexbook.cls | 70 +- Master/texmf-dist/tex/latex/ctex/ctexcap.sty | 4 +- Master/texmf-dist/tex/latex/ctex/ctexheading.sty | 9 +- Master/texmf-dist/tex/latex/ctex/ctexhook.sty | 4 +- Master/texmf-dist/tex/latex/ctex/ctexpatch.sty | 30 +- Master/texmf-dist/tex/latex/ctex/ctexrep.cls | 70 +- Master/texmf-dist/tex/latex/ctex/ctexsize.sty | 11 +- Master/texmf-dist/tex/latex/ctex/ctxdoc.cls | 360 +++++ .../tex/latex/ctex/engine/ctex-engine-aptex.def | 246 ++++ .../tex/latex/ctex/engine/ctex-engine-luatex.def | 32 +- .../tex/latex/ctex/engine/ctex-engine-pdftex.def | 4 +- .../tex/latex/ctex/engine/ctex-engine-uptex.def | 69 +- .../tex/latex/ctex/engine/ctex-engine-xetex.def | 4 +- .../tex/latex/ctex/fontset/ctex-fontset-adobe.def | 4 +- .../tex/latex/ctex/fontset/ctex-fontset-fandol.def | 4 +- .../latex/ctex/fontset/ctex-fontset-founder.def | 4 +- .../tex/latex/ctex/fontset/ctex-fontset-mac.def | 4 +- .../tex/latex/ctex/fontset/ctex-fontset-ubuntu.def | 4 +- .../latex/ctex/fontset/ctex-fontset-windows.def | 6 +- .../latex/ctex/fontset/ctex-fontset-windowsnew.def | 16 +- .../latex/ctex/fontset/ctex-fontset-windowsold.def | 4 +- .../ctex/scheme/ctex-scheme-chinese-article.def | 12 +- .../ctex/scheme/ctex-scheme-chinese-beamer.def | 14 +- .../latex/ctex/scheme/ctex-scheme-chinese-book.def | 12 +- .../ctex/scheme/ctex-scheme-chinese-report.def | 12 +- .../tex/latex/ctex/scheme/ctex-scheme-chinese.def | 48 +- .../ctex/scheme/ctex-scheme-plain-article.def | 4 +- .../latex/ctex/scheme/ctex-scheme-plain-beamer.def | 4 +- .../latex/ctex/scheme/ctex-scheme-plain-book.def | 4 +- .../latex/ctex/scheme/ctex-scheme-plain-report.def | 4 +- .../tex/latex/ctex/scheme/ctex-scheme-plain.def | 4 +- 50 files changed, 2371 insertions(+), 965 deletions(-) delete mode 100644 Master/texmf-dist/doc/latex/ctex/README create mode 100644 Master/texmf-dist/doc/latex/ctex/README.md create mode 100644 Master/texmf-dist/source/latex/ctex/ctex.ins create mode 100644 Master/texmf-dist/tex/generic/ctex/ctxdocstrip.tex create mode 100644 Master/texmf-dist/tex/latex/ctex/ctxdoc.cls create mode 100644 Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-aptex.def (limited to 'Master') diff --git a/Master/texmf-dist/doc/latex/ctex/README b/Master/texmf-dist/doc/latex/ctex/README deleted file mode 100644 index ed1ec51c827..00000000000 --- a/Master/texmf-dist/doc/latex/ctex/README +++ /dev/null @@ -1,89 +0,0 @@ -ctex is a collection of macro packages and document classes -for LaTeX Chinese typesetting. - -This package is licensed in LPPL. - -The authors and contributors of this package are: - - * Wu Lingyun - * Jiang Jiang - * Wang Yue - * Liu Haiyang - * Li Yanrui - * Chen Zhichu - * Li Qing - * Liam Huang - -If you are interested in the process of development you -may observe - - https://github.com/CTeX-org/ctex-kit - -Report feedback in the Issues section of ctex-kit project, -or in [ctex](http://bbs.ctex.org) forum. - -This package consists of the file ctex.dtx, and the derived files - - ctex.pdf, - ctex.ins, - ctex.sty, - ctexsize.sty, - ctexheading.sty, - ctexart.cls, - ctexbook.cls, - ctexrep.cls, - ctexbeamer.cls, - ctexcap.sty, - ctexhook.sty, - ctexpatch.sty, - ctex-c5size.clo, - ctex-cs4size.clo, - 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, - ctexopts.cfg, - ctex-engine-pdftex.def, - ctex-engine-xetex.def, - ctex-engine-luatex.def, - ctex-engine-uptex.def, - c19rm.fd, - c19sf.fd, - c19tt.fd, - c70rm.fd, - c70sf.fd, - c70tt.fd, - ctex-fontset-windows.def, - ctex-fontset-windowsnew.def, - ctex-fontset-windowsold.def, - ctex-fontset-adobe.def, - ctex-fontset-fandol.def, - ctex-fontset-mac.def, - ctex-fontset-founder.def, - ctex-fontset-ubuntu.def, - ctexspa.def, - ctexpunct.spa, - ctexmakespa.tex, - ctexspamacro.tex, - zhadobefonts.tex, - zhfandolfonts.tex, - zhfounderfonts.tex, - zhubuntufonts.tex, - zhwindowsfonts.tex, - translator-theorem-dictionary-ChineseGBK.dict, - translator-theorem-dictionary-ChineseUTF8.dict, and - README (this file). - diff --git a/Master/texmf-dist/doc/latex/ctex/README.md b/Master/texmf-dist/doc/latex/ctex/README.md new file mode 100644 index 00000000000..f3dac07a9cd --- /dev/null +++ b/Master/texmf-dist/doc/latex/ctex/README.md @@ -0,0 +1,112 @@ +ctex +==== + +`ctex` is a collection of macro packages and document classes +for LaTeX Chinese typesetting. + +Authors and Contributors +------------------------ + +* Wu Lingyun +* Jiang Jiang +* Wang Yue +* Liu Haiyang +* Li Yanrui +* Chen Zhichu +* Li Qing +* Liam Huang + +Contributing +------------ + +This package is a part of the [ctex-kit](https://github.com/CTeX-org/ctex-kit) project. + +Issues and pull requests are welcome. + +Copyright and Licence +--------------------- + + Copyright (C) 2003--2016 + CTEX.ORG and any individual authors listed elsewhere in this file. + ---------------------------------------------------------------------- + + This work may be distributed and/or modified under the + conditions of the LaTeX Project Public License, either + version 1.3c of this license or (at your option) any later + version. This version of this license is in + http://www.latex-project.org/lppl/lppl-1-3c.txt + and the latest version of this license is in + http://www.latex-project.org/lppl.txt + and version 1.3 or later is part of all distributions of + LaTeX version 2005/12/01 or later. + + This work has the LPPL maintenance status `maintained'. + + The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang. + + This package consists of the file ctex.dtx, + and the derived files ctex.pdf, + ctex.ins, + ctex.sty, + ctexsize.sty, + ctexheading.sty, + ctexart.cls, + ctexbook.cls, + ctexrep.cls, + ctexbeamer.cls, + ctxdoc.cls, + ctexcap.sty, + ctexhook.sty, + ctexpatch.sty, + ctex-c5size.clo, + ctex-cs4size.clo, + 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, + ctexopts.cfg, + ctex-engine-pdftex.def, + ctex-engine-xetex.def, + ctex-engine-luatex.def, + ctex-engine-aptex.def, + ctex-engine-uptex.def, + c19rm.fd, + c19sf.fd, + c19tt.fd, + c70rm.fd, + c70sf.fd, + c70tt.fd, + ctex-fontset-windows.def, + ctex-fontset-windowsnew.def, + ctex-fontset-windowsold.def, + ctex-fontset-adobe.def, + ctex-fontset-fandol.def, + ctex-fontset-mac.def, + ctex-fontset-founder.def, + ctex-fontset-ubuntu.def, + ctexspa.def, + ctexpunct.spa, + ctexmakespa.tex, + ctexspamacro.tex, + ctxdocstrip.tex, + zhadobefonts.tex, + zhfandolfonts.tex, + zhfounderfonts.tex, + zhubuntufonts.tex, + zhwindowsfonts.tex, + translator-theorem-dictionary-ChineseGBK.dict, + translator-theorem-dictionary-ChineseUTF8.dict, and + README.md (this file). diff --git a/Master/texmf-dist/doc/latex/ctex/ctex.pdf b/Master/texmf-dist/doc/latex/ctex/ctex.pdf index 775f3b59615..e395193c598 100644 Binary files a/Master/texmf-dist/doc/latex/ctex/ctex.pdf and b/Master/texmf-dist/doc/latex/ctex/ctex.pdf differ diff --git a/Master/texmf-dist/source/latex/ctex/ctex.dtx b/Master/texmf-dist/source/latex/ctex/ctex.dtx index 42507c1bb6a..cf14799e05d 100644 --- a/Master/texmf-dist/source/latex/ctex/ctex.dtx +++ b/Master/texmf-dist/source/latex/ctex/ctex.dtx @@ -26,95 +26,118 @@ \iffalse % %<*readme> -ctex is a collection of macro packages and document classes +ctex +==== + +`ctex` is a collection of macro packages and document classes for LaTeX Chinese typesetting. -This package is licensed in LPPL. +Authors and Contributors +------------------------ + +* Wu Lingyun +* Jiang Jiang +* Wang Yue +* Liu Haiyang +* Li Yanrui +* Chen Zhichu +* Li Qing +* Liam Huang -The authors and contributors of this package are: +Contributing +------------ - * Wu Lingyun - * Jiang Jiang - * Wang Yue - * Liu Haiyang - * Li Yanrui - * Chen Zhichu - * Li Qing - * Liam Huang +This package is a part of the [ctex-kit](https://github.com/CTeX-org/ctex-kit) project. -If you are interested in the process of development you -may observe +Issues and pull requests are welcome. - https://github.com/CTeX-org/ctex-kit +Copyright and Licence +--------------------- + + Copyright (C) 2003--2016 + CTEX.ORG and any individual authors listed elsewhere in this file. + ---------------------------------------------------------------------- -Report feedback in the Issues section of ctex-kit project, -or in [ctex](http://bbs.ctex.org) forum. + This work may be distributed and/or modified under the + conditions of the LaTeX Project Public License, either + version 1.3c of this license or (at your option) any later + version. This version of this license is in + http://www.latex-project.org/lppl/lppl-1-3c.txt + and the latest version of this license is in + http://www.latex-project.org/lppl.txt + and version 1.3 or later is part of all distributions of + LaTeX version 2005/12/01 or later. -This package consists of the file ctex.dtx, and the derived files + This work has the LPPL maintenance status `maintained'. - ctex.pdf, - ctex.ins, - ctex.sty, - ctexsize.sty, - ctexheading.sty, - ctexart.cls, - ctexbook.cls, - ctexrep.cls, - ctexbeamer.cls, - ctexcap.sty, - ctexhook.sty, - ctexpatch.sty, - ctex-c5size.clo, - ctex-cs4size.clo, - 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, - ctexopts.cfg, - ctex-engine-pdftex.def, - ctex-engine-xetex.def, - ctex-engine-luatex.def, - ctex-engine-uptex.def, - c19rm.fd, - c19sf.fd, - c19tt.fd, - c70rm.fd, - c70sf.fd, - c70tt.fd, - ctex-fontset-windows.def, - ctex-fontset-windowsnew.def, - ctex-fontset-windowsold.def, - ctex-fontset-adobe.def, - ctex-fontset-fandol.def, - ctex-fontset-mac.def, - ctex-fontset-founder.def, - ctex-fontset-ubuntu.def, - ctexspa.def, - ctexpunct.spa, - ctexmakespa.tex, - ctexspamacro.tex, - zhadobefonts.tex, - zhfandolfonts.tex, - zhfounderfonts.tex, - zhubuntufonts.tex, - zhwindowsfonts.tex, - translator-theorem-dictionary-ChineseGBK.dict, - translator-theorem-dictionary-ChineseUTF8.dict, and - README (this file). + The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang. + This package consists of the file ctex.dtx, + and the derived files ctex.pdf, + ctex.ins, + ctex.sty, + ctexsize.sty, + ctexheading.sty, + ctexart.cls, + ctexbook.cls, + ctexrep.cls, + ctexbeamer.cls, + ctxdoc.cls, + ctexcap.sty, + ctexhook.sty, + ctexpatch.sty, + ctex-c5size.clo, + ctex-cs4size.clo, + 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, + ctexopts.cfg, + ctex-engine-pdftex.def, + ctex-engine-xetex.def, + ctex-engine-luatex.def, + ctex-engine-aptex.def, + ctex-engine-uptex.def, + c19rm.fd, + c19sf.fd, + c19tt.fd, + c70rm.fd, + c70sf.fd, + c70tt.fd, + ctex-fontset-windows.def, + ctex-fontset-windowsnew.def, + ctex-fontset-windowsold.def, + ctex-fontset-adobe.def, + ctex-fontset-fandol.def, + ctex-fontset-mac.def, + ctex-fontset-founder.def, + ctex-fontset-ubuntu.def, + ctexspa.def, + ctexpunct.spa, + ctexmakespa.tex, + ctexspamacro.tex, + ctxdocstrip.tex, + zhadobefonts.tex, + zhfandolfonts.tex, + zhfounderfonts.tex, + zhubuntufonts.tex, + zhwindowsfonts.tex, + translator-theorem-dictionary-ChineseGBK.dict, + translator-theorem-dictionary-ChineseUTF8.dict, and + README.md (this file). % %<*internal> \fi @@ -125,50 +148,7 @@ This package consists of the file ctex.dtx, and the derived files % %<*install> -\newread\inputcheck -\openin\inputcheck=ctex.ver -\ifeof\inputcheck - \def\ctexPutVersion{\string\GetIdInfo$Id$} -\else - \input ctex.ver -\fi -\closein\inputcheck - -\input l3docstrip.tex - -\def\checkOption<#1{% - \ifcase - \ifx*#10\else \ifx/#11\else - \ifx+#12\else \ifx-#13\else - \ifx<#14\else \ifx @#15\else - \ifx.#16\else - 7\fi\fi\fi\fi\fi\fi\fi\relax - \expandafter\starOption\or - \expandafter\slashOption\or - \expandafter\plusOption\or - \expandafter\minusOption\or - \expandafter\verbOption\or - \expandafter\moduleOption\or - \expandafter\expOption\or - \expandafter\doOption\fi - #1% -} -\def\expOption .#1>#2\endLine{% - \maybeMsg{<.#1 . >}% - \Evaluate{#1}% - \begingroup - \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 - \xdef\expandedLineStuff{\scantokens{#2\noexpand}}% - \endgroup - \def\do##1##2##3{% - \if1\Expr{##2}\StreamPut##1{\expandedLineStuff}\fi - }% - \activefiles - } - - -\keepsilent -\askforoverwritefalse +\input ctxdocstrip % \preamble @@ -193,7 +173,6 @@ This package consists of the file ctex.dtx, and the derived files ------------------------------------------------------------------------------ \endpreamble - \postamble This package consists of the file ctex.dtx, @@ -206,6 +185,7 @@ This package consists of the file ctex.dtx, and the derived files ctexbook.cls, ctexrep.cls, ctexbeamer.cls, + ctxdoc.cls, ctexcap.sty, ctexhook.sty, ctexpatch.sty, @@ -232,6 +212,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-aptex.def, ctex-engine-uptex.def, c19rm.fd, c19sf.fd, @@ -251,6 +232,7 @@ This package consists of the file ctex.dtx, and the derived files ctexpunct.spa, ctexmakespa.tex, ctexspamacro.tex, + ctxdocstrip.tex, zhadobefonts.tex, zhfandolfonts.tex, zhfounderfonts.tex, @@ -258,13 +240,9 @@ This package consists of the file ctex.dtx, and the derived files zhwindowsfonts.tex, translator-theorem-dictionary-ChineseGBK.dict, translator-theorem-dictionary-ChineseUTF8.dict, and - README. -\endpostamble - -\declarepostamble\emptypostamble + README.md. \endpostamble - \generate { \usedir{tex/latex/ctex} @@ -276,6 +254,7 @@ This package consists of the file ctex.dtx, and the derived files \file{ctexrep.cls} {\from{\jobname.dtx}{class,report}} \file{ctexbeamer.cls} {\from{\jobname.dtx}{class,beamer}} \usepostamble\emptypostamble + \file{ctxdoc.cls} {\from{\jobname.dtx}{ctxdoc}} \file{ctexcap.sty} {\from{\jobname.dtx}{ctexcap}} \file{ctexhook.sty} {\from{\jobname.dtx}{ctexhook}} \file{ctexpatch.sty} {\from{\jobname.dtx}{ctexpatch}} @@ -302,6 +281,7 @@ This package consists of the file ctex.dtx, and the derived files \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-aptex.def} {\from{\jobname.dtx}{aptex}} \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}} @@ -317,11 +297,16 @@ This package consists of the file ctex.dtx, and the derived files \file{ctex-fontset-mac.def} {\from{\jobname.dtx}{fontset,mac}} \file{ctex-fontset-founder.def} {\from{\jobname.dtx}{fontset,founder}} \file{ctex-fontset-ubuntu.def} {\from{\jobname.dtx}{fontset,ubuntu}} + \file{translator-theorem-dictionary-ChineseGBK.dict} + {\from{\jobname.dtx}{dict,theorem,GBK}} + \file{translator-theorem-dictionary-ChineseUTF8.dict} + {\from{\jobname.dtx}{dict,theorem,UTF8}} \file{ctexspa.def} { \from{\jobname.dtx} {ctexspa} \from{ctexpunct.spa} {} } + \usedir{tex/generic/ctex} \file{ctexmakespa.tex} {\from{\jobname.dtx}{spa,make}} \file{ctexspamacro.tex} {\from{\jobname.dtx}{spa,macro}} \file{zhadobefonts.tex} {\from{\jobname.dtx}{zhmap,adobe}} @@ -329,15 +314,16 @@ 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}} + \file{ctxdocstrip.tex} {\from{\jobname.dtx}{docstrip}} +% +%<*internal> \usedir{source/latex/ctex} \file{\jobname.ins} {\from{\jobname.dtx}{install}} +% +%<*install> \nopreamble\nopostamble \usedir{doc/latex/ctex} - \file{README.txt} {\from{\jobname.dtx}{readme}} + \file{README.md} {\from{\jobname.dtx}{readme}} } \catcode32=12\space @@ -356,6 +342,7 @@ This package consists of the file ctex.dtx, and the derived files \Msg{* ctexbook.cls *} \Msg{* ctexrep.cls *} \Msg{* ctexbeamer.cls *} +\Msg{* ctxdoc.cls *} \Msg{* ctexcap.sty *} \Msg{* ctexhook.sty *} \Msg{* ctexpatch.sty *} @@ -382,6 +369,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-aptex.def *} \Msg{* ctex-engine-uptex.def *} \Msg{* c19rm.fd *} \Msg{* c19sf.fd *} @@ -400,6 +388,7 @@ This package consists of the file ctex.dtx, and the derived files \Msg{* ctexspa.def *} \Msg{* ctexmakespa.tex *} \Msg{* ctexspamacro.tex *} +\Msg{* ctxdocstrip.tex *} \Msg{* zhadobefonts.tex *} \Msg{* zhfandolfonts.tex *} \Msg{* zhfounderfonts.tex *} @@ -420,20 +409,13 @@ This package consists of the file ctex.dtx, and the derived files %<*internal> \fi % -%<*!(readme|install|zhmap|spa)> +%<*!(driver|readme|install|zhmap|spa|docstrip)> %<*!(c19|c70|ctexspa|dict)> -%<*driver|class|style|ctexcap|ctexhook|ctexpatch> -\NeedsTeXFormat{LaTeX2e} -\RequirePackage{expl3} -% -%<.!(readme|install|zhmap|spa|c19|c70|ctexspa)>\ctexPutVersion -%<*driver> -\InputIfFileExists{ctex.ver}{}{ - \def\ctexGetVersionInfo{\GetIdInfo$Id$}} -\ctexGetVersionInfo - {ctex source file} -\ProvidesExplFile{\ExplFileName.\ExplFileExtension} -% +%\NeedsTeXFormat{LaTeX2e} +%\RequirePackage{expl3} +%<+!driver>\GetIdInfo$Id$ +% {ctex documentation (CTEX)} +%\ProvidesExplClass{ctxdoc} % {Chinese adapter in LaTeX (CTEX)} %\ProvidesExplPackage{\ExplFileName} % {Chinese font size definition (CTEX)} @@ -500,6 +482,8 @@ This package consists of the file ctex.dtx, and the derived files %\ProvidesExplFile{ctex-engine-xetex.def} % {LuaLaTeX adapter (CTEX)} %\ProvidesExplFile{ctex-engine-luatex.def} +% {Asian pTeX adapter (CTEX)} +%\ProvidesExplFile{ctex-engine-aptex.def} % {upTeX adapter (CTEX)} %\ProvidesExplFile{ctex-engine-uptex.def} % {Windows fonts definition (CTEX)} @@ -518,294 +502,26 @@ This package consists of the file ctex.dtx, and the derived files %\ProvidesExplFile{ctex-fontset-founder.def} % {Ubuntu fonts definition (CTEX)} %\ProvidesExplFile{ctex-fontset-ubuntu.def} - {\ExplFileDate}{2.4}{\ExplFileDescription} +% {\ExplFileDate}{2.4.1}{\ExplFileDescription} % -%\ProvidesFile{c19rm.fd}% -%\ProvidesFile{c19sf.fd}% -%\ProvidesFile{c19tt.fd}% -%\ProvidesFile{c70rm.fd}% -%\ProvidesFile{c70sf.fd}% -%\ProvidesFile{c70tt.fd}% +%\ProvidesFile{c19rm.fd}% +%\ProvidesFile{c19sf.fd}% +%\ProvidesFile{c19tt.fd}% +%\ProvidesFile{c70rm.fd}% +%\ProvidesFile{c70sf.fd}% +%\ProvidesFile{c70tt.fd}% %\ProvidesFile{ctexspa.def}% %\ProvidesDictionary{translator-theorem-dictionary}{ChineseGBK}% %\ProvidesDictionary{translator-theorem-dictionary}{ChineseUTF8}% % [2016/04/23 v2.4 Chinese font definition (CTEX)] % [2016/04/23 v2.4 Space info for CJKpunct (CTEX)] % [2016/02/20 v1.0 Chinese translation for theorem name (CTEX)] -% +% %<*driver> -\ExplSyntaxOff -\let\ctexrevnum\ExplFileVersion -\expandafter\let\csname ver@thumbpdf.sty\endcsname\fmtversion -\documentclass[a4paper,full,numbered]{l3doc} -\usepackage[UTF8, punct = kaiming, heading, - linespread = 1.2, sub3section]{ctex} -\ctexset{ - abstractname = 简介, - indexname = 代码索引, - section = { - format = \Large\bfseries\raggedright, - name = {第,节}, - }, -} -\usepackage[toc]{multitoc} -\usepackage{geometry} -\usepackage{tabularx} -\usepackage{siunitx} -\usepackage{unicode-math} -\geometry{includemp,hmargin={0mm,15mm},vmargin={25mm,15mm},footskip=7mm} -\hypersetup{pdfstartview=FitH,bookmarksdepth=subparagraph} -\setcounter{secnumdepth}{4} -\setcounter{tocdepth}{2} -\newcommand*\email{\nolinkurl} -\setmainfont{TeX Gyre Pagella} -\setsansfont{TeX Gyre Heros} -\setmonofont[ - UprightFont=* Light, BoldFont=* Bold, - SlantedFont=* Light Oblique]{CMU Typewriter Text} -\setmathfont{texgyrepagella-math.otf} -\usepackage{xcolor} -\usepackage{caption} -\captionsetup{strut=off, labelsep=quad, labelfont+=bf} -\makeatletter -%% <--- http://tex.stackexchange.com/a/40896 -\patchcmd{\@addtocurcol}% - {\vskip \intextsep}% - {\edef\save@first@penalty{\the\lastpenalty}\unpenalty - \ifnum \lastpenalty = \@M % hopefully the OR penalty - \unpenalty - \else - \penalty \save@first@penalty \relax % put it back - \fi - \ifnum\outputpenalty <-\@Mii - \addvspace\intextsep - \vskip\parskip - \else - \addvspace\intextsep - \fi}% - {\typeout{*** SUCCESS ***}}{\typeout{*** FAIL ***}} -\patchcmd{\@addtocurcol}% - {\vskip\intextsep \ifnum\outputpenalty <-\@Mii \vskip -\parskip\fi}% - {\ifnum\outputpenalty <-\@Mii - \aftergroup\vskip\aftergroup\intextsep - \aftergroup\nointerlineskip - \else - \vskip\intextsep - \fi}% - {\typeout{*** SUCCESS ***}}{\typeout{*** FAIL ***}} -\patchcmd{\@getpen}{\@M}{\@Mi} - {\typeout{*** SUCCESS ***}}{\typeout{*** FAIL ***}} -%% ---> -%% 不对代码实现的 \section 以下标题编目录。 -\AtBeginEnvironment{implementation}{% - \ifnum\value{tocdepth}>\@ne - \addtocontents{toc}{\protect\value{tocdepth}=1\relax}% - \fi} -\ifxetex - \let\ctexdocverbaddon\xeCJKVerbAddon - \def\ctexdisableecglue{\xeCJKsetup{CJKecglue}} - \appto\meta@font@select{\ifinner\ctexdisableecglue\fi} -\else - \let\ctexdocverbaddon\relax - \def\ctexdisableecglue{\ltjsetparameter{autoxspacing=false}} - \appto\meta@font@select{\ctexdisableecglue} -\fi -\setlist{noitemsep,topsep=\smallskipamount} -\setlist[1]{labelindent=\parindent} -\setlist[enumerate]{leftmargin=*} -\setlist[itemize]{leftmargin=*} -\newlist{optdesc}{description}{3} -%% 设置间距为 \marginparsep,与 l3doc 一致 -\setlist[optdesc]{% - font=\mdseries\small\ttfamily,align=right,listparindent=\parindent, - labelsep=\marginparsep,labelindent=-\marginparsep,leftmargin=*} -\fvset{ - fontsize=\small,baselinestretch=1,numbersep=5pt, - formatcom=\ctexdocverbaddon, - listparameters=\setlength\topsep{\MacrocodeTopsep}} -\DefineVerbatimEnvironment{frameverb}{Verbatim}{% - gobble=4, - frame=single,framesep=8pt, - listparameters= - \setlength\topsep{\medskipamount}% - \appto\FV@EndList{\nointerlineskip}} -\DefineVerbatimEnvironment{ctexexam}{Verbatim}{% - gobble=4, - frame=single,framesep=10pt, - label=\rule{0pt}{12pt}\textnormal{\bfseries 例 \arabic{ctexexam}}, - listparameters= - \setlength\topsep{\bigskipamount}% - \refstepcounter{ctexexam}\ctexexamlabelref - \appto\FV@EndList{\nointerlineskip}} -\define@key{FV}{labelref}{\def\ctexexamlabelref{\label{#1}}} -\let\ctexexamlabelref\empty -\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} -\AfterEndEnvironment{function}{\ctexfixprevdepth} -\AtBeginEnvironment{syntax}{\linespread{1}\ctexdisableecglue} -\preto\MacroFont{\linespread{1}} -\appto\MacroFont{\hyphenchar\font\m@ne\ctexdocverbaddon} -\preto\AltMacroFont{\linespread{1}} -\appto\AltMacroFont{\hyphenchar\font\m@ne\ctexdocverbaddon} -\def\Module#1{\mbox{% - \color{purple}\footnotesize\normalfont\sffamily\textlangle#1\textrangle}} -\newcommand*\exptarget{\Hy@raisedlink{\hypertarget{expstar}{}}} -\newcommand*\rexptarget{\Hy@raisedlink{\hypertarget{rexpstar}{}}} -\newcommand*\expstar{\hyperlink{expstar}{$\star$}} -\newcommand*\rexpstar{\hyperlink{rexpstar}{\ding{73}}} -\ExplSyntaxOn -%% l3doc 会设置列表环境中 \listparindent=\z@,我们在这里恢复它。 -\cs_set_eq:NN \list \__codedoc_oldlist:nn -\cs_new_nopar:Npn \zihaopt #1 - { - \exp_last_unbraced:Nf \tl_head:w - { \prop_item:Nn \c__ctex_font_size_prop {#1} } { } \q_stop - } -%% 用 \vtop 让函数名字和语法盒子首行对齐 -\patchcmd \__codedoc_syntax:w - { { minipage } { \l__codedoc_syntax_dim } } - { { 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 - { \vbox_unpack_clear:N } - { \linespread { 1 } \selectfont \vbox_unpack_clear:N } - { \iow_term:n { *** ~ SUCCESS ~ *** } } - { \iow_term:n { *** ~ FAIL ~ *** } } -%% 不重复使用 \HD@target,避免索引出现重复页码 -\cs_set_protected:Npn \__codedoc_special_index_aux:nnnnn #1#2#3#4#5 - { - \__codedoc_special_index_set:Nn \l__codedoc_index_escaped_macro_tl {#2} - \str_if_eq:onTF { \@currenvir } { macrocode } - { \codeline@wrindex } - { - \HD@target - \index - } - { - \tl_if_empty:nF { #3 #4 } - { #3 \actualchar #4 \levelchar } - #1 - \actualchar - { - \token_to_str:N \verbatim@font \c_space_tl - \l__codedoc_index_escaped_macro_tl - } - \encapchar - hdclindex{\the\c@HD@hypercount}{#5} - } - } -\DeclareDocumentCommand \cs { O{} m } - { \__codedoc_cmd_aux:no {#1} { \c__codedoc_backslash_tl #2 } } -\DeclareDocumentCommand \tn { O{} m } - { - \__codedoc_cmd_aux:no - { index = TeX , replace = false , #1 } - { \c__codedoc_backslash_tl #2 } - } -\DeclareDocumentCommand \meta { +m } - { \__codedoc_meta_aux:n {#1} } -\DeclareExpandableDocumentCommand \bookmarkcstn { O{} m } - { \textbackslash \tl_to_str:n {#2} } -\cs_new:Npn \bookmarkmeta #1 { < \tl_to_str:n {#1} > } -\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 等编索引 -\DeclareDocumentCommand \StopSpecialIndexModule { } - { \cs_set_eq:NN \__codedoc_special_index_module:nnnn \use_none:nnnn } -\tl_map_inline:nn { \actualchar \encapchar \levelchar } - { \exp_args:Nx \DoNotIndex { \bslash \tl_to_str:N #1 } } -\ExplSyntaxOff -\AtBeginDocument{\addtocontents{toc}{\StopSpecialIndexModule}} -\pdfstringdefDisableCommands{% - \let\cs\bookmarkcstn - \let\tn\bookmarkcstn - \let\meta\bookmarkmeta - \let\opt\@firstofone} -\preto\@thehead{\cslet{MakeUppercase\space}{\@iden}} -\def\orbar{\textup{\textbar}} -\def\defaultval#1{\textbf{\textup{#1}}} -\def\defaultvalaux#1){\defaultval{#1}} -\def\TF{true\orbar false} -\def\TTF{\defaultval{true}\orbar false} -\def\TFF{true\orbar\defaultval{false}} -\protected\def\opt{\texttt} -\def\pdfTeX{\hologo{pdfTeX}} -\def\XeTeX{\hologo{XeTeX}} -\def\XeLaTeX{\hologo{XeLaTeX}} -\def\LuaLaTeX{\hologo{LuaLaTeX}} -\def\pdfLaTeX{\hologo{pdfLaTeX}} -\def\LaTeX{\hologo{LaTeX}} -\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}{}{} -\appto\GlossaryParms{% - \def\@idxitem{\par\hangindent 2em }% - \def\subitem{\@idxitem\hspace*{1em}}% - \def\subsubitem{\@idxitem\hspace*{2em}}} -\patchcmd\l@section{2.5em}{1.5em}{}{} -\patchcmd\l@subsection{2.5em}{1.5em}{}{} -\patchcmd\changes@{\space}{\lbrack}{}{} -\patchcmd\@wrglossary{hdpindex}{% - \ifnum\c@HD@hypercount=\z@ - hdpindex% - \else - hdclindex{\the\c@HD@hypercount}\fi}{}{} -\newenvironment{defaultcapconfig}{% - \MakePercentComment - \input{ctex-name-utf8.cfg}% - \ExplSyntaxOff - \MakePercentIgnore}{} -\newcommand*\BSTACK{\begin{tabular}[t]{@{}l@{}}} -\newcommand*\ESTACK{\end{tabular}} -\makeatother -\EnableCrossrefs -\CodelineIndex -\RecordChanges -\def\glossaryname{版本历史} -\GlossaryPrologue{\section{\glossaryname}} -\IndexPrologue{% - \section{\indexname} - \textit{意大利体的数字表示描述对应索引项的页码; - 带下划线的数字表示定义对应索引项的代码行号; - 罗马字体的数字表示使用对应索引项的代码行号。}} -\setlength\IndexMin{.4\textheight} -\usepackage{makecell} -\newcommand{\bashcmd}{\texttt} -\newcommand{\TeXLive}{\TeX\ Live} -\newcommand{\MiKTeX}{\hologo{MiKTeX}} -\usepackage{threeparttable} +\documentclass{ctxdoc} \begin{document} \DocInput{\jobname.dtx} - \newgeometry{hmargin=15mm,vmargin={25mm,15mm},footskip=7mm} - \ctexset{section/numbering=false} + \IndexLayout \PrintChanges \PrintIndex \end{document} @@ -821,7 +537,7 @@ This package consists of the file ctex.dtx, and the derived files % \changes{v2.4}{2015/02/19}{加强 \pkg{beamer} 宏包支持。} % % -% \CheckSum{5506} +% \CheckSum{5581} % % \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 @@ -839,11 +555,11 @@ This package consists of the file ctex.dtx, and the derived files % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % -% \GetFileInfo{\jobname.dtx}% +% \GetFileId{ctex.sty}% % % \title{\bfseries \CTeX{} 宏集手册} % \author{\href{http://www.ctex.org}{ctex.org}} -% \date{\filedate\qquad\fileversion\thanks{\ctexkitrev{\ctexrevnum}.}} +% \date{\filedate\qquad\fileversion\thanks{\ctexkitrev{\ExplFileVersion}.}} % \maketitle % % \begin{abstract} @@ -1116,19 +832,15 @@ This package consists of the file ctex.dtx, and the derived files % \begin{threeparttable} % \caption{\CTeX{} 宏集的中文支持方式} % \label{tab:chinese-support} -% \begin{tabular}{ll} +% \begin{tabular}{*6c} % \toprule -% 编译方式 & 支持宏包 \\ +% 编译方式 & (pdf)\LaTeX & \XeLaTeX & \LuaLaTeX & \upLaTeX\tnote{*} \\ % \midrule -% (pdf)\LaTeX & \pkg{CJK} \\ -% \XeLaTeX & \pkg{xeCJK} \\ -% \LuaLaTeX & \pkg{LuaTeX-ja} \\ -% \upLaTeX\tnote{*} & 原生 \\ +% 支持宏包 & \pkg{CJK} & \pkg{xeCJK} & \pkg{LuaTeX-ja} & 原生 \\ % \bottomrule % \end{tabular} -% \smallskip % \begin{tablenotes} -% \item[*] p\LaTeX-ng(或称 Ap\LaTeX)与 \upLaTeX{} 兼容。使用 p\LaTeX-ng 编译 +% \item[*] p\LaTeX-ng(或称 \ApLaTeX)与 \upLaTeX{} 兼容。使用 p\LaTeX-ng 编译 % 时,\pkg{ctex} 采用与 \upLaTeX{} 相同的设置。 % \end{tablenotes} % \end{threeparttable} @@ -1202,8 +914,7 @@ This package consists of the file ctex.dtx, and the derived files % \makecell{\pkg{zhmetrics-uptex}\\Fandol 字库} \\ % \bottomrule % \end{tabular} -% \smallskip -% \begin{tablenotes}\footnotesize +% \begin{tablenotes} % \item [1] Windows Vista 及以后的 Windows 操作系统。 % \item [2] Windows XP 及以前的 Windows 操作系统。 % \item [3] 由马起园、苏杰、黄晨成等人开发的开源中文字体, @@ -1329,7 +1040,9 @@ This package consists of the file ctex.dtx, and the derived files % 本选项可以用于四个 \CTeX{} 文档类和 \pkg{ctex} 宏包, % 也可以用于 \pkg{ctexsize} 宏包。 % -% \opt{scheme = chinese} 时,默认值为 |5|,即设置 \tn{normalsize} 为五号字。 +% \opt{scheme = chinese} 时,对标准文档类默认值为 |5|,即设置 +% \tn{normalsize} 为五号字;对 \cls{beamer} 则为 |false|,使用文档类原有的设 +% 置。 % \end{function} % % \begin{table}[htbp] @@ -1422,9 +1135,9 @@ This package consists of the file ctex.dtx, and the derived files % 选择文章的排版方案,预设有 \opt{chinese} 和 \opt{plain} 两种方案。% % \end{function} % \begin{optdesc}[itemsep=\medskipamount] -% \item[chinese] 调整默认字号为五号字,并调整行距为 |1.3|; -% 汉化文档中的标题名字(如“图”、“表”、“目录”和“参考文献”等, -% 见 \ref{subs:capname}~节); +% \item[chinese] 对 \cls{beamer} 以外的文档类,调整默认字号为五号字,并调 +%` 整行距为 |1.3|;汉化文档中的标题名字(如“图”、“表”、“目录”和“参 +% 考文献”等,见 \ref{subs:capname}~节); % 在 \opt{heading = true} 的情况下^^A % \footnote{使用 \CTeX{} 文档类,或者使用 \pkg{ctex} 宏包且开启该选项时。}^^A % (\ref{subs:options-heading}~节),还会将章节标题的风格修改为 @@ -1495,8 +1208,9 @@ This package consists of the file ctex.dtx, and the derived files % 接受一个浮点数值,设置行距倍数。本选项的初始值与 \opt{scheme} 有关。 % \end{function} % \begin{optdesc} -% \item[scheme = chinese] 初始值为 $1.3$,即 $1.3$ 倍行距。此时,相邻两行的基线 -% (\tn{baselineskip})距离为 $1.3\times 1.2=1.56$ 倍字体高度。 +% \item[scheme = chinese] 对标准文档类初始值为 $1.3$,即 $1.3$ 倍行距。此 +% 时,相邻两行的基线(\tn{baselineskip})距离为 $1.3\times 1.2=1.56$ 倍字体 +% 高度。对 \cls{beamer} 不改变行距,即使用默认的单倍行距。 % % \item[scheme = plain] \CTeX{} 宏集默认不调整行距倍数,文档中的行距由所选文档类和 % 其他宏包或用户设置决定。 @@ -1964,7 +1678,7 @@ This package consists of the file ctex.dtx, and the derived files % \begin{ctexexam} % \ctexset{ % chapter/format = \sffamily\raggedright, -% section/format+ = \sffamily +% section/format += \sffamily % } % \end{ctexexam} % @@ -2256,7 +1970,7 @@ This package consists of the file ctex.dtx, and the derived files % \end{tabular} % \end{table} % -% \begin{function}[EXP,updated=2015-06-27]{.../beforeskip} +% \begin{function}[EXP,updated=2016-05-10]{.../beforeskip} % \begin{syntax} % beforeskip = \Arg{弹性间距} % \end{syntax} @@ -2287,6 +2001,15 @@ This package consists of the file ctex.dtx, and the derived files % \end{tabular} % \end{table} % +% \begin{function}[EXP,added=2016-05-10]{part/fixbeforeskip,chapter/fixbeforeskip} +% \begin{syntax} +% fixbeforeskip = \TFF +% \end{syntax} +% \cls{book} 和 \cls{report} 类的 \tn{part} 和 \tn{chapter} 标题与正文顶部的距离除了由 +% \opt{beforeskip} 选项设置的垂直间距外,还会有一个空行。 +% \opt{fixbeforeskip} 选项用于抑制这个多余空行。 +% \end{function} +% % \begin{function}[EXP,updated=2015-06-27]{.../afterskip} % \begin{syntax} % afterskip = \Arg{弹性间距} @@ -2467,11 +2190,13 @@ This package consists of the file ctex.dtx, and the derived files % \begin{ctexexam}[labelref=exam:miscopt] % \ctexset { % chapter = { -% format = \Huge\bfseries, -% nameformat = \hrule height 1bp \relax\bigskip\hfill\chapternamebox, -% number = \arabic{chapter}, -% aftername = \par\medskip, -% aftertitle = \bigskip\hrule height 2bp \relax +% beforeskip = 0pt, +% fixbeforeskip = true, +% format = \Huge\bfseries, +% nameformat = \rule{\linewidth}{1bp}\par\bigskip\hfill\chapternamebox, +% number = \arabic{chapter}, +% aftername = \par\medskip, +% aftertitle = \par\bigskip\nointerlineskip\rule{\linewidth}{2bp}\par % } % } % \newcommand\chapternamebox[1]{% @@ -2554,9 +2279,10 @@ This package consists of the file ctex.dtx, and the derived files % \CTeX{} 宏集的中文数字转换功能实际上是调用 \pkg{zhnumber} 宏包来完成。下面只 % 介绍一些基本的用法,更高级的用法可以查阅 \pkg{zhnumber} 宏包的文档。 % -% \begin{function}[updated=2014-03-08]{\chinese} +% \begin{function}[updated=2016-05-01]{\chinese} % \begin{syntax} % \tn{chinese} \Arg{counter} +% \tn{pagenumbering} \{chinese\} % \end{syntax} % \tn{chinese} 命令与 \tn{roman} 等命令的用法类似,作用在一个 \LaTeX{} % 计数器上,将计数器的值以中文数字的形式输出。 @@ -3168,18 +2894,20 @@ This package consists of the file ctex.dtx, and the derived files % % \end{macrocode} % -% \begin{variable}[int]{\c_@@_engine_file_str} -% 引擎检查,暂不支持 \pTeX{} 系。 +% \begin{variable}[int]{\c_@@_engine_str,\c_@@_engine_file_str} +% 引擎检查。目前 \LaTeXiii{} 将 \ApTeX{} 识别为 \upTeX。 % \begin{macrocode} +\str_const:Nx \c_@@_engine_str + { \cs_if_exist:NTF \ngostype { aptex } { \c_sys_engine_str } } \msg_new:nnnn { ctex } { engine-not-supported } { Engine~`#1'~is~not~yet~supported,~ctex~will~abort! } - { You~can~switch~to~xelatex,~lualatex~or~pdflatex.} -\file_if_exist:nTF { ctex-engine- \c_sys_engine_str .def } + { You~can~switch~to~xelatex,~lualatex,~pdflatex,~uplatex,~or~aplatex. } +\file_if_exist:nTF { ctex-engine- \c_@@_engine_str .def } { \str_const:Nx \c_@@_engine_file_str - { ctex-engine- \c_sys_engine_str .def } + { ctex-engine- \c_@@_engine_str .def } } - { \msg_critical:nnx { ctex } { engine-not-supported } { \c_sys_engine_str } } + { \msg_critical:nnx { ctex } { engine-not-supported } { \c_@@_engine_str } } % \end{macrocode} % \end{variable} % @@ -3414,7 +3142,8 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % % \begin{variable}[int]{\g_@@_font_size_flag} -% |0| 表示修改默认字体大小为五号,|1| 为小四号,其它值则不作修改。 +% |0| 表示修改默认字体大小为五号,|1| 为小四号,大于 1 则不作修改。初始值 |-1| +% 表示 \opt{zihao} 选项未初始化,会在将来根据文档类决定初值。 % \begin{macrocode} %<*class|ctex|ctexsize> \cs_new_eq:NN \g_@@_font_size_flag \c_minus_one @@ -3438,10 +3167,11 @@ This package consists of the file ctex.dtx, and the derived files % \changes{v2.0}{2015/05/06}{\opt{c5size}, \opt{cs4size} 是过时选项。} % % \begin{macro}{zihao} +% \changes{v2.4.1}{2016/05/13}{不允许无参 \opt{zihao} 选项。} % \begin{macrocode} %<*class|ctex|ctexsize> zihao .choice: , - zihao .default:n = { 5 } , + zihao .value_required:n = true , zihao / 5 .code:n = { \cs_gset_eq:NN \g_@@_font_size_flag \c_zero } , zihao / -4 .code:n = { \cs_gset_eq:NN \g_@@_font_size_flag \c_one } , zihao / false .code:n = { \cs_gset_eq:NN \g_@@_font_size_flag \c_two } , @@ -3891,7 +3621,7 @@ This package consists of the file ctex.dtx, and the derived files % 设置 \upTeX{} 字体映射,同时作用于 \tn{AtBeginDvi} 与 % \tn{AtBeginShipoutFirst}。该宏对 \pdfTeX{} 和 \upTeX{} 均有用。 % \begin{macrocode} -%<*pdftex|uptex> +%<*pdftex|uptex|aptex> \cs_new_protected_nopar:Npn \ctex_set_zhmap:n #1 { \AtBeginDvi { #1 } @@ -3899,7 +3629,7 @@ This package consists of the file ctex.dtx, and the derived files { \AtBeginShipoutFirst { #1 } } } \@onlypreamble \ctex_set_zhmap:n -% +% % \end{macrocode} % \end{macro} % @@ -5745,30 +5475,6 @@ This package consists of the file ctex.dtx, and the derived files % % \paragraph{其它设置} % -% \begin{macro}[int]{\ctex_ltj_update_xkanjiskip:,\l_@@_xkanjiskip_skip} -% \tn{ltjsetparameter} 对 \opt{xkanjiskip} 是即时赋值。\tn{zw} 与字体相关,因此 -% 需要每次 \tn{selectfont} 的时候更新一次 \opt{xkanjiskip}。如果用户设置过 -% \opt{xkanjiskip},就不更新。注意,同 \TeX{} 的 \tn{baselineskip} 一样,如果在 -% 一个段落内多次设置了 \opt{kanjiskip} 或 \opt{xkanjiskip},最后的设置会影响 -% 全段。 -% \begin{macrocode} -\cs_new_protected_nopar:Npn \ctex_ltj_update_xkanjiskip: - { - \skip_if_eq:nnT - { \ltjgetparameter { xkanjiskip } } { \l_@@_xkanjiskip_skip } - { - \skip_set:Nn \l_@@_xkanjiskip_skip { .25 \zw plus 1pt minus 1pt } - \ltjsetxkanjiskip \l_@@_xkanjiskip_skip - } - } -% \end{macrocode} -% 注意,此时还没有实际设置字体,所以 \tn{zw} 是 \opt{0pt}。 -% \begin{macrocode} -\skip_new:N \l_@@_xkanjiskip_skip -\skip_set:Nn \l_@@_xkanjiskip_skip { .25 \zw plus 1pt minus 1pt } -% \end{macrocode} -% \end{macro} -% % 在抄录环境中禁用 \opt{autospacing} 和 \opt{autoxspacing}。然而,\pkg{LuaTeX-ja} % 还是会使 JAchar 自动折行。没有看到有简单的禁用折行的办法,可能需要设置所有的 % JAchar 的 \opt{prebreakpenalty} 或 \opt{postbreakpenalty} 为 \texttt{10000}: @@ -5820,7 +5526,7 @@ This package consists of the file ctex.dtx, and the derived files % \subsubsection{\pkg{ctex-engine-uptex.def}} % % \begin{macrocode} -%<*uptex> +%<*uptex|aptex> % \end{macrocode} % % \changes{v2.4}{2016/02/28}{初步支持 \upLaTeX。} @@ -5842,6 +5548,11 @@ This package consists of the file ctex.dtx, and the derived files \tl_set:Nn \kanjifamilydefault { \CJKfamilydefault } % \end{macrocode} % +% 在导言区末尾更新 \tn{CJKfamilydefault}。 +% \begin{macrocode} +\ctex_at_end_preamble:n { \ctex_update_default_family: } +% \end{macrocode} +% % \begin{macro}{\em} % 取消 \upLaTeX{} 对 \tn{em} 使用 |\mcfamily|、|\gtfamily| 命令的重定义,恢复 % \LaTeXe{} 对 \tn{em} 的原始定义。如果用户已经重定义了 \tn{em},则新定义保持 @@ -5930,11 +5641,11 @@ This package consists of the file ctex.dtx, and the derived files \@ifpackageloaded { tracefnt } { \EverySelectfont - { - \ifnum \tracingfonts > \tw@ - \@font@info { Switching~ to~ \font@name } - \fi - } + { + \ifnum \tracingfonts > \tw@ + \@font@info { Switching~ to~ \font@name } + \fi + } } { } \let \@EverySelectfont@Init \undefined @@ -5943,18 +5654,19 @@ This package consists of the file ctex.dtx, and the derived files % \end{macro} % % \begin{macrocode} -% +% % \end{macrocode} % % \subsubsection{调整 \tn{CJKfamilydefault}} % % \changes{v2.4}{2016/02/15}{正确更新 \pkg{CJK} 包的 \tn{CJKfamilydefault}。} +% \changes{v2.4.1}{2016/04/26}{正确更新 \upLaTeX{} 的 \tn{CJKfamilydefault}。} % % \begin{macro}[int]{\ctex_update_default_family:} % 在导言区结束,如果 \tn{CJKfamilydefault} 没有被更改,则在此时根据西文字体的情况 % 更新 \tn{CJKfamilydefault}。\pkg{xeCJK} 已经有这个功能,不需要再调整。 % \begin{macrocode} -%<*pdftex|luatex> +%<*pdftex|luatex|uptex|aptex> \cs_new_protected_nopar:Npn \ctex_update_default_family: { \tl_if_eq:NNT \CJKfamilydefault \l_@@_family_default_init_tl @@ -5974,8 +5686,9 @@ This package consists of the file ctex.dtx, and the derived files \group_end: } % \end{macrocode} -% 使用 \LuaLaTeX{} 时,自动调整得到的 \tn{CJKfamilydefault} 可能没有定义,需要确认 -% 它的存在性。使用 \pkg{CJK} 宏包时,\texttt{C19rm} 等总是有定义的,不需要确认。 +% 使用 \LuaLaTeX{} 时,自动调整得到的 \tn{CJKfamilydefault} 可能没有定义,需要 +% 确认它的存在性。使用 \pkg{CJK} 宏包或 \upLaTeX{} +% 时,\texttt{C19rm}、\texttt{JY2rm} 等总是有定义的,不需要确认。 % \begin{macrocode} %<*luatex> \ctex_ltj_ensure_default_family: @@ -5995,7 +5708,7 @@ This package consists of the file ctex.dtx, and the derived files { \exp_not:o { \CJKfamilydefault } } } \tl_gset_eq:NN \CJKfamilydefault \l_@@_family_default_init_tl -% +% % \end{macrocode} % \end{macro} % @@ -6025,6 +5738,26 @@ This package consists of the file ctex.dtx, and the derived files } % % \end{macrocode} +% +% \ApTeX{} 可以使用 \tn{ngostype} 来判断。 +% \begin{macrocode} +%<*aptex> +\cs_new_protected_nopar:Npn \ctex_detected_platform: + { + \tl_gset:Nx \g_@@_fontset_tl + { + \str_case:onF { \ngostype } + { + { Win32 } { windows } + { Win64 } { windows } + { Darwin } { mac } + } + { fandol } + } + } +% +% \end{macrocode} +% % \pdfTeX{} 和 \XeTeX{} 下则依据 \file{/dev/null} 和 \file{nul:} 的存在性以及 % 文件系统的大小写敏感性来判断。Mac~OS~X 的大小写敏感性在安装时是可选的。为了 % 保险起见,这里的判断很繁琐,最多要进行 4 次文件操作! @@ -6166,18 +5899,20 @@ This package consists of the file ctex.dtx, and the derived files % % \end{macrocode} % +% 我们假定 \upTeX{} 使用 \dvipdfmx{} 驱动输出,于是使用与 \pdfTeX{} 类似的设 +% 置。注意 \upTeX{} 需要使用 UTF8-UTF16 的编码转换。 % \begin{macrocode} -%<*uptex> -\PassOptionsToPackage { dvipdfmx } { hyperref } +%<*uptex|aptex> +\ctex_hypersetup:n { driverfallback = dvipdfmx } \ctex_at_end_package:nn { hyperref } { \AtBeginShipoutFirst{ \special{ pdf:tounicode~ UTF8-UTF16 } } } -% +% % \end{macrocode} % % \begin{macrocode} -%<*pdftex|xetex|luatex|uptex> +%<*pdftex|xetex|luatex|uptex|aptex> % \end{macrocode} % % \subsubsection{\pkg{CJKfntef}、\pkg{xeCJKfntef} 相关设置} @@ -6213,11 +5948,13 @@ This package consists of the file ctex.dtx, and the derived files { \tl_clear:c { CJK#1color } } } % -%<*luatex> +%<*luatex|uptex|aptex> \msg_new:nnn { ctex } { fntef-not-available } - { Functions~ of~ `CJKfntef'~ is~ not~ available~ in~ LuaLaTeX. } +% { Functions~ of~ `CJKfntef'~ is~ not~ available~ in~ LuaLaTeX. } +% { Functions~ of~ `CJKfntef'~ is~ not~ available~ in~ upLaTeX. } +% { Functions~ of~ `CJKfntef'~ is~ not~ available~ in~ ApLaTeX. } \msg_warning:nn { ctex } { fntef-not-available } -% +% \clist_map_inline:nn { underdot , underline , underdblline , underwave , sout , xout } %<*pdftex|xetex> @@ -6238,11 +5975,11 @@ This package consists of the file ctex.dtx, and the derived files } \cs_new_protected_nopar:Npn { \endCTEXfilltwosides } { \endCJKfilltwosides } % -%<*luatex|uptex> +%<*luatex|uptex|aptex> { \cs_new_eq:cN { CTEX#1 } \use:n } \cs_new_eq:NN \CTEXfilltwosides \use_none:n \cs_new_eq:NN \endCTEXfilltwosides \prg_do_nothing: -% +% %<*pdftex> \clist_map_inline:nn { @@ -6262,6 +5999,7 @@ This package consists of the file ctex.dtx, and the derived files % \subsubsection{\tn{ccwd} 的更新} % % \begin{macro}[int]{\ctex_update_ccwd:,\ccwd} +% \changes{v2.4.1}{2016/04/29}{正确设置 \upTeX{} 下的 \tn{ccwd}。} % \begin{macrocode} \cs_new_protected_nopar:Npn \ctex_update_ccwd: %<*pdftex|xetex> @@ -6273,9 +6011,9 @@ This package consists of the file ctex.dtx, and the derived files %<*luatex> { \skip_set:Nn \ccwd { \ltjgetparameter { kanjiskip } + \zw } } % -%<*uptex> - { \skip_set:Nn \ccwd { 1zw } } -% +%<*uptex|aptex> + { \skip_set:Nn \ccwd { 1zw + \ptex_kanjiskip:D } } +% \dim_new:N \ccwd % \end{macrocode} % \end{macro} @@ -6296,9 +6034,9 @@ This package consists of the file ctex.dtx, and the derived files %<*luatex> { \ltjsetkanjiskip \l_@@_ccglue_skip } % -%<*uptex> - { \kanjiskip \l_@@_ccglue_skip } -% +%<*uptex|aptex> + { \skip_set_eq:NN \ptex_kanjiskip:D \l_@@_ccglue_skip } +% \skip_new:N \l_@@_ccglue_skip % \end{macrocode} % \end{macro} @@ -6316,10 +6054,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: } % -%<*uptex> - \skip_if_eq:nnTF { \l_@@_ccglue_skip } { \kanjiskip } +%<*uptex|aptex> + \skip_if_eq:nnTF { \l_@@_ccglue_skip } { \ptex_kanjiskip:D } { \prg_return_false: } { \prg_return_true: } -% +% } % \end{macrocode} % 注意下面的标记不能用 \verb"%",它会导致旧版本的 \pkg{l3docstrip} @@ -6332,8 +6070,8 @@ This package consists of the file ctex.dtx, and the derived files % \end{macro} % % \begin{macro}[int]{\ctex_update_em_unit:} -% 将当前汉字的宽度保存到 \tn{ccwd} 中备用。不采用 \texttt{1 em},因为这时的 -% \texttt{1 em} 实际上来自西文字体的信息,未必等于汉字的宽度,这似乎在传统的 +% 将当前汉字的宽度保存到 \tn{ccwd} 中备用。不采用 \texttt{1em},因为这时的 +% \texttt{1em} 实际上来自西文字体的信息,未必等于汉字的宽度,这似乎在传统的 % \file{.tfm} 字体上表现更明显。在 \pdfTeX{} 和 \XeTeX{} 下,直接使用 |\f@size\p@| % 作为汉字的宽度,这应该对大多数汉字字体都成立,但不适用于诸如“方正兰亭黑长”之类 % 的特殊字体。在 \XeTeX{} 可以用 \tn{fontcharwd} 来改进。而在 \pdfTeX{} 下,若使用 @@ -6344,7 +6082,7 @@ This package consists of the file ctex.dtx, and the derived files \cs_new_protected_nopar:Npn \ctex_update_em_unit: % { \dim_set:Nn \ccwd { \f@size \p@ } } % { \dim_set:Nn \ccwd { \zw } } -% { \dim_set:Nn \ccwd { 1zw } } +% { \dim_set:Nn \ccwd { 1zw } } % \end{macrocode} % \end{macro} % @@ -6379,9 +6117,9 @@ This package consists of the file ctex.dtx, and the derived files %<*pdftex> \EverySelectfont { \cs_if_exist:NF \CJK@plane { \CTEX@selectfont@hook } } % -%<*xetex|luatex|uptex> +%<*xetex|luatex|uptex|aptex> \EverySelectfont { \CTEX@selectfont@hook } -% +% % \end{macrocode} % % Attribute 寄存器 \tn{ltj@curjfnt} 的初始值是 $-1$,必须把它设置为一个有效的 @@ -6392,13 +6130,49 @@ This package consists of the file ctex.dtx, and the derived files { \ctex_ltj_select_font: \ctex_ltj_select_alternate_font: - \ctex_ltj_update_xkanjiskip: } \tl_set:Nn \CJK@family { song } \selectfont \tl_clear:N \CJK@family % % \end{macrocode} % +% \changes{v2.4.1}{2016/05/01}{随字体更新 \upTeX{} 的 \tn{xkanjiskip}。} +% +% \begin{macro}[int]{\ctex_update_xkanjiskip:,\l_@@_xkanjiskip_skip} +% \upTeX{} 和 \pkg{LuaTeX-ja} 对 \tn{xkanjiskip} 都是即时赋值。单位 \opt{zw} 与字体相关,因此 +% 需要每次 \tn{selectfont} 的时候更新一次 \tn{xkanjiskip}。如果用户设置过 +% \tn{xkanjiskip},就不更新。注意,同 \TeX{} 的 \tn{baselineskip} 一样,如果在 +% 一个段落内多次设置了 \tn{kanjiskip} 或 \tn{xkanjiskip},只有最后的设置会影响 +% 全段。 +% \begin{macrocode} +%<*luatex|uptex|aptex> +\cs_new_protected_nopar:Npn \ctex_update_xkanjiskip: + { + \skip_if_eq:nnT +% { \ltjgetparameter { xkanjiskip } } { \l_@@_xkanjiskip_skip } +% { \ptex_xkanjiskip:D } { \l_@@_xkanjiskip_skip } + { + \skip_set:Nn \l_@@_xkanjiskip_skip { \l_@@_xkanjiskip_tl } +% \ltjsetxkanjiskip \l_@@_xkanjiskip_skip +% \skip_set_eq:NN \ptex_xkanjiskip:D \l_@@_xkanjiskip_skip + } + } +\tl_new:N \l_@@_xkanjiskip_tl +\tl_set:Nn \l_@@_xkanjiskip_tl +% { .25\zw plus 1pt minus 1pt } +% { .25zw plus 1pt minus 1pt } +\skip_new:N \l_@@_xkanjiskip_skip +\skip_set:Nn \l_@@_xkanjiskip_skip +% { \ltjgetparameter { xkanjiskip } } +% { \ptex_xkanjiskip:D } +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\ctex_add_to_selectfont:n { \ctex_update_xkanjiskip: } +% +% \end{macrocode} +% % \begin{macro}{space} % 在导言区或正文中设置忽略空格方式。 % \pdfTeX{} 和 \XeTeX{} 下初始设置为 \opt{auto},\LuaTeX{}、\upTeX{} 下是无效 @@ -6420,10 +6194,10 @@ This package consists of the file ctex.dtx, and the derived files space .default:n = { true } , space .initial:n = { auto } % -%<*luatex|uptex> +%<*luatex|uptex|aptex> space .code:n = { \msg_warning:nn { ctex } { invalid-option } } -% +% } % \end{macrocode} % \end{macro} @@ -6440,7 +6214,7 @@ This package consists of the file ctex.dtx, and the derived files % \punctstyle { \l_@@_punct_tl } % \xeCJKsetup { PunctStyle = \l_@@_punct_tl } % \ctex_mono_jfm:o { \l_@@_punct_tl } -% \msg_warning:nn { ctex } { invalid-option } +% \msg_warning:nn { ctex } { invalid-option } } , punct .default:n = { quanjiao } , } @@ -6449,13 +6223,13 @@ This package consists of the file ctex.dtx, and the derived files % % \XeLaTeX{}、\LuaLaTeX{} 和 \upLaTeX{} 总是使用 \texttt{UTF8} 编码。 % \begin{macrocode} -%<*xetex|luatex|uptex> +%<*xetex|luatex|uptex|aptex> \tl_set:Nn \l_@@_encoding_tl { UTF8 } -% +% % \end{macrocode} % % \begin{macrocode} -% +% %<*class|ctex> % \end{macrocode} % @@ -6697,8 +6471,10 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % % \begin{macro}{\chinese} +% \changes{v2.4.1}{2016/05/01}{支持 \tn{pagenumbering}。} % \begin{macrocode} -\cs_new_eq:NN \chinese \zhnum +\cs_new_nopar:Npn \chinese { \zhnum_counter:n } +\cs_new_eq:NN \@chinese \@zhnum \cs_new_eq:NN \Chinese \chinese \cs_new_eq:NN \CTEXcounter \use_none:n % \end{macrocode} @@ -6707,14 +6483,15 @@ This package consists of the file ctex.dtx, and the derived files % \changes{v2.2}{2015/06/29}{给 \pkg{enumitem} 宏包注册 \tn{chinese} 和 % \tn{zhnum}。} % -% 给 \pkg{enumitem} 宏包注册 \tn{chinese} 和 \tn{zhnum}。 +% 给 \pkg{enumitem} 宏包注册 \tn{chinese}、\tn{zhnum} 和 \tn{zhdig}。 % \begin{macrocode} \ctex_at_end_package:nn { enumitem } { \cs_if_free:NF \AddEnumerateCounter { - \AddEnumerateCounter * { \zhnum } { \zhnum_int:n } { 1 } - \AddEnumerateCounter * { \chinese } { \zhnum_int:n } { 1 } + \AddEnumerateCounter * { \zhnum } { \@zhnum } { 1 } + \AddEnumerateCounter * { \zhdig } { \@zhdig } { 1 } + \AddEnumerateCounter * { \chinese } { \@chinese } { 1 } } } % \end{macrocode} @@ -6969,17 +6746,26 @@ This package consists of the file ctex.dtx, and the derived files % \end{macro} % % \changes{v2.0}{2014/03/21}{标题设置新增 \opt{pagestyle} 选项。} +% \changes{v2.4.1}{2016/05/10}{新的标题格式选项 \opt{part/fixbeforeskip} 和 +% \opt{chapter/fixbeforeskip}。} % -% \begin{macro}{part/pagestyle,chapter/pagestyle} +% \begin{macro}{part/pagestyle,chapter/pagestyle, +% part/fixbeforeskip,chapter/fixbeforeskip} % 只在 \cls{ctexbook} 和 \cls{ctexrep} 下有定义。 % \begin{macrocode} +\group_begin: %<*book|report> \tl_set:Nn \l_@@_tmp_tl { - part / pagestyle .tl_set:N = \CTEX@part@pagestyle , - chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle , + part / pagestyle .tl_set:N = \CTEX@part@pagestyle , + chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle , + part / fixbeforeskip .bool_set:N = \CTEX@part@fixbeforeskip , + chapter / fixbeforeskip .bool_set:N = \CTEX@chapter@fixbeforeskip , } % +%<*article|beamer> +\tl_clear:N \l_@@_tmp_tl +% % \end{macrocode} % \end{macro} % @@ -6990,8 +6776,11 @@ This package consists of the file ctex.dtx, and the derived files \@@_initial_heading:n {#1} \@@_def_heading_keys:n {#1} } -\use:x { \keys_define:nn { ctex } { \exp_not:o { \l_@@_tmp_tl } } } -\tl_clear:N \l_@@_tmp_tl +\use:x + { + \group_end: + \keys_define:nn { ctex } { \exp_not:o { \l_@@_tmp_tl } } + } % \end{macrocode} % % \begin{macrocode} @@ -7009,6 +6798,26 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % +% \begin{macro}[int]{\CTEX@fixbeforeskip} +% 修正 \cls{book} 和 \cls{report} 类的 \tn{part} 和 \tn{chapter} 标题之前的多余空行。 +% 事实上,减掉 \tn{parskip} 有一定的风险。如果接下来的内容不会进入水平模式(例如在 \opt{format} +% 选项中使用 \tn{hrule} 或者 \tn{hbox}),\TeX{} 就不会加上 \tn{parskip}。这时候就需要用户把 +% \tn{parskip} 加到 \opt{beforeskip} 上作为修正。 +% \begin{macrocode} +%<*book|report> +\cs_new_protected_nopar:Npn \CTEX@fixbeforeskip + { + \par + \ifdim \pagegoal = \maxdimen + \advance \@tempskipa -\topskip + \advance \@tempskipa -\parskip + \nointerlineskip + \fi + } +% +% \end{macrocode} +% \end{macro} +% % \changes{v2.2}{2015/06/27}{\opt{beforeskip}、\opt{afterskip} 和 \opt{indent} % 选项支持表达式。} % @@ -7052,7 +6861,11 @@ This package consists of the file ctex.dtx, and the derived files \@tempswafalse \fi % \null\vfil - \null\vskip \glueexpr \CTEX@part@beforeskip \relax + \@tempskipa = \glueexpr \CTEX@part@beforeskip \relax + \ifodd \CTEX@part@fixbeforeskip + \CTEX@fixbeforeskip + \fi + \vspace*{\@tempskipa}% \secdef\@part\@spart} % % \end{macrocode} @@ -7230,7 +7043,11 @@ This package consists of the file ctex.dtx, and the derived files % \begin{macrocode} \def\@makechapterhead#1{% % \vspace*{50\p@}% - \vspace*{\glueexpr\CTEX@chapter@beforeskip\relax}% + \@tempskipa = \glueexpr \CTEX@chapter@beforeskip \relax + \ifodd \CTEX@chapter@fixbeforeskip + \CTEX@fixbeforeskip + \fi + \vspace*{\@tempskipa}% % {\normalfont \parindent \z@ \raggedright {\normalfont \parindent \dimexpr \CTEX@chapter@indent \relax \CTEX@chapter@format @@ -7257,7 +7074,11 @@ This package consists of the file ctex.dtx, and the derived files % \begin{macrocode} \def\@makeschapterhead#1{% % \vspace*{50\p@}% - \vspace*{\glueexpr\CTEX@chapter@beforeskip\relax}% + \@tempskipa = \glueexpr \CTEX@chapter@beforeskip \relax + \ifodd \CTEX@chapter@fixbeforeskip + \CTEX@fixbeforeskip + \fi + \vspace*{\@tempskipa}% % {\normalfont \parindent \z@ \raggedright {\normalfont \parindent \dimexpr \CTEX@chapter@indent \relax \CTEX@chapter@format @@ -8320,51 +8141,21 @@ This package consists of the file ctex.dtx, and the derived files %\pagestyle { headings } % \end{macrocode} % -% 汉化标题名字。 +% 日期格式。 % \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 } } +\keys_set:nn { ctex } { today = small } % \end{macrocode} -% \changes{v2.0.2}{2015/05/16}{修复加载 \pkg{ctex} 宏包后章节标题后第一段 -% 无段首缩进的问题。} -% 若 \pkg{ctex} 宏包与标准文档类及其衍生文档类联用,则将载入 \pkg{indentfirst} 宏包, -% 实现章节标题后首个段落的段首缩进。 +% +% 若用户未设置宏包选项 \opt{autoindent},则自动调整首行缩进。 +% \begin{macrocode} +\ctex_if_autoindent_touched:F + { \keys_set:nn { ctex } { autoindent = true } } +% \end{macrocode} +% +% 使用标题定义时的设置。首先是命题名字汉化。\cls{beamer} 需要汉化定理名称。 % \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> \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 } } -% %<*beamer> { \uselanguage { ChineseGBK } @@ -8376,33 +8167,71 @@ This package consists of the file ctex.dtx, and the derived files \languagealias { chinese } { ChineseUTF8 } \ctex_file_input:n { ctex-name-utf8.cfg } } -\clist_put_left:Nn \trans@languagepath { chinese } -% -% % \end{macrocode} -% -% 日期格式。 +% 让 \pkg{translator} 包优先查找中文翻译。 % \begin{macrocode} -\keys_set:nn { ctex } { today = small } +\clist_put_left:Nn \trans@languagepath { chinese } +% +%<*!beamer> + { \ctex_file_input:n { ctex-name-gbk.cfg } } + { \ctex_file_input:n { ctex-name-utf8.cfg } } % \end{macrocode} % -% 若用户未设置宏包选项 \opt{zihao},则设置 \tn{normalsize} 为五号字。 +% \changes{v2.4.1}{2016/05/09}{\cls{beamer} 不调整默认字体大小。} +% 对 \cls{beamer} 以外的文档类,若用户未设置宏包选项 \opt{zihao},则设置 \tn{normalsize} +% 为五号字。\cls{beamer} 不调整默认字体大小。 % \begin{macrocode} \int_compare:nNnF \g_@@_font_size_flag > \c_minus_one { \cs_gset_eq:NN \g_@@_font_size_flag \c_zero } % \end{macrocode} % -% 若用户未设置宏包选项 \opt{linespread},则设置行距初始值为 $1.3\times 1.2=1.56$ -% 倍字体大小。 +% \changes{v2.4.1}{2016/05/09}{\cls{beamer} 不调整默认行距。} +% 对 \cls{beamer} 以外的文档类,若用户未设置宏包选项 \opt{linespread},则设置行 +% 距初始值为 $1.3\times 1.2=1.56$ 倍字体大小。\cls{beamer} 不调整行距。 % \begin{macrocode} \fp_compare:nNnT { \l_@@_line_spread_fp } ? { \c_zero_fp } - { \keys_set:nn { ctex / option } { linespread = 1.3 } } + { \fp_set:Nn \l_@@_line_spread_fp { 1.3 } } +% +% % \end{macrocode} % -% 若用户未设置宏包选项 \opt{autoindent},则自动调整首行缩进。 +% 不使用标题定义时的通用设置。 % \begin{macrocode} -\ctex_if_autoindent_touched:F - { \keys_set:nn { ctex } { autoindent = true } } +%<*generic> +\tl_set:Nn \l_@@_tmp_tl { beamer } +\tl_if_eq:NNTF \c_@@_std_class_tl \l_@@_tmp_tl + { + \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 } } + \int_compare:nNnF \g_@@_font_size_flag > \c_minus_one + { \cs_gset_eq:NN \g_@@_font_size_flag \c_zero } + \fp_compare:nNnT { \l_@@_line_spread_fp } ? { \c_zero_fp } + { \fp_set:Nn \l_@@_line_spread_fp { 1.3 } } +% \end{macrocode} +% \changes{v2.0.2}{2015/05/16}{修复加载 \pkg{ctex} 宏包后章节标题后第一段 +% 无段首缩进的问题。} +% 若 \pkg{ctex} 宏包与标准文档类及其衍生文档类联用,则将载入 \pkg{indentfirst} 宏包, +% 实现章节标题后首个段落的段首缩进。 +% \begin{macrocode} + \tl_if_exist:NT \c_@@_std_class_tl + { \RequirePackage { indentfirst } } + } +% % \end{macrocode} % % \begin{macrocode} @@ -8887,14 +8716,14 @@ This package consists of the file ctex.dtx, and the derived files % \upTeX{} 使用的字体族。\upLaTeX 在 NFSS 下使用字体编码 |JY2| 和 |JT2| 来分别 % 表示横排与直排的日文。 % \begin{macrocode} -%<*uptex> +%<*uptex|aptex> \DeclareKanjiFamily{JY2}{rm}{} \DeclareKanjiFamily{JY2}{sf}{} \DeclareKanjiFamily{JY2}{tt}{} \DeclareKanjiFamily{JT2}{rm}{} \DeclareKanjiFamily{JT2}{sf}{} \DeclareKanjiFamily{JT2}{tt}{} -% +% % \end{macrocode} % % @@ -8923,14 +8752,14 @@ This package consists of the file ctex.dtx, and the derived files \DeclareFontShape{C70}{rm}{bx}{it}{<-> CJKb * unikai}{\CJKbold} % % -%<*uptex> +%<*uptex|aptex> \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}{} -% +% % \end{macrocode} % % \begin{macrocode} @@ -8958,12 +8787,12 @@ This package consists of the file ctex.dtx, and the derived files \DeclareFontShape{C70}{sf}{bx}{it}{<-> CJKb * uniyou}{\CJKbold} % % -%<*uptex> +%<*uptex|aptex> \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}{} -% +% % \end{macrocode} % % \begin{macrocode} @@ -8991,10 +8820,10 @@ This package consists of the file ctex.dtx, and the derived files \DeclareFontShape{C70}{tt}{bx}{it}{<-> CJKb * unifs}{\CJKbold} % % -%<*uptex> +%<*uptex|aptex> \DeclareFontShape{JY2}{tt}{m}{n}{<-> upzhmono-h}{} \DeclareFontShape{JT2}{tt}{m}{n}{<-> upzhmono-v}{} -% +% % \end{macrocode} % % \begin{macrocode} @@ -9004,11 +8833,14 @@ This package consists of the file ctex.dtx, and the derived files % \subsubsection{\pkg{ctex-fontset-windows.def}, % \pkg{ctex-fontset-windowsnew.def}, \pkg{ctex-fontset-windowsold.def}} % -% \pkg{ctex} 包利用 \path{C:\boot.ini} 文件的存在性来判断是否使用 Windows XP -% 及以前的版本,分别载入新旧字体设置。 +% \changes{v2.4.1}{2016/05/14}{使用 \file{bootfont.bin} 判断 Windows XP 以避免 +% 权限问题。} +% \pkg{ctex} 包利用 |C:\bootfont.bin| 文件的存在性来判断是否使用 Windows XP 版 +% 本,分别载入新旧字体设置。(注:\pkg{ctex} 包不支持 Windows 2000 以前使用 +% \file{simsun.ttf} 的旧宋体文件名。) % \begin{macrocode} %<*windows> -\file_if_exist:nTF { C:/boot.ini } +\file_if_exist:nTF { C:/bootfont.bin } { \ctex_file_input:n { ctex-fontset-windowsold.def } } { \ctex_file_input:n { ctex-fontset-windowsnew.def } } % @@ -9020,12 +8852,12 @@ This package consists of the file ctex.dtx, and the derived files % 加以区分。 % \begin{macrocode} %<*windowsnew> -\tl_new:N \l_@@_msyh_suffix -\tl_set:Nn \l_@@_msyh_suffix { .ttc } +\tl_new:N \l_@@_msyh_suffix_tl +\tl_set:Nn \l_@@_msyh_suffix_tl { .ttc } \file_if_exist:nF { C:/Windows/Fonts/msyh.ttc } { \file_if_exist:nF { msyh.ttc } - { \tl_set:Nn \l_@@_msyh_suffix { .ttf } } + { \tl_set:Nn \l_@@_msyh_suffix_tl { .ttf } } } % %<*windowsnew|windowsold> @@ -9041,9 +8873,9 @@ This package consists of the file ctex.dtx, and the derived files \ctex_punct_map_family:nn { \CJKsfdefault } { zhhei } % %<*windowsnew> - \setCJKsansfont [ BoldFont = msyhbd\l_@@_msyh_suffix ] { msyh\l_@@_msyh_suffix } + \setCJKsansfont [ BoldFont = msyhbd\l_@@_msyh_suffix_tl ] { msyh\l_@@_msyh_suffix_tl } \setCJKfamilyfont { zhyahei } - [ BoldFont = msyhbd\l_@@_msyh_suffix ] { msyh\l_@@_msyh_suffix } + [ BoldFont = msyhbd\l_@@_msyh_suffix_tl ] { msyh\l_@@_msyh_suffix_tl } \ctex_punct_map_family:nn { \CJKsfdefault } { zhyahei } \ctex_punct_map_bfseries:nn { \CJKsfdefault , zhyahei } { zhyaheib } % @@ -9077,7 +8909,7 @@ This package consists of the file ctex.dtx, and the derived files { \ctex_set_upfonts:nnnnnn {simsun.ttc} {simhei.ttf} {simkai.ttf} -% {msyh\l_@@_msyh_suffix} {msyhbd\l_@@_msyh_suffix} +% {msyh\l_@@_msyh_suffix_tl} {msyhbd\l_@@_msyh_suffix_tl} % {simhei.ttf} {simhei.ttf} {simfang.ttf} \ctex_set_upfamily:nnn { zhsong } { upzhserif } {} @@ -10457,18 +10289,17 @@ This package consists of the file ctex.dtx, and the derived files \ctex_get_macro_meaning:N ##1 { TF } { \exp_after:wN \@@_get_macro_meaning:w - \token_to_meaning:N ##1 \q_mark #1 -> \q_no_value \q_mark \q_stop + \token_to_meaning:N ##1 \q_mark #1 -> \q_mark \q_stop } \cs_new_protected:Npn \@@_get_macro_meaning:w ##1 #1 ##2 -> ##3 \q_mark ##4 \q_stop { - \tl_set:Nn \l_@@_replacement_tl {##3} - \quark_if_no_value:NTF \l_@@_replacement_tl + \tl_if_empty:nTF { ##4 } { \prg_return_false: } { - \str_set:Nn \l_@@_prefix_str {##1} - \str_set:Nn \l_@@_parameter_str {##2} - \str_set:Nn \l_@@_replacement_str {##3} + \str_set:Nn \l_@@_prefix_str { ##1 } + \str_set:Nn \l_@@_parameter_str { ##2 } + \str_set:Nn \l_@@_replacement_str { ##3 } \prg_return_true: } } @@ -10514,7 +10345,7 @@ This package consists of the file ctex.dtx, and the derived files { \str_if_empty:NTF #2 { \tl_clear:N #1 } - { \tl_set_rescan:Nnx #1 {#3} {#2} } + { \tl_set_rescan:Nno #1 {#3} {#2} } } \tl_new:N \l_@@_prefix_tl \tl_new:N \l_@@_parameter_tl @@ -10567,30 +10398,31 @@ This package consists of the file ctex.dtx, and the derived files \ctex_get_macro_meaning:NTF #1 { \str_if_empty:NTF \l_@@_parameter_str - { \@@_hookto_cmd_parameterless:Nnnw #1 {#2} {#4} } - { \@@_hookto_cmd_parameter:Nnnnw #1 {#2} {#3} {#4} } + { \@@_hookto_cmd_parameterless:Nnnnw } + { \@@_hookto_cmd_parameter:Nnnnw } + #1 {#2} {#3} {#4} } { \@@_patch_false:w } } % \end{macrocode} % \end{macro} % -% \begin{macro}[aux]{\@@_hookto_cmd_parameterless:Nnnw} +% \begin{macro}[aux]{\@@_hookto_cmd_parameterless:Nnnnw} % 如果宏没有参数,可以直接进行附加操作。注意保持宏的前缀。 % \begin{macrocode} -\cs_new_protected:Npn \@@_hookto_cmd_parameterless:Nnnw #1#2#3 +\cs_new_protected:Npn \@@_hookto_cmd_parameterless:Nnnnw #1#2#3#4 { \str_if_empty:NF \l_@@_prefix_str - { \tl_rescan:nx { } { \l_@@_prefix_str } } + { \tl_rescan:no {#3} { \l_@@_prefix_str } } \tex_edef:D #1 { \use:c { @@_ #2 _hook_aux:nn } { \exp_not:o {#1} } - { \exp_not:n {#3} } + { \exp_not:n {#4} } } \@@_patch_true:w } -\cs_generate_variant:Nn \tl_rescan:nn { nx } +\cs_generate_variant:Nn \tl_rescan:nn { no } \cs_new:Npn \@@_left_hook_aux:nn #1#2 { #2#1 } \cs_new_eq:NN \@@_right_hook_aux:nn \use:nn % \end{macrocode} @@ -10621,4 +10453,387 @@ This package consists of the file ctex.dtx, and the derived files % % \Finale % +% \endinput +% +% \DisableImplementation +% +% \begin{implementation} +% +% \subsection{\cls{ctxdoc}} +% +% \begin{macrocode} +%<*ctxdoc> +\ExplSyntaxOff +\DeclareOption*{\PassOptionsToClass{\CurrentOption}{l3doc}} +\PassOptionsToClass{a4paper,full}{l3doc} +\ProcessOptions +\@namedef{ver@thumbpdf.sty}{9999/99/99} +\LoadClass{l3doc} +\RequirePackage[UTF8, punct = kaiming, heading, fontset = none, + linespread = 1.2, sub3section]{ctex} +\ifxetex + \xeCJKsetup{AutoFakeBold=false} +\fi +\ctexset{ + fontset, + abstractname = 简介, + indexname = 代码索引, + section = { + format = \Large\bfseries\raggedright, + name = {第,节}, + }, +} +\RequirePackage[toc]{multitoc} +\RequirePackage{geometry} +\RequirePackage{tabularx} +\RequirePackage{makecell} +\RequirePackage{threeparttable} +\RequirePackage{siunitx} +\RequirePackage{unicode-math} +\RequirePackage{xcolor} +\RequirePackage{caption} +\RequirePackage{fvrb-ex} +\geometry{includemp,hmargin={0mm,15mm},vmargin={25mm,15mm},footskip=7mm} +\hypersetup{pdfstartview=FitH,bookmarksdepth=subparagraph} +\setcounter{secnumdepth}{4} +\setcounter{tocdepth}{2} +\newcommand*\email{\nolinkurl} +\setmainfont{TeX Gyre Pagella} +\setsansfont{TeX Gyre Heros} +\setmonofont[ + UprightFont=* Light, BoldFont=* Bold, + SlantedFont=* Light Oblique]{CMU Typewriter Text} +\setmathfont{texgyrepagella-math.otf} +\captionsetup{strut=off, labelsep=quad, labelfont+=bf} +%% <--- http://tex.stackexchange.com/a/40896 +\patchcmd{\@addtocurcol}% + {\vskip \intextsep}% + {\edef\save@first@penalty{\the\lastpenalty}\unpenalty + \ifnum \lastpenalty = \@M % hopefully the OR penalty + \unpenalty + \else + \penalty \save@first@penalty \relax % put it back + \fi + \ifnum\outputpenalty <-\@Mii + \addvspace\intextsep + \vskip\parskip + \else + \addvspace\intextsep + \fi}% + {\typeout{*** SUCCESS ***}}{\typeout{*** FAIL ***}} +\patchcmd{\@addtocurcol}% + {\vskip\intextsep \ifnum\outputpenalty <-\@Mii \vskip -\parskip\fi}% + {\ifnum\outputpenalty <-\@Mii + \aftergroup\vskip\aftergroup\intextsep + \aftergroup\nointerlineskip + \else + \vskip\intextsep + \fi}% + {\typeout{*** SUCCESS ***}}{\typeout{*** FAIL ***}} +\patchcmd{\@getpen}{\@M}{\@Mi} + {\typeout{*** SUCCESS ***}}{\typeout{*** FAIL ***}} +%% ---> +%% 不对代码实现的 \section 以下标题编目录。 +\AtBeginEnvironment{implementation}{% + \ifnum\value{tocdepth}>\@ne + \addtocontents{toc}{\protect\value{tocdepth}=1\relax}% + \fi} +\ifxetex + \let\ctexdocverbaddon\xeCJKVerbAddon + \def\ctexdisableecglue{\xeCJKsetup{CJKecglue}} + \def\ctexplainps{\xeCJKsetup{PunctStyle=plain}} + \appto\meta@font@select{\ifinner\ctexdisableecglue\fi} +\else + \let\ctexdocverbaddon\relax + \let\ctexplainps\relax + \def\ctexdisableecglue{\ltjsetparameter{autoxspacing=false}} + \appto\meta@font@select{\ctexdisableecglue} +\fi +\setlist{noitemsep,topsep=\smallskipamount} +\setlist[1]{labelindent=\parindent} +\setlist[enumerate]{leftmargin=*} +\setlist[itemize]{leftmargin=*} +\newlist{optdesc}{description}{3} +%% 设置间距为 \marginparsep,与 l3doc 一致 +\setlist[optdesc]{% + font=\mdseries\small\ttfamily,align=right,listparindent=\parindent, + labelsep=\marginparsep,labelindent=-\marginparsep,leftmargin=*} +%% 重新定义 threeparttable 包的 tablenotes 环境 +\renewlist{tablenotes}{description}{1} +\setlist[tablenotes]{% + format=\normalfont\tnote@item,align=right,listparindent=\parindent, + labelindent=\tabcolsep,leftmargin=*,rightmargin=\tabcolsep, + after=\@noparlisttrue} +\AtBeginEnvironment{tablenotes}{% + \setlength\parindent{2\ccwd}% + \normalfont\footnotesize} +\AtBeginEnvironment{threeparttable}{% + \stepcounter{tpt@id}% + \edef\curr@tpt@id{tpt@\arabic{tpt@id}}} +\newcounter{tpt@id} +\def\tnote@item#1{% + \Hy@raisedlink{\hyper@anchor{\curr@tpt@id-#1}}#1} +\def\TPTtagStyle#1{\hyperlink{\curr@tpt@id-#1}{#1}} +\fvset{ + fontsize=\small,baselinestretch=1,numbersep=5pt, + formatcom=\ctexdocverbaddon, + listparameters=\setlength\topsep{\MacrocodeTopsep}} +\DefineVerbatimEnvironment{frameverb}{Verbatim}{% + gobble=4, + frame=single,framesep=8pt, + listparameters= + \setlength\topsep{\medskipamount}% + \appto\FV@EndList{\nointerlineskip}} +\DefineVerbatimEnvironment{ctexexam}{Verbatim}{% + gobble=4, + frame=single,framesep=10pt, + label=\rule{0pt}{12pt}\textnormal{\bfseries 例 \arabic{ctexexam}}, + listparameters= + \setlength\topsep{\bigskipamount}% + \refstepcounter{ctexexam}\ctexexamlabelref + \appto\FV@EndList{\nointerlineskip}} +\define@key{FV}{labelref}{\def\ctexexamlabelref{\label{#1}}} +\let\ctexexamlabelref\empty +\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} +\AfterEndEnvironment{function}{\ctexfixprevdepth} +\AtBeginEnvironment{syntax}{\linespread{1}\ctexplainps\ctexdisableecglue} +\BeforeBeginEnvironment{SideBySideExample}{\par\addvspace{\medskipamount}} +\preto\MacroFont{\linespread{1}} +\appto\MacroFont{\hyphenchar\font\m@ne\ctexdocverbaddon} +\preto\AltMacroFont{\linespread{1}} +\appto\AltMacroFont{\hyphenchar\font\m@ne\ctexdocverbaddon} +\def\Module#1{\mbox{% + \color{purple}\footnotesize\normalfont\sffamily\textlangle#1\textrangle}} +\newcommand*\exptarget{\Hy@raisedlink{\hypertarget{expstar}{}}} +\newcommand*\rexptarget{\Hy@raisedlink{\hypertarget{rexpstar}{}}} +\newcommand*\expstar{\hyperlink{expstar}{$\star$}} +\newcommand*\rexpstar{\hyperlink{rexpstar}{\ding{73}}} +\ExplSyntaxOn +%% l3doc 会设置列表环境中 \listparindent=\z@,我们在这里恢复它。 +\cs_set_eq:NN \list \__codedoc_oldlist:nn +\cs_new_nopar:Npn \zihaopt #1 + { + \exp_last_unbraced:Nf \tl_head:w + { \prop_item:Nn \c__ctex_font_size_prop {#1} } { } \q_stop + } +%% 用 \vtop 让函数名字和语法盒子首行对齐 +\patchcmd \__codedoc_syntax:w + { { minipage } { \l__codedoc_syntax_dim } } + { { 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 + { \vbox_unpack_clear:N } + { \linespread { 1 } \selectfont \vbox_unpack_clear:N } + { \iow_term:n { *** ~ SUCCESS ~ *** } } + { \iow_term:n { *** ~ FAIL ~ *** } } +%% 不重复使用 \HD@target,避免索引出现重复页码 +\cs_set_protected:Npn \__codedoc_special_index_aux:nnnnn #1#2#3#4#5 + { + \__codedoc_special_index_set:Nn \l__codedoc_index_escaped_macro_tl {#2} + \str_if_eq:onTF { \@currenvir } { macrocode } + { \codeline@wrindex } + { + \HD@target + \index + } + { + \tl_if_empty:nF { #3 #4 } + { #3 \actualchar #4 \levelchar } + #1 + \actualchar + { + \token_to_str:N \verbatim@font \c_space_tl + \l__codedoc_index_escaped_macro_tl + } + \encapchar + hdclindex{\the\c@HD@hypercount}{#5} + } + } +\DeclareDocumentCommand \cs { O{} m } + { \__codedoc_cmd_aux:no {#1} { \c__codedoc_backslash_tl #2 } } +\DeclareDocumentCommand \tn { O{} m } + { + \__codedoc_cmd_aux:no + { index = TeX , replace = false , #1 } + { \c__codedoc_backslash_tl #2 } + } +\DeclareDocumentCommand \meta { +m } + { \__codedoc_meta_aux:n {#1} } +\DeclareExpandableDocumentCommand \bookmarkcstn { O{} m } + { \textbackslash \tl_to_str:n {#2} } +\cs_new:Npn \bookmarkmeta #1 { < \tl_to_str:n {#1} > } +\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 等编索引 +\DeclareDocumentCommand \StopSpecialIndexModule { } + { \cs_set_eq:NN \__codedoc_special_index_module:nnnn \use_none:nnnn } +\tl_map_inline:nn { \actualchar \encapchar \levelchar } + { \exp_args:Nx \DoNotIndex { \bslash \tl_to_str:N #1 } } +\DeclareDocumentCommand \package { o m } + { + \exp_args:Nx \href + { + http \c_colon_str //www.ctan.org/pkg/ + \IfNoValueTF {#1} { \str_fold_case:n {#2} } {#1} + } + { \pkg {#2} } + } +\DeclareDocumentCommand \GetFileId { m } + { + \GetFileInfo {#1} + \ior_open:NnTF \g_ctxdoc_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 + } + { \GetIdInfo $Id$ } + { \fileinfo } + } +\iow_new:N \g_ctxdoc_ior +\ExplSyntaxOff +\AtBeginDocument{\addtocontents{toc}{\StopSpecialIndexModule}} +\pdfstringdefDisableCommands{% + \let\cs\bookmarkcstn + \let\tn\bookmarkcstn + \let\meta\bookmarkmeta + \let\path\meta + \let\opt\@firstofone} +\preto\@thehead{\cslet{MakeUppercase\space}{\@iden}} +\def\orbar{\textup{\textbar}} +\def\defaultval#1{\textbf{\textup{#1}}} +\def\defaultvalaux#1){\defaultval{#1}} +\def\TF{true\orbar false} +\def\TTF{\defaultval{true}\orbar false} +\def\TFF{true\orbar\defaultval{false}} +\protected\def\opt{\texttt} +\def\pdfTeX{\hologo{pdfTeX}} +\def\XeTeX{\hologo{XeTeX}} +\def\XeLaTeX{\hologo{XeLaTeX}} +\def\LuaLaTeX{\hologo{LuaLaTeX}} +\def\pdfLaTeX{\hologo{pdfLaTeX}} +\def\LaTeX{\hologo{LaTeX}} +\def\LaTeXe{\hologo{LaTeX2e}} +\def\LaTeXiii{\hologo{LaTeX3}} +\def\dvipdfmx{DVIPDFM\textit{x}} +\def\TeX{\hologo{TeX}} +\def\ApTeX{Ap\TeX} +\def\ApLaTeX{Ap\LaTeX} +\def\upTeX{up\TeX} +\def\upLaTeX{up\LaTeX} +\def\bashcmd{\texttt} +\def\TeXLive{\TeX\ Live} +\def\MiKTeX{\hologo{MiKTeX}} +\def\BSTACK{\begin{tabular}[t]{@{}l@{}}} +\def\ESTACK{\end{tabular}} +\newenvironment{defaultcapconfig}{% + \MakePercentComment + \input{ctex-name-utf8.cfg}% + \ExplSyntaxOff + \MakePercentIgnore}{} +\def\ctexkit{\href{https://github.com/CTeX-org/ctex-kit/}{\texttt{ctex-kit}}} +\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}{}{} +\appto\GlossaryParms{% + \def\@idxitem{\par\hangindent 2em }% + \def\subitem{\@idxitem\hspace*{1em}}% + \def\subsubitem{\@idxitem\hspace*{2em}}} +\patchcmd\l@section{2.5em}{1.5em}{}{} +\patchcmd\l@subsection{2.5em}{1.5em}{}{} +\patchcmd\changes@{\space}{\lbrack}{}{} +\patchcmd\@wrglossary{hdpindex}{% + \ifnum\c@HD@hypercount=\z@ + hdpindex% + \else + hdclindex{\the\c@HD@hypercount}\fi}{}{} +\def\glossaryname{版本历史} +\GlossaryPrologue{\section{\glossaryname}} +\IndexPrologue{% + \section{\indexname} + \textit{意大利体的数字表示描述对应索引项的页码; + 带下划线的数字表示定义对应索引项的代码行号; + 罗马字体的数字表示使用对应索引项的代码行号。}} +\def\IndexLayout{% + \newgeometry{hmargin=15mm,vmargin={25mm,15mm},footskip=7mm}% + \setlength\IndexMin{.5\textheight}% + \ctexset{section/numbering=false}% + \StopSpecialIndexModule} +\EnableCrossrefs +\CodelineIndex +\RecordChanges +% +% \end{macrocode} +% +% \subsection{\pkg{ctxdocstrip}} +% +% \begin{macrocode} +%<*docstrip> +\csname ctxdocstriploaded\endcsname +\let\ctxdocstriploaded\endinput +\input l3docstrip % +\edef\ctxresetcatcode{% + \catcode\number`\$=\the\catcode`\$\relax} +\makeOther\$ +\def\plusOption+#1>#2$#3$\endLine{% + \maybeMsg{<+#1 . >}% + \Evaluate{#1}% + \def\ctxCMD{#2}% + \def\ctxID{$#3$}% + \def\do##1##2##3{% + \if1\Expr{##2}% + \readIDFile + \StreamPut##1{\inLine}% + \fi + }% + \activefiles +} +\def\readIDFile{% + \openin\inputcheck=\jobname.id\relax + \ifeof\inputcheck\else + \read \inputcheck to \inLine + \closein\inputcheck + \fi + \ifx\inLine\empty\else + \let\ctxID\inLine + \fi + \maybeMsg{^^J\ctxID^^J}% + \def\inLine{\ctxCMD\ctxID}% +} +\keepsilent +\askforoverwritefalse +\declarepreamble\emptypreamble +\endpreamble +\declarepostamble\emptypostamble +\endpostamble +\ctxresetcatcode +% +% \end{macrocode} +% +% \end{implementation} +% \endinput diff --git a/Master/texmf-dist/source/latex/ctex/ctex.ins b/Master/texmf-dist/source/latex/ctex/ctex.ins new file mode 100644 index 00000000000..aae0b8226ef --- /dev/null +++ b/Master/texmf-dist/source/latex/ctex/ctex.ins @@ -0,0 +1,283 @@ +%% +%% This is file `ctex.ins', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% ctex.dtx (with options: `install') +%% +%% Copyright (C) 2003--2016 +%% CTEX.ORG and any individual authors listed in the documentation. +%% ------------------------------------------------------------------------------ +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. This version of this license is in +%% http://www.latex-project.org/lppl/lppl-1-3c.txt +%% and the latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang. +%% +%% ------------------------------------------------------------------------------ +%% + +\input ctxdocstrip % + +\preamble + + Copyright (C) 2003--2016 + CTEX.ORG and any individual authors listed in the documentation. +------------------------------------------------------------------------------ + + This work may be distributed and/or modified under the + conditions of the LaTeX Project Public License, either + version 1.3c of this license or (at your option) any later + version. This version of this license is in + http://www.latex-project.org/lppl/lppl-1-3c.txt + and the latest version of this license is in + http://www.latex-project.org/lppl.txt + and version 1.3 or later is part of all distributions of + LaTeX version 2005/12/01 or later. + + This work has the LPPL maintenance status `maintained'. + + The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang. + +------------------------------------------------------------------------------ + +\endpreamble +\postamble + + This package consists of the file ctex.dtx, + and the derived files ctex.pdf, + ctex.ins, + ctex.sty, + ctexsize.sty, + ctexheading.sty, + ctexart.cls, + ctexbook.cls, + ctexrep.cls, + ctexbeamer.cls, + ctxdoc.cls, + ctexcap.sty, + ctexhook.sty, + ctexpatch.sty, + ctex-c5size.clo, + ctex-cs4size.clo, + 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, + ctexopts.cfg, + ctex-engine-pdftex.def, + ctex-engine-xetex.def, + ctex-engine-luatex.def, + ctex-engine-aptex.def, + ctex-engine-uptex.def, + c19rm.fd, + c19sf.fd, + c19tt.fd, + c70rm.fd, + c70sf.fd, + c70tt.fd, + ctex-fontset-windows.def, + ctex-fontset-windowsnew.def, + ctex-fontset-windowsold.def, + ctex-fontset-adobe.def, + ctex-fontset-fandol.def, + ctex-fontset-mac.def, + ctex-fontset-founder.def, + ctex-fontset-ubuntu.def, + ctexspa.def, + ctexpunct.spa, + ctexmakespa.tex, + ctexspamacro.tex, + ctxdocstrip.tex, + zhadobefonts.tex, + zhfandolfonts.tex, + zhfounderfonts.tex, + zhubuntufonts.tex, + zhwindowsfonts.tex, + translator-theorem-dictionary-ChineseGBK.dict, + translator-theorem-dictionary-ChineseUTF8.dict, and + README.md. +\endpostamble + +\generate + { + \usedir{tex/latex/ctex} + \file{ctex.sty} {\from{\jobname.dtx}{style,ctex}} + \file{ctexsize.sty} {\from{\jobname.dtx}{style,ctexsize}} + \file{ctexheading.sty} {\from{\jobname.dtx}{style,ctexheading}} + \file{ctexart.cls} {\from{\jobname.dtx}{class,article}} + \file{ctexbook.cls} {\from{\jobname.dtx}{class,book}} + \file{ctexrep.cls} {\from{\jobname.dtx}{class,report}} + \file{ctexbeamer.cls} {\from{\jobname.dtx}{class,beamer}} + \usepostamble\emptypostamble + \file{ctxdoc.cls} {\from{\jobname.dtx}{ctxdoc}} + \file{ctexcap.sty} {\from{\jobname.dtx}{ctexcap}} + \file{ctexhook.sty} {\from{\jobname.dtx}{ctexhook}} + \file{ctexpatch.sty} {\from{\jobname.dtx}{ctexpatch}} + \file{ctex-c5size.clo} {\from{\jobname.dtx}{c5size}} + \file{ctex-cs4size.clo} {\from{\jobname.dtx}{cs4size}} + \file{ctex-article.def} {\from{\jobname.dtx}{heading,article}} + \file{ctex-book.def} {\from{\jobname.dtx}{heading,book}} + \file{ctex-report.def} {\from{\jobname.dtx}{heading,report}} + \file{ctex-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-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-aptex.def} {\from{\jobname.dtx}{aptex}} + \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}} + \file{c70rm.fd} {\from{\jobname.dtx}{rm,c70}} + \file{c70sf.fd} {\from{\jobname.dtx}{sf,c70}} + \file{c70tt.fd} {\from{\jobname.dtx}{tt,c70}} + \file{ctex-fontset-windows.def} {\from{\jobname.dtx}{fontset,windows}} + \file{ctex-fontset-windowsnew.def} {\from{\jobname.dtx}{fontset,windowsnew}} + \file{ctex-fontset-windowsold.def} {\from{\jobname.dtx}{fontset,windowsold}} + \file{ctex-fontset-adobe.def} {\from{\jobname.dtx}{fontset,adobe}} + \file{ctex-fontset-fandol.def} {\from{\jobname.dtx}{fontset,fandol}} + \file{ctex-fontset-mac.def} {\from{\jobname.dtx}{fontset,mac}} + \file{ctex-fontset-founder.def} {\from{\jobname.dtx}{fontset,founder}} + \file{ctex-fontset-ubuntu.def} {\from{\jobname.dtx}{fontset,ubuntu}} + \file{translator-theorem-dictionary-ChineseGBK.dict} + {\from{\jobname.dtx}{dict,theorem,GBK}} + \file{translator-theorem-dictionary-ChineseUTF8.dict} + {\from{\jobname.dtx}{dict,theorem,UTF8}} + \file{ctexspa.def} + { + \from{\jobname.dtx} {ctexspa} + \from{ctexpunct.spa} {} + } + \usedir{tex/generic/ctex} + \file{ctexmakespa.tex} {\from{\jobname.dtx}{spa,make}} + \file{ctexspamacro.tex} {\from{\jobname.dtx}{spa,macro}} + \file{zhadobefonts.tex} {\from{\jobname.dtx}{zhmap,adobe}} + \file{zhfandolfonts.tex} {\from{\jobname.dtx}{zhmap,fandol}} + \file{zhfounderfonts.tex} {\from{\jobname.dtx}{zhmap,founder}} + \file{zhubuntufonts.tex} {\from{\jobname.dtx}{zhmap,ubuntu}} + \file{zhwindowsfonts.tex} {\from{\jobname.dtx}{zhmap,windows}} + \file{ctxdocstrip.tex} {\from{\jobname.dtx}{docstrip}} + \nopreamble\nopostamble + \usedir{doc/latex/ctex} + \file{README.md} {\from{\jobname.dtx}{readme}} + } + +\catcode32=12\space + +\Msg{*************************************************************} +\Msg{* *} +\Msg{* To finish the installation you have to move the following *} +\Msg{* file into proper directories searched by TeX: *} +\Msg{* *} +\Msg{* The recommended directory is TDS:tex/latex/ctex *} +\Msg{* *} +\Msg{* ctex.sty *} +\Msg{* ctexsize.sty *} +\Msg{* ctexheading.sty *} +\Msg{* ctexart.cls *} +\Msg{* ctexbook.cls *} +\Msg{* ctexrep.cls *} +\Msg{* ctexbeamer.cls *} +\Msg{* ctxdoc.cls *} +\Msg{* ctexcap.sty *} +\Msg{* ctexhook.sty *} +\Msg{* ctexpatch.sty *} +\Msg{* ctex-c5size.clo *} +\Msg{* ctex-cs4size.clo *} +\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 *} +\Msg{* ctexopts.cfg *} +\Msg{* ctex-engine-pdftex.def *} +\Msg{* ctex-engine-xetex.def *} +\Msg{* ctex-engine-luatex.def *} +\Msg{* ctex-engine-aptex.def *} +\Msg{* ctex-engine-uptex.def *} +\Msg{* c19rm.fd *} +\Msg{* c19sf.fd *} +\Msg{* c19tt.fd *} +\Msg{* c70rm.fd *} +\Msg{* c70sf.fd *} +\Msg{* c70tt.fd *} +\Msg{* ctex-fontset-windows.def *} +\Msg{* ctex-fontset-windowsnew.def *} +\Msg{* ctex-fontset-windowsold.def *} +\Msg{* ctex-fontset-adobe.def *} +\Msg{* ctex-fontset-fandol.def *} +\Msg{* ctex-fontset-mac.def *} +\Msg{* ctex-fontset-founder.def *} +\Msg{* ctex-fontset-ubuntu.def *} +\Msg{* ctexspa.def *} +\Msg{* ctexmakespa.tex *} +\Msg{* ctexspamacro.tex *} +\Msg{* ctxdocstrip.tex *} +\Msg{* zhadobefonts.tex *} +\Msg{* zhfandolfonts.tex *} +\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. *} +\Msg{* *} +\Msg{* Happy TeXing! *} +\Msg{* *} +\Msg{*************************************************************} + +\endbatchfile +%% +%% +%% End of file `ctex.ins'. diff --git a/Master/texmf-dist/tex/generic/ctex/ctxdocstrip.tex b/Master/texmf-dist/tex/generic/ctex/ctxdocstrip.tex new file mode 100644 index 00000000000..d1b45c1af6b --- /dev/null +++ b/Master/texmf-dist/tex/generic/ctex/ctxdocstrip.tex @@ -0,0 +1,69 @@ +%% +%% This is file `ctxdocstrip.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% ctex.dtx (with options: `docstrip') +%% +%% Copyright (C) 2003--2016 +%% CTEX.ORG and any individual authors listed in the documentation. +%% ------------------------------------------------------------------------------ +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. This version of this license is in +%% http://www.latex-project.org/lppl/lppl-1-3c.txt +%% and the latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang. +%% +%% ------------------------------------------------------------------------------ +%% +\csname ctxdocstriploaded\endcsname +\let\ctxdocstriploaded\endinput +\input l3docstrip % +\edef\ctxresetcatcode{% + \catcode\number`\$=\the\catcode`\$\relax} +\makeOther\$ +\def\plusOption+#1>#2$#3$\endLine{% + \maybeMsg{<+#1 . >}% + \Evaluate{#1}% + \def\ctxCMD{#2}% + \def\ctxID{$#3$}% + \def\do##1##2##3{% + \if1\Expr{##2}% + \readIDFile + \StreamPut##1{\inLine}% + \fi + }% + \activefiles +} +\def\readIDFile{% + \openin\inputcheck=\jobname.id\relax + \ifeof\inputcheck\else + \read \inputcheck to \inLine + \closein\inputcheck + \fi + \ifx\inLine\empty\else + \let\ctxID\inLine + \fi + \maybeMsg{^^J\ctxID^^J}% + \def\inLine{\ctxCMD\ctxID}% +} +\keepsilent +\askforoverwritefalse +\declarepreamble\emptypreamble +\endpreamble +\declarepostamble\emptypostamble +\endpostamble +\ctxresetcatcode +%% +%% +%% End of file `ctxdocstrip.tex'. diff --git a/Master/texmf-dist/tex/latex/ctex/config/ctex-name-gbk.cfg b/Master/texmf-dist/tex/latex/ctex/config/ctex-name-gbk.cfg index 0e85f95f53c..f10c59afe12 100644 --- a/Master/texmf-dist/tex/latex/ctex/config/ctex-name-gbk.cfg +++ b/Master/texmf-dist/tex/latex/ctex/config/ctex-name-gbk.cfg @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Caption with encoding GBK (CTEX)} \ProvidesExplFile{ctex-name-gbk.cfg} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \keys_set_known:nn { ctex } { contentsname = Ŀ¼ , diff --git a/Master/texmf-dist/tex/latex/ctex/config/ctex-name-utf8.cfg b/Master/texmf-dist/tex/latex/ctex/config/ctex-name-utf8.cfg index 1e5784b9c58..ee0c4412323 100644 --- a/Master/texmf-dist/tex/latex/ctex/config/ctex-name-utf8.cfg +++ b/Master/texmf-dist/tex/latex/ctex/config/ctex-name-utf8.cfg @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Caption with encoding UTF8 (CTEX)} \ProvidesExplFile{ctex-name-utf8.cfg} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \keys_set_known:nn { ctex } { contentsname = 目录 , diff --git a/Master/texmf-dist/tex/latex/ctex/config/ctex.cfg b/Master/texmf-dist/tex/latex/ctex/config/ctex.cfg index 20b7d31209b..49e63f873fc 100644 --- a/Master/texmf-dist/tex/latex/ctex/config/ctex.cfg +++ b/Master/texmf-dist/tex/latex/ctex/config/ctex.cfg @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Configuration file (CTEX)} \ProvidesExplFile{\ExplFileName.cfg} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} %% %% %% diff --git a/Master/texmf-dist/tex/latex/ctex/config/ctexopts.cfg b/Master/texmf-dist/tex/latex/ctex/config/ctexopts.cfg index 6c50c294638..e4222855db1 100644 --- a/Master/texmf-dist/tex/latex/ctex/config/ctexopts.cfg +++ b/Master/texmf-dist/tex/latex/ctex/config/ctexopts.cfg @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Option configuration file (CTEX)} \ProvidesExplFile{ctexopts.cfg} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} %% %% \keys_set:nn { ctex / option } { fontset = windowsnew } %% diff --git a/Master/texmf-dist/tex/latex/ctex/ctex-article.def b/Master/texmf-dist/tex/latex/ctex/ctex-article.def index 3c17fbd5c77..1d4880b4c6f 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctex-article.def +++ b/Master/texmf-dist/tex/latex/ctex/ctex-article.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Heading modification for article (CTEX)} \ProvidesExplFile{ctex-article.def} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \seq_new:N \c__ctex_section_headings_seq \seq_gset_from_clist:Nn \c__ctex_section_headings_seq { section , subsection , subsubsection , paragraph , subparagraph } @@ -117,13 +117,18 @@ { \tl_clear:c { CTEX@post#1 } } { \tl_set:cn { CTEX@post#1 } {#3} } } +\group_begin: +\tl_clear:N \l__ctex_tmp_tl \seq_map_inline:Nn \c__ctex_headings_seq { \__ctex_initial_heading:n {#1} \__ctex_def_heading_keys:n {#1} } -\use:x { \keys_define:nn { ctex } { \exp_not:o { \l__ctex_tmp_tl } } } -\tl_clear:N \l__ctex_tmp_tl +\use:x + { + \group_end: + \keys_define:nn { ctex } { \exp_not:o { \l__ctex_tmp_tl } } + } \cs_new_protected_nopar:Npn \CTEX@makeheadinganchor { } \ctex_at_end_package:nn { hyperref } { \cs_gset_protected_nopar:Npn \CTEX@makeheadinganchor { \phantomsection } } diff --git a/Master/texmf-dist/tex/latex/ctex/ctex-beamer.def b/Master/texmf-dist/tex/latex/ctex/ctex-beamer.def index c672d635ad3..30b4977388d 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctex-beamer.def +++ b/Master/texmf-dist/tex/latex/ctex/ctex-beamer.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Heading modification for beamer (CTEX)} \ProvidesExplFile{ctex-beamer.def} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \seq_new:N \c__ctex_headings_seq \seq_gset_from_clist:Nn \c__ctex_headings_seq { part , section , subsection } @@ -112,13 +112,18 @@ { \tl_clear:c { CTEX@post#1 } } { \tl_set:cn { CTEX@post#1 } {#3} } } +\group_begin: +\tl_clear:N \l__ctex_tmp_tl \seq_map_inline:Nn \c__ctex_headings_seq { \__ctex_initial_heading:n {#1} \__ctex_def_heading_keys:n {#1} } -\use:x { \keys_define:nn { ctex } { \exp_not:o { \l__ctex_tmp_tl } } } -\tl_clear:N \l__ctex_tmp_tl +\use:x + { + \group_end: + \keys_define:nn { ctex } { \exp_not:o { \l__ctex_tmp_tl } } + } \ExplSyntaxOff \defbeamertemplate*{part page}{CTEX}[1][]{ \begingroup diff --git a/Master/texmf-dist/tex/latex/ctex/ctex-book.def b/Master/texmf-dist/tex/latex/ctex/ctex-book.def index dc31743dd8a..17546e00669 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctex-book.def +++ b/Master/texmf-dist/tex/latex/ctex/ctex-book.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Heading modification for book (CTEX)} \ProvidesExplFile{ctex-book.def} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \seq_new:N \c__ctex_section_headings_seq \seq_gset_from_clist:Nn \c__ctex_section_headings_seq { section , subsection , subsubsection , paragraph , subparagraph } @@ -118,21 +118,36 @@ { \tl_clear:c { CTEX@post#1 } } { \tl_set:cn { CTEX@post#1 } {#3} } } +\group_begin: \tl_set:Nn \l__ctex_tmp_tl { - part / pagestyle .tl_set:N = \CTEX@part@pagestyle , - chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle , + part / pagestyle .tl_set:N = \CTEX@part@pagestyle , + chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle , + part / fixbeforeskip .bool_set:N = \CTEX@part@fixbeforeskip , + chapter / fixbeforeskip .bool_set:N = \CTEX@chapter@fixbeforeskip , } \seq_map_inline:Nn \c__ctex_headings_seq { \__ctex_initial_heading:n {#1} \__ctex_def_heading_keys:n {#1} } -\use:x { \keys_define:nn { ctex } { \exp_not:o { \l__ctex_tmp_tl } } } -\tl_clear:N \l__ctex_tmp_tl +\use:x + { + \group_end: + \keys_define:nn { ctex } { \exp_not:o { \l__ctex_tmp_tl } } + } \cs_new_protected_nopar:Npn \CTEX@makeheadinganchor { } \ctex_at_end_package:nn { hyperref } { \cs_gset_protected_nopar:Npn \CTEX@makeheadinganchor { \phantomsection } } +\cs_new_protected_nopar:Npn \CTEX@fixbeforeskip + { + \par + \ifdim \pagegoal = \maxdimen + \advance \@tempskipa -\topskip + \advance \@tempskipa -\parskip + \nointerlineskip + \fi + } \renewcommand\part{% \if@openright \cleardoublepage @@ -146,7 +161,11 @@ \else \@tempswafalse \fi - \null\vskip \glueexpr \CTEX@part@beforeskip \relax + \@tempskipa = \glueexpr \CTEX@part@beforeskip \relax + \ifodd \CTEX@part@fixbeforeskip + \CTEX@fixbeforeskip + \fi + \vspace*{\@tempskipa}% \secdef\@part\@spart} \def\@part[#1]#2{% \ifnum \c@secnumdepth >-2\relax @@ -225,7 +244,11 @@ \@afterheading \fi} \def\@makechapterhead#1{% - \vspace*{\glueexpr\CTEX@chapter@beforeskip\relax}% + \@tempskipa = \glueexpr \CTEX@chapter@beforeskip \relax + \ifodd \CTEX@chapter@fixbeforeskip + \CTEX@fixbeforeskip + \fi + \vspace*{\@tempskipa}% {\normalfont \parindent \dimexpr \CTEX@chapter@indent \relax \CTEX@chapter@format \ifnum \c@secnumdepth >\m@ne @@ -242,7 +265,11 @@ \vskip \glueexpr \CTEX@chapter@afterskip \relax }} \def\@makeschapterhead#1{% - \vspace*{\glueexpr\CTEX@chapter@beforeskip\relax}% + \@tempskipa = \glueexpr \CTEX@chapter@beforeskip \relax + \ifodd \CTEX@chapter@fixbeforeskip + \CTEX@fixbeforeskip + \fi + \vspace*{\@tempskipa}% {\normalfont \parindent \dimexpr \CTEX@chapter@indent \relax \CTEX@chapter@format \interlinepenalty\@M diff --git a/Master/texmf-dist/tex/latex/ctex/ctex-c5size.clo b/Master/texmf-dist/tex/latex/ctex/ctex-c5size.clo index 2a7a4279063..23492c2aacf 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctex-c5size.clo +++ b/Master/texmf-dist/tex/latex/ctex/ctex-c5size.clo @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {c5size option (CTEX)} \ProvidesExplFile{ctex-c5size.clo} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \ctex_set_font_size:Nnn \normalsize { 5 } { \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@ diff --git a/Master/texmf-dist/tex/latex/ctex/ctex-cs4size.clo b/Master/texmf-dist/tex/latex/ctex/ctex-cs4size.clo index f9446a3cabf..56d5956435e 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctex-cs4size.clo +++ b/Master/texmf-dist/tex/latex/ctex/ctex-cs4size.clo @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {cs4size option (CTEX)} \ProvidesExplFile{ctex-cs4size.clo} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \ctex_set_font_size:Nnn \normalsize { -4 } { \abovedisplayskip 12\p@ \@plus3\p@ \@minus7\p@ diff --git a/Master/texmf-dist/tex/latex/ctex/ctex-report.def b/Master/texmf-dist/tex/latex/ctex/ctex-report.def index 4dbec90572f..e923e6cba86 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctex-report.def +++ b/Master/texmf-dist/tex/latex/ctex/ctex-report.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Heading modification for report (CTEX)} \ProvidesExplFile{ctex-report.def} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \seq_new:N \c__ctex_section_headings_seq \seq_gset_from_clist:Nn \c__ctex_section_headings_seq { section , subsection , subsubsection , paragraph , subparagraph } @@ -118,21 +118,36 @@ { \tl_clear:c { CTEX@post#1 } } { \tl_set:cn { CTEX@post#1 } {#3} } } +\group_begin: \tl_set:Nn \l__ctex_tmp_tl { - part / pagestyle .tl_set:N = \CTEX@part@pagestyle , - chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle , + part / pagestyle .tl_set:N = \CTEX@part@pagestyle , + chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle , + part / fixbeforeskip .bool_set:N = \CTEX@part@fixbeforeskip , + chapter / fixbeforeskip .bool_set:N = \CTEX@chapter@fixbeforeskip , } \seq_map_inline:Nn \c__ctex_headings_seq { \__ctex_initial_heading:n {#1} \__ctex_def_heading_keys:n {#1} } -\use:x { \keys_define:nn { ctex } { \exp_not:o { \l__ctex_tmp_tl } } } -\tl_clear:N \l__ctex_tmp_tl +\use:x + { + \group_end: + \keys_define:nn { ctex } { \exp_not:o { \l__ctex_tmp_tl } } + } \cs_new_protected_nopar:Npn \CTEX@makeheadinganchor { } \ctex_at_end_package:nn { hyperref } { \cs_gset_protected_nopar:Npn \CTEX@makeheadinganchor { \phantomsection } } +\cs_new_protected_nopar:Npn \CTEX@fixbeforeskip + { + \par + \ifdim \pagegoal = \maxdimen + \advance \@tempskipa -\topskip + \advance \@tempskipa -\parskip + \nointerlineskip + \fi + } \renewcommand\part{% \if@openright \cleardoublepage @@ -146,7 +161,11 @@ \else \@tempswafalse \fi - \null\vskip \glueexpr \CTEX@part@beforeskip \relax + \@tempskipa = \glueexpr \CTEX@part@beforeskip \relax + \ifodd \CTEX@part@fixbeforeskip + \CTEX@fixbeforeskip + \fi + \vspace*{\@tempskipa}% \secdef\@part\@spart} \def\@part[#1]#2{% \ifnum \c@secnumdepth >-2\relax @@ -221,7 +240,11 @@ \@afterheading \fi} \def\@makechapterhead#1{% - \vspace*{\glueexpr\CTEX@chapter@beforeskip\relax}% + \@tempskipa = \glueexpr \CTEX@chapter@beforeskip \relax + \ifodd \CTEX@chapter@fixbeforeskip + \CTEX@fixbeforeskip + \fi + \vspace*{\@tempskipa}% {\normalfont \parindent \dimexpr \CTEX@chapter@indent \relax \CTEX@chapter@format \ifnum \c@secnumdepth >\m@ne @@ -236,7 +259,11 @@ \vskip \glueexpr \CTEX@chapter@afterskip \relax }} \def\@makeschapterhead#1{% - \vspace*{\glueexpr\CTEX@chapter@beforeskip\relax}% + \@tempskipa = \glueexpr \CTEX@chapter@beforeskip \relax + \ifodd \CTEX@chapter@fixbeforeskip + \CTEX@fixbeforeskip + \fi + \vspace*{\@tempskipa}% {\normalfont \parindent \dimexpr \CTEX@chapter@indent \relax \CTEX@chapter@format \interlinepenalty\@M diff --git a/Master/texmf-dist/tex/latex/ctex/ctex.sty b/Master/texmf-dist/tex/latex/ctex/ctex.sty index 66bed8e069d..632b12b04f1 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctex.sty +++ b/Master/texmf-dist/tex/latex/ctex/ctex.sty @@ -28,10 +28,10 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Chinese adapter in LaTeX (CTEX)} \ProvidesExplPackage{\ExplFileName} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \tl_const:Nx \c__ctex_version_tl { \cs_if_exist_use:cF { ver@ \@currname . \@currext } { 9999/99/99 } } \msg_new:nnnn { ctex } { subpackage-loaded } @@ -56,15 +56,17 @@ } \@ifpackagelater { expl3 } { 2015/12/20 } { } { \msg_error:nnn { ctex } { l3-too-old } { expl3 } } +\str_const:Nx \c__ctex_engine_str + { \cs_if_exist:NTF \ngostype { aptex } { \c_sys_engine_str } } \msg_new:nnnn { ctex } { engine-not-supported } { Engine~`#1'~is~not~yet~supported,~ctex~will~abort! } - { You~can~switch~to~xelatex,~lualatex~or~pdflatex.} -\file_if_exist:nTF { ctex-engine- \c_sys_engine_str .def } + { You~can~switch~to~xelatex,~lualatex,~pdflatex,~uplatex,~or~aplatex. } +\file_if_exist:nTF { ctex-engine- \c__ctex_engine_str .def } { \str_const:Nx \c__ctex_engine_file_str - { ctex-engine- \c_sys_engine_str .def } + { ctex-engine- \c__ctex_engine_str .def } } - { \msg_critical:nnx { ctex } { engine-not-supported } { \c_sys_engine_str } } + { \msg_critical:nnx { ctex } { engine-not-supported } { \c__ctex_engine_str } } \RequirePackage { ctexhook , ctexpatch } \RequirePackage { fix-cm , everysel } \tl_new:N \l__ctex_tmp_tl @@ -155,7 +157,7 @@ \keys_define:nn { ctex / option } { zihao .choice: , - zihao .default:n = { 5 } , + zihao .value_required:n = true , zihao / 5 .code:n = { \cs_gset_eq:NN \g__ctex_font_size_flag \c_zero } , zihao / -4 .code:n = { \cs_gset_eq:NN \g__ctex_font_size_flag \c_one } , zihao / false .code:n = { \cs_gset_eq:NN \g__ctex_font_size_flag \c_two } , @@ -523,15 +525,17 @@ } \PassOptionsToPackage { encoding = \l__ctex_encoding_tl } { zhnumber } \RequirePackage { zhnumber } -\cs_new_eq:NN \chinese \zhnum +\cs_new_nopar:Npn \chinese { \zhnum_counter:n } +\cs_new_eq:NN \@chinese \@zhnum \cs_new_eq:NN \Chinese \chinese \cs_new_eq:NN \CTEXcounter \use_none:n \ctex_at_end_package:nn { enumitem } { \cs_if_free:NF \AddEnumerateCounter { - \AddEnumerateCounter * { \zhnum } { \zhnum_int:n } { 1 } - \AddEnumerateCounter * { \chinese } { \zhnum_int:n } { 1 } + \AddEnumerateCounter * { \zhnum } { \@zhnum } { 1 } + \AddEnumerateCounter * { \zhdig } { \@zhdig } { 1 } + \AddEnumerateCounter * { \chinese } { \@chinese } { 1 } } } \NewDocumentCommand \CTEXnumber { m m } @@ -823,6 +827,7 @@ %% ctexbook.cls, %% ctexrep.cls, %% ctexbeamer.cls, +%% ctxdoc.cls, %% ctexcap.sty, %% ctexhook.sty, %% ctexpatch.sty, @@ -849,6 +854,7 @@ %% ctex-engine-pdftex.def, %% ctex-engine-xetex.def, %% ctex-engine-luatex.def, +%% ctex-engine-aptex.def, %% ctex-engine-uptex.def, %% c19rm.fd, %% c19sf.fd, @@ -868,6 +874,7 @@ %% ctexpunct.spa, %% ctexmakespa.tex, %% ctexspamacro.tex, +%% ctxdocstrip.tex, %% zhadobefonts.tex, %% zhfandolfonts.tex, %% zhfounderfonts.tex, @@ -875,6 +882,6 @@ %% zhwindowsfonts.tex, %% translator-theorem-dictionary-ChineseGBK.dict, %% translator-theorem-dictionary-ChineseUTF8.dict, and -%% README. +%% README.md. %% %% End of file `ctex.sty'. diff --git a/Master/texmf-dist/tex/latex/ctex/ctexart.cls b/Master/texmf-dist/tex/latex/ctex/ctexart.cls index 95e59591680..8261a9ec7d8 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctexart.cls +++ b/Master/texmf-dist/tex/latex/ctex/ctexart.cls @@ -28,10 +28,10 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Chinese adapter for class article (CTEX)} \ProvidesExplClass{ctexart} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \tl_const:Nx \c__ctex_version_tl { \cs_if_exist_use:cF { ver@ \@currname . \@currext } { 9999/99/99 } } \cs_new_eq:cN { ver@ctex. \@pkgextension } \c__ctex_version_tl @@ -50,15 +50,17 @@ { \msg_error:nnn { ctex } { l3-too-old } { expl3 } } \@ifpackagelater { l3keys2e } { 2015/12/20 } { } { \msg_error:nnn { ctex } { l3-too-old } { l3keys2e } } +\str_const:Nx \c__ctex_engine_str + { \cs_if_exist:NTF \ngostype { aptex } { \c_sys_engine_str } } \msg_new:nnnn { ctex } { engine-not-supported } { Engine~`#1'~is~not~yet~supported,~ctex~will~abort! } - { You~can~switch~to~xelatex,~lualatex~or~pdflatex.} -\file_if_exist:nTF { ctex-engine- \c_sys_engine_str .def } + { You~can~switch~to~xelatex,~lualatex,~pdflatex,~uplatex,~or~aplatex. } +\file_if_exist:nTF { ctex-engine- \c__ctex_engine_str .def } { \str_const:Nx \c__ctex_engine_file_str - { ctex-engine- \c_sys_engine_str .def } + { ctex-engine- \c__ctex_engine_str .def } } - { \msg_critical:nnx { ctex } { engine-not-supported } { \c_sys_engine_str } } + { \msg_critical:nnx { ctex } { engine-not-supported } { \c__ctex_engine_str } } \RequirePackage { ctexhook , ctexpatch } \RequirePackage { fix-cm , everysel } \tl_new:N \l__ctex_tmp_tl @@ -150,7 +152,7 @@ \keys_define:nn { ctex / option } { zihao .choice: , - zihao .default:n = { 5 } , + zihao .value_required:n = true , zihao / 5 .code:n = { \cs_gset_eq:NN \g__ctex_font_size_flag \c_zero } , zihao / -4 .code:n = { \cs_gset_eq:NN \g__ctex_font_size_flag \c_one } , zihao / false .code:n = { \cs_gset_eq:NN \g__ctex_font_size_flag \c_two } , @@ -534,15 +536,17 @@ } \PassOptionsToPackage { encoding = \l__ctex_encoding_tl } { zhnumber } \RequirePackage { zhnumber } -\cs_new_eq:NN \chinese \zhnum +\cs_new_nopar:Npn \chinese { \zhnum_counter:n } +\cs_new_eq:NN \@chinese \@zhnum \cs_new_eq:NN \Chinese \chinese \cs_new_eq:NN \CTEXcounter \use_none:n \ctex_at_end_package:nn { enumitem } { \cs_if_free:NF \AddEnumerateCounter { - \AddEnumerateCounter * { \zhnum } { \zhnum_int:n } { 1 } - \AddEnumerateCounter * { \chinese } { \zhnum_int:n } { 1 } + \AddEnumerateCounter * { \zhnum } { \@zhnum } { 1 } + \AddEnumerateCounter * { \zhdig } { \@zhdig } { 1 } + \AddEnumerateCounter * { \chinese } { \@chinese } { 1 } } } \NewDocumentCommand \CTEXnumber { m m } @@ -671,13 +675,18 @@ { \tl_clear:c { CTEX@post#1 } } { \tl_set:cn { CTEX@post#1 } {#3} } } +\group_begin: +\tl_clear:N \l__ctex_tmp_tl \seq_map_inline:Nn \c__ctex_headings_seq { \__ctex_initial_heading:n {#1} \__ctex_def_heading_keys:n {#1} } -\use:x { \keys_define:nn { ctex } { \exp_not:o { \l__ctex_tmp_tl } } } -\tl_clear:N \l__ctex_tmp_tl +\use:x + { + \group_end: + \keys_define:nn { ctex } { \exp_not:o { \l__ctex_tmp_tl } } + } \cs_new_protected_nopar:Npn \CTEX@makeheadinganchor { } \ctex_at_end_package:nn { hyperref } { \cs_gset_protected_nopar:Npn \CTEX@makeheadinganchor { \phantomsection } } @@ -1245,6 +1254,7 @@ %% ctexbook.cls, %% ctexrep.cls, %% ctexbeamer.cls, +%% ctxdoc.cls, %% ctexcap.sty, %% ctexhook.sty, %% ctexpatch.sty, @@ -1271,6 +1281,7 @@ %% ctex-engine-pdftex.def, %% ctex-engine-xetex.def, %% ctex-engine-luatex.def, +%% ctex-engine-aptex.def, %% ctex-engine-uptex.def, %% c19rm.fd, %% c19sf.fd, @@ -1290,6 +1301,7 @@ %% ctexpunct.spa, %% ctexmakespa.tex, %% ctexspamacro.tex, +%% ctxdocstrip.tex, %% zhadobefonts.tex, %% zhfandolfonts.tex, %% zhfounderfonts.tex, @@ -1297,6 +1309,6 @@ %% zhwindowsfonts.tex, %% translator-theorem-dictionary-ChineseGBK.dict, %% translator-theorem-dictionary-ChineseUTF8.dict, and -%% README. +%% README.md. %% %% End of file `ctexart.cls'. diff --git a/Master/texmf-dist/tex/latex/ctex/ctexbeamer.cls b/Master/texmf-dist/tex/latex/ctex/ctexbeamer.cls index d4a46d9237f..44da38a86d4 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctexbeamer.cls +++ b/Master/texmf-dist/tex/latex/ctex/ctexbeamer.cls @@ -28,10 +28,10 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Chinese adapter for class beamer (CTEX)} \ProvidesExplClass{ctexbeamer} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \tl_const:Nx \c__ctex_version_tl { \cs_if_exist_use:cF { ver@ \@currname . \@currext } { 9999/99/99 } } \cs_new_eq:cN { ver@ctex. \@pkgextension } \c__ctex_version_tl @@ -50,15 +50,17 @@ { \msg_error:nnn { ctex } { l3-too-old } { expl3 } } \@ifpackagelater { l3keys2e } { 2015/12/20 } { } { \msg_error:nnn { ctex } { l3-too-old } { l3keys2e } } +\str_const:Nx \c__ctex_engine_str + { \cs_if_exist:NTF \ngostype { aptex } { \c_sys_engine_str } } \msg_new:nnnn { ctex } { engine-not-supported } { Engine~`#1'~is~not~yet~supported,~ctex~will~abort! } - { You~can~switch~to~xelatex,~lualatex~or~pdflatex.} -\file_if_exist:nTF { ctex-engine- \c_sys_engine_str .def } + { You~can~switch~to~xelatex,~lualatex,~pdflatex,~uplatex,~or~aplatex. } +\file_if_exist:nTF { ctex-engine- \c__ctex_engine_str .def } { \str_const:Nx \c__ctex_engine_file_str - { ctex-engine- \c_sys_engine_str .def } + { ctex-engine- \c__ctex_engine_str .def } } - { \msg_critical:nnx { ctex } { engine-not-supported } { \c_sys_engine_str } } + { \msg_critical:nnx { ctex } { engine-not-supported } { \c__ctex_engine_str } } \RequirePackage { ctexhook , ctexpatch } \RequirePackage { fix-cm , everysel } \tl_new:N \l__ctex_tmp_tl @@ -149,7 +151,7 @@ \keys_define:nn { ctex / option } { zihao .choice: , - zihao .default:n = { 5 } , + zihao .value_required:n = true , zihao / 5 .code:n = { \cs_gset_eq:NN \g__ctex_font_size_flag \c_zero } , zihao / -4 .code:n = { \cs_gset_eq:NN \g__ctex_font_size_flag \c_one } , zihao / false .code:n = { \cs_gset_eq:NN \g__ctex_font_size_flag \c_two } , @@ -527,15 +529,17 @@ } \PassOptionsToPackage { encoding = \l__ctex_encoding_tl } { zhnumber } \RequirePackage { zhnumber } -\cs_new_eq:NN \chinese \zhnum +\cs_new_nopar:Npn \chinese { \zhnum_counter:n } +\cs_new_eq:NN \@chinese \@zhnum \cs_new_eq:NN \Chinese \chinese \cs_new_eq:NN \CTEXcounter \use_none:n \ctex_at_end_package:nn { enumitem } { \cs_if_free:NF \AddEnumerateCounter { - \AddEnumerateCounter * { \zhnum } { \zhnum_int:n } { 1 } - \AddEnumerateCounter * { \chinese } { \zhnum_int:n } { 1 } + \AddEnumerateCounter * { \zhnum } { \@zhnum } { 1 } + \AddEnumerateCounter * { \zhdig } { \@zhdig } { 1 } + \AddEnumerateCounter * { \chinese } { \@chinese } { 1 } } } \NewDocumentCommand \CTEXnumber { m m } @@ -662,13 +666,18 @@ { \tl_clear:c { CTEX@post#1 } } { \tl_set:cn { CTEX@post#1 } {#3} } } +\group_begin: +\tl_clear:N \l__ctex_tmp_tl \seq_map_inline:Nn \c__ctex_headings_seq { \__ctex_initial_heading:n {#1} \__ctex_def_heading_keys:n {#1} } -\use:x { \keys_define:nn { ctex } { \exp_not:o { \l__ctex_tmp_tl } } } -\tl_clear:N \l__ctex_tmp_tl +\use:x + { + \group_end: + \keys_define:nn { ctex } { \exp_not:o { \l__ctex_tmp_tl } } + } \ExplSyntaxOff \defbeamertemplate*{part page}{CTEX}[1][]{ \begingroup @@ -942,6 +951,7 @@ %% ctexbook.cls, %% ctexrep.cls, %% ctexbeamer.cls, +%% ctxdoc.cls, %% ctexcap.sty, %% ctexhook.sty, %% ctexpatch.sty, @@ -968,6 +978,7 @@ %% ctex-engine-pdftex.def, %% ctex-engine-xetex.def, %% ctex-engine-luatex.def, +%% ctex-engine-aptex.def, %% ctex-engine-uptex.def, %% c19rm.fd, %% c19sf.fd, @@ -987,6 +998,7 @@ %% ctexpunct.spa, %% ctexmakespa.tex, %% ctexspamacro.tex, +%% ctxdocstrip.tex, %% zhadobefonts.tex, %% zhfandolfonts.tex, %% zhfounderfonts.tex, @@ -994,6 +1006,6 @@ %% zhwindowsfonts.tex, %% translator-theorem-dictionary-ChineseGBK.dict, %% translator-theorem-dictionary-ChineseUTF8.dict, and -%% README. +%% README.md. %% %% End of file `ctexbeamer.cls'. diff --git a/Master/texmf-dist/tex/latex/ctex/ctexbook.cls b/Master/texmf-dist/tex/latex/ctex/ctexbook.cls index 19394a51ba8..0944499835d 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctexbook.cls +++ b/Master/texmf-dist/tex/latex/ctex/ctexbook.cls @@ -28,10 +28,10 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Chinese adapter for class book (CTEX)} \ProvidesExplClass{ctexbook} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \tl_const:Nx \c__ctex_version_tl { \cs_if_exist_use:cF { ver@ \@currname . \@currext } { 9999/99/99 } } \cs_new_eq:cN { ver@ctex. \@pkgextension } \c__ctex_version_tl @@ -50,15 +50,17 @@ { \msg_error:nnn { ctex } { l3-too-old } { expl3 } } \@ifpackagelater { l3keys2e } { 2015/12/20 } { } { \msg_error:nnn { ctex } { l3-too-old } { l3keys2e } } +\str_const:Nx \c__ctex_engine_str + { \cs_if_exist:NTF \ngostype { aptex } { \c_sys_engine_str } } \msg_new:nnnn { ctex } { engine-not-supported } { Engine~`#1'~is~not~yet~supported,~ctex~will~abort! } - { You~can~switch~to~xelatex,~lualatex~or~pdflatex.} -\file_if_exist:nTF { ctex-engine- \c_sys_engine_str .def } + { You~can~switch~to~xelatex,~lualatex,~pdflatex,~uplatex,~or~aplatex. } +\file_if_exist:nTF { ctex-engine- \c__ctex_engine_str .def } { \str_const:Nx \c__ctex_engine_file_str - { ctex-engine- \c_sys_engine_str .def } + { ctex-engine- \c__ctex_engine_str .def } } - { \msg_critical:nnx { ctex } { engine-not-supported } { \c_sys_engine_str } } + { \msg_critical:nnx { ctex } { engine-not-supported } { \c__ctex_engine_str } } \RequirePackage { ctexhook , ctexpatch } \RequirePackage { fix-cm , everysel } \tl_new:N \l__ctex_tmp_tl @@ -150,7 +152,7 @@ \keys_define:nn { ctex / option } { zihao .choice: , - zihao .default:n = { 5 } , + zihao .value_required:n = true , zihao / 5 .code:n = { \cs_gset_eq:NN \g__ctex_font_size_flag \c_zero } , zihao / -4 .code:n = { \cs_gset_eq:NN \g__ctex_font_size_flag \c_one } , zihao / false .code:n = { \cs_gset_eq:NN \g__ctex_font_size_flag \c_two } , @@ -534,15 +536,17 @@ } \PassOptionsToPackage { encoding = \l__ctex_encoding_tl } { zhnumber } \RequirePackage { zhnumber } -\cs_new_eq:NN \chinese \zhnum +\cs_new_nopar:Npn \chinese { \zhnum_counter:n } +\cs_new_eq:NN \@chinese \@zhnum \cs_new_eq:NN \Chinese \chinese \cs_new_eq:NN \CTEXcounter \use_none:n \ctex_at_end_package:nn { enumitem } { \cs_if_free:NF \AddEnumerateCounter { - \AddEnumerateCounter * { \zhnum } { \zhnum_int:n } { 1 } - \AddEnumerateCounter * { \chinese } { \zhnum_int:n } { 1 } + \AddEnumerateCounter * { \zhnum } { \@zhnum } { 1 } + \AddEnumerateCounter * { \zhdig } { \@zhdig } { 1 } + \AddEnumerateCounter * { \chinese } { \@chinese } { 1 } } } \NewDocumentCommand \CTEXnumber { m m } @@ -672,21 +676,36 @@ { \tl_clear:c { CTEX@post#1 } } { \tl_set:cn { CTEX@post#1 } {#3} } } +\group_begin: \tl_set:Nn \l__ctex_tmp_tl { - part / pagestyle .tl_set:N = \CTEX@part@pagestyle , - chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle , + part / pagestyle .tl_set:N = \CTEX@part@pagestyle , + chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle , + part / fixbeforeskip .bool_set:N = \CTEX@part@fixbeforeskip , + chapter / fixbeforeskip .bool_set:N = \CTEX@chapter@fixbeforeskip , } \seq_map_inline:Nn \c__ctex_headings_seq { \__ctex_initial_heading:n {#1} \__ctex_def_heading_keys:n {#1} } -\use:x { \keys_define:nn { ctex } { \exp_not:o { \l__ctex_tmp_tl } } } -\tl_clear:N \l__ctex_tmp_tl +\use:x + { + \group_end: + \keys_define:nn { ctex } { \exp_not:o { \l__ctex_tmp_tl } } + } \cs_new_protected_nopar:Npn \CTEX@makeheadinganchor { } \ctex_at_end_package:nn { hyperref } { \cs_gset_protected_nopar:Npn \CTEX@makeheadinganchor { \phantomsection } } +\cs_new_protected_nopar:Npn \CTEX@fixbeforeskip + { + \par + \ifdim \pagegoal = \maxdimen + \advance \@tempskipa -\topskip + \advance \@tempskipa -\parskip + \nointerlineskip + \fi + } \renewcommand\part{% \if@openright \cleardoublepage @@ -700,7 +719,11 @@ \else \@tempswafalse \fi - \null\vskip \glueexpr \CTEX@part@beforeskip \relax + \@tempskipa = \glueexpr \CTEX@part@beforeskip \relax + \ifodd \CTEX@part@fixbeforeskip + \CTEX@fixbeforeskip + \fi + \vspace*{\@tempskipa}% \secdef\@part\@spart} \def\@part[#1]#2{% \ifnum \c@secnumdepth >-2\relax @@ -779,7 +802,11 @@ \@afterheading \fi} \def\@makechapterhead#1{% - \vspace*{\glueexpr\CTEX@chapter@beforeskip\relax}% + \@tempskipa = \glueexpr \CTEX@chapter@beforeskip \relax + \ifodd \CTEX@chapter@fixbeforeskip + \CTEX@fixbeforeskip + \fi + \vspace*{\@tempskipa}% {\normalfont \parindent \dimexpr \CTEX@chapter@indent \relax \CTEX@chapter@format \ifnum \c@secnumdepth >\m@ne @@ -796,7 +823,11 @@ \vskip \glueexpr \CTEX@chapter@afterskip \relax }} \def\@makeschapterhead#1{% - \vspace*{\glueexpr\CTEX@chapter@beforeskip\relax}% + \@tempskipa = \glueexpr \CTEX@chapter@beforeskip \relax + \ifodd \CTEX@chapter@fixbeforeskip + \CTEX@fixbeforeskip + \fi + \vspace*{\@tempskipa}% {\normalfont \parindent \dimexpr \CTEX@chapter@indent \relax \CTEX@chapter@format \interlinepenalty\@M @@ -1327,6 +1358,7 @@ %% ctexbook.cls, %% ctexrep.cls, %% ctexbeamer.cls, +%% ctxdoc.cls, %% ctexcap.sty, %% ctexhook.sty, %% ctexpatch.sty, @@ -1353,6 +1385,7 @@ %% ctex-engine-pdftex.def, %% ctex-engine-xetex.def, %% ctex-engine-luatex.def, +%% ctex-engine-aptex.def, %% ctex-engine-uptex.def, %% c19rm.fd, %% c19sf.fd, @@ -1372,6 +1405,7 @@ %% ctexpunct.spa, %% ctexmakespa.tex, %% ctexspamacro.tex, +%% ctxdocstrip.tex, %% zhadobefonts.tex, %% zhfandolfonts.tex, %% zhfounderfonts.tex, @@ -1379,6 +1413,6 @@ %% zhwindowsfonts.tex, %% translator-theorem-dictionary-ChineseGBK.dict, %% translator-theorem-dictionary-ChineseUTF8.dict, and -%% README. +%% README.md. %% %% End of file `ctexbook.cls'. diff --git a/Master/texmf-dist/tex/latex/ctex/ctexcap.sty b/Master/texmf-dist/tex/latex/ctex/ctexcap.sty index d92cd9bd155..6538a076f39 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctexcap.sty +++ b/Master/texmf-dist/tex/latex/ctex/ctexcap.sty @@ -28,10 +28,10 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Chinese adapter in LaTeX (CTEX)} \ProvidesExplPackage{ctexcap} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \clist_new:N \l__ctex_ctexcap_options_clist \clist_set:Nx \l__ctex_ctexcap_options_clist { \exp_not:v { opt@ \@currname . \@currext } , heading } diff --git a/Master/texmf-dist/tex/latex/ctex/ctexheading.sty b/Master/texmf-dist/tex/latex/ctex/ctexheading.sty index 9e4e58a3886..e2e2478d76b 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctexheading.sty +++ b/Master/texmf-dist/tex/latex/ctex/ctexheading.sty @@ -28,10 +28,10 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Heading style modification (CTEX)} \ProvidesExplPackage{ctexheading} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \RequirePackage { xparse , l3keys2e } \RequirePackage { ctexhook , ctexpatch } \tl_new:N \l__ctex_tmp_tl @@ -123,6 +123,7 @@ %% ctexbook.cls, %% ctexrep.cls, %% ctexbeamer.cls, +%% ctxdoc.cls, %% ctexcap.sty, %% ctexhook.sty, %% ctexpatch.sty, @@ -149,6 +150,7 @@ %% ctex-engine-pdftex.def, %% ctex-engine-xetex.def, %% ctex-engine-luatex.def, +%% ctex-engine-aptex.def, %% ctex-engine-uptex.def, %% c19rm.fd, %% c19sf.fd, @@ -168,6 +170,7 @@ %% ctexpunct.spa, %% ctexmakespa.tex, %% ctexspamacro.tex, +%% ctxdocstrip.tex, %% zhadobefonts.tex, %% zhfandolfonts.tex, %% zhfounderfonts.tex, @@ -175,6 +178,6 @@ %% zhwindowsfonts.tex, %% translator-theorem-dictionary-ChineseGBK.dict, %% translator-theorem-dictionary-ChineseUTF8.dict, and -%% README. +%% README.md. %% %% End of file `ctexheading.sty'. diff --git a/Master/texmf-dist/tex/latex/ctex/ctexhook.sty b/Master/texmf-dist/tex/latex/ctex/ctexhook.sty index 025e4870b9d..beb15349715 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctexhook.sty +++ b/Master/texmf-dist/tex/latex/ctex/ctexhook.sty @@ -28,10 +28,10 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Document and package hooks (CTEX)} \ProvidesExplPackage{ctexhook} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \cs_new_protected:Npn \ctex_at_end_preamble:n #1 { \tl_gput_right:Nn \g__ctex_end_preamble_hook_tl {#1} } \cs_new_protected:Npn \ctex_after_end_preamble:n #1 diff --git a/Master/texmf-dist/tex/latex/ctex/ctexpatch.sty b/Master/texmf-dist/tex/latex/ctex/ctexpatch.sty index 95c811fb41c..03bbb06dec0 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctexpatch.sty +++ b/Master/texmf-dist/tex/latex/ctex/ctexpatch.sty @@ -28,10 +28,10 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Patching commands (CTEX)} \ProvidesExplPackage{ctexpatch} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \cs_if_exist:NF \str_new:N { \RequirePackage { l3str } } \cs_new_protected:Npn \ctex_patch_cmd_once:NnnnTF #1#2 { @@ -153,18 +153,17 @@ \ctex_get_macro_meaning:N ##1 { TF } { \exp_after:wN \__ctex_get_macro_meaning:w - \token_to_meaning:N ##1 \q_mark #1 -> \q_no_value \q_mark \q_stop + \token_to_meaning:N ##1 \q_mark #1 -> \q_mark \q_stop } \cs_new_protected:Npn \__ctex_get_macro_meaning:w ##1 #1 ##2 -> ##3 \q_mark ##4 \q_stop { - \tl_set:Nn \l__ctex_replacement_tl {##3} - \quark_if_no_value:NTF \l__ctex_replacement_tl + \tl_if_empty:nTF { ##4 } { \prg_return_false: } { - \str_set:Nn \l__ctex_prefix_str {##1} - \str_set:Nn \l__ctex_parameter_str {##2} - \str_set:Nn \l__ctex_replacement_str {##3} + \str_set:Nn \l__ctex_prefix_str { ##1 } + \str_set:Nn \l__ctex_parameter_str { ##2 } + \str_set:Nn \l__ctex_replacement_str { ##3 } \prg_return_true: } } @@ -197,7 +196,7 @@ { \str_if_empty:NTF #2 { \tl_clear:N #1 } - { \tl_set_rescan:Nnx #1 {#3} {#2} } + { \tl_set_rescan:Nno #1 {#3} {#2} } } \tl_new:N \l__ctex_prefix_tl \tl_new:N \l__ctex_parameter_tl @@ -232,24 +231,25 @@ \ctex_get_macro_meaning:NTF #1 { \str_if_empty:NTF \l__ctex_parameter_str - { \__ctex_hookto_cmd_parameterless:Nnnw #1 {#2} {#4} } - { \__ctex_hookto_cmd_parameter:Nnnnw #1 {#2} {#3} {#4} } + { \__ctex_hookto_cmd_parameterless:Nnnnw } + { \__ctex_hookto_cmd_parameter:Nnnnw } + #1 {#2} {#3} {#4} } { \__ctex_patch_false:w } } -\cs_new_protected:Npn \__ctex_hookto_cmd_parameterless:Nnnw #1#2#3 +\cs_new_protected:Npn \__ctex_hookto_cmd_parameterless:Nnnnw #1#2#3#4 { \str_if_empty:NF \l__ctex_prefix_str - { \tl_rescan:nx { } { \l__ctex_prefix_str } } + { \tl_rescan:no {#3} { \l__ctex_prefix_str } } \tex_edef:D #1 { \use:c { __ctex_ #2 _hook_aux:nn } { \exp_not:o {#1} } - { \exp_not:n {#3} } + { \exp_not:n {#4} } } \__ctex_patch_true:w } -\cs_generate_variant:Nn \tl_rescan:nn { nx } +\cs_generate_variant:Nn \tl_rescan:nn { no } \cs_new:Npn \__ctex_left_hook_aux:nn #1#2 { #2#1 } \cs_new_eq:NN \__ctex_right_hook_aux:nn \use:nn \cs_new_protected:Npn \__ctex_hookto_cmd_parameter:Nnnnw #1#2#3#4 diff --git a/Master/texmf-dist/tex/latex/ctex/ctexrep.cls b/Master/texmf-dist/tex/latex/ctex/ctexrep.cls index a9efa9be97e..6ed88664664 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctexrep.cls +++ b/Master/texmf-dist/tex/latex/ctex/ctexrep.cls @@ -28,10 +28,10 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Chinese adapter for class report (CTEX)} \ProvidesExplClass{ctexrep} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \tl_const:Nx \c__ctex_version_tl { \cs_if_exist_use:cF { ver@ \@currname . \@currext } { 9999/99/99 } } \cs_new_eq:cN { ver@ctex. \@pkgextension } \c__ctex_version_tl @@ -50,15 +50,17 @@ { \msg_error:nnn { ctex } { l3-too-old } { expl3 } } \@ifpackagelater { l3keys2e } { 2015/12/20 } { } { \msg_error:nnn { ctex } { l3-too-old } { l3keys2e } } +\str_const:Nx \c__ctex_engine_str + { \cs_if_exist:NTF \ngostype { aptex } { \c_sys_engine_str } } \msg_new:nnnn { ctex } { engine-not-supported } { Engine~`#1'~is~not~yet~supported,~ctex~will~abort! } - { You~can~switch~to~xelatex,~lualatex~or~pdflatex.} -\file_if_exist:nTF { ctex-engine- \c_sys_engine_str .def } + { You~can~switch~to~xelatex,~lualatex,~pdflatex,~uplatex,~or~aplatex. } +\file_if_exist:nTF { ctex-engine- \c__ctex_engine_str .def } { \str_const:Nx \c__ctex_engine_file_str - { ctex-engine- \c_sys_engine_str .def } + { ctex-engine- \c__ctex_engine_str .def } } - { \msg_critical:nnx { ctex } { engine-not-supported } { \c_sys_engine_str } } + { \msg_critical:nnx { ctex } { engine-not-supported } { \c__ctex_engine_str } } \RequirePackage { ctexhook , ctexpatch } \RequirePackage { fix-cm , everysel } \tl_new:N \l__ctex_tmp_tl @@ -150,7 +152,7 @@ \keys_define:nn { ctex / option } { zihao .choice: , - zihao .default:n = { 5 } , + zihao .value_required:n = true , zihao / 5 .code:n = { \cs_gset_eq:NN \g__ctex_font_size_flag \c_zero } , zihao / -4 .code:n = { \cs_gset_eq:NN \g__ctex_font_size_flag \c_one } , zihao / false .code:n = { \cs_gset_eq:NN \g__ctex_font_size_flag \c_two } , @@ -534,15 +536,17 @@ } \PassOptionsToPackage { encoding = \l__ctex_encoding_tl } { zhnumber } \RequirePackage { zhnumber } -\cs_new_eq:NN \chinese \zhnum +\cs_new_nopar:Npn \chinese { \zhnum_counter:n } +\cs_new_eq:NN \@chinese \@zhnum \cs_new_eq:NN \Chinese \chinese \cs_new_eq:NN \CTEXcounter \use_none:n \ctex_at_end_package:nn { enumitem } { \cs_if_free:NF \AddEnumerateCounter { - \AddEnumerateCounter * { \zhnum } { \zhnum_int:n } { 1 } - \AddEnumerateCounter * { \chinese } { \zhnum_int:n } { 1 } + \AddEnumerateCounter * { \zhnum } { \@zhnum } { 1 } + \AddEnumerateCounter * { \zhdig } { \@zhdig } { 1 } + \AddEnumerateCounter * { \chinese } { \@chinese } { 1 } } } \NewDocumentCommand \CTEXnumber { m m } @@ -672,21 +676,36 @@ { \tl_clear:c { CTEX@post#1 } } { \tl_set:cn { CTEX@post#1 } {#3} } } +\group_begin: \tl_set:Nn \l__ctex_tmp_tl { - part / pagestyle .tl_set:N = \CTEX@part@pagestyle , - chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle , + part / pagestyle .tl_set:N = \CTEX@part@pagestyle , + chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle , + part / fixbeforeskip .bool_set:N = \CTEX@part@fixbeforeskip , + chapter / fixbeforeskip .bool_set:N = \CTEX@chapter@fixbeforeskip , } \seq_map_inline:Nn \c__ctex_headings_seq { \__ctex_initial_heading:n {#1} \__ctex_def_heading_keys:n {#1} } -\use:x { \keys_define:nn { ctex } { \exp_not:o { \l__ctex_tmp_tl } } } -\tl_clear:N \l__ctex_tmp_tl +\use:x + { + \group_end: + \keys_define:nn { ctex } { \exp_not:o { \l__ctex_tmp_tl } } + } \cs_new_protected_nopar:Npn \CTEX@makeheadinganchor { } \ctex_at_end_package:nn { hyperref } { \cs_gset_protected_nopar:Npn \CTEX@makeheadinganchor { \phantomsection } } +\cs_new_protected_nopar:Npn \CTEX@fixbeforeskip + { + \par + \ifdim \pagegoal = \maxdimen + \advance \@tempskipa -\topskip + \advance \@tempskipa -\parskip + \nointerlineskip + \fi + } \renewcommand\part{% \if@openright \cleardoublepage @@ -700,7 +719,11 @@ \else \@tempswafalse \fi - \null\vskip \glueexpr \CTEX@part@beforeskip \relax + \@tempskipa = \glueexpr \CTEX@part@beforeskip \relax + \ifodd \CTEX@part@fixbeforeskip + \CTEX@fixbeforeskip + \fi + \vspace*{\@tempskipa}% \secdef\@part\@spart} \def\@part[#1]#2{% \ifnum \c@secnumdepth >-2\relax @@ -775,7 +798,11 @@ \@afterheading \fi} \def\@makechapterhead#1{% - \vspace*{\glueexpr\CTEX@chapter@beforeskip\relax}% + \@tempskipa = \glueexpr \CTEX@chapter@beforeskip \relax + \ifodd \CTEX@chapter@fixbeforeskip + \CTEX@fixbeforeskip + \fi + \vspace*{\@tempskipa}% {\normalfont \parindent \dimexpr \CTEX@chapter@indent \relax \CTEX@chapter@format \ifnum \c@secnumdepth >\m@ne @@ -790,7 +817,11 @@ \vskip \glueexpr \CTEX@chapter@afterskip \relax }} \def\@makeschapterhead#1{% - \vspace*{\glueexpr\CTEX@chapter@beforeskip\relax}% + \@tempskipa = \glueexpr \CTEX@chapter@beforeskip \relax + \ifodd \CTEX@chapter@fixbeforeskip + \CTEX@fixbeforeskip + \fi + \vspace*{\@tempskipa}% {\normalfont \parindent \dimexpr \CTEX@chapter@indent \relax \CTEX@chapter@format \interlinepenalty\@M @@ -1321,6 +1352,7 @@ %% ctexbook.cls, %% ctexrep.cls, %% ctexbeamer.cls, +%% ctxdoc.cls, %% ctexcap.sty, %% ctexhook.sty, %% ctexpatch.sty, @@ -1347,6 +1379,7 @@ %% ctex-engine-pdftex.def, %% ctex-engine-xetex.def, %% ctex-engine-luatex.def, +%% ctex-engine-aptex.def, %% ctex-engine-uptex.def, %% c19rm.fd, %% c19sf.fd, @@ -1366,6 +1399,7 @@ %% ctexpunct.spa, %% ctexmakespa.tex, %% ctexspamacro.tex, +%% ctxdocstrip.tex, %% zhadobefonts.tex, %% zhfandolfonts.tex, %% zhfounderfonts.tex, @@ -1373,6 +1407,6 @@ %% zhwindowsfonts.tex, %% translator-theorem-dictionary-ChineseGBK.dict, %% translator-theorem-dictionary-ChineseUTF8.dict, and -%% README. +%% README.md. %% %% End of file `ctexrep.cls'. diff --git a/Master/texmf-dist/tex/latex/ctex/ctexsize.sty b/Master/texmf-dist/tex/latex/ctex/ctexsize.sty index 2af9ea66a98..591d9c623ea 100644 --- a/Master/texmf-dist/tex/latex/ctex/ctexsize.sty +++ b/Master/texmf-dist/tex/latex/ctex/ctexsize.sty @@ -28,16 +28,16 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Chinese font size definition (CTEX)} \ProvidesExplPackage{ctexsize} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \RequirePackage { xparse , l3keys2e } \cs_new_eq:NN \g__ctex_font_size_flag \c_minus_one \keys_define:nn { ctex / option } { zihao .choice: , - zihao .default:n = { 5 } , + zihao .value_required:n = true , zihao / 5 .code:n = { \cs_gset_eq:NN \g__ctex_font_size_flag \c_zero } , zihao / -4 .code:n = { \cs_gset_eq:NN \g__ctex_font_size_flag \c_one } , zihao / false .code:n = { \cs_gset_eq:NN \g__ctex_font_size_flag \c_two } , @@ -168,6 +168,7 @@ %% ctexbook.cls, %% ctexrep.cls, %% ctexbeamer.cls, +%% ctxdoc.cls, %% ctexcap.sty, %% ctexhook.sty, %% ctexpatch.sty, @@ -194,6 +195,7 @@ %% ctex-engine-pdftex.def, %% ctex-engine-xetex.def, %% ctex-engine-luatex.def, +%% ctex-engine-aptex.def, %% ctex-engine-uptex.def, %% c19rm.fd, %% c19sf.fd, @@ -213,6 +215,7 @@ %% ctexpunct.spa, %% ctexmakespa.tex, %% ctexspamacro.tex, +%% ctxdocstrip.tex, %% zhadobefonts.tex, %% zhfandolfonts.tex, %% zhfounderfonts.tex, @@ -220,6 +223,6 @@ %% zhwindowsfonts.tex, %% translator-theorem-dictionary-ChineseGBK.dict, %% translator-theorem-dictionary-ChineseUTF8.dict, and -%% README. +%% README.md. %% %% End of file `ctexsize.sty'. diff --git a/Master/texmf-dist/tex/latex/ctex/ctxdoc.cls b/Master/texmf-dist/tex/latex/ctex/ctxdoc.cls new file mode 100644 index 00000000000..5f7839a3a36 --- /dev/null +++ b/Master/texmf-dist/tex/latex/ctex/ctxdoc.cls @@ -0,0 +1,360 @@ +%% +%% This is file `ctxdoc.cls', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% ctex.dtx (with options: `ctxdoc') +%% +%% Copyright (C) 2003--2016 +%% CTEX.ORG and any individual authors listed in the documentation. +%% ------------------------------------------------------------------------------ +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. This version of this license is in +%% http://www.latex-project.org/lppl/lppl-1-3c.txt +%% and the latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang. +%% +%% ------------------------------------------------------------------------------ +%% +\NeedsTeXFormat{LaTeX2e} +\RequirePackage{expl3} +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ + {ctex documentation (CTEX)} +\ProvidesExplClass{ctxdoc} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} +\ExplSyntaxOff +\DeclareOption*{\PassOptionsToClass{\CurrentOption}{l3doc}} +\PassOptionsToClass{a4paper,full}{l3doc} +\ProcessOptions +\@namedef{ver@thumbpdf.sty}{9999/99/99} +\LoadClass{l3doc} +\RequirePackage[UTF8, punct = kaiming, heading, fontset = none, + linespread = 1.2, sub3section]{ctex} +\ifxetex + \xeCJKsetup{AutoFakeBold=false} +\fi +\ctexset{ + fontset, + abstractname = 简介, + indexname = 代码索引, + section = { + format = \Large\bfseries\raggedright, + name = {第,节}, + }, +} +\RequirePackage[toc]{multitoc} +\RequirePackage{geometry} +\RequirePackage{tabularx} +\RequirePackage{makecell} +\RequirePackage{threeparttable} +\RequirePackage{siunitx} +\RequirePackage{unicode-math} +\RequirePackage{xcolor} +\RequirePackage{caption} +\RequirePackage{fvrb-ex} +\geometry{includemp,hmargin={0mm,15mm},vmargin={25mm,15mm},footskip=7mm} +\hypersetup{pdfstartview=FitH,bookmarksdepth=subparagraph} +\setcounter{secnumdepth}{4} +\setcounter{tocdepth}{2} +\newcommand*\email{\nolinkurl} +\setmainfont{TeX Gyre Pagella} +\setsansfont{TeX Gyre Heros} +\setmonofont[ + UprightFont=* Light, BoldFont=* Bold, + SlantedFont=* Light Oblique]{CMU Typewriter Text} +\setmathfont{texgyrepagella-math.otf} +\captionsetup{strut=off, labelsep=quad, labelfont+=bf} +%% <--- http://tex.stackexchange.com/a/40896 +\patchcmd{\@addtocurcol}% + {\vskip \intextsep}% + {\edef\save@first@penalty{\the\lastpenalty}\unpenalty + \ifnum \lastpenalty = \@M % hopefully the OR penalty + \unpenalty + \else + \penalty \save@first@penalty \relax % put it back + \fi + \ifnum\outputpenalty <-\@Mii + \addvspace\intextsep + \vskip\parskip + \else + \addvspace\intextsep + \fi}% + {\typeout{*** SUCCESS ***}}{\typeout{*** FAIL ***}} +\patchcmd{\@addtocurcol}% + {\vskip\intextsep \ifnum\outputpenalty <-\@Mii \vskip -\parskip\fi}% + {\ifnum\outputpenalty <-\@Mii + \aftergroup\vskip\aftergroup\intextsep + \aftergroup\nointerlineskip + \else + \vskip\intextsep + \fi}% + {\typeout{*** SUCCESS ***}}{\typeout{*** FAIL ***}} +\patchcmd{\@getpen}{\@M}{\@Mi} + {\typeout{*** SUCCESS ***}}{\typeout{*** FAIL ***}} +%% ---> +%% 不对代码实现的 \section 以下标题编目录。 +\AtBeginEnvironment{implementation}{% + \ifnum\value{tocdepth}>\@ne + \addtocontents{toc}{\protect\value{tocdepth}=1\relax}% + \fi} +\ifxetex + \let\ctexdocverbaddon\xeCJKVerbAddon + \def\ctexdisableecglue{\xeCJKsetup{CJKecglue}} + \def\ctexplainps{\xeCJKsetup{PunctStyle=plain}} + \appto\meta@font@select{\ifinner\ctexdisableecglue\fi} +\else + \let\ctexdocverbaddon\relax + \let\ctexplainps\relax + \def\ctexdisableecglue{\ltjsetparameter{autoxspacing=false}} + \appto\meta@font@select{\ctexdisableecglue} +\fi +\setlist{noitemsep,topsep=\smallskipamount} +\setlist[1]{labelindent=\parindent} +\setlist[enumerate]{leftmargin=*} +\setlist[itemize]{leftmargin=*} +\newlist{optdesc}{description}{3} +%% 设置间距为 \marginparsep,与 l3doc 一致 +\setlist[optdesc]{% + font=\mdseries\small\ttfamily,align=right,listparindent=\parindent, + labelsep=\marginparsep,labelindent=-\marginparsep,leftmargin=*} +%% 重新定义 threeparttable 包的 tablenotes 环境 +\renewlist{tablenotes}{description}{1} +\setlist[tablenotes]{% + format=\normalfont\tnote@item,align=right,listparindent=\parindent, + labelindent=\tabcolsep,leftmargin=*,rightmargin=\tabcolsep, + after=\@noparlisttrue} +\AtBeginEnvironment{tablenotes}{% + \setlength\parindent{2\ccwd}% + \normalfont\footnotesize} +\AtBeginEnvironment{threeparttable}{% + \stepcounter{tpt@id}% + \edef\curr@tpt@id{tpt@\arabic{tpt@id}}} +\newcounter{tpt@id} +\def\tnote@item#1{% + \Hy@raisedlink{\hyper@anchor{\curr@tpt@id-#1}}#1} +\def\TPTtagStyle#1{\hyperlink{\curr@tpt@id-#1}{#1}} +\fvset{ + fontsize=\small,baselinestretch=1,numbersep=5pt, + formatcom=\ctexdocverbaddon, + listparameters=\setlength\topsep{\MacrocodeTopsep}} +\DefineVerbatimEnvironment{frameverb}{Verbatim}{% + gobble=4, + frame=single,framesep=8pt, + listparameters= + \setlength\topsep{\medskipamount}% + \appto\FV@EndList{\nointerlineskip}} +\DefineVerbatimEnvironment{ctexexam}{Verbatim}{% + gobble=4, + frame=single,framesep=10pt, + label=\rule{0pt}{12pt}\textnormal{\bfseries 例 \arabic{ctexexam}}, + listparameters= + \setlength\topsep{\bigskipamount}% + \refstepcounter{ctexexam}\ctexexamlabelref + \appto\FV@EndList{\nointerlineskip}} +\define@key{FV}{labelref}{\def\ctexexamlabelref{\label{#1}}} +\let\ctexexamlabelref\empty +\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} +\AfterEndEnvironment{function}{\ctexfixprevdepth} +\AtBeginEnvironment{syntax}{\linespread{1}\ctexplainps\ctexdisableecglue} +\BeforeBeginEnvironment{SideBySideExample}{\par\addvspace{\medskipamount}} +\preto\MacroFont{\linespread{1}} +\appto\MacroFont{\hyphenchar\font\m@ne\ctexdocverbaddon} +\preto\AltMacroFont{\linespread{1}} +\appto\AltMacroFont{\hyphenchar\font\m@ne\ctexdocverbaddon} +\def\Module#1{\mbox{% + \color{purple}\footnotesize\normalfont\sffamily\textlangle#1\textrangle}} +\newcommand*\exptarget{\Hy@raisedlink{\hypertarget{expstar}{}}} +\newcommand*\rexptarget{\Hy@raisedlink{\hypertarget{rexpstar}{}}} +\newcommand*\expstar{\hyperlink{expstar}{$\star$}} +\newcommand*\rexpstar{\hyperlink{rexpstar}{\ding{73}}} +\ExplSyntaxOn +%% l3doc 会设置列表环境中 \listparindent=\z@,我们在这里恢复它。 +\cs_set_eq:NN \list \__codedoc_oldlist:nn +\cs_new_nopar:Npn \zihaopt #1 + { + \exp_last_unbraced:Nf \tl_head:w + { \prop_item:Nn \c__ctex_font_size_prop {#1} } { } \q_stop + } +%% 用 \vtop 让函数名字和语法盒子首行对齐 +\patchcmd \__codedoc_syntax:w + { { minipage } { \l__codedoc_syntax_dim } } + { { 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 + { \vbox_unpack_clear:N } + { \linespread { 1 } \selectfont \vbox_unpack_clear:N } + { \iow_term:n { *** ~ SUCCESS ~ *** } } + { \iow_term:n { *** ~ FAIL ~ *** } } +%% 不重复使用 \HD@target,避免索引出现重复页码 +\cs_set_protected:Npn \__codedoc_special_index_aux:nnnnn #1#2#3#4#5 + { + \__codedoc_special_index_set:Nn \l__codedoc_index_escaped_macro_tl {#2} + \str_if_eq:onTF { \@currenvir } { macrocode } + { \codeline@wrindex } + { + \HD@target + \index + } + { + \tl_if_empty:nF { #3 #4 } + { #3 \actualchar #4 \levelchar } + #1 + \actualchar + { + \token_to_str:N \verbatim@font \c_space_tl + \l__codedoc_index_escaped_macro_tl + } + \encapchar + hdclindex{\the\c@HD@hypercount}{#5} + } + } +\DeclareDocumentCommand \cs { O{} m } + { \__codedoc_cmd_aux:no {#1} { \c__codedoc_backslash_tl #2 } } +\DeclareDocumentCommand \tn { O{} m } + { + \__codedoc_cmd_aux:no + { index = TeX , replace = false , #1 } + { \c__codedoc_backslash_tl #2 } + } +\DeclareDocumentCommand \meta { +m } + { \__codedoc_meta_aux:n {#1} } +\DeclareExpandableDocumentCommand \bookmarkcstn { O{} m } + { \textbackslash \tl_to_str:n {#2} } +\cs_new:Npn \bookmarkmeta #1 { < \tl_to_str:n {#1} > } +\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 等编索引 +\DeclareDocumentCommand \StopSpecialIndexModule { } + { \cs_set_eq:NN \__codedoc_special_index_module:nnnn \use_none:nnnn } +\tl_map_inline:nn { \actualchar \encapchar \levelchar } + { \exp_args:Nx \DoNotIndex { \bslash \tl_to_str:N #1 } } +\DeclareDocumentCommand \package { o m } + { + \exp_args:Nx \href + { + http \c_colon_str //www.ctan.org/pkg/ + \IfNoValueTF {#1} { \str_fold_case:n {#2} } {#1} + } + { \pkg {#2} } + } +\DeclareDocumentCommand \GetFileId { m } + { + \GetFileInfo {#1} + \ior_open:NnTF \g_ctxdoc_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 + } + { \GetIdInfo $Id$ } + { \fileinfo } + } +\iow_new:N \g_ctxdoc_ior +\ExplSyntaxOff +\AtBeginDocument{\addtocontents{toc}{\StopSpecialIndexModule}} +\pdfstringdefDisableCommands{% + \let\cs\bookmarkcstn + \let\tn\bookmarkcstn + \let\meta\bookmarkmeta + \let\path\meta + \let\opt\@firstofone} +\preto\@thehead{\cslet{MakeUppercase\space}{\@iden}} +\def\orbar{\textup{\textbar}} +\def\defaultval#1{\textbf{\textup{#1}}} +\def\defaultvalaux#1){\defaultval{#1}} +\def\TF{true\orbar false} +\def\TTF{\defaultval{true}\orbar false} +\def\TFF{true\orbar\defaultval{false}} +\protected\def\opt{\texttt} +\def\pdfTeX{\hologo{pdfTeX}} +\def\XeTeX{\hologo{XeTeX}} +\def\XeLaTeX{\hologo{XeLaTeX}} +\def\LuaLaTeX{\hologo{LuaLaTeX}} +\def\pdfLaTeX{\hologo{pdfLaTeX}} +\def\LaTeX{\hologo{LaTeX}} +\def\LaTeXe{\hologo{LaTeX2e}} +\def\LaTeXiii{\hologo{LaTeX3}} +\def\dvipdfmx{DVIPDFM\textit{x}} +\def\TeX{\hologo{TeX}} +\def\ApTeX{Ap\TeX} +\def\ApLaTeX{Ap\LaTeX} +\def\upTeX{up\TeX} +\def\upLaTeX{up\LaTeX} +\def\bashcmd{\texttt} +\def\TeXLive{\TeX\ Live} +\def\MiKTeX{\hologo{MiKTeX}} +\def\BSTACK{\begin{tabular}[t]{@{}l@{}}} +\def\ESTACK{\end{tabular}} +\newenvironment{defaultcapconfig}{% + \MakePercentComment + \input{ctex-name-utf8.cfg}% + \ExplSyntaxOff + \MakePercentIgnore}{} +\def\ctexkit{\href{https://github.com/CTeX-org/ctex-kit/}{\texttt{ctex-kit}}} +\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}{}{} +\appto\GlossaryParms{% + \def\@idxitem{\par\hangindent 2em }% + \def\subitem{\@idxitem\hspace*{1em}}% + \def\subsubitem{\@idxitem\hspace*{2em}}} +\patchcmd\l@section{2.5em}{1.5em}{}{} +\patchcmd\l@subsection{2.5em}{1.5em}{}{} +\patchcmd\changes@{\space}{\lbrack}{}{} +\patchcmd\@wrglossary{hdpindex}{% + \ifnum\c@HD@hypercount=\z@ + hdpindex% + \else + hdclindex{\the\c@HD@hypercount}\fi}{}{} +\def\glossaryname{版本历史} +\GlossaryPrologue{\section{\glossaryname}} +\IndexPrologue{% + \section{\indexname} + \textit{意大利体的数字表示描述对应索引项的页码; + 带下划线的数字表示定义对应索引项的代码行号; + 罗马字体的数字表示使用对应索引项的代码行号。}} +\def\IndexLayout{% + \newgeometry{hmargin=15mm,vmargin={25mm,15mm},footskip=7mm}% + \setlength\IndexMin{.5\textheight}% + \ctexset{section/numbering=false}% + \StopSpecialIndexModule} +\EnableCrossrefs +\CodelineIndex +\RecordChanges +%% +%% +%% End of file `ctxdoc.cls'. diff --git a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-aptex.def b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-aptex.def new file mode 100644 index 00000000000..44b50915e3b --- /dev/null +++ b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-aptex.def @@ -0,0 +1,246 @@ +%% +%% This is file `ctex-engine-aptex.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% ctex.dtx (with options: `aptex') +%% +%% Copyright (C) 2003--2016 +%% CTEX.ORG and any individual authors listed in the documentation. +%% ------------------------------------------------------------------------------ +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. This version of this license is in +%% http://www.latex-project.org/lppl/lppl-1-3c.txt +%% and the latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang. +%% +%% ------------------------------------------------------------------------------ +%% +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ + {Asian pTeX adapter (CTEX)} +\ProvidesExplFile{ctex-engine-aptex.def} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} +\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 +\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 } +\ctex_at_end_preamble:n { \ctex_update_default_family: } +\ctex_patch_cmd:Nnn \em + { \mcfamily \upshape \else \gtfamily \itshape } + { \eminnershape \else \itshape } +\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 +\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 +\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 +\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 + } +\cs_new_protected_nopar:Npn \ctex_update_default_family: + { + \tl_if_eq:NNT \CJKfamilydefault \l__ctex_family_default_init_tl + { + \group_begin: + \cs_set_eq:NN \__ctex_family_default_wrap:n \exp_not:n + \tl_gset:Nx \CJKfamilydefault + { + \str_case:onF { \familydefault } + { + { \rmdefault } { \exp_not:N \CJKrmdefault } + { \sfdefault } { \exp_not:N \CJKsfdefault } + { \ttdefault } { \exp_not:N \CJKttdefault } + } + { \CJKfamilydefault } + } + \group_end: + } + } +\tl_new:N \l__ctex_family_default_init_tl +\cs_new_eq:NN \__ctex_family_default_wrap:n \use:n +\tl_set:Nx \l__ctex_family_default_init_tl + { + \exp_not:N \__ctex_family_default_wrap:n + { \exp_not:o { \CJKfamilydefault } } + } +\tl_gset_eq:NN \CJKfamilydefault \l__ctex_family_default_init_tl +\cs_new_protected_nopar:Npn \ctex_detected_platform: + { + \tl_gset:Nx \g__ctex_fontset_tl + { + \str_case:onF { \ngostype } + { + { Win32 } { windows } + { Win64 } { windows } + { Darwin } { mac } + } + { fandol } + } + } +\ctex_hypersetup:n { driverfallback = dvipdfmx } +\ctex_at_end_package:nn { hyperref } + { + \AtBeginShipoutFirst{ \special{ pdf:tounicode~ UTF8-UTF16 } } + } +\msg_new:nnn { ctex } { fntef-not-available } + { Functions~ of~ `CJKfntef'~ is~ not~ available~ in~ ApLaTeX. } +\msg_warning:nn { ctex } { fntef-not-available } +\clist_map_inline:nn + { underdot , underline , underdblline , underwave , sout , xout } + { \cs_new_eq:cN { CTEX#1 } \use:n } +\cs_new_eq:NN \CTEXfilltwosides \use_none:n +\cs_new_eq:NN \endCTEXfilltwosides \prg_do_nothing: +\cs_new_protected_nopar:Npn \ctex_update_ccwd: + { \skip_set:Nn \ccwd { 1zw + \ptex_kanjiskip:D } } +\dim_new:N \ccwd +\cs_new_protected_nopar:Npn \ctex_update_ccglue: + { \skip_set_eq:NN \ptex_kanjiskip:D \l__ctex_ccglue_skip } +\skip_new:N \l__ctex_ccglue_skip +\prg_new_conditional:Npnn \ctex_if_ccglue_touched: { TF } + { + \skip_if_eq:nnTF { \l__ctex_ccglue_skip } { \ptex_kanjiskip:D } + { \prg_return_false: } { \prg_return_true: } + } +\cs_new_protected_nopar:Npn \ctex_update_em_unit: + { \dim_set:Nn \ccwd { 1zw } } +\cs_new_protected:Npn \ctex_add_to_selectfont:n #1 + { + \cs_set_protected_nopar:Npx \CTEX@selectfont@hook + { \exp_not:o { \CTEX@selectfont@hook #1 } } + } +\cs_new_eq:NN \CTEX@selectfont@hook \prg_do_nothing: +\cs_new_eq:Nc \__ctex_save_selectfont: { selectfont ~ } +\ctex_preto_cmd:NnnTF \selectfont { \ExplSyntaxOff } + { \CTEX@selectfont@hook } + { + \tl_put_left:Nn \@EverySelectfont@Init + { \cs_set_eq:cN { selectfont ~ } \__ctex_save_selectfont: } + } + { \ctex_patch_failure:N \selectfont } +\EverySelectfont { \CTEX@selectfont@hook } +\cs_new_protected_nopar:Npn \ctex_update_xkanjiskip: + { + \skip_if_eq:nnT + { \ptex_xkanjiskip:D } { \l__ctex_xkanjiskip_skip } + { + \skip_set:Nn \l__ctex_xkanjiskip_skip { \l__ctex_xkanjiskip_tl } + \skip_set_eq:NN \ptex_xkanjiskip:D \l__ctex_xkanjiskip_skip + } + } +\tl_new:N \l__ctex_xkanjiskip_tl +\tl_set:Nn \l__ctex_xkanjiskip_tl + { .25zw plus 1pt minus 1pt } +\skip_new:N \l__ctex_xkanjiskip_skip +\skip_set:Nn \l__ctex_xkanjiskip_skip + { \ptex_xkanjiskip:D } +\ctex_add_to_selectfont:n { \ctex_update_xkanjiskip: } +\keys_define:nn { ctex } + { + space .code:n = + { \msg_warning:nn { ctex } { invalid-option } } + } +\keys_define:nn { ctex } + { + punct .code:n = + { + \tl_set:Nx \l__ctex_punct_tl { #1 } + \msg_warning:nn { ctex } { invalid-option } + } , + punct .default:n = { quanjiao } , + } +\tl_set:Nn \l__ctex_encoding_tl { UTF8 } +\DeclareKanjiFamily{JY2}{rm}{} +\DeclareKanjiFamily{JY2}{sf}{} +\DeclareKanjiFamily{JY2}{tt}{} +\DeclareKanjiFamily{JT2}{rm}{} +\DeclareKanjiFamily{JT2}{sf}{} +\DeclareKanjiFamily{JT2}{tt}{} +\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}{} +\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}{} +\DeclareFontShape{JY2}{tt}{m}{n}{<-> upzhmono-h}{} +\DeclareFontShape{JT2}{tt}{m}{n}{<-> upzhmono-v}{} +%% +%% +%% End of file `ctex-engine-aptex.def'. diff --git a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-luatex.def b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-luatex.def index bb0cfb50ea5..665914d7d9e 100644 --- a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-luatex.def +++ b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-luatex.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {LuaLaTeX adapter (CTEX)} \ProvidesExplFile{ctex-engine-luatex.def} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \msg_new:nnn { ctex } { luatexja-loaded } { Package~`luatexja'~can~not~be~loaded~before~`ctex'.\\ @@ -968,17 +968,6 @@ } \seq_put_right:No \l__ctex_ltj_alternate_seq { \l__ctex_ltj_tmp_tl } } -\cs_new_protected_nopar:Npn \ctex_ltj_update_xkanjiskip: - { - \skip_if_eq:nnT - { \ltjgetparameter { xkanjiskip } } { \l__ctex_ltj_xkanjiskip_skip } - { - \skip_set:Nn \l__ctex_ltj_xkanjiskip_skip { .25 \zw plus 1pt minus 1pt } - \ltjsetxkanjiskip \l__ctex_ltj_xkanjiskip_skip - } - } -\skip_new:N \l__ctex_ltj_xkanjiskip_skip -\skip_set:Nn \l__ctex_ltj_xkanjiskip_skip { .25 \zw plus 1pt minus 1pt } \AtBeginDocument { \ctex_appto_cmd:NnnTF \verbatim@font @@ -1075,10 +1064,25 @@ { \ctex_ltj_select_font: \ctex_ltj_select_alternate_font: - \ctex_ltj_update_xkanjiskip: } \tl_set:Nn \CJK@family { song } \selectfont \tl_clear:N \CJK@family +\cs_new_protected_nopar:Npn \ctex_update_xkanjiskip: + { + \skip_if_eq:nnT + { \ltjgetparameter { xkanjiskip } } { \l__ctex_xkanjiskip_skip } + { + \skip_set:Nn \l__ctex_xkanjiskip_skip { \l__ctex_xkanjiskip_tl } + \ltjsetxkanjiskip \l__ctex_xkanjiskip_skip + } + } +\tl_new:N \l__ctex_xkanjiskip_tl +\tl_set:Nn \l__ctex_xkanjiskip_tl + { .25\zw plus 1pt minus 1pt } +\skip_new:N \l__ctex_xkanjiskip_skip +\skip_set:Nn \l__ctex_xkanjiskip_skip + { \ltjgetparameter { xkanjiskip } } +\ctex_add_to_selectfont:n { \ctex_update_xkanjiskip: } \keys_define:nn { ctex } { space .code:n = diff --git a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-pdftex.def b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-pdftex.def index 617423d572e..976b01b9c4b 100644 --- a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-pdftex.def +++ b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-pdftex.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {(pdf)LaTeX adapter (CTEX)} \ProvidesExplFile{ctex-engine-pdftex.def} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \cs_new_protected_nopar:Npn \ctex_set_zhmap:n #1 { \AtBeginDvi { #1 } diff --git a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-uptex.def b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-uptex.def index a65526b2deb..581fd65f11b 100644 --- a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-uptex.def +++ b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-uptex.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {upTeX adapter (CTEX)} \ProvidesExplFile{ctex-engine-uptex.def} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \cs_new_protected_nopar:Npn \ctex_set_zhmap:n #1 { \AtBeginDvi { #1 } @@ -50,6 +50,7 @@ \selectfont } \tl_set:Nn \kanjifamilydefault { \CJKfamilydefault } +\ctex_at_end_preamble:n { \ctex_update_default_family: } \ctex_patch_cmd:Nnn \em { \mcfamily \upshape \else \gtfamily \itshape } { \eminnershape \else \itshape } @@ -101,15 +102,42 @@ \@ifpackageloaded { tracefnt } { \EverySelectfont - { - \ifnum \tracingfonts > \tw@ - \@font@info { Switching~ to~ \font@name } - \fi - } + { + \ifnum \tracingfonts > \tw@ + \@font@info { Switching~ to~ \font@name } + \fi + } } { } \let \@EverySelectfont@Init \undefined } +\cs_new_protected_nopar:Npn \ctex_update_default_family: + { + \tl_if_eq:NNT \CJKfamilydefault \l__ctex_family_default_init_tl + { + \group_begin: + \cs_set_eq:NN \__ctex_family_default_wrap:n \exp_not:n + \tl_gset:Nx \CJKfamilydefault + { + \str_case:onF { \familydefault } + { + { \rmdefault } { \exp_not:N \CJKrmdefault } + { \sfdefault } { \exp_not:N \CJKsfdefault } + { \ttdefault } { \exp_not:N \CJKttdefault } + } + { \CJKfamilydefault } + } + \group_end: + } + } +\tl_new:N \l__ctex_family_default_init_tl +\cs_new_eq:NN \__ctex_family_default_wrap:n \use:n +\tl_set:Nx \l__ctex_family_default_init_tl + { + \exp_not:N \__ctex_family_default_wrap:n + { \exp_not:o { \CJKfamilydefault } } + } +\tl_gset_eq:NN \CJKfamilydefault \l__ctex_family_default_init_tl \cs_new_protected_nopar:Npn \ctex_detected_platform: { \file_if_exist:nTF { /dev/null } @@ -133,25 +161,28 @@ { \tl_gset:Nn \g__ctex_fontset_tl {#2} } } \str_const:Nn \c__ctex_macosx_file_str { /Library/Fonts/Songti.ttc } -\PassOptionsToPackage { dvipdfmx } { hyperref } +\ctex_hypersetup:n { driverfallback = dvipdfmx } \ctex_at_end_package:nn { hyperref } { \AtBeginShipoutFirst{ \special{ pdf:tounicode~ UTF8-UTF16 } } } +\msg_new:nnn { ctex } { fntef-not-available } + { Functions~ of~ `CJKfntef'~ is~ not~ available~ in~ upLaTeX. } +\msg_warning:nn { ctex } { fntef-not-available } \clist_map_inline:nn { underdot , underline , underdblline , underwave , sout , xout } { \cs_new_eq:cN { CTEX#1 } \use:n } \cs_new_eq:NN \CTEXfilltwosides \use_none:n \cs_new_eq:NN \endCTEXfilltwosides \prg_do_nothing: \cs_new_protected_nopar:Npn \ctex_update_ccwd: - { \skip_set:Nn \ccwd { 1zw } } + { \skip_set:Nn \ccwd { 1zw + \ptex_kanjiskip:D } } \dim_new:N \ccwd \cs_new_protected_nopar:Npn \ctex_update_ccglue: - { \kanjiskip \l__ctex_ccglue_skip } + { \skip_set_eq:NN \ptex_kanjiskip:D \l__ctex_ccglue_skip } \skip_new:N \l__ctex_ccglue_skip \prg_new_conditional:Npnn \ctex_if_ccglue_touched: { TF } { - \skip_if_eq:nnTF { \l__ctex_ccglue_skip } { \kanjiskip } + \skip_if_eq:nnTF { \l__ctex_ccglue_skip } { \ptex_kanjiskip:D } { \prg_return_false: } { \prg_return_true: } } \cs_new_protected_nopar:Npn \ctex_update_em_unit: @@ -171,6 +202,22 @@ } { \ctex_patch_failure:N \selectfont } \EverySelectfont { \CTEX@selectfont@hook } +\cs_new_protected_nopar:Npn \ctex_update_xkanjiskip: + { + \skip_if_eq:nnT + { \ptex_xkanjiskip:D } { \l__ctex_xkanjiskip_skip } + { + \skip_set:Nn \l__ctex_xkanjiskip_skip { \l__ctex_xkanjiskip_tl } + \skip_set_eq:NN \ptex_xkanjiskip:D \l__ctex_xkanjiskip_skip + } + } +\tl_new:N \l__ctex_xkanjiskip_tl +\tl_set:Nn \l__ctex_xkanjiskip_tl + { .25zw plus 1pt minus 1pt } +\skip_new:N \l__ctex_xkanjiskip_skip +\skip_set:Nn \l__ctex_xkanjiskip_skip + { \ptex_xkanjiskip:D } +\ctex_add_to_selectfont:n { \ctex_update_xkanjiskip: } \keys_define:nn { ctex } { space .code:n = diff --git a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-xetex.def b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-xetex.def index 7feeba4bec6..216baf15a94 100644 --- a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-xetex.def +++ b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-xetex.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {XeLaTeX adapter (CTEX)} \ProvidesExplFile{ctex-engine-xetex.def} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \RequirePackage { xeCJK } \exp_args:Nx \xeCJKsetup { diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-adobe.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-adobe.def index ba3011e1c30..756039dc8b3 100644 --- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-adobe.def +++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-adobe.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Adobe fonts definition (CTEX)} \ProvidesExplFile{ctex-fontset-adobe.def} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \sys_if_engine_pdftex:TF { \sys_if_output_pdf:TF diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-fandol.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-fandol.def index bc41f538eeb..3112c89066c 100644 --- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-fandol.def +++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-fandol.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Fandol fonts definition (CTEX)} \ProvidesExplFile{ctex-fontset-fandol.def} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \sys_if_engine_pdftex:TF { \sys_if_output_pdf:TF diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-founder.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-founder.def index d8fedd1c174..0639c128723 100644 --- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-founder.def +++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-founder.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Founder fonts definition (CTEX)} \ProvidesExplFile{ctex-fontset-founder.def} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \sys_if_engine_pdftex:TF { \ctex_zhmap_case:nnn diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-mac.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-mac.def index e064e258d0f..2bffc2b54e7 100644 --- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-mac.def +++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-mac.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Mac OS X fonts definition (CTEX)} \ProvidesExplFile{ctex-fontset-mac.def} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \sys_if_engine_pdftex:TF { \ctex_fontset_error:n { mac } } { diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-ubuntu.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-ubuntu.def index f48c6c85408..afd068fdef2 100644 --- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-ubuntu.def +++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-ubuntu.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Ubuntu fonts definition (CTEX)} \ProvidesExplFile{ctex-fontset-ubuntu.def} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \sys_if_engine_pdftex:TF { \ctex_zhmap_case:nnn diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windows.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windows.def index 20505f507e8..14d2e7abc15 100644 --- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windows.def +++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windows.def @@ -26,11 +26,11 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Windows fonts definition (CTEX)} \ProvidesExplFile{ctex-fontset-windows.def} - {\ExplFileDate}{2.4}{\ExplFileDescription} -\file_if_exist:nTF { C:/boot.ini } + {\ExplFileDate}{2.4.1}{\ExplFileDescription} +\file_if_exist:nTF { C:/bootfont.bin } { \ctex_file_input:n { ctex-fontset-windowsold.def } } { \ctex_file_input:n { ctex-fontset-windowsnew.def } } %% diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsnew.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsnew.def index 0419b85047b..a2f66355bed 100644 --- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsnew.def +++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsnew.def @@ -26,16 +26,16 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Windows fonts definition for Vista or later version (CTEX)} \ProvidesExplFile{ctex-fontset-windowsnew.def} - {\ExplFileDate}{2.4}{\ExplFileDescription} -\tl_new:N \l__ctex_msyh_suffix -\tl_set:Nn \l__ctex_msyh_suffix { .ttc } + {\ExplFileDate}{2.4.1}{\ExplFileDescription} +\tl_new:N \l__ctex_msyh_suffix_tl +\tl_set:Nn \l__ctex_msyh_suffix_tl { .ttc } \file_if_exist:nF { C:/Windows/Fonts/msyh.ttc } { \file_if_exist:nF { msyh.ttc } - { \tl_set:Nn \l__ctex_msyh_suffix { .ttf } } + { \tl_set:Nn \l__ctex_msyh_suffix_tl { .ttf } } } \sys_if_engine_pdftex:TF { @@ -44,9 +44,9 @@ \ctex_punct_set:n { windows } \setCJKmainfont [ BoldFont = simhei.ttf , ItalicFont = simkai.ttf ] { simsun.ttc } - \setCJKsansfont [ BoldFont = msyhbd\l__ctex_msyh_suffix ] { msyh\l__ctex_msyh_suffix } + \setCJKsansfont [ BoldFont = msyhbd\l__ctex_msyh_suffix_tl ] { msyh\l__ctex_msyh_suffix_tl } \setCJKfamilyfont { zhyahei } - [ BoldFont = msyhbd\l__ctex_msyh_suffix ] { msyh\l__ctex_msyh_suffix } + [ BoldFont = msyhbd\l__ctex_msyh_suffix_tl ] { msyh\l__ctex_msyh_suffix_tl } \ctex_punct_map_family:nn { \CJKsfdefault } { zhyahei } \ctex_punct_map_bfseries:nn { \CJKsfdefault , zhyahei } { zhyaheib } \setCJKmonofont { simfang.ttf } @@ -79,7 +79,7 @@ { \ctex_set_upfonts:nnnnnn {simsun.ttc} {simhei.ttf} {simkai.ttf} - {msyh\l__ctex_msyh_suffix} {msyhbd\l__ctex_msyh_suffix} + {msyh\l__ctex_msyh_suffix_tl} {msyhbd\l__ctex_msyh_suffix_tl} {simfang.ttf} \ctex_set_upfamily:nnn { zhsong } { upzhserif } {} \ctex_set_upfamily:nnn { zhhei } { upzhserifb } {} diff --git a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsold.def b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsold.def index 5ba0b77c9ae..dc44c9df1e8 100644 --- a/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsold.def +++ b/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsold.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Windows fonts definition for XP or earlier version (CTEX)} \ProvidesExplFile{ctex-fontset-windowsold.def} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \sys_if_engine_pdftex:TF { \ctex_zhmap_case:nnn diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-article.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-article.def index 74052f63371..96793e2e0a1 100644 --- a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-article.def +++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-article.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Chinese scheme for article (CTEX)} \ProvidesExplFile{ctex-scheme-chinese-article.def} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \keys_set:nn { ctex / part } { aftertitle = \par , @@ -127,16 +127,16 @@ \keys_set:nn { ctex / appendix } { number = \@Alph \c@section } \pagestyle { headings } +\keys_set:nn { ctex } { today = small } +\ctex_if_autoindent_touched:F + { \keys_set:nn { ctex } { autoindent = true } } \str_if_eq:onTF { \l__ctex_encoding_tl } { GBK } { \ctex_file_input:n { ctex-name-gbk.cfg } } { \ctex_file_input:n { ctex-name-utf8.cfg } } -\keys_set:nn { ctex } { today = small } \int_compare:nNnF \g__ctex_font_size_flag > \c_minus_one { \cs_gset_eq:NN \g__ctex_font_size_flag \c_zero } \fp_compare:nNnT { \l__ctex_line_spread_fp } ? { \c_zero_fp } - { \keys_set:nn { ctex / option } { linespread = 1.3 } } -\ctex_if_autoindent_touched:F - { \keys_set:nn { ctex } { autoindent = true } } + { \fp_set:Nn \l__ctex_line_spread_fp { 1.3 } } \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 } diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-beamer.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-beamer.def index a2c5108e1e3..dc5ea1af9c5 100644 --- a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-beamer.def +++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-beamer.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Chinese scheme for beamer (CTEX)} \ProvidesExplFile{ctex-scheme-chinese-beamer.def} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \keys_set:nn { ctex / part } { aftertitle = \par , @@ -60,6 +60,9 @@ titleformat = \usebeamerfont { subsection ~ title } , aftertitle = \par } +\keys_set:nn { ctex } { today = small } +\ctex_if_autoindent_touched:F + { \keys_set:nn { ctex } { autoindent = true } } \str_if_eq:onTF { \l__ctex_encoding_tl } { GBK } { \uselanguage { ChineseGBK } @@ -72,13 +75,6 @@ \ctex_file_input:n { ctex-name-utf8.cfg } } \clist_put_left:Nn \trans@languagepath { chinese } -\keys_set:nn { ctex } { today = small } -\int_compare:nNnF \g__ctex_font_size_flag > \c_minus_one - { \cs_gset_eq:NN \g__ctex_font_size_flag \c_zero } -\fp_compare:nNnT { \l__ctex_line_spread_fp } ? { \c_zero_fp } - { \keys_set:nn { ctex / option } { linespread = 1.3 } } -\ctex_if_autoindent_touched:F - { \keys_set:nn { ctex } { autoindent = true } } %% %% %% End of file `ctex-scheme-chinese-beamer.def'. diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-book.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-book.def index 4bd8d9c9fd1..1875794792e 100644 --- a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-book.def +++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-book.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Chinese scheme for book (CTEX)} \ProvidesExplFile{ctex-scheme-chinese-book.def} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \keys_set:nn { ctex / part } { aftertitle = \par , @@ -141,16 +141,16 @@ number = \@Alph \c@chapter } \pagestyle { headings } +\keys_set:nn { ctex } { today = small } +\ctex_if_autoindent_touched:F + { \keys_set:nn { ctex } { autoindent = true } } \str_if_eq:onTF { \l__ctex_encoding_tl } { GBK } { \ctex_file_input:n { ctex-name-gbk.cfg } } { \ctex_file_input:n { ctex-name-utf8.cfg } } -\keys_set:nn { ctex } { today = small } \int_compare:nNnF \g__ctex_font_size_flag > \c_minus_one { \cs_gset_eq:NN \g__ctex_font_size_flag \c_zero } \fp_compare:nNnT { \l__ctex_line_spread_fp } ? { \c_zero_fp } - { \keys_set:nn { ctex / option } { linespread = 1.3 } } -\ctex_if_autoindent_touched:F - { \keys_set:nn { ctex } { autoindent = true } } + { \fp_set:Nn \l__ctex_line_spread_fp { 1.3 } } \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 } diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-report.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-report.def index d825a37678e..9f372276648 100644 --- a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-report.def +++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-report.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Chinese scheme for report (CTEX)} \ProvidesExplFile{ctex-scheme-chinese-report.def} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \keys_set:nn { ctex / part } { aftertitle = \par , @@ -141,16 +141,16 @@ number = \@Alph \c@chapter } \pagestyle { headings } +\keys_set:nn { ctex } { today = small } +\ctex_if_autoindent_touched:F + { \keys_set:nn { ctex } { autoindent = true } } \str_if_eq:onTF { \l__ctex_encoding_tl } { GBK } { \ctex_file_input:n { ctex-name-gbk.cfg } } { \ctex_file_input:n { ctex-name-utf8.cfg } } -\keys_set:nn { ctex } { today = small } \int_compare:nNnF \g__ctex_font_size_flag > \c_minus_one { \cs_gset_eq:NN \g__ctex_font_size_flag \c_zero } \fp_compare:nNnT { \l__ctex_line_spread_fp } ? { \c_zero_fp } - { \keys_set:nn { ctex / option } { linespread = 1.3 } } -\ctex_if_autoindent_touched:F - { \keys_set:nn { ctex } { autoindent = true } } + { \fp_set:Nn \l__ctex_line_spread_fp { 1.3 } } \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 } diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese.def index d2ef35d84c6..b82dbebda32 100644 --- a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese.def +++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese.def @@ -26,46 +26,40 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Chinese scheme for generic (CTEX)} \ProvidesExplFile{ctex-scheme-chinese.def} - {\ExplFileDate}{2.4}{\ExplFileDescription} -\tl_if_exist:NTF \c__ctex_std_class_tl + {\ExplFileDate}{2.4.1}{\ExplFileDescription} +\keys_set:nn { ctex } { today = small } +\ctex_if_autoindent_touched:F + { \keys_set:nn { ctex } { autoindent = true } } +\tl_set:Nn \l__ctex_tmp_tl { beamer } +\tl_if_eq:NNTF \c__ctex_std_class_tl \l__ctex_tmp_tl { - \str_if_eq:onTF { \c__ctex_std_class_tl } { beamer } + \str_if_eq:onTF { \l__ctex_encoding_tl } { GBK } { - \str_if_eq:onTF { \l__ctex_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 } + \uselanguage { ChineseGBK } + \languagealias { chinese } { ChineseGBK } + \ctex_file_input:n { ctex-name-gbk.cfg } } { - \str_if_eq:onTF { \l__ctex_encoding_tl } { GBK } - { \ctex_file_input:n { ctex-name-gbk.cfg } } - { \ctex_file_input:n { ctex-name-utf8.cfg } } - \RequirePackage { indentfirst } + \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__ctex_encoding_tl } { GBK } { \ctex_file_input:n { ctex-name-gbk.cfg } } { \ctex_file_input:n { ctex-name-utf8.cfg } } + \int_compare:nNnF \g__ctex_font_size_flag > \c_minus_one + { \cs_gset_eq:NN \g__ctex_font_size_flag \c_zero } + \fp_compare:nNnT { \l__ctex_line_spread_fp } ? { \c_zero_fp } + { \fp_set:Nn \l__ctex_line_spread_fp { 1.3 } } + \tl_if_exist:NT \c__ctex_std_class_tl + { \RequirePackage { indentfirst } } } -\keys_set:nn { ctex } { today = small } -\int_compare:nNnF \g__ctex_font_size_flag > \c_minus_one - { \cs_gset_eq:NN \g__ctex_font_size_flag \c_zero } -\fp_compare:nNnT { \l__ctex_line_spread_fp } ? { \c_zero_fp } - { \keys_set:nn { ctex / option } { linespread = 1.3 } } -\ctex_if_autoindent_touched:F - { \keys_set:nn { ctex } { autoindent = true } } %% %% %% End of file `ctex-scheme-chinese.def'. diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-article.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-article.def index ab11b96b27a..efdc2209d03 100644 --- a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-article.def +++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-article.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Plain scheme for article (CTEX)} \ProvidesExplFile{ctex-scheme-plain-article.def} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \keys_set:nn { ctex / part } { aftertitle = \par , diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-beamer.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-beamer.def index 796c4b81aac..19beb27cb20 100644 --- a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-beamer.def +++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-beamer.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Plain scheme for beamer (CTEX)} \ProvidesExplFile{ctex-scheme-plain-beamer.def} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \keys_set:nn { ctex / part } { aftertitle = \par , diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-book.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-book.def index 8903bebe106..19b8fa165f5 100644 --- a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-book.def +++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-book.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Plain scheme for book (CTEX)} \ProvidesExplFile{ctex-scheme-plain-book.def} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \keys_set:nn { ctex / part } { aftertitle = \par , diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-report.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-report.def index 846177eaa15..380b3ea7c1a 100644 --- a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-report.def +++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-report.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Plain scheme for report (CTEX)} \ProvidesExplFile{ctex-scheme-plain-report.def} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \keys_set:nn { ctex / part } { aftertitle = \par , diff --git a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain.def b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain.def index 1823e0390e3..bdf82e589ce 100644 --- a/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain.def +++ b/Master/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 1fcc459 2016-04-25 13:35:13 +0800 Liu Haiyang $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee $ {Plain scheme for generic (CTEX)} \ProvidesExplFile{ctex-scheme-plain.def} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} %% %% %% End of file `ctex-scheme-plain.def'. -- cgit v1.2.3