diff options
author | Karl Berry <karl@freefriends.org> | 2018-01-21 22:34:29 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-01-21 22:34:29 +0000 |
commit | d09ad8b89dbedfbe939605baf5380584077e4584 (patch) | |
tree | 43fa343e175662ff442d3c068767d18a9a5ec07f /Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-unicode-math.sty | |
parent | 12752728bebf1cd785fc968fffcc83e8da4989c4 (diff) |
luatexja (21jan18)
git-svn-id: svn://tug.org/texlive/trunk@46405 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-unicode-math.sty')
-rw-r--r-- | Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-unicode-math.sty | 57 |
1 files changed, 49 insertions, 8 deletions
diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-unicode-math.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-unicode-math.sty index 2642dd1e4f9..acca226a7f0 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-unicode-math.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-unicode-math.sty @@ -3,17 +3,15 @@ % \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{lltjp-unicode-math}[2017/11/12 Patch to unicode-math for LuaTeX-ja] +\ProvidesPackage{lltjp-unicode-math}[2018/01/14 Patch to unicode-math for LuaTeX-ja] -\RequirePackage{unicode-math,luatexja} +\RequirePackage{unicode-math,luatexja,etoolbox} \ExplSyntaxOn \group_begin: - \bool_new:N \lltjp_um_patch_mathgroup_bool - \bool_set_true:N \lltjp_um_patch_mathgroup_bool -%% Recent unicode-math (2017-10-02, v0.8g) does not have \ProvidesPackage, -%% So we can't use the date option of \@ifpackageloaded. + \bool_new:N \__lltjp_um_patch_mathgroup_bool + \bool_set_true:N \__lltjp_um_patch_mathgroup_bool \cs_gset:Nn \__um_define_math_chars: { \group_begin: \cs_set:Npn \__um_sym:nnn ##1##2##3 @@ -22,7 +20,7 @@ { \mathord \mathalpha \mathbin \mathrel \mathpunct \mathop \mathfence } {##3} { - \exp_last_unbraced:NNx \cs_gset_eq:NN ##2 { \Ucharcat ##1 ~ 12 ~ } + \exp_last_unbraced:NNx \cs_gset_eq:NN ##2 { \char_generate:nn {##1} {12} } \ltjsetmathletter{ ##1 } } } @@ -30,7 +28,7 @@ \group_end: } -\bool_if:NT \lltjp_um_patch_mathgroup_bool { +\bool_if:NT \__lltjp_um_patch_mathgroup_bool { \cs_gset:Npn \use@mathgroup #1 #2 { %\typeout{UM <#1><#2>} @@ -47,6 +45,49 @@ } \group_end: +\ifcsname jsc@mag@xrealtrue \endcsname \else + \expandafter\expandafter\expandafter \ExplSyntaxOff \expandafter \endinput +\fi +\ifjsc@mag@xreal + \cs_if_exist:cTF { ltjs@orig@get@external@font } { + % ltjsclasses: use lua + \cs_new:Nn \lltjp_um_unmag_fsize: + { + \cs_gset:Nx \lltjp_um_f@size: {\directlua{luatexja.ltjs_unmagnify_fsize(\f@size)}} + \cs_gset:Nx \lltjp_um_sf@size: {\directlua{luatexja.ltjs_unmagnify_fsize(\sf@size)}} + \cs_gset:Nx \lltjp_um_ssf@size: {\directlua{luatexja.ltjs_unmagnify_fsize(\ssf@size)}} + } + }{ + % bxjscls: use \jsc@preadjust@extract@font + \cs_new:Nn \lltjp_um_unmag_fsize: + { + \group_begin: + \jsc@preadjust@extract@font + \cs_gset_eq:NN \lltjp_um_f@size: \f@size + \group_end: + \group_begin: + \cs_set_eq:NN \f@size \sf@size \jsc@preadjust@extract@font + \cs_gset_eq:NN \lltjp_um_sf@size: \f@size + \group_end: + \group_begin: + \cs_set_eq:NN \f@size \ssf@size \jsc@preadjust@extract@font + \cs_gset_eq:NN \lltjp_um_ssf@size: \f@size + \group_end: + } + } + \pretocmd { \__um_fontspec_select_font: } { + \cs_set_eq:NN \lltjp_um_orig_fsize: \f@size + \lltjp_um_unmag_fsize: + \cs_set_eq:NN \f@size \lltjp_um_f@size: + \cs_set_eq:NN \tf@size \lltjp_um_f@size: + \cs_set_eq:NN \sf@size \lltjp_um_sf@size: + \cs_set_eq:NN \ssf@size \lltjp_um_ssf@size: + } {} {} + \apptocmd { \__um_fontspec_select_font: } { + \cs_set_eq:NN \f@size \lltjp_um_orig_fsize: + } {} {} +\fi + \ExplSyntaxOff \endinput |