Changes

Jump to navigation Jump to search
903 bytes added ,  17:51, 19 August 2021
layers in fitting pages
You may experience cases where the defined size of your layer is ignored and you can’t get linebreaking or multiple lines at all.
This is due to {{cmd|setlayer</cmd> }} using {{cmd|hbox</cmd> }} internally. You can work around the problem using {{cmd|setlayerframed</cmd>}}:
<context source=yes>
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.
typeset in the setup area. However, layers are an exception and
a font needs to be set up beforehand.
 
= Layers in fitting pages =
 
Fitting pages have no fixed dimensions, but they are taken from their content. Layers require dimensions to be placed on the page.
 
Hans provided two alternative methods to do it:
 
<texcode>
\starttext
 
\definelayer[hi]
 
\startTEXpage[background=hi]
\setbox\scratchbox\hbox\framed
[frame=off,offset=none,align=middle]
{\input{tufte}}%
\setuplayer
[hi]
[width=\wd\scratchbox,height=\htdp\scratchbox]
\setlayer
[hi][preset=middle]
{\color[green]{there}}
\box\scratchbox
\stopTEXpage
 
\defineoverlay[hi]
 
\startTEXpage[background=hi]
\defineoverlay
[hi]
[{\framed [frame=off, offset=overlay, width=\overlaywidth, height=\overlayheight]
{\color[red]{there}}}]
\framed
[frame=off,offset=none,align=middle,background=hi]
{\input{tufte}}%
\stopTEXpage
 
\stoptext
</texcode>
= See Also =
139

edits

Navigation menu