diff options
author | Karl Berry <karl@freefriends.org> | 2016-05-14 22:03:09 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-05-14 22:03:09 +0000 |
commit | 1ffd29c330984928904e5f95a4033d334fba974b (patch) | |
tree | da2c8a81497119292b01e00a76fb78727f65da93 /Master/texmf-dist/tex/latex/ctex/engine | |
parent | 1bafd95e83267f9e55b47de90fa004d4db84971d (diff) |
ctex (14may16)
git-svn-id: svn://tug.org/texlive/trunk@41120 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/ctex/engine')
5 files changed, 326 insertions, 29 deletions
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 <sobenlee@gmail.com> $ + {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 <leoliu.pku@gmail.com> $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee <sobenlee@gmail.com> $ {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 <leoliu.pku@gmail.com> $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee <sobenlee@gmail.com> $ {(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 <leoliu.pku@gmail.com> $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee <sobenlee@gmail.com> $ {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 <leoliu.pku@gmail.com> $ +\GetIdInfo$Id: ctex.dtx f745b21 2016-05-14 12:17:18 +0800 Qing Lee <sobenlee@gmail.com> $ {XeLaTeX adapter (CTEX)} \ProvidesExplFile{ctex-engine-xetex.def} - {\ExplFileDate}{2.4}{\ExplFileDescription} + {\ExplFileDate}{2.4.1}{\ExplFileDescription} \RequirePackage { xeCJK } \exp_args:Nx \xeCJKsetup { |