OSDN Git Service

Fix lltjp-unicode-math.sty.
[luatex-ja/luatexja.git] / src / patches / lltjp-unicode-math.sty
1 %
2 % lltjp-unicode-math.sty
3 %
4
5 \NeedsTeXFormat{LaTeX2e}
6 \ProvidesPackage{lltjp-unicode-math}[2013/05/14 Patch to unicode-math for LuaTeX-ja]
7
8 \RequirePackage{unicode-math,luatexja}
9
10 \ExplSyntaxOn
11
12 \group_begin:
13   \cs_gset:Nn \um_define_math_chars: {
14     \group_begin:
15       \char_set_catcode_math_superscript:N \^
16       \cs_set:Npn \_um_sym:nnn ##1##2##3 {
17         \bool_if:nTF { \cs_if_eq_p:NN ##3 \mathaccent ||
18                       \cs_if_eq_p:NN ##3 \mathopen   ||
19                       \cs_if_eq_p:NN ##3 \mathclose  ||
20                       \cs_if_eq_p:NN ##3 \mathover   ||
21                       \cs_if_eq_p:NN ##3 \mathunder  ||
22                       \cs_if_eq_p:NN ##3 \mathbotaccent } {
23           \ltjsetmathletter{ ##1 }
24         } {
25           \um_cs_set_eq_active_char:Nw ##2 = ##1 \q_nil \ignorespaces
26         }
27       }
28       \char_set_catcode_other:N \#
29       \um_input_math_symbol_table:
30     \group_end:
31   }
32   \cs_gset:Npn \um_cs_set_eq_active_char:Nw #1 = "#2 \q_nil {%"
33     \group_begin:
34       %\typeout {um: \string#1, \int_from_hexadecimal:n {#2}, #2}% <- for debug
35       \char_set_lccode:nn { `! } { "#2 }%"
36       \tex_lowercase:D {
37         \tl_set:Nn \l_tmpa_tl {\relax\ifmmode!\else{\directlua{tex.globaldefs = 0}\ltj@allalchar!}\fi}
38         \cs_gset_eq:NN #1 \l_tmpa_tl
39       }
40       \ltjsetmathletter{ \int_from_hexadecimal:n {#2} }
41     \group_end:
42   }
43 \group_end:
44
45 \ExplSyntaxOff
46
47 \endinput