Hi Hans, \startframed doesn’t accept local settings because \pack_framed_process expects two arguments. Here is only one optional argument \unexpanded\def\startframed {\dosingleempty\pack_framed_start_framed} \def\pack_framed_start_framed[#1]% {\bgroup \advance\framednesting\plusone \expandafter\let\csname\??ol:\the\framednesting\s!parent\endcsname\??ol \pack_framed_process[\??ol:\the\framednesting][#1]% \bgroup} while \framed accepts two \unexpanded\def\framed {\bgroup \advance\framednesting\plusone \expandafter\let\csname\??ol:\the\framednesting\s!parent\endcsname\??ol \dodoubleempty\pack_framed_process[\??ol:\the\framednesting]} and \pack_framed_process checks for the second argument: \unexpanded\def\pack_framed_process[#1][#2]% assumes a \dodoubleempty (slows down), also should have leading \bgroup {\bgroup \pack_framed_initialize{#1}% \ifsecondargument % faster \getparameters[\currentframed][#2]% here ! \fi \pack_framed_process_indeed} Test file: \starttext \secondargumentfalse % was true from a previous command but should be false \startframed[frame=off]text\stopframed \framed[frame=off]{text} \stoptext Wolfgang
On 17-5-2012 12:11, Wolfgang Schuster wrote:
\unexpanded\def\startframed {\dosingleempty\pack_framed_start_framed}
...
so we should have \def\pack_framed_start_framed[#1]% {\bgroup \advance\framednesting\plusone \expandafter\let\csname\??ol:\the\framednesting\s!parent\endcsname\??ol \secondargumenttrue % dirty trick \pack_framed_process[\??ol:\the\framednesting][#1]% \bgroup} ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Am 17.05.2012 um 14:06 schrieb Hans Hagen:
On 17-5-2012 12:11, Wolfgang Schuster wrote:
\unexpanded\def\startframed {\dosingleempty\pack_framed_start_framed}
...
so we should have
\def\pack_framed_start_framed[#1]% {\bgroup \advance\framednesting\plusone \expandafter\let\csname\??ol:\the\framednesting\s!parent\endcsname\??ol \secondargumenttrue % dirty trick \pack_framed_process[\??ol:\the\framednesting][#1]% \bgroup}
Better: \iffirstargument\secondargumenttrue\fi Wolfgang
participants (2)
-
Hans Hagen
-
Wolfgang Schuster