From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/47032 Path: news.gmane.org!not-for-mail From: "Bart C. Wise" Newsgroups: gmane.comp.tex.context Subject: Re: Centering a defined text frame Date: Mon, 26 Jan 2009 09:51:39 -0700 Message-ID: <200901260951.39306.bntgcontext@wiseguysweb.com> References: <200901240730.02216.bntgcontext@wiseguysweb.com> <200901260711.43247.bart@wiseguysweb.com> <115224fb0901260714t44f90104p68da9933b7424744@mail.gmail.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: ger.gmane.org 1232988839 26619 80.91.229.12 (26 Jan 2009 16:53:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 26 Jan 2009 16:53:59 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Mon Jan 26 17:55:11 2009 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 1LRUju-0001vv-Fk for gctc-ntg-context-518@m.gmane.org; Mon, 26 Jan 2009 17:55:10 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 1E37D1FD4A; Mon, 26 Jan 2009 17:53: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 09179-05; Mon, 26 Jan 2009 17:52:38 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 2A2E71FCEC; Mon, 26 Jan 2009 17:52:38 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id BBA1E1FCEC for ; Mon, 26 Jan 2009 17:52:35 +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 08442-03 for ; Mon, 26 Jan 2009 17:51:53 +0100 (CET) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by ronja.ntg.nl (Postfix) with ESMTP id 409341FCBD for ; Mon, 26 Jan 2009 17:51:52 +0100 (CET) Original-Received: from out02.mta.xmission.com (out02.mta.xmission.com [166.70.13.232]) by filter2-ams.mf.surf.net (8.13.8/8.13.8/Debian-3) with ESMTP id n0QGpofH022318 for ; Mon, 26 Jan 2009 17:51:51 +0100 Original-Received: from mx04.mta.xmission.com ([166.70.13.214]) by out02.mta.xmission.com with esmtp (Exim 4.62) (envelope-from ) id 1LRUge-0007Jv-TY for ntg-context@ntg.nl; Mon, 26 Jan 2009 09:51:48 -0700 Original-Received: from bwise.fttp.xmission.com ([166.70.232.60] helo=zeus.localnet) by mx04.mta.xmission.com with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1LRUge-0003Nm-LG for ntg-context@ntg.nl; Mon, 26 Jan 2009 09:51:48 -0700 User-Agent: KMail/1.10.4 (Linux/2.6.27-11-generic; KDE/4.1.4; x86_64; ; ) In-Reply-To: <115224fb0901260714t44f90104p68da9933b7424744@mail.gmail.com> Content-Disposition: inline X-XM-SPF: eid=; ; ; mid=; ; ; hst=mx04.mta.xmission.com; ; ; ip=166.70.232.60; ; ; frm=bntgcontext@wiseguysweb.com; ; ; spf=none X-XM-DomainKey: sender_domain=wiseguysweb.com; ; ; sender=bntgcontext@wiseguysweb.com; ; ; status=no signature X-SA-Exim-Connect-IP: 166.70.232.60 X-SA-Exim-Rcpt-To: ntg-context@ntg.nl X-SA-Exim-Mail-From: bntgcontext@wiseguysweb.com X-SA-Exim-Version: 4.2.1 (built Thu, 07 Dec 2006 04:40:56 +0000) X-SA-Exim-Scanned: No (on mx04.mta.xmission.com); Unknown failure X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=166.70.13.232; country=US; region=UT; city=Salt Lake City; latitude=40.7242; longitude=-111.8787; metrocode=770; areacode=801; http://maps.google.com/maps?q=40.7242,-111.8787&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 170686036 - ca9be45b9199 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.11 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:47032 Archived-At: On Mon January 26 2009 8:14:11 am Wolfgang Schuster wrote: > Hi Bart, > > > Is there a way to pass in my own defined parameters to such a function? > > > > I would like to be able to do something similar to the following: > > > > \startCenteredText[myownparm="This is a test"] > > \startlines > > My own parm is: \myownparm > > \stoplines > > \stopCenteredText > > Not with framedtext but you define your environment with a optional > argument. > > ConTeXt has the command \definestartstop but it did not help in your case, > something like LaTeXs \newenvironment, I wrote a simple version below. > > \unprotect > > \def\????ev{@@@@ev} > > \def\environmentparameter#1% > {\csname\????ev\currentenvironment#1\endcsname} > > \def\defineenvironment > {\dodoubleempty\dodefineenvironment} > > \def\dodefineenvironment[#1][#2]% > {\getparameters > [\????ev#1] > [\c!before=, > \c!after=, > #2]% > \setvalue{\e!start#1}{\dodoubleempty\dostartenvironment[#1]}% > \setvalue{\e!stop #1}{\dostopenvironment}} > > \def\setupenvironment > {\dodoubleargument\dosetupenvironment} > > \def\dosetupenvironment[#1][#2]% > {\getparameters[\????ev#1][#2]} > > \def\dostartenvironment[#1][#2]% > {\bgroup > \edef\currentenvironment{#1}% > \ifsecondargument > \setupenvironment[\currentenvironment][#2]% > \fi > \environmentparameter\c!before} > > \def\dostopenvironment > {\environmentparameter\c!after > \egroup} > > \protect > > \defineframedtext > [CenteredTextFrame] > [width=fit, > location=middle] > > \defineenvironment > [CenteredText] > [before=\startCenteredTextFrame\startlines, > after=\stoplines\stopCenteredTextFrame] > > \starttext > > \startCenteredText[text={This is a test}] > My own parm is: \environmentparameter{text} > \stopCenteredText > > \stoptext > Thanks Wolfgang for the insight. Bart ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________