Fabrice Couvreur schrieb am 06.03.2021 um 11:17:
Hi Hans,
Some time ago, you offered this code to respond to a specific request
from me. I used this code again and wanted to know if it was possible
for the title "Algorithm" to be automatically centered based on the content.
Thank you
Fabrice
\definecolor[MyBlue][c=0.2 , m=0.03, y=0.00, k=0.00]
\definecolor[maincolor] [b=.5]
\defineframedtext
[MyFrame]
[frame=off,
background=MyFrame,
width=fit,
height=fit,
style=small]
\startuseMPgraphic{MyFrame}
path b;
picture p;
p := textext.rt("\tfx\bf\white\framedtextparameter{Title}");
p := p shifted (2BodyFontSize,OverlayHeight-ypart center
p+.25ExHeight);
p := textext.t("\tfx\bf\white\framedtextparameter{Title}");
p := p shifted (OverlayWidth/2,OverlayHeight-ypart center
p+.25ExHeight);
Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________