[Dev-luatex] Very simple sample?

David Kastrup dak at gnu.org
Sat May 12 17:13:49 CEST 2007


"Javier Bezos" <lists at texytipografia.com> writes:

> \def\lua#1{\directlua0\expandafter{\detokenize{#1}}}
>
> \def\sub#1{%
>   \lua{
>     tex.print("{\\bf #1}");
> }}
>
> \sub{Hello} Bye
>
> \bye
> =========
>
> If I use \unexpanded it fails:
>
> This is luaTeX, Version 3.141592-snapshot-2007042614 (Web2C 7.5.6)
> (lua-tex.tex
> ! Argument of \\ has an extra }.
> <inserted text>
>                 \par
> <to be read again>
>                    }

Throw out the \expandafter.  It basically negates the effect of
\unexpanded by having expansion occur afterwards.

Namely:

\def\lua#1{\directlua0{\unexpanded{#1}}}

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum


More information about the dev-luatex mailing list