Am 30.10.2011 um 16:00 schrieb Curiouslearn:
Hi All,
Please see the working example below. I have defined a command called \myframedsection. It works the first two times I use it, but not the third time. I think it has something to do with using \startitemize...\stopitemize before the command is used the third time. But I am not sure. Can someone please tell me why it is not working, and how I can change my definition so that it works? Is this a bug?
\definehead[mysection][section] \setuphead[mysection][color=blue*:3]
\def\myframedsection#1{\bgroup\vskip 0.5in \framed[background=color, backgroundcolor=gray:10] {\mysection{#1}}% \egroup}
No wonder you get unexpected results with this definition, better solutions are \definehead[myframedsection][section] \setuphead [myframedsection] [before={\blank[0.5in]\startframedtext[background=color,backgroundcolor=gray:10]}, after={\stopframedtext\blank[0.25in]}, color=blue*:3] and \define[2]\MyframedsectionCommand {\framed [background=color,backgroundcolor=gray:10,align=flushleft] {\hbox to 2cm{#1}\vtop{\hsize=\dimexpr\hsize-2cm\relax#2}}} \definehead[myframedsection][section] \setuphead [myframedsection] [before={\blank[0.5in]}, command=\MyframedsectionCommand, style=blue*:3] Wolfgang