[luatex] Absolute beginners questions
Keith J. Schultz
schultzk at gmx.net
Fri Sep 30 08:53:04 CEST 2011
Hi Peter,
I am so to say an very advanced programmer, but I have never liked
the TeX way of doing things nor have I tried to really learn TeX.
I had seen the reference, but as you said it is quite low level and more aimed
towards the TeX use.
My main interest is what I have to pass to the lua interpreter and what I can access from
with in it. Here the Lua(La)TeX documentation is so what vague. It seem also to suggest
that each call to lua are singular and can not themselves share their state between them and
if the globals where glaobals to TeX or the lua interpreter.
For right know all I need to do is inject the proper commands into the TeX engine.
regards
Keith.
Am 29.09.2011 um 11:27 schrieb Patrick Gundlach:
> Hi Keith,
>
> besides the useful I'd like to try to answer the questions:
>
>> I find it hard to find in-depth documentation for luatex.
>>
>
> Well, the in-depth documentation is there, but it is meant for advanced users/experts and it takes quite some time to dig through it. The reference manual is excellent (IMO!) but you need to know quite some TeX to actively use it.
>
>
>> 1) As I understand it I can inject tex-code back to tex via texsprint, inside of
>> a directly call.
>
> Correct. Be aware that the tex.sprint("…") gets executed after you leave the current \directlua{…} block.
>
> (for a more technical discussion see http://tex.stackexchange.com/q/20893/243)
>
>
>> 2) Is it possible to access and or manipulate tex-variable macros directly?
>
> you can manipulate the standard TeX variables like tex.lefthyphenmin (see 4.13.1 of the reference manual). Other then that you cannot dig into the self defined macros (I am not sure about this but have never come across the need to do that, so someone else might clarify on that).
>
>
>
>> 3) Is it possible to to save globals between directly calls?
>
> yes, see:
>
> ++++++++++++++++++++++++++++++++++++++++++
> \directlua{
> myvar = "world"
> }
> Hello
> \directlua{
> tex.print(myvar)
> }%
> !
>
> \bye
> ++++++++++++++++++++++++++++++++++++++++++
>
> Patrick
>
>
More information about the luatex
mailing list