[luatex] Getting all symbols

Sensei senseiwa at gmail.com
Tue Jun 12 16:29:09 CEST 2012

On 6/12/12 11:48am, Ulrike Fischer wrote:
> 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
> 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.

Thanks for the info!

I am puzzled by the output, though. When I dump the contents to a file, 
with the following:


  local f = io.open("hash.txt", "w")
  for name in pairs(tex.hashtokens()) do
      f:write(name .. ";;;;")

I can't open it with ease with a text editor: it complains it has a 
corrupt UTF-8 enconding. I am using ";;;;" since I don't know how to add 
a new line safely here: sorry for this inconvenience.

Moreover, I can find symbols that are common, for example begin, textit, 
equation, but they're all without a backslash. How can I distinguish 
between \ commands and known symbols? For example, begin is a command, 
\begin, and it may accept the environment flushleft, but not \flushleft.

It is somewhat confusing to me...

More information about the luatex mailing list