[luatex] Getting all symbols

Arno Trautmann Arno.Trautmann at gmx.de
Wed Jun 13 08:35:24 CEST 2012


Ulrike Fischer wrote:
> Am Thu, 7 Jun 2012 17:20:48 +0200 schrieb Arno Trautmann:
>>> I'm trying to find *at runtime* all the symbols allowed in a latex
>>> environment. So, given a tex file, I'd like to access
>>> - the complete predefined commands/symbols/definitions;
>>> - the complete list of commands/symbols/definitions defined in packages.
>
>> This may not really help, but maybe give a hint: I think I had asked a
>> similar question some time ago, Tako answered that he wanted to
>> implement something, and Hans answered that he [Tako] already did.
>> Unfortunately I cannot find the corresponding mails, sorry.
>
> The thread starts here
> http://tug.org/mailman/htdig/luatex/2011-July/003115.html
>
> And Hans answer is here
> http://tug.org/mailman/htdig/luatex/2011-July/003125.html

Thanks for finding and posting this again!

> If I process the following document with
>
> "lualatex test > output.txt"
>
> I get a list of about 3500 commands in output.txt
>
> \documentclass{article}
>
> \begin{document}
> \directlua{
>   for name in pairs(tex.hashtokens()) do
>       print(name)
>   end}
> \end{document}
>
> Addings fontspec leds to 14.000 commands.

I tried your example with fontspec and am somewhat puzzled with the 
result. The L3 syntax seems to lead to some strange entries, e.g.:

pdfdecimaldigits
key code > fontspec/Script/Braille
@ifdot
key var > fontspec/Script/osma.req
key var > fontspec/CharacterWidth/Quarter.default

How do these key code and key var expressions make it into the 
hashtokens? I guess it's because of the ~ that is used in L3, but I 
don't the exact reasoning.

Cheers
Arno


More information about the luatex mailing list