Am 21.02.2012 um 12:00 schrieb luigi scarso:
On Tue, Feb 21, 2012 at 11:34 AM, Mari Voipio
wrote: Hello!
I'm trying to place dynamic content on a layer and now it turns out that while getting a different pic every time is easy, getting the layers redrawn wasn't that simple. The wiki has this code:
\definelayer [pagenumber] [width=\paperwidth, height=\paperheight, preset=middle, state=repeat]
\setlayer[pagenumber]{Page \pagenumber}
\setupbackgrounds[page][background=pagenumber]
\starttext \dorecurse{4}{\page[empty]} \stoptext
AFAIK, that should be a complete minimal sample. Unfortunately it doesn't seem to work, at least my ConTeXt MkIV of February 8 only gives "Page 1" on every one of those 4 pages... right, it's ok
How to fix this? Preferably on the "Dummies" level, I'd prefer not to see the bowels of my ConTeXt, if I can avoid it. going on on http://wiki.contextgarden.net/Layers you see
\definelayer [pagenumber] [width=\paperwidth, height=\paperheight, preset=middle]
\startsetups layer
\setlayer[pagenumber]{Page \pagenumber}
\stopsetups
\setupbackgrounds[page][setups=layer,background=pagenumber]
\starttext \dorecurse{4}{\page[empty]} \stoptext
Here is a slightly different version which is better when you need more dynamic layers. \definelayer [pagenumber][width=\overlaywidth,height=\overlayheight,preset=middle] \defineoverlay[pagenumber][\texsetup{layer}] \startsetups layer \setlayer[pagenumber]{Page \pagenumber} \tightlayer[pagenumber] \stopsetups \setupbackgrounds[page][background=pagenumber] \starttext \dorecurse{4}{\page[empty]} \stoptext Wolfgang