# [NTG-context] mplib errors

Olivier billet at eurecom.fr
Wed Oct 1 15:57:12 CEST 2008

Hi Taco,

> Running mplib is easy enough to document, but that is only a part of
> the work: you also have to convert the image to pdf literals, and
> that is more work than I would like to put in the manual.

OK. It could be nice then to simply state this?

> Anyway, attached is a bunch of definitions I stripped out of context
> that will allow you to run mplib in plain tex provided that you also
> have context installed (you need mlib-pdf.lua for the PDF conversion)

Thanks a lot for these. With these hints I am now able to compile
metapost figs from conTeXt through "texexec --luatex" normaly.
To this end, I had to perform two tweaks:

* the files mlib-run.lua, mlib-ctx.lua, and mlib-pdf.lua were *NEVER*
\directlua0 { dofile
("/usr/share/texmf/tex/context/base/mlib-ctx.lua") }
\directlua0 { dofile
("/usr/share/texmf/tex/context/base/mlib-run.lua") }
\directlua0 { dofile
("/usr/share/texmf/tex/context/base/mlib-pdf.lua") }

* the format was generated correctly but loaded incorrectly:
ini_version = false,
in the metapost.load function in the mlib-run.lua file.

Now everything is OK.  The second thing (an misfortunate typo) is easy
to fix.  However, the fact that mlib-*.lua are never loaded is more worrying:
any idea where this error comes from?

Hope this will help Hans as well.

Cheers,
Olivier