From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/33043 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: creating environments Date: Wed, 31 Jan 2007 11:15:06 +0100 Message-ID: <20070131111506.c0e2eba9.schuster.wolfgang@googlemail.com> References: <20070129132113.06a4e2ba.schuster.wolfgang@googlemail.com> <20070130140124.bcd02a27.schuster.wolfgang@googlemail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1170238560 20654 80.91.229.12 (31 Jan 2007 10:16:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 31 Jan 2007 10:16:00 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Wed Jan 31 11:15:48 2007 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1HCCVE-0005Oh-Hy for gctc-ntg-context-518@m.gmane.org; Wed, 31 Jan 2007 11:15:44 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 6B5D4FB; Wed, 31 Jan 2007 11:15:26 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 23598-04; Wed, 31 Jan 2007 11:15:20 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 3D4A5A9; Wed, 31 Jan 2007 11:15:20 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id E065FA9 for ; Wed, 31 Jan 2007 11:15:18 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 22520-03-2 for ; Wed, 31 Jan 2007 11:15:15 +0100 (CET) Original-Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.190]) by ronja.ntg.nl (Postfix) with ESMTP id 599398C for ; Wed, 31 Jan 2007 11:15:15 +0100 (CET) Original-Received: by nf-out-0910.google.com with SMTP id k27so426748nfc for ; Wed, 31 Jan 2007 02:15:29 -0800 (PST) Original-Received: by 10.49.8.15 with SMTP id l15mr401103nfi.1170238529817; Wed, 31 Jan 2007 02:15:29 -0800 (PST) Original-Received: from eve ( [194.94.240.124]) by mx.google.com with ESMTP id l21sm5531129nfc.2007.01.31.02.15.28; Wed, 31 Jan 2007 02:15:29 -0800 (PST) In-Reply-To: X-Mailer: Sylpheed 2.3.1 (GTK+ 2.10.7; i686-pc-mingw32) X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.7 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:33043 Archived-At: On Tue, 30 Jan 2007 10:05:23 -0500 (EST) Aditya Mahajan wrote: > On Tue, 30 Jan 2007, Wolfgang Schuster wrote: > > > On Mon, 29 Jan 2007 10:15:34 -0500 (EST) > > Aditya Mahajan wrote: > > > >> On Mon, 29 Jan 2007, Wolfgang Schuster wrote: > >> > >>> Hi all, > >>> > >>> > >>> I have a module with a envrionment defined in the following way: > >>> > >>> \def\startFOO#1\stopFOO{...#1...} > >>> > >>> > >>> I try currently to write a command \defineFOO[MYFOO] that expands to my > >>> already created environment. > >>> > >>> \startMYFOO#1\stopMYFOO -> \startFOO#1\stopFOO > >>> > >>> > >>> I know it is possible to make this in the following way: > >>> > >>> \def\startMYFOO#1\stopMYFOO{\startFOO#1\stopFOO} > >>> > >>> but this not what I want. > >> > >> Something like this > >> > >> \def\defineFOO[#1]% > >> {\setvalue{\c!start#1}{\startFOO} > >> \setvalue{\c!stop#1} {\stopFOO}} > >> > > > > Hi Aditya, > > > > > > this can only be used if you define your environment in this way: > > > > \def\startFOO{...} > > \def\stopFoo{...} > > > > > > I defined my environment in this way: > > > > \def\startFOO#1\stopFOO{...} > > > > This means TeX reads everything from \startFOO till \stopFOO and looks > > afterwards at the replacement text. > > I am not sure how something like that you work. > > > I used tried the first way with saving the content into a buffer and > > using the buffer content. > > If you want to write to a buffer and later use it, there are low level > macros to define your own buffer commands. Have a look at the R module > to see an example. Depending on your usage, you will have to keep > track of the buffer numbers on your own. > > Aditya Hi Aditya, I tried to use a buffer but you cannot make something like this: \starttext \placefigure {} {\startbuffer{mybuffer} Floating text from a buffer \stopbuffer \getbuffer{mybuffer}} \stoptext with content saved in a buffer. It's not a real problem but I wanted to know if it is possible to define a environment in the way I wanted. Wolfgang