[luatex] Getting all symbols

Ulrike Fischer luatex at nililand.de
Wed Jun 13 09:54:51 CEST 2012


Am Wed, 13 Jun 2012 08:35:24 +0200 schrieb Arno Trautmann:


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

Well the list contains other command names which looks a bit odd
like e.g.   "\T1\'-C"    ;-)


The command names starting with "key var" are created when you
define keys. E.g. this

============================
\documentclass{article}
\usepackage{expl3}
\RequirePackage{l3keys2e}
\begin{document}
\ExplSyntaxOn
\keys_define:nn {keytest}
 {
  famtest / style         .code:n =
   {
     blub
   },
 }
\ExplSyntaxOff

\directlua{
 for name in pairs(tex.hashtokens()) do
     print(name)
 end}
\end{document}
==============================

will led to the command name

    "key var > keytest/famtest/style.req"


The prefix comes from the following definition in l3keys:

\tl_const:Nn \c_keys_vars_root_tl { key~var~>~ }


Using spaces inside commands names (and keys like in beamer and pgf)
are sometimes a bit confusing as it can be unclear when the command
actually ends but on the other side they improve readability. 


-- 
Ulrike Fischer 



More information about the luatex mailing list