5

Is there a list or method to determine a list of the lua functions available/installed?

Sofar I could only find the lua source files. Maybe I should write something that search through all the installed lua files for lines starting with "function". Then I will have a list, but it would still not give me the rest of detail of the functions.

Any better ideas or suggestions?

2 Answers 2

8

You know the LuaTeX functions short reference? That together with the Lua reference should cover all available functions if I am correct.

4
  • TNX I hoped that it was part of the installation I have. It will come to good use, I already printed it.
    – Louis
    Jul 26, 2011 at 11:16
  • Unfortunately that first link is now dead. Dec 26, 2015 at 13:50
  • @AndrewSwann fixed, although it is probably not a permanent fix.
    – topskip
    Dec 29, 2015 at 10:08
  • The first link dead again. (although if they say it's old perhaps you may want to add a disclaimer, as the new version may have changed) (perhaps make it a web.archive.org link so it's permanent)
    – user202729
    Nov 2, 2021 at 2:49
6

This is hard to answer, as you are asking the lua equivalent of 'what are the names of all defined macros?'. The answer is: it depends.

The core luatex functions are documented in the reference manual, as Patrick wrote in his answer. Everything else is loaded from lua source files on your hard-disk, but only if you (possibly indirectly) asked for it, just as would be the case for macros/packages.

If you are only interested in a list of defined lua functions in your current luatex source file, you can try this inside a lua code block:

function dump (prefix, a) 
  for i,v in pairs (a) do
    if type(v) == "table" then
      dump(prefix .. '.' .. i,v)
    elseif type(v) == "function" then
      print (prefix .. '.' .. i .. '()')
    end 
  end
end
dump('_G',_G)

but there are two caveats:

  • you only get to know function names, not their calling conventions. This is about as useful as only knowing macro names (meaning: not very useful at all)

  • circular references to tables will confuse this bit of lua code, it needs to be made smarter to allow for that

1
  • TNX also. I was looking for info to extend the other answer I have received regarding a table of fonts. The idea is if I know the function better I can maybe print a better table.
    – Louis
    Jul 26, 2011 at 11:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .