On Tue, 21 Aug 2012, Olivier Binda wrote:
3) I'm flowing text around mathematical text with graphic ornaments (overlay) but the bounding box from metapost (red) and from TeX (black) on the following minimal example aren't the same which produce all kinds of "flowing text" issues. is there a way/an option for framedtexts with overlay to get the max width/height size of the main content + overlays ?
Can you create a minimal example showing what you are trying to do? The following example is a bit confusing (where is \MPstring{Content} set? Why use framedtext instead of framed? What is \framed[fit] supposed to do? etc).
\startusableMPgraphic{myFrame} numeric o, l, m ; path a, b ; pair c ; picture d; d = textext.rt(\MPstring{Content}) ; draw (unitsquare xyscaled (OverlayWidth,OverlayHeight) shifted (-OverlayWidth/2,-OverlayHeight/2)) withpen pencircle scaled 1pt withcolor green;
You could also use draw OverlayBox withpen ...
draw (d enlarged 2cm) withcolor red withpen pencircle scaled 2pt; draw boundingbox currentpicture withpen pencircle scaled .1mm dashed evenly withcolor blue ; \stopusableMPgraphic
\defineoverlay[myOverlay][\useMPgraphic{myFrame}] \defineframedtext[myStatement][frame=off] \setupframedtexts[myStatement][backgroundcolor=lightgray,background=myOverlay,width=\textwidth,autowidth=force] \starttext \framed[fit]{\startmyStatement TEST \stopmyStatement} \stoptext
You can try \framed[strut=no]{...} and add \setupframedtext[...][offset=overlay]. See http://wiki.contextgarden.net/Command/setupframed for details. Aditya