[metapost] Metafun + plainLuaTeX/LuaLaTeX

Hans Hagen pragma at wxs.nl
Sun Jul 31 22:41:09 CEST 2011


On 31-7-2011 9:48, Arno Trautmann wrote:

> May I ask why MetaFun depends on ConTeXt? In my simple world, MetaFun is
> just a collection of macros for MetaPost, so I don't see where the TeX
> format comes in.

Sure, most of the metapost macros can be used, but it happens that 
metafun has a bit more: colorspaces, shading, transparency, advance text 
support, external images, bitmaps, etc. Soem of these could probably be 
supported in other macro packages as well, given that there is glue 
code, which there isn't.

In context mkiv running mp is even more integrated and no longer 
external runs are needed. For this some (hidden) management is needed as 
well as runtime conversion to pdf. Again this integrates nicely in the 
core code.

> That would be applicable in, say, a private document. However, I'd like
> to use it in a package, so in the end the user should only need to say a
> TeX command and it should result in a MetaPost graphic. And this should
> be independent of the TeX format and not require an extra context run
> (as this would need shell-escape).

> So from your answer I conclude that an extra context run is the best
> way; however, is there another way for me, even if some macro are
> missing then?

Well, you could try to make a metafun format and see if that works for 
you. There is also luatex-mplib.tex that you can load and then set 
mplibformat to metafun and see what happens. I never tested it. Another 
option is to load mp-tool.mp in your mp code, as that's probably the 
only part of metafun that makes sense outside context. (Other modules 
concern text processing, complex backgrounds behind text, color spaces, 
shading etc.) Maybe at some point I will make a split in the code (just 
as we have a split in the context tex code, where the pdftex/xetex and 
luatex code base is now completely independent).

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the metapost mailing list