Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 6 down vote accepted

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

share|improve this answer
    
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 '11 at 11:16

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

share|improve this answer
    
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 '11 at 11:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.