[metapost] Metafun + plainLuaTeX/LuaLaTeX
Arno Trautmann
Arno.Trautmann at gmx.de
Mon Aug 1 09:43:02 CEST 2011
Hans Hagen wrote:
> 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.
It sounds like an interesting project to try and separate all this code
… especially since shading and transparency are the features I'd like most.
>> 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).
Thank you very much for your expanations!
Now, if I would like to really try to do what you're suggesting –
hypothetically speaking – what else should I know? What is the best
starting point to understand in which way MetaFun is coded in ConTeXt
and most important – is all the code in TeX live 2011? Or do I need
something separate from standalone? luatex-mplib.tex e.g. seems not to
be in my TL 2011. (Yes, I am willing to put some time and effort into
this …)
cheers
Arno
More information about the metapost
mailing list