adapted to LuaTeX