summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luatexja/ltj-math.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-01-27 21:56:42 +0000
committerKarl Berry <karl@freefriends.org>2020-01-27 21:56:42 +0000
commitf5dc95456cfd50e1e65093613f2dcab3e30b6714 (patch)
tree1965b1f5cc1ab512d14b1ab5573af1e46fc7a978 /Master/texmf-dist/tex/luatex/luatexja/ltj-math.lua
parentc1881c5c5344914a46d0f06387afcb78981a85c5 (diff)
luatexja (27jan20)
git-svn-id: svn://tug.org/texlive/trunk@53575 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luatexja/ltj-math.lua')
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/ltj-math.lua32
1 files changed, 21 insertions, 11 deletions
diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-math.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-math.lua
index cd24e2294af..b6ef1a9dd37 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/ltj-math.lua
+++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-math.lua
@@ -165,17 +165,27 @@ function (p, sty)
return p
end
-luatexbase.add_to_callback('mlist_to_hlist',
- function (n, display_type, penalties)
- n = to_direct(n); list_dir = ltjd_get_dir_count()
- if getid(n)==id_whatsit and getsubtype(n)==sid_user and
+do
+ local function mlist_callback_ltja(n)
+ local n = to_direct(n); list_dir = ltjd_get_dir_count()
+ if getid(n)==id_whatsit and getsubtype(n)==sid_user and
getfield(n, 'user_id') == DIR then
- local old_n = n; n = node_remove(n, n)
- node_free(old_n); if not n then return nil end
- end
- return node.mlist_to_hlist(
- to_node(conv_jchar_to_hbox(n, 0)),
- display_type, penalties)
- end,'ltj.mlist_to_hlist', 1)
+ local old_n = n; n = node_remove(n, n)
+ node_free(old_n); if not n then return nil end
+ end
+ return to_node(conv_jchar_to_hbox(n, 0))
+ end
+ -- LaTeX 2020-02-02 seems to have pre_mlist_to_hlist_filter callback
+ if luatexbase.callbacktypes['pre_mlist_to_hlist_filter'] then
+ luatexbase.add_to_callback('pre_mlist_to_hlist_filter',
+ mlist_callback_ltja, 'ltj.mlist_to_hlist_pre', 1)
+ else
+ local mlist_to_hlist = node.mlist_to_hlist
+ luatexbase.add_to_callback('mlist_to_hlist',
+ function (n, display_type, penalties)
+ return mlist_to_hlist(mlist_callback_ltja(n),display_type, penalties)
+ end,'ltj.mlist_to_hlist', 1)
+ end
+end
luatexja.math = { is_math_letters = is_math_letters }