Changes

Jump to navigation Jump to search
1,108 bytes added ,  11:12, 3 February 2009
Added example for dynamic layer content.
==Placing Place labels on pictures==
Layers can be used to put labels on pictures, alternative ways can be found in the [[manual:details.pdf| Details]] manual
\externalfigure[cow][whatever][width=14cm,height=4cm]
\stoptext
</texcode>
 
 
==Use dynamic content==
 
The content of layer is fixed after your set it and will appear in the same way on each page.
 
<texcode>
\definelayer
[pagenumber]
[width=\paperwidth,
height=\paperheight,
preset=middle,
state=repeat]
 
\setlayer[pagenumber]{Page \pagenumber}
 
\setupbackgrounds[page][background=pagenumber]
 
\starttext
\dorecurse{4}{\page[empty]}
\stoptext
</texcode>
 
This is not always what you desire like in the example above, where on each page the current page number should be shown and not the number from the first page.
 
To recalculate the content on each new page you have to enclose the <cmd>setlayer</cmd> settings within <cmd>startsetups</cmd> ... <cmd>stopsetups</cmd> and
write <code>\setupbackgrounds[page][setups=setupname,background=layername]</code> in your document.
 
<texcode>
\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
</texcode>
gardener
110

edits

Navigation menu