Hi Philipp,

I don’t know if you have followed the recent discussion on lualatex-dev
about an issue with the lualatex-math package.

The code in lualatex-math.lua relies on unpack being a global variable,
which was the case in Lua 5.1, but is not the case anymore in Lua 5.2.
As a result, I get the following error when importing amsmath and
lualatex-math in the same document:

    ! LuaTeX error
    .../texmf-dist/tex/lualatex/lualatex-math/lualatex-math.lua:46:
    attempt to call upvalue 'unpack' (a nil value)
    stack traceback:
            .../texmf-dist/tex/lualatex/lualatex-math/lualatex-math.lua:46:
            in function 'print_class_fam_slot'
            [string "\directlua "]:1: in main chunk.
    \__lltxmath_set_mathchar:NN ...\int_eval:n {`#2})}
                                                      \scan_stop: 

Other Lua files (lualibs-basic-merged.lua, lualibs-lua.lua, and
luaotfload-merged.lua) use the following code to work around this
incompatibility between Lua 5.1 and Lua 5.2:

    if not table.unpack then
      table.unpack=_G.unpack
    elseif not unpack then
      _G.unpack=table.unpack
    end

By adding this code to lualatex-math.lua at an appropriate place, I was
able to fix the issue with lualatex-math and amsmath.

I’ve attached a patch. Could this patch or some other fix for the
problem please be incorporated into lualatex-math? Thank you.

Best wishes,
Wolfgang
32a33,37
> if not table.unpack then
>   table.unpack=_G.unpack
> elseif not unpack then
>   _G.unpack=table.unpack
> end

Reply via email to