Hi, can someone show me a minimal example of how to embed a MetaPost figure into a (La)TeX document using LuaTeX (along the lines of embedded MetaPost code in ConTeXt)? Provided that that's the goal of mplib, of course... I'm using the latest LuaTeX as of today (0.40.6 beta). This is where I've got so far: \documentclass{article} \usepackage[english,italian]{babel} \begin{document} \directlua{ local mplib = require('mplib') local mp = mplib.new ({ ini_version = false, mem_name = 'plain' }) if mp then local l = mp:execute([[ beginfig(1); fill fullcircle scaled 20; endfig; ]]) if l and l.fig then print (l.fig[1]:postscript()) end mp:finish(); end } \end{document} This compiles successfully (with pdflualatex), but it does not generate any output figure. How do I generate an output figure and/or how do I include it into the document? Besides, is it possible to use mplib with Lua (not LuaTeX)? If so, how? Thanks, Nicola
Nicola a écrit :
Hi, can someone show me a minimal example of how to embed a MetaPost figure into a (La)TeX document using LuaTeX (along the lines of embedded MetaPost code in ConTeXt)?
Hi, you should take a look at luamplib (http://tug.ctan.org/tex-archive/macros/luatex/generic/luamplib/). Thank you, -- Elie
In article <4A47CC3E.9030109@telecom-bretagne.eu>,
Elie Roux
Nicola a écrit :
Hi, can someone show me a minimal example of how to embed a MetaPost figure into a (La)TeX document using LuaTeX (along the lines of embedded MetaPost code in ConTeXt)?
Hi,
you should take a look at luamplib (http://tug.ctan.org/tex-archive/macros/luatex/generic/luamplib/).
Thanks, that looks exactly like what I was after. Regards, Nicola
participants (2)
-
Elie Roux
-
Nicola