[Dev-luatex] # => ## in \directlua

David Kastrup dak at gnu.org
Tue Oct 7 15:02:14 CEST 2008

"Jonathan Sauer" <Jonathan.Sauer at silverstroke.com> writes:

> Hello, 
>> >> So `#' is transformed into `##' when passed from TeX to Lua.
>> [...]
>> This currently uses TeX's tokenlist print function, but I could
>> make it behave differently, no problem (after all, this
>> generated string is only 'seen' by the lua interpreter).
> In that case: Please make it so.

It is consistent with TeX's printing mechanism.  You could deal with
this problem by placing the resulting string inside of a macro body
(where ## will get collapsed to # while the body is being collected) and
then use it from there.

Disadvantage: this is not an expandible method.

David Kastrup

More information about the dev-luatex mailing list