From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/15903 Path: main.gmane.org!not-for-mail From: Hans Hagen Outside Newsgroups: gmane.comp.tex.context Subject: Re: Collecting command arguments in a startstop environment Date: Mon, 02 Aug 2004 22:14:07 +0200 Sender: ntg-context-bounces@ntg.nl Message-ID: <410EA08F.40004@wxs.nl> References: <4.3.1.2.20040802103535.01618f00@cits1.stanford.edu> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1091477665 29494 80.91.224.253 (2 Aug 2004 20:14:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 2 Aug 2004 20:14:25 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Mon Aug 02 22:14:16 2004 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BrjCK-00067B-00 for ; Mon, 02 Aug 2004 22:14:16 +0200 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 179F0127DF; Mon, 2 Aug 2004 22:14:16 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (ronja.vet.uu.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 21141-01; Mon, 2 Aug 2004 22:14:13 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 7D8FB127D9; Mon, 2 Aug 2004 22:14:13 +0200 (CEST) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id BB876127D9 for ; Mon, 2 Aug 2004 22:14:12 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (ronja.vet.uu.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 20948-05 for ; Mon, 2 Aug 2004 22:14:12 +0200 (CEST) Original-Received: from mailrelay02.solcon.nl (unknown [212.45.32.200]) by ronja.ntg.nl (Postfix) with ESMTP id 38A0B127D7 for ; Mon, 2 Aug 2004 22:14:12 +0200 (CEST) Original-Received: from server-1.pragma-net.nl (dsl-212-84-128-085.solcon.nl [212.84.128.85]) by mailrelay02.solcon.nl (8.12.11/SQL-8.12.11-5/8.12.11) with ESMTP id i72KE7qJ002906 for ; Mon, 2 Aug 2004 22:14:07 +0200 Original-Received: by server-1.pragma-net.nl (Postfix, from userid 65534) id 51FF81A7B1; Mon, 2 Aug 2004 22:14:11 +0200 (CEST) Original-Received: from [127.0.0.1] (unknown [10.100.1.1]) by server-1.pragma-net.nl (Postfix) with ESMTP id 0BB1E17BA1 for ; Mon, 2 Aug 2004 20:14:09 +0000 (UTC) User-Agent: Mozilla Thunderbird 0.6 (Windows/20040502) X-Accept-Language: en-us, en Original-To: mailing list for ConTeXt users In-Reply-To: <4.3.1.2.20040802103535.01618f00@cits1.stanford.edu> X-Virus-Scanned: clamd / ClamAV version 0.75, clamav-milter version 0.75 on mailrelay02 X-Virus-Status: Clean X-Virus-Scanned: by amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: by amavisd-new at ntg.nl Xref: main.gmane.org gmane.comp.tex.context:15903 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:15903 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 \collect@body 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 -----------------------------------------------------------------