0

The MWE below works with Overleaf (TeXLive 2023), but does not with MiKTeX as debug.getinfo is nil -- perhaps this library is not loaded properly in the new update? I have relayed the issue to MiKTeX's github repo, but am curious if anyone knows how this could be temporarily fixed? Another standard library, math for example, stil works. The error occurs when using texlua to run a lua script as well.

Overleaf prints the name of the function as expected, but MiKTeX throws an error Error:attempt to call a nil value (field 'getinfo').

https://github.com/MiKTeX/miktex/issues/1459

\documentclass{scrartcl}
\usepackage{luacode}
\begin{document}
\section{Test}
Hello world.
\begin{luacode*}
  function testfunction()
     return debug.getinfo(1, "fn").name
  end
  tex.sprint(testfunction())
\end{luacode*}

\end{document}
4
  • Doesn't work on Overleaf: you can check there, level is not defined. I think you are reading e.g. lua.org/pil/23.1.html and missing that you need to supply the level as a number.
    – Joseph Wright
    Mar 12 at 18:22
  • Ooops, I forgot to update my example... Please see the revision. Overlead prints the name of the function as expected, but MiKTeX throws an error Error:attempt to call a nil value (field 'getinfo') Mar 12 at 18:28
  • 2
    with luatex 1.18 you need to use the --luadebug option to enable the library. Mar 12 at 19:12
  • @UlrikeFischer thank you! Is there a possibility of enabling the library at run time instead of using the command line option? Mar 12 at 20:07

0

You must log in to answer this question.

Browse other questions tagged .