29.11.2012 Views

MetaFun - Pragma ADE

MetaFun - Pragma ADE

MetaFun - Pragma ADE

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

128<br />

In this case, it would have made sense to either set the offset to a larger value, or to set<br />

backgroundoffset. In the latter case, the ellipse is positioned outside the frame.<br />

The difference between the three offsets offset, frameoffset and backgroundoffset is demonstrated<br />

in figure 4.1. While the offset is added to the (natural or specified) dimensions of the<br />

content of the box, the other two are applied to the frame and background and don't add to the<br />

dimensions.<br />

In the first row we only set the offset, while in the second row, the (text) offset is set to 3pt. When<br />

not specified, the offset has a comfortable default value of .25ex (some 25% of the height of an x).<br />

\setupframed<br />

[width=.3\textwidth,<br />

background=demo circle]<br />

\startcombination[3*3]<br />

{\framed[offset=none] {\TeX}} {\tt offset=none}<br />

{\framed[offset=overlay] {\TeX}} {\tt offset=overlay}<br />

{\framed[offset=0pt] {\TeX}} {\tt offset=0pt}<br />

{\framed[offset=1pt] {\TeX}} {\tt offset=1pt}<br />

{\framed[offset=2pt] {\TeX}} {\tt offset=2pt}<br />

{\framed[offset=4pt] {\TeX}} {\tt offset=4pt}<br />

{\framed[offset=3pt] {\TeX}} {\tt offset=3pt}<br />

{\framed[frameoffset=3pt] {\TeX}} {\tt frameoffset=3pt}<br />

{\framed[backgroundoffset=3pt]{\TeX}} {\tt backgroundoffset=3pt}<br />

\stopcombination<br />

TEX TEX TEX<br />

offset=none offset=overlay offset=0pt<br />

TEX TEX TEX<br />

offset=1pt offset=2pt offset=4pt<br />

TEX TEX TEX<br />

offset=3pt frameoffset=3pt backgroundoffset=3pt<br />

Figure 4.1 The three offsets.<br />

As the first row in figure 4.1 demonstrates, instead of a value, one can pass a keyword. The overlay<br />

keyword implies that there is no offset at all and that the lines cover the content. With none the<br />

frame is drawn tight around the content. When the offset is set to 0pt or more, the text is automatically<br />

set to at least the height of a line. You can turn this feature of by saying strut=off. More<br />

details can be found in the CONTEXT manual.<br />

In figure 4.2 we have set offset to 3pt, frameoffset to 6pt and backgroundoffset to 9pt. Both the<br />

frame and background offset are sort of imaginary, since they don't contribute to the size of the<br />

box.<br />

\ruledhbox<br />

{\framed<br />

Enhancing the layout Overlays

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!