Am 23.10.2011 16:37, schrieb Thomas A. Schmitz:
Hi Peter,
thanks for your reply, and I'll keep the bit about goat milk in mind :-).
"frame=" .. tostring(framestate)
It has the advantage of making the example compile. It has the drawback of not doing anything :-)
(sadly) true :-) I will look into it. Looks like I need a big glass of goat milk before (can't wait for the moon)...
seems to work. Anyhow, if you are planning to do some more complex stuff, you should separate the lua from the tex code.
The advantages are - no catcode limitations Then you can use nice stuff like string.format("frame=%s",framestate) - in case of lua errors you get the real line number - lua syntax check is possible
Load the lua code at the beginning of your tex file with
\registerctxluafile{filename_without_suffix}{version number or empty}
One last but important tip: if you get lua errors like 'undefined whatever', check your lua file with 'luatexc -p foo.lua' (lua compiler). A single syntax error in the lua file and all of its content is ignored! Can be quite frustrating to find the error cause, if all of your lua code is undefined right from the beginning.
OK, that sounds like very good advice - I'll see if I can manage to apply this for xml style sheets.
Thanks a lot, and best wishes
Thomas