2 -- There are two interfaces:
5 -- new * execute^1 * finish
8 mpx = mp.new({ini_version = true, command_line = "plain \\dump"})
13 dofile("/opt/tex/texmf-local/tex/context/base/l-table.lua");
16 local v = m:execute(s)
17 -- print ('<<term:'..v.term..'>>')
18 print ('<<log:'..v.log..'>>')
20 for _,gs in ipairs(v.fig) do
21 local b = gs:objects()
22 for _,vv in ipairs(b) do
23 print(vv, vv.type, table.serialize(vv.path), table.serialize(vv.color))
24 if vv.type == "text" then
25 print(vv.text, vv.font, vv.dsize, table.serialize(vv.transform))
28 -- print(gs:postscript())
33 -- chunks have to have 'complete file' nesting state
37 "p = (0,0){right}..(20,100)..(50,60)..(75,50)...(25,25)..cycle;",
38 "q = (0,0){right}..(20,100)..(50,60)..(75,50)...(25,25);",
39 "pickup pencircle scaled 2;",
40 "beginfig(1); fill p withcolor (1,0,0); draw p dashed evenly; endfig;",
41 [[beginfig(2); fill p withcolor (1,0,1); endfig;
42 beginfig(3); draw q withcolor (0,1,1); endfig;]],
43 "beginfig(4); label(\"stuff\", (0,0)); endfig;",
46 function finder (a,b,c)
48 if a == "mpost.map" then
49 return "/opt/tex/texmf-local/fonts/map/pdftex/pdftex.map"
51 if a =="cmr10.tfm" then
52 return "/opt/tex/texmf/fonts/tfm/public/cm/cmr10.tfm"
57 mpx = mp.new({mem_name = "plain.mem",
58 command_line = "\\relax ",
61 for _,l in ipairs(lines) do