From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/52238 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: =?utf-8?q?loop_textext_and_=5CMPstring=7B=E2=80=A6?= =?utf-8?q?=7D?= Date: Wed, 12 Aug 2009 09:25:33 -0400 (EDT) Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-1028696345-1250083533=:18834" X-Trace: ger.gmane.org 1250083566 29919 80.91.229.12 (12 Aug 2009 13:26:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Aug 2009 13:26:06 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Aug 12 15:25:59 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 1MbDq2-00074Q-OY for gctc-ntg-context-518@m.gmane.org; Wed, 12 Aug 2009 15:25:58 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 209D1C9AF9; Wed, 12 Aug 2009 15:25:54 +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 s1FNnnsIB884; Wed, 12 Aug 2009 15:25:52 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E5BCEC9AC1; Wed, 12 Aug 2009 15:25:51 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 0BF3DC9AC1 for ; Wed, 12 Aug 2009 15:25:51 +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 hDyI+++2nqEb for ; Wed, 12 Aug 2009 15:25:48 +0200 (CEST) Original-Received: from skycaptain.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.93.160]) by balder.ntg.nl (Postfix) with ESMTP id 48663C9AB7 for ; Wed, 12 Aug 2009 15:25:48 +0200 (CEST) Original-Received: FROM wireless-165-124-139-37.nuwlan.northwestern.edu (wireless-165-124-139-37.nuwlan.northwestern.edu [165.124.139.37]) By skycaptain.mr.itd.umich.edu ID 4A82C2DA.D9A09.6970 ; Authuser adityam; 12 Aug 2009 09:25:46 EDT In-Reply-To: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) 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:52238 Archived-At: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-1028696345-1250083533=:18834 Content-Type: TEXT/PLAIN; charset=windows-1252; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE 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: >>=20 >>> Hi, >>>=20 >>> I am trying to achieve the following: >>>=20 >>> \setMPtext{1}{ABC} >>> \setMPtext{2}{DEF} >>> \setMPtext{3}{GHI} >>>=20 >>> \starttext >>>=20 >>> \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 >>>=20 >>> \stoptext >>>=20 >>> There is no error but no content either. What's wrong? >>=20 >> Another way to do this is to use >>=20 >> \TeXtext{1}{ABC} etc. >>=20 >> and then call >>=20 >> draw sometxt(i) >>=20 >> For Sec 4.5 of Mojca's my way on sometxt=20 >> http://dl.contextgarden.net/myway/sometxt.pdf > > Thank you for the tip, I tried it, but sometext seems deprecated in mkiv= =20 > ("[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 Metapo= st. I=20 > thought I could use a textext(\getbuffer[i])-construct, it failed. So I t= ried=20 > 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 "..=20 userdata.shift(i) .. ";" end \stopluacode \starttext \startluacode context.startMPpage({offset =3D "1ex", width =3D [[\paperwidth]], height= =3D=20 [[\paperheight]]}) for i =3D 1,3 do context(userdata.draw(i)) end context.stopMPpage() \stopluacode \stoptext Aditya --8323328-1028696345-1250083533=:18834 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --8323328-1028696345-1250083533=:18834--