Hi list,

I'm playing around with blocks and buffers again, realizing that I cannot use 
them inbetween a \start...\stop that I defined myself. Apparently, they work 
between \startsection...\stopsection and the like, so I was wondering how I 
should define or expand #2 in the MWE below to make TeX happily accept these 
useful features?

Thanks a lot


Benjamin


\starttext

\let\stopMyCommand\relax

\tolerant\protected\def\startMyCommand[#1]#2\stopMyCommand{

        Optional argument #1
        
        Content #2

}

\bf Here we test the command: Works \tf

\startMyCommand[is optional]
gets processed!
\stopMyCommand

\bf Here we test the block: Works \tf

\defineblock[MyBlock]

\beginMyBlock
Block for something else.
\endMyBlock

\useblocks[MyBlock][criterium=text]

\bf Here we test the block inside command: Fails \tf

% UNCOMMENT BELOW FAILS: tex error > runaway error: end of file encountered
%
% \startMyCommand[is optional]
% Still?
%
% \beginMyBlock
% Block for something else.
% \endMyBlock
% \stopMyCommand

\definebuffer[MyBuffer]

\bf Here we test the buffer: Works \tf

\startbuffer[MyBuffer]
Buffer for something else.
\stopbuffer

\getbuffer[MyBuffer]

\bf Here we test the buffer inside command: Fails \tf

% UNCOMMENT BELOW FAILS: tex error > runaway error: end of file encountered
%
% \startMyCommand[is optional]
% Still?
%
% \startbuffer[MyBuffer]
% Buffer for something else.
% \endbuffer
% \stopMyCommand

\stoptext
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to