From Wiki
< Command
Revision as of 10:13, 10 February 2015 by Philexander (talk | contribs)
Jump to navigation Jump to search



{...} before
{...} after


\groupedcommand is used for defining commands that might receive a verbatim environment as their argument, or a block wrapped in \bgroup...\egroup.


is a robust implementation of the more naïve pattern


The first problem with the naïve approach: the tokens that form #1 are fixed the the moment the argument is read in. Normally this is no problem, but e.g. verbatim environments adapt the catcodes of characters and therefore are not always happy with already fixed tokens.

Another problem arises when the argument is grouped not by {} but by \bgroup and \egroup. Such an argument fails, because the \bgroup is seen as the argument (which is quite normal).

If you use \groupedcommand, the argument is identified and processed correctly.


% Don't write this

% Write this, instead.

Another example, where the item to process is a paragraph:


See also

Help from ConTeXt-Mailinglist/Forum

All issues with: