Hi Javier,
As Thomas put it, it is beter to provide a minimal sample, even if it doesn't work correctly.
Given that, you can dig in this list archives, which contain few questions on the topic you are dealing with.
I am afraid that you can't achieve your goal (which is more or less a text within a frame with a title), without MP, which seems to me a good tool to draw such frame.
I remember that Fabrice Couvreur once has asked in 2016 a similar question, in order to draw a frame for a "summary" at the end of a chapter.
You need to populate the preamble of your file with something like below (you have to test it and modify it to your needs).
Pay attention ! You have to give a \start command, after the \starttext command, inside the body of your text, when you want \startMyFrame[Title=A Title], and when to stop the frame with the \stopMyFrame command.
Have a look to the code below and test it (note that the frame is red in this sample).
% Début de la définition d'un texte encadré en rouge
% Defining a framed text
\defineframedtext
[MyFrame]
[before={\blank[3*big]},
after={\blank[5*big]},
frame=off,
background=MyFrame,
%width=\textwidth,
width=max,
height=fit,
style={\setupbodyfont[9pt]}]
% Defining a label
\definelabel
[Definition]
[headstyle=\bf\smallcaps]
\startuseMPgraphic{MyFrame}
path b;
picture p;
%p := textext.rt("\white\Definition");
p := textext.rt("\white\framedtextparameter{Title}");
%p := textext.rt("\white\getvariable{text}{text1}");
p := p shifted (2BodyFontSize,OverlayHeight-ypart center p+.25ExHeight);
b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth;
fill OverlayBox withcolor lightgray; %\MPcolor{
fill b withcolor darkred;
draw bottomboundary OverlayBox withpen pencircle scaled 1pt withcolor
darkred;
draw topboundary OverlayBox withpen pencircle scaled 1pt withcolor
darkred;
draw p;
setbounds currentpicture to boundingbox currentpicture enlarged 2mm;
\stopuseMPgraphic
\defineoverlay
[MyFrame]
[\useMPgraphic{MyFrame}]
% Fin de la définition d'un texte encadré en rouge
\starttext
\startMyFrame[Title=Knuth Text]
\knuth
\stopMyFrame
\stoptext
Hope it helps !
JP
----- Mail original -----
De: "Javier M Mora"