From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/33053 Path: news.gmane.org!not-for-mail From: "Wolfgang Schuster" Newsgroups: gmane.comp.tex.context Subject: Re: creating environments Date: Wed, 31 Jan 2007 17:24:52 +0100 Message-ID: <115224fb0701310824y764c9e28q6e6ce63aed39a350@mail.gmail.com> References: <20070129132113.06a4e2ba.schuster.wolfgang@googlemail.com> <20070130140124.bcd02a27.schuster.wolfgang@googlemail.com> <20070131111506.c0e2eba9.schuster.wolfgang@googlemail.com> <45C076A9.9030407@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2052602058==" X-Trace: sea.gmane.org 1170261009 18070 80.91.229.12 (31 Jan 2007 16:30:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 31 Jan 2007 16:30:09 +0000 (UTC) To: "mailing list for ConTeXt users" Original-X-From: ntg-context-bounces@ntg.nl Wed Jan 31 17:29:53 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 1HCIGh-0002In-Sf for gctc-ntg-context-518@m.gmane.org; Wed, 31 Jan 2007 17:25:08 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id E6360127; Wed, 31 Jan 2007 17:24:49 +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 15597-08-5; Wed, 31 Jan 2007 17:24:44 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 06EF3105; Wed, 31 Jan 2007 17:24:44 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 06A6710C for ; Wed, 31 Jan 2007 17:24:42 +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 15597-08-4 for ; Wed, 31 Jan 2007 17:24:37 +0100 (CET) Original-Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.228]) by ronja.ntg.nl (Postfix) with ESMTP id 1DA5160 for ; Wed, 31 Jan 2007 17:24:37 +0100 (CET) Original-Received: by wx-out-0506.google.com with SMTP id h29so215237wxd for ; Wed, 31 Jan 2007 08:24:52 -0800 (PST) Original-Received: by 10.70.87.5 with SMTP id k5mr1700897wxb.1170260692186; Wed, 31 Jan 2007 08:24:52 -0800 (PST) Original-Received: by 10.70.113.11 with HTTP; Wed, 31 Jan 2007 08:24:52 -0800 (PST) In-Reply-To: <45C076A9.9030407@wxs.nl> 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:33053 Archived-At: --===============2052602058== Content-Type: multipart/alternative; boundary="----=_Part_5693_26283712.1170260692138" ------=_Part_5693_26283712.1170260692138 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline 2007/1/31, Hans Hagen : > > Wolfgang Schuster wrote: > > 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. > > > no, there is \setbuffer but in general (at least not in context mkii) > buffers are to be defined at the outer level > > It's not a real problem but I wanted to know if it is possible to > > define a environment in the way I wanted. > > Hi Hans, I looked into core-buf but this was not what I was looking for. What I want is a command like this: \def\defineFOO[#1]% {\expandafter\def\csname start#1\endcsname##1\csname stop#1\endcsname% {\startFOO##1\stopFOO}} and after I wrote \defineFOO[MYFOO] I can use the next command \startMYFOO...\stopMYFOO Wolfgang ------=_Part_5693_26283712.1170260692138 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline

2007/1/31, Hans Hagen <pragma@wxs.nl>:
Wolfgang Schuster wrote:
> On Tue, 30 Jan 2007 10:05:23 -0500 (EST)
> Aditya Mahajan < adityam@umich.edu> wrote:
>
>
>> On Tue, 30 Jan 2007, Wolfgang Schuster wrote:
>>
>>
>>> On Mon, 29 Jan 2007 10:15:34 -0500 (EST)
>>> Aditya Mahajan < adityam@umich.edu> 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.
>
no, there is \setbuffer but in general (at least not in context mkii)
buffers are to be defined at the outer level
> It's not a real problem but I wanted to know if it is possible to
> define a environment in the way I wanted.
>
 
Hi Hans,
 
I looked into core-buf but this was not what I was looking for.
 
What I want is a command like this:
 
\def\defineFOO[#1]%
  {\expandafter\def\csname start#1\endcsname##1\csname stop#1\endcsname%
     {\startFOO##1\stopFOO}}
 
and after I wrote
 
\defineFOO[MYFOO]
 
I can use the next command
 
\startMYFOO...\stopMYFOO
 
Wolfgang
 
------=_Part_5693_26283712.1170260692138-- --===============2052602058== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context --===============2052602058==--