Re: Decorative frame for enumeration

Wolfgang Schuster <[email protected]> Sun, 14 Jun 2026 18:25:38 +0200
Newsgroups gmane.comp.tex.context
Message-ID <[email protected]>

Am 13.06.2026 um 20:45 schrieb Jethro Djan:
> I am going for a design I saw in a high school math text book for 
> typesetting examples.
> 
> But my implementation leaves a little vertical space at the top above 
> the enumeration title. Also, I have to manually shift the frame. If I 
> zoom in, I still see that the frame for the header title and the frame 
> it is contained in are not aligned.
> 
> Is there a better way to do this?
> 
> MWE:
> 
> \startuseMPgraphic{WEFrame}
>      numeric w, h ;
>      w := OverlayWidth ; h := OverlayHeight ;
>      fill (0,0)--(0,h)--(w,h)--(w,0)--cycle withcolor (.93, .96, 1.0) ;
>      setbounds currentpicture to unitsquare xyscaled(w,h) ;
> \stopuseMPgraphic
> 
> \defineoverlay[WEFrame][\useMPgraphic{WEFrame}]
> 
> \defineenumeration[WorkedEx]
> \setupenumeration[WorkedEx][%
>      alternative=top,
>      text={Worked Example},
>      inbetween={\blank[small]},
>      before={\startframedtext[
>          frame=off,
>          background=WEFrame,
>          offset=0pt,
>          loffset=8pt,
>          boffset=4pt,
>          width=max,

You have to add

rulethickness=0pt,

because even when you disable the frame the thickness of the line is 
still used in the background offset.

Wolfgang

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : [email protected] / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________