[lltx] \luanewcommand?

Manuel Pégourié-Gonnard mpg at elzevir.fr
Tue Jan 12 00:11:01 CET 2010

On 11/01/2010 18:44, Khaled Hosny wrote:
> I think it'd be handy to have a \luanewcommand that is similar to
> \newcommand but takes luacode instead of TeX macros, so one can do
> something like:
> \luanewcommand{\hello}[1]{tex.sprint("Hello #1")}
> Instead of:
> \newcommand{\hello}[1]{\directlua{tex.sprint("Hello #1")}}
Well, in the general case one should write

\directlua{tex.sprint("Hello \luatexescapestring{#1}")}

> This would make lua feel more integrated (and it may take care of spaces
> and catcodes etc. so we can use lua comment char '--' etc.)
> What do you think?
I like the idea, but i may need a bit more reflexion. I added it to my todolist
for later. Obviously it would be a LaTeX-specific thing?


More information about the lualatex-dev mailing list