[Dev-luatex] Can \directlua be nested?

Hans Hagen pragma at wxs.nl
Fri Feb 1 10:52:00 CET 2008


Taco Hoekwater wrote:
> 
> Jonathan Sauer wrote:
>> Hello
>>
>>> My assumption was that everything is catcode 11 or 12 or some other
>>> harmless value. \directlua does indeed read the entire braced
>>> argument at once.
>> Thanks for your reply. When coming home yesterday, I experimented
>> a little bit, and the results do not seem to match your answer.
>> In Plain TeX:
>>
>> 	\directlua0{%
>> 		tex.sprint('A')%
>> 		\directlua0{tex.sprint('B')}%
>> 		tex.sprint('C')%
>> 	}
>>
>> This results in "LuaTeX error [string "luas[0]"]:1: attempt to index
>> global 'Btex' (a nil value)". 
> 
> 
> Yes, that's what I meant to say (you input is invalid). We have a
> bit of a communication error, I'm afraid. Do it like this:
> 
> 
>          \let\\\relax
>   	\directlua0{%
>   		tex.sprint('A')%
>   		tex.sprint('\\directlua0{B}')}%
>   		tex.sprint('C')%
>   	}

i suppose that you meant ...


   	\directlua0{%
   		tex.sprint('A')%
   		tex.sprint('\string\\directlua0{tex.sprint("B")}')%
   		tex.sprint('C')%
   	}

 >   		tex.sprint('\\directlua0{B}')}%
                                              ^ no

and B needs to be printed to tex (otherwise an lua error)



-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the dev-luatex mailing list