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 | 241 |
1 files changed, 224 insertions, 17 deletions
diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty b/Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty index 8338f15acf2..7a8df75c301 100644 --- a/Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty +++ b/Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty @@ -6,7 +6,7 @@ %% %% xeCJK.dtx (with options: `xunicode') %% -%% $Id: xeCJK.dtx 525 2013-11-11 06:32:00Z sobenlee $ +%% $Id: xeCJK.dtx 533 2013-12-05 10:52:12Z sobenlee $ %% $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ %% ----------------------------------------------------------------- %% Author: @@ -33,11 +33,11 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: xeCJK.dtx 525 2013-11-11 06:32:00Z sobenlee $ +\GetIdInfo$Id: xeCJK.dtx 533 2013-12-05 10:52:12Z sobenlee $ {addon file for xunicode} \ProvidesExplPackage {xunicode-addon} - {\ExplFileDate}{3.2.7}{\ExplFileDescription} + {\ExplFileDate}{3.2.8}{\ExplFileDescription} \pdftex_if_engine:T { \msg_new:nnnn { xunicode-addon } { cannot-use-pdftex } @@ -98,6 +98,8 @@ \tl_set:Nx \UTFencname {##1} \clist_gput_right:Nx \g__xunadd_encname_clist {##1} \file_input:n { xunicode.sty } + \__xunadd_declare_textcircled:n { \UTFencname } + \__xunadd_declare_math_symbols:n { \UTFencname } } { \msg_error:nnn { xunicode-addon } { encoding-unknown } {##1} } } @@ -106,12 +108,62 @@ } \clist_new:N \l__xunadd_encname_clist \msg_new:nnnn { xunicode-addon } { encoding-unknown } - {Encoding~scheme~"#1"~unknown.} + { Encoding~scheme~"#1"~unknown. } { You~may~use \\\\ \token_to_str:N \usepackage [ #1 , \encodingdefault ] {fontenc} \\\\ before~xunicode-addon~or~xunicode. } +\cs_new_protected_nopar:Npn \__xunadd_declare_math_symbols:n #1 + { + \__xunadd_declare_character:Nnn \textFinv {#1} { x2132 } + \__xunadd_declare_character:Nnn \textaleph {#1} { x2135 } + \__xunadd_declare_character:Nnn \textbeth {#1} { x2136 } + \__xunadd_declare_character:Nnn \textgimel {#1} { x2137 } + \__xunadd_declare_character:Nnn \textdaleth {#1} { x2138 } + \__xunadd_declare_character:Nnn \textGame {#1} { x2141 } + } +\RenewDocumentCommand \DeclareUTFmathsymbols { m } + { + \bool_if:NT \l__xunadd_math_as_UTF_text_bool + { + \seq_map_inline:Nn \l__xunadd_math_as_UTF_text_seq + { \__xunadd_declare_math_as_UTF_text:n {##1} } + \bool_set_false:N \l__xunadd_math_as_UTF_text_bool + } + } +\seq_new:N \l__xunadd_math_as_UTF_text_seq +\seq_set_from_clist:Nn \l__xunadd_math_as_UTF_text_seq + { hbar , Finv , aleph , beth , gimel , daleth , Game } +\bool_new:N \l__xunadd_math_as_UTF_text_bool +\RenewDocumentCommand \UseMathAsText { } + { + \math@s@text@true + \bool_set_true:N \l__xunadd_math_as_UTF_text_bool + } +\@onlypreamble \UseMathAsText +\cs_new_protected_nopar:Npn \__xunadd_declare_math_as_UTF_text:n #1 + { + \cs_if_exist:cTF {#1} + { + \cs_new_eq:cc { keepmathUTF #1 } {#1} + \cs_gset_protected_nopar:cpx {#1} + { + \exp_not:N \mode_if_math:TF + { \exp_not:c { keepmathUTF #1 } } + { \exp_not:c { text #1 } } + } + \tl_put_right:Nx \l__xunadd_hyperref_hook_tl + { \cs_set_eq:NN \exp_not:c {#1} \exp_not:c { text #1 } } + } + { \cs_new_nopar:cpx {#1} { \exp_not:c { text #1 } } } + } +\tl_new:N \l__xunadd_hyperref_hook_tl +\AtBeginDocument + { + \cs_if_free:NF \pdfstringdefDisableCommands + { \pdfstringdefDisableCommands { \l__xunadd_hyperref_hook_tl } } + } \prg_new_conditional:Npnn \__xunadd_glyph_if_exist:n #1 { p , T , F , TF } { \etex_iffontchar:D \tex_font:D \etex_numexpr:D #1 \scan_stop: @@ -145,11 +197,26 @@ } \RenewDocumentCommand \DeclareUTFcharacter { O { \UTFencname } m m } { - \__xunadd_if_csname:nTF {#3} - { \__xunadd_declare_character:Nnn #3 } - { \__xunadd_declare_character:cnn { \tl_to_str:n {#3} } } - {#1} {#2} + \str_if_eq:nnTF {#3} { \hbar } + { \__xunadd_restore_hbar: } + { + \__xunadd_if_csname:nTF {#3} + { \__xunadd_declare_character:Nnn #3 } + { \__xunadd_declare_character:cnn { \tl_to_str:n {#3} } } + {#1} {#2} + } + } +\cs_new_protected_nopar:Npn \__xunadd_restore_hbar: + { + \cs_if_free:cF { ? - \token_to_str:N \hbar } + { \__xunadd_restore_hbar:c { ? - \token_to_str:N \hbar } } } +\cs_new_protected_nopar:Npn \__xunadd_restore_hbar:N #1 + { + \cs_gset_eq:NN \hbar #1 + \cs_undefine:N #1 + } +\cs_generate_variant:Nn \__xunadd_restore_hbar:N { c } \cs_new_protected:Npn \__xunadd_declare_character:Nnn #1#2#3 { \__xunadd_provide_text_command_default:N #1 @@ -288,24 +355,53 @@ { \__xunadd_glyph_if_exist:nTF { `#4 } {#4} - { - \cs_if_exist_use:cTF { ? #2 } - { {#1} } {#4} - } + { \cs_if_exist_use:cTF { ? #2 } { {#1} } {#4} } } { - \__xunadd_glyph_if_exist:nTF { `#3 } - { #1#3 } + \bool_if:NTF \l__xunadd_add_circle_bool { + \bool_set_false:N \l__xunadd_add_circle_bool \__xunadd_glyph_if_exist:nTF { `#4 } - { \add@accent { `#4 } {#1} } + { \__xunadd_add_circle:nn {#4} {#1} } + } + { + \__xunadd_glyph_if_exist:nTF { `#3 } + { #1#3 } { - \cs_if_exist_use:cTF { ? #2 } - { {#1} } {#1} + \__xunadd_glyph_if_exist:nTF { `#4 } + { \add@accent { `#4 } {#1} } } } + { \cs_if_exist_use:cTF { ? #2 } { {#1} } {#1} } + } + } +\cs_new_protected:Npn \__xunadd_add_circle:nn #1#2 + { + \hcoffin_set:Nn \l__xunadd_circle_coffin {#1} + \hcoffin_set:Nn \l__xunadd_tmp_coffin {#2} + \dim_set:Nn \l__xunadd_circle_width_dim + { \fp_use:N \l__xunadd_circle_ratio_fp \coffin_wd:N \l__xunadd_circle_coffin } + \coffin_resize:Nnn \l__xunadd_tmp_coffin + { \l__xunadd_circle_width_dim } + { + ( \coffin_ht:N \l__xunadd_tmp_coffin + \coffin_dp:N \l__xunadd_tmp_coffin ) + * \tex_number:D \l__xunadd_circle_width_dim + / \tex_number:D \coffin_wd:N \l__xunadd_tmp_coffin } + \coffin_attach:NnnNnnnn + \l__xunadd_circle_coffin { hc } { vc } + \l__xunadd_tmp_coffin { hc } { vc } + { \c_zero_dim } { \c_zero_dim } + \coffin_typeset:Nnnnn \l__xunadd_circle_coffin + { H } { l } { \c_zero_dim } { \c_zero_dim } } +\dim_new:N \l__xunadd_circle_width_dim +\coffin_new:N \l__xunadd_tmp_coffin +\coffin_new:N \l__xunadd_circle_coffin +\NewDocumentCommand \settextcircledratio { m } + { \fp_set:Nn \l__xunadd_circle_ratio_fp {#1} } +\fp_new:N \l__xunadd_circle_ratio_fp +\settextcircledratio { 0.7 } \NewDocumentCommand \AtBeginUTFCommand { s O { } +m } { \tl_if_blank:nTF {#2} @@ -356,6 +452,117 @@ {#2} \tl_use:N \l__xunadd_end_hook_tl } +\AtBeginUTFCommand [ \textcircled ] + { \bool_set_true:N \l__xunadd_add_circle_bool } +\bool_new:N \l__xunadd_add_circle_bool +\cs_new_protected_nopar:Npn \__xunadd_declare_textcircled:n #1 + { + \__xunadd_declare_character:Nnn \textbigcircle {#1} { x25EF } + \__xunadd_declare_accent:Nnnn \textcircled {#1} { 20DD } { 25EF } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 0 } { x24EA } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 1 } { x2460 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 2 } { x2461 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 3 } { x2462 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 4 } { x2463 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 5 } { x2464 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 6 } { x2465 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 7 } { x2466 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 8 } { x2467 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 9 } { x2468 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 10 } { x2469 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 11 } { x246A } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 12 } { x246B } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 13 } { x246C } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 14 } { x246D } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 15 } { x246E } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 16 } { x246F } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 17 } { x2470 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 18 } { x2471 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 19 } { x2472 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 20 } { x2473 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 21 } { x3251 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 22 } { x3252 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 23 } { x3253 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 24 } { x3254 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 25 } { x3255 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 26 } { x3256 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 27 } { x3257 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 28 } { x3258 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 29 } { x3259 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 30 } { x325A } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 31 } { x325B } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 32 } { x325C } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 33 } { x325D } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 34 } { x325E } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 35 } { x325F } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 36 } { x32B1 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 37 } { x32B2 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 38 } { x32B3 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 39 } { x32B4 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 40 } { x32B5 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 41 } { x32B6 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 42 } { x32B7 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 43 } { x32B8 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 44 } { x32B9 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 45 } { x32BA } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 46 } { x32BB } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 47 } { x32BC } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 48 } { x32BD } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 49 } { x32BE } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 50 } { x32BF } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { A } { x24B6 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { B } { x24B7 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { C } { x24B8 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { D } { x24B9 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { E } { x24BA } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { F } { x24BB } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { G } { x24BC } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { H } { x24BD } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { I } { x24BE } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { J } { x24BF } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { K } { x24C0 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { L } { x24C1 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { M } { x24C2 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { N } { x24C3 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { O } { x24C4 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { P } { x24C5 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { Q } { x24C6 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { R } { x24C7 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { S } { x24C8 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { T } { x24C9 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { U } { x24CA } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { V } { x24CB } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { W } { x24CC } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { X } { x24CD } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { Y } { x24CE } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { Z } { x24CF } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { a } { x24D0 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { b } { x24D1 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { c } { x24D2 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { d } { x24D3 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { e } { x24D4 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { f } { x24D5 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { g } { x24D6 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { h } { x24D7 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { i } { x24D8 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { j } { x24D9 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { k } { x24DA } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { l } { x24DB } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { m } { x24DC } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { n } { x24DD } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { o } { x24DE } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { p } { x24DF } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { q } { x24E0 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { r } { x24E1 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { s } { x24E2 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { t } { x24E3 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { u } { x24E4 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { v } { x24E5 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { w } { x24E6 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { x } { x24E7 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { y } { x24E8 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { z } { x24E9 } + } %% %% This package consists of the file xeCJK.dtx, %% full-stop.map, |