[lltx] patch for lualatex-math.lua

Wolfgang Jeltsch wolfgang at cs.ioc.ee
Sat Aug 3 19:28:07 CEST 2013


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lualatex-math.lua.diff
Type: text/x-patch
Size: 121 bytes
Desc: not available
URL: <http://tug.org/pipermail/lualatex-dev/attachments/20130803/13394302/attachment-0001.bin>


More information about the lualatex-dev mailing list