HI All, I remember seeing some seeing what I want to do but I can not find it. I would like to define a command that takes an optional key-valued list and 1 or 2 manditory ones. Something like \unexanded\def\MyCommand[#1]#2% {% \NassiGroupFrame[#1]{#2}% }% or \unexanded\def\MyCommand[#1]#2% {% % extract keyvalue \NassiGroupFrame[\width=\extractedvalueone]{hbox to \extractvaletwo{#2}}% }% where \NassiGroupFrame is a Frame. To give you an idea why I need this see the MWE below. This is a relatively simple example, there will be more complicated frames and they will be nested. Maybe I am chasing windmills and there is a better way and I should use cld or lua for outputing the Frames so that I can have spacing between the command and avoid having to use "%" after the first opening "{". Or does someone know how it can be done. Is there a way to use ConTeXt to write the command Pointers, help welcome. MWE: %%%%%%%%%%%%%%%%%%%%% %% NassiSimpleFrameBox %% %% Draw a box around a frame using exact height %% and width. to use it use overlay NassiSimpleFrameBox %% \startuniqueMPgraphic{NassiSimpleFrameBox} pickup pencircle scaled \overlaylinewidth ; draw (0,0) -- (0, OverlayHeight) -- (OverlayWidth, OverlayHeight) -- (OverlayWidth, 0) -- cycle withcolor OverlayLineColor; \stopuniqueMPgraphic %% Define Overlay for NassiSimpleFrameBox %% \defineoverlay[NassiSimpleFrameBox][\uniqueMPgraphic{NassiSimpleFrameBox}] %% %%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%% %% NassiGroupFrameBox %% %% Draw a box around a frame which contains several %% structures. Since the frame size containing the structures %% has a \rulethickness frame around then we have to adjust %% so that we can draw on top of its bounding box %% \startuniqueMPgraphic{NassiGroupFrameBox} numeric DoubleLineWidth, TrueWidth, TrueHeight; DoubleLineWidth := 2 * OverlayLineWidth; TrueHeight := OverlayHeight - DoubleLineWidth; TrueWidth := OverlayWidth - DoubleLineWidth; pickup pencircle scaled OverlayLineWidth; draw (0,0) -- (0, TrueHeight) -- (TrueWidth, TrueHeight) -- (TrueWidth, 0) -- cycle withcolor OverlayLineColor; \stopuniqueMPgraphic \defineoverlay[NassiGroupFrameBox][\uniqueMPgraphic{NassiGroupFrameBox}] %% %%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%% %% NassiSimpleFrame %% %% Frame for putting a frame around it. %% Location is set so that they can be stack %% on top of each other. \defineframed[NassiSimpleFrame] \setupframed[NassiSimpleFrame] [width=5cm, frame=off, background=NassiSimpleFrameBox, rulethickness=1pt, framecolor=blue, offset=0pt, frameoffset=0pt, location=lohi] %% %%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%% %% NassiGroupFrame %% %% Frame for putting a frame around a block of %% structures. Since it surrounds a group we use %% fit for Height and Width. %% So that the The frame gets draw on top that the %% the background has to be setup accordingly. \defineframed[NassiGroupFrame] \setupframed[NassiGroupFrame] [width=fit, height=fit, frame=off, rulethickness=3pt, framecolor=green, offset=0pt, background={foreground, NassiGroupFrameBox}, frameoffset=0pt, align=middle, strut=no] %% %%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%% %% Frame a Statement %% The text inside the frame is adjust to %% leave room for the frame \unexpanded\def\Statement#1% {% \NassiSimpleFrame[width=5cm,framecolor=red]{\vbox{\hsize \dimexpr\framedparameter{width} * 9/10\relax \strut #1}}% }% \unexpanded\def\MyGroup#1% {% \NassiGroupFrame{\hbox to 10cm% {#1}} }% \unexpanded\def\MyBlock#1% {% \vtop{{\hsize 5cm#1}}% }% \starttext \NassiGroupFrame{% \vbox{\hsize 5cm% \Statement{This is a test This is a test This is a test This is a test This is a test This is a test} \Statement{This $is^a$ test } \Statement{This $is^a$ test This is a test This is a test This is a test This is a test This is a test} }} \MyGroup{% How do I avoid comment here \MyBlock{ \Statement{This is a test This is a test This is a test This is a test This is a test This is a test} \Statement{This $is^a$ test } }% How do I avoid comment here \MyBlock{\Statement{This is a test This is a test This is a test This is a test This is a test This is a test} } } \stoptext regards Keith.