Brooks Moses wrote:

To answer my own question:

At 10:39 PM 8/1/2004, I wrote:

There's a nice little problem that arises in LaTeX, of wanting to write a bit of code like the following, to define an environment that passes the contents of the environment to a command as an argument:

  \newcommand{\foo}[1]{...}
  \newenvironment{fooenv}{%
    \foo\bgroup
  }{%
    \egroup
  }

There's even a nice FAQ entry about this. [1] As it turns out, the amsmath package defines a handy [EMAIL PROTECTED] command that handles collecting the environment body to pass it to a command.

Anyhow, I'm finding myself wanting to do this in ConTeXt, with of course replacing \newenvironment with \definestartstop. Is there by any chance a built-in ConTeXt macro that can do this? Or even things that would make a decent foundation for building such a thing?


The \grabuntil and \processbetween commands, as defined in syst-ext.tex, do exactly what I'm asking for.

If you want to play with low level features, it makes sense to look into:


syst-gen.tex
syst-ext.tex (syst-new.tex)
supp-box.tex
supp-fun.tex


the interfaces of syst/supp modules are sort of 'public' and stable. These modules may also teach some tex tricks -)

Hans


----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------

_______________________________________________
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context

Reply via email to