Am 03.11.2011 12:01, schrieb Hans Hagen:
On 3-11-2011 10:15, Martin Fechner wrote:
Hi all,
I try to call a lua-function, but it seems that it doesn't work if the parameter contains squared brackets. Here is a short example:
\starttext sometext \reference[myref]{} is \ctxlua{tex.print(\atpage[myref])} \stoptext
Is there a way to mask the brackets?
"\atpage[myref]"
My lua function doesn't just print the parameter. I have a function like this: \startluacode function pagesetup(page1,page2) if page1==page2 then tex.print(page1) elseif page1+1==page2 then tex.print(page1..'f.') else tex.print(page1..'-'..page2) end function \stopluacode \starttext \reference[myref1]{} \page \reference[myref2]{} \ctxlua{\at[myref1],\at[myref2]} \stoptext But I find no way that it works with the two references with brackets. Somewhere else I have an similar problem when I work with counters. The lua-function there doesn't accept this \ctxlua{dosomething(\getnumber[mynumber])}