From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/52255 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: =?windows-1252?q?loop_textext_and_=5CMPstring=7B=85?= =?windows-1252?q?=7D?= Date: Wed, 12 Aug 2009 21:23:09 +0200 Message-ID: <4A83169D.7010602@wxs.nl> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252"; Format="flowed" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1250105034 3887 80.91.229.12 (12 Aug 2009 19:23:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Aug 2009 19:23:54 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Aug 12 21:23:47 2009 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.50) id 1MbJQI-00008T-Oe for gctc-ntg-context-518@m.gmane.org; Wed, 12 Aug 2009 21:23:46 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 285DFC9A9B; Wed, 12 Aug 2009 21:23:41 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id kH9bvSV7VtLB; Wed, 12 Aug 2009 21:23:22 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 9496CC9A90; Wed, 12 Aug 2009 21:23:22 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id C2FA9C9A90 for ; Wed, 12 Aug 2009 21:23:21 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 06ovqPW4jhoR for ; Wed, 12 Aug 2009 21:23:17 +0200 (CEST) Original-Received: from mail.pragma-ade.net (dsl-083-247-100-017.solcon.nl [83.247.100.17]) by balder.ntg.nl (Postfix) with ESMTP id C9573C9A68 for ; Wed, 12 Aug 2009 21:23:12 +0200 (CEST) Original-Received: from [10.100.1.100] (unverified [10.100.1.100]) by controller-1 (SurgeMail 3.9e) with ESMTP id 33398-1840426 for ; Wed, 12 Aug 2009 21:23:12 +0200 User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) In-Reply-To: X-Originating-IP: 10.100.1.100 X-Authenticated-User: hagen@controller-1 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 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 Xref: news.gmane.org gmane.comp.tex.context:52255 Archived-At: Aditya Mahajan wrote: > On Wed, 12 Aug 2009, Andreas Harder wrote: > = >> >> Am 12.08.2009 um 07:40 schrieb Aditya Mahajan: >> >>> On Tue, 11 Aug 2009, Andreas Harder wrote: >>> >>>> Hi, >>>> >>>> I am trying to achieve the following: >>>> >>>> \setMPtext{1}{ABC} >>>> \setMPtext{2}{DEF} >>>> \setMPtext{3}{GHI} >>>> >>>> \starttext >>>> >>>> \startMPpage[offset=3D1ex,width=3D\paperwidth,height=3D\paperheight] >>>> for i=3D1 upto 3: >>>> draw textext(\MPstring{i}) shifted(i*cm,i*cm) ; >>>> endfor; >>>> \stopMPpage >>>> >>>> \stoptext >>>> >>>> There is no error but no content either. What's wrong? >>> >>> Another way to do this is to use >>> >>> \TeXtext{1}{ABC} etc. >>> >>> and then call >>> >>> draw sometxt(i) >>> >>> For Sec 4.5 of Mojca's my way on sometxt = >>> http://dl.contextgarden.net/myway/sometxt.pdf >> >> Thank you for the tip, I tried it, but sometext seems deprecated in = >> mkiv ("[do we need TeXtexts in MkIV]"). > = > I thought that you were using MKII. > = >> I've different buffers named 1=9612 and would like to pipe them to = >> Metapost. I thought I could use a textext(\getbuffer[i])-construct, it = >> failed. So I tried it with \setMPtext{}{} =85 >> >> What is the approach to achieve this? > = > Well, if nothing else works, you can always cheat. > = > \startluacode > userdata =3D userdata or {} > userdata.labels =3D { > [1] =3D "ABC" , > [2] =3D "DEF" , > [3] =3D "GHI" } > = > function userdata.shift(i) > return "(" .. i .. "cm ," .. i .. "cm )" > end > = > function userdata.draw(i) > return "draw btex " .. userdata.labels[i] .. " etex shifted ".. = > userdata.shift(i) .. ";" > end > = > \stopluacode > = > \starttext > = > \startluacode > context.startMPpage({offset =3D "1ex", width =3D [[\paperwidth]], heigh= t =3D = > [[\paperheight]]}) > for i =3D 1,3 do > context(userdata.draw(i)) > end > context.stopMPpage() > \stopluacode > = > \stoptext a nice example for the wiki 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 ----------------------------------------------------------------- ___________________________________________________________________________= ________ If your question is of interest to others as well, please add an entry to t= he Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-cont= ext webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________