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=1ex,width=\paperwidth,height=\paperheight] >>> for i=1 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–12 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{}{} … > > What is the approach to achieve this? Well, if nothing else works, you can always cheat. \startluacode userdata = userdata or {} userdata.labels = { [1] = "ABC" , [2] = "DEF" , [3] = "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 = "1ex", width = [[\paperwidth]], height = [[\paperheight]]}) for i = 1,3 do context(userdata.draw(i)) end context.stopMPpage() \stopluacode \stoptext Aditya