Hi, Playing with metafun, I saw the FunnyFrame example (page 239 MetaFun screen manual), where a framed is put around some paragraph and this frame has a small framed title inserted at the top of the framed paragraph. I would like to do a similar output but in the context of an enumeration. I am able to obtain the main frame by a proper definition of the \definenumeration, but not the title ! For clarity, a sample test file is provided below. I have tried to look in the mailing list for some examples that can help me, but no luck ! Do you think this is something feasible ? I wouldl take any hint ! Thanks, Fabrice. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %[ The main code of this example came actullay from a thread in 2000 by Hans.] % http://archive.contextgarden.net/message/20000929.130642.dc591d10.en.html \setupcolors[state=start] \def\FrameText#1% {\startuseMPgraphic{FunnyFrame} picture p ; numeric w, h, o ; p := btex \strut#1 etex ; w := \overlaywidth ; h := \overlayheight ; o := \the\bodyfontsize/2 ; p := p shifted (4o,h-ypart center p) ; draw p ; drawoptions (withpen pencircle scaled 1pt withcolor red) ; draw (3o,h)--(0,h)--(0,0)--(w,0)--(w,h)--(xpart urcorner p+o,h) ; draw boundingbox p enlarged(o,0) withcolor red ; setbounds currentpicture to unitsquare xyscaled(w,h) ; \stopuseMPgraphic} \defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}] \defineframedtext[FunnyText][frame=off,background=FunnyFrame,width= \hsize] \def\StartFrame#1{\FrameText{#1}\startFunnyText} \def\StopFrame {\stopFunnyText } \starttext \StartFrame{A nice place for a title} The value of variables inside this fence are isolated from the values outside. \StopFrame \defineenumeration[Definition] [width=fit, before=\StartFrame{}, after=\StopFrame, text={Definition} ] \startDefinition The text of the definition. The sentence "{\bf Definition 1}" should be in the above small box. \stopDefinition \stoptext %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
participants (1)
-
Fabrice