diff options
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty')
-rw-r--r-- | Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty | 76 |
1 files changed, 42 insertions, 34 deletions
diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty b/Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty index a578dfd8b21..e033226ccfe 100644 --- a/Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty +++ b/Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty @@ -13,9 +13,9 @@ %% Leo Liu <leoliu.pku@gmail.com> %% Qing Lee <sobenlee@gmail.com> %% -%% Copyright (C) 2007--2015 Wenchang Sun -%% (C) 2009--2015 Leo Liu -%% (C) 2012--2015 Qing Lee +%% Copyright (C) 2007--2010 Wenchang Sun +%% (C) 2009--2016 Leo Liu +%% (C) 2012--2016 Qing Lee %% %% This file may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -31,38 +31,46 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: xeCJK.dtx 7321d12 2015-05-15 23:07:58 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: xeCJK.dtx 2667062 2016-02-01 12:02:59 +0800 Qing Lee <sobenlee@gmail.com> $ {addon file for xunicode} \ProvidesExplPackage {xunicode-addon} - {\ExplFileDate}{3.3.2}{\ExplFileDescription} -\pdftex_if_engine:T + {\ExplFileDate}{3.3.3}{\ExplFileDescription} +\bool_if:nF { - \msg_new:nnnn { xunicode-addon } { cannot-use-pdftex } + \sys_if_engine_xetex_p: || + \sys_if_engine_luatex_p: + } + { + \msg_new:nnnn { xunicode-addon } { xetex-luatex } { This~package~requires~either~XeTeX~or~LuaTeX~to~function.} { You~must~change~your~typesetting~engine~to,~e.g.,\\ "xelatex"~or~"lualatex"~instead~of~plain~"latex"~or~"pdflatex". } - \msg_critical:nn { xunicode-addon } { cannot-use-pdftex } + \msg_critical:nn { xunicode-addon } { xetex-luatex } } \RequirePackage { xparse } \clist_new:N \g__xunadd_encname_clist +\tl_if_exist:NT \UTFencname + { \clist_gput_right:Nx \g__xunadd_encname_clist { \UTFencname } } \DeclareOption* - { \clist_gput_left:NV \g__xunadd_encname_clist \CurrentOption } + { \clist_gput_right:NV \g__xunadd_encname_clist \CurrentOption } \ProcessOptions \scan_stop: -\tl_if_exist:NT \UTFencname - { \clist_gput_left:Nx \g__xunadd_encname_clist { \UTFencname } } \@ifpackageloaded { xunicode } { } { \clist_get:NNF \g__xunadd_encname_clist \UTFencname { - \xetex_if_engine:TF - { \tl_set:Nn \UTFencname { EU1 } } - { \tl_set:Nn \UTFencname { EU2 } } - \clist_set_eq:NN \g__xunadd_encname_clist \UTFencname + \file_if_exist:nTF { tuenc.def } + { \tl_set:Nn \UTFencname { TU } } + { + \sys_if_engine_xetex:TF + { \tl_set:Nn \UTFencname { EU1 } } + { \tl_set:Nn \UTFencname { EU2 } } + } + \clist_gset_eq:NN \g__xunadd_encname_clist \UTFencname } - \xetex_if_engine:TF + \sys_if_engine_xetex:TF { \RequirePackage { xunicode } } { \cs_set_eq:NN \__xunadd_tmp:w \XeTeXpicfile @@ -71,46 +79,46 @@ \cs_set_eq:NN \XeTeXpicfile \__xunadd_tmp:w } } -\AtEndOfPackage { \ReloadXunicode { \g__xunadd_encname_clist } } +\AtEndOfPackage { \__xunadd_reload:N \g__xunadd_encname_clist } \RenewDocumentCommand \ReloadXunicode { m } { \clist_set:Nx \l__xunadd_encname_clist {#1} - \clist_remove_duplicates:N \l__xunadd_encname_clist + \__xunadd_reload:N \l__xunadd_encname_clist + } +\cs_new_protected:Npn \__xunadd_reload:N #1 + { + \cs_set_eq:NN \__xunadd_tmp:w \iftipaonetoken + \cs_set_eq:NN \iftipaonetoken \scan_stop: \use:x { \ExplSyntaxOff \char_set_catcode_letter:n { 64 } - \__xunadd_reload:N \exp_not:N \l__xunadd_encname_clist + \exp_not:N \clist_map_function:NN \exp_not:N #1 \__xunadd_reload_aux:n \bool_if:NTF \l__kernel_expl_bool { \ExplSyntaxOn } { \ExplSyntaxOff } \char_set_catcode:nn { 64 } { \char_value_catcode:n { 64 } } } + \cs_set_eq:NN \iftipaonetoken \__xunadd_tmp:w } -\cs_new_protected:Npn \__xunadd_reload:N #1 +\cs_new_protected:Npn \__xunadd_reload_aux:n #1 { - \cs_set_eq:NN \__xunadd_tmp:w \iftipaonetoken - \cs_set_eq:NN \iftipaonetoken \scan_stop: - \clist_map_inline:Nn #1 + \cs_if_exist:cTF { T@ #1 } { - \cs_if_exist:cTF { T@ ##1 } - { - \tl_set:Nx \UTFencname {##1} - \clist_gput_right:Nx \g__xunadd_encname_clist {##1} - \file_input:n { xunicode.sty } - \file_input:n { xunicode-extra.def } - } - { \msg_error:nnn { xunicode-addon } { encoding-unknown } {##1} } + \tl_set:Nn \UTFencname {#1} + \clist_if_in:NnF \g__xunadd_encname_clist {#1} + { \clist_gput_right:Nn \g__xunadd_encname_clist {#1} } + \file_input:n { xunicode.sty } + \file_input:n { xunicode-extra.def } } - \cs_set_eq:NN \iftipaonetoken \__xunadd_tmp:w - \clist_gremove_duplicates:N \g__xunadd_encname_clist + { \msg_error:nnn { xunicode-addon } { encoding-unknown } {#1} } } \clist_new:N \l__xunadd_encname_clist \msg_new:nnnn { xunicode-addon } { encoding-unknown } { Encoding~scheme~"#1"~unknown. } { You~may~use \\\\ - \token_to_str:N \usepackage [ #1 , \encodingdefault ] {fontenc} \\\\ + \token_to_str:N \usepackage [ #1 , \encodingdefault ] \{fontenc\} \\\\ before~xunicode-addon~or~xunicode. } \RenewDocumentCommand \DeclareUTFmathsymbols { m } |