Hello, I encountered a bit weird thing when I used Lua in \startsetup: --- \definelayer[T][x=0mm,y=0mm,width=\paperwidth,height=\paperheight] \directlua{n, m = 1, 11} % Initialization \startsetups layer % In my real code (= not in this example) % the value of 'n' is used here to set the appropriate background, % = n-th page of a PDF, and also to draw a filled rectangle on % the left or right side (depending on whether n is even or odd) % The code bellow fails [1] \startluacode print("N=", n) if n == 2 then else end \stopluacode \stopsetups \setupbackgrounds[page][setups=layer,background={T}] \starttext % The code bellow works well [2] \startluacode print("M=", m) if m == 2 then else end \stopluacode \dorecurse{4}{\page[empty]} \stoptext --- The problem is that Lua code between \startsetups ... \stopsetups [1] seems to be "parsed" another way than when in [2]. The [1] gives the following error message: --- ! LuaTeX error
:1: 'then' expected near 'thenelseend'. --- So it seems like s and/or <\n>s were "ignored". If you commented [1], the section [2] would work well. So how to use make Lua work well even between \startsetups ... \stopsetups? Best regards, Lukas -- Ing. Lukáš Procházka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038