diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-uptex.def')
-rw-r--r-- | Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-uptex.def | 69 |
1 files changed, 58 insertions, 11 deletions
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 = |