[luatex] Getting all symbols

Robin Fairbairns Robin.Fairbairns at cl.cam.ac.uk
Tue Jun 12 16:57:03 CEST 2012


Sensei <senseiwa at gmail.com> wrote:

> [ulrike's code snipped]
> 
> I am puzzled by the output, though. When I dump the contents to a
> file, with the following:
> 
> \documentclass{article}
> 
> \begin{document}
> \directlua{
>  local f = io.open("hash.txt", "w")
>  for name in pairs(tex.hashtokens()) do
>      f:write(name .. ";;;;")
>  end
>  f:close()}
> \end{document}
> 
> 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.

ulrike's code simpler and didn't exhibit that problem.

> 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.

\begin{flushleft} uses \flushleft

it's not clear to me what you mean by "known symbols".  afaics, this
table doesn't deal with active characters, if that's what you're after.

(note, ulrike's is the first lua code i've run; i tend to spend my tex
time behind the bleading edge, hoping to ride others' shock waves...)




More information about the luatex mailing list