From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/47029 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Centering a defined text frame Date: Mon, 26 Jan 2009 16:14:11 +0100 Message-ID: <115224fb0901260714t44f90104p68da9933b7424744@mail.gmail.com> References: <200901240730.02216.bntgcontext@wiseguysweb.com> <3E61CC08-9CCB-4BA4-A65B-B969C3EF418C@gmail.com> <200901260711.43247.bart@wiseguysweb.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 1232982975 4284 80.91.229.12 (26 Jan 2009 15:16:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 26 Jan 2009 15:16:15 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Jan 26 16:17:28 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 1LRTDL-000286-Kk for gctc-ntg-context-518@m.gmane.org; Mon, 26 Jan 2009 16:17:27 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 9306D1FD0A; Mon, 26 Jan 2009 16:16:07 +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 00591-04; Mon, 26 Jan 2009 16:14:56 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C2BE41FCFF; Mon, 26 Jan 2009 16:14:55 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 8CF041FCFF for ; Mon, 26 Jan 2009 16:14:53 +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 01036-03 for ; Mon, 26 Jan 2009 16:14:13 +0100 (CET) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by ronja.ntg.nl (Postfix) with ESMTP id E5F9D1FCF3 for ; Mon, 26 Jan 2009 16:14:12 +0100 (CET) Original-Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157]) by filter2-til.mf.surf.net (8.13.8/8.13.8/Debian-3) with ESMTP id n0QFECp1028605 for ; Mon, 26 Jan 2009 16:14:12 +0100 Original-Received: by fg-out-1718.google.com with SMTP id 19so3713570fgg.8 for ; Mon, 26 Jan 2009 07:14:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=K9q5Jx41ecJKJBmQQtHvnTwEleP9+qaGt/BLGNcCMy0=; b=I5gzh6f29UD5PR3draHRkKXBOwaqOz1JQinn+AdFiK4QUvMPoY8Dc4kVDqMmE7KK6+ X01EMoTuE40EKqEmBFk6kjRPIw4BfvWtwci2HYyV+uNFOfBNVGrHqgBLgFkX7/wemY+4 4VWc3DsZHuZ693NQAYpqaFfZ2MPz6WwcLvfd0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=hwul7uaMc1ogQIJNSyLpJtum68Z55YZTB3VyQE3tt9EzoNsFx/eqP8joIOZTmhnkJ0 h5ARYQ1a9eBtBo9wQ5KcGIzsa0OakI7lSh7CMCnvwmHJxHdr+vNq8RUde3dfyrKof1oS Oos2A0oM4DztxwygJwY/iuJmI6qb8MuZK0rDs= Original-Received: by 10.223.122.70 with SMTP id k6mr1293746far.26.1232982851920; Mon, 26 Jan 2009 07:14:11 -0800 (PST) In-Reply-To: <200901260711.43247.bart@wiseguysweb.com> X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=72.14.220.157; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 170634167 - facbea041969 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.218 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:47029 Archived-At: 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 Wolfgang ___________________________________________________________________________________ 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 ___________________________________________________________________________________