2 -- There are two interfaces:
5 -- new * execute^1 * finish
8 mpx = mp.new({ini_version = true, command_line = "plain \\dump"})
14 local v = m:execute(s)
15 -- print ('<<term:'..v.term..'>>')
16 print ('<<log:'..v.log..'>>')
18 for _,gs in ipairs(v.fig) do
19 -- print(gs:postscript())
24 -- chunks have to have 'complete file' nesting state
28 "p = (0,0){right}..(20,100)..(50,60)..(75,50)...(25,25)..cycle;",
29 "pickup pencircle scaled 2;",
30 "beginfig(1); fill p withcolor (1,0,0); draw p dashed evenly; endfig;",
31 "beginfig(2); fill p withcolor (0,1,0); draw p dashed evenly; endfig;",
32 "beginfig(3); fill p withcolor (0,0,1); draw p dashed evenly; endfig;",
33 "beginfig(4); fill p withcolor (1,1,0); draw p dashed evenly; endfig;",
34 [[beginfig(5); fill p withcolor (1,0,1); draw p dashed evenly; endfig;
35 beginfig(6); fill p withcolor (0,1,1); draw p dashed evenly; endfig;]],
36 "beginfig(7); label(\"stuff\", (0,0)); endfig;",
39 function finder (a,b,c)
41 if a == "mpost.map" then
42 return "/opt/tex/texmf-local/fonts/map/pdftex/pdftex.map"
44 if a =="cmr10.tfm" then
45 return "/opt/tex/texmf/fonts/tfm/public/cm/cmr10.tfm"
50 mpx = mp.new({mem_name = "plain.mem",
51 command_line = "\\relax ",
54 for _,l in ipairs(lines) do