[luatex] Inspecting a \def from LuaTeX

Eduardo Ochs eduardoochs at gmail.com
Wed Jan 31 19:44:25 CET 2018


Yaaay! Works perfectly, thanks a lot! =)

Two questions...

1) The version of the reference manual here - feb 2017, 1.0.4,

     http://www.luatex.org/svn/trunk/manual/luatex.pdf

   seems to describe a smaller token library and doesn't mention
   token.get_meaning... where do I find the updated manual?

   Btw 1: this page points to the link above:

     http://wiki.luatex.org/index.php/Documentation_and_help

   Btw 2: I updated texlive on my system a week ago and I have
   a LuaTeX reference manual here

     /usr/local/texlive/2017/texmf-dist/doc/context/documents/general/manuals/luatex.pdf

   that says "march 2017, version 1.0.5", but it still doesn't mention
   token.get_meaning...

2) How do I get the meaning of a character with catcode 13 ("active")?
   For example, here?

     \catcode`Δ=13 \defΔ{\Delta}

Cheers!
  Eduardo Ochs
  http://angg.twu.net/luatex.html

On Tue, Jan 30, 2018 at 6:13 AM, Hans Hagen <pragma at wxs.nl> wrote:
> On 1/29/2018 7:26 PM, Eduardo Ochs wrote:
>>
>> Hi list,
>>
>> Is there a way to inspect the contents of a \def from Lua in LuaTeX?
>> If I do, say,
>>
>>    \def\hello{Hello}
>>
>> I know how to see the sequence of tokens in \hello by running
>> "\show\hello" in a TeX prompt... is there something similar that can
>> be done from Lua?
>
> You can try:
>
> \starttext
>
> \def\alpha#1#2{beta#1gamma#2delta}
>
> \directlua{print(token.get_macro("alpha"))}
> \directlua{print(token.get_meaning("alpha"))}
>
> \directlua{print(token.set_macro("alpha","whatever"))}
>
> \directlua{print(token.get_macro("alpha"))}
> \directlua{print(token.get_meaning("alpha"))}
>
> \stoptext
>
> (these helpers still have a somewhat experimental status but they will stay)
>
> Hans
>
>
> -----------------------------------------------------------------
>                                           Hans Hagen | PRAGMA ADE
>               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -----------------------------------------------------------------



More information about the luatex mailing list