How can I install the metafun metapost macros?

I have tried to tlmgr install metafun, but it cannot find it. Also a search for “metafun” on ctan yields only a introductory tutorial on ConTeXt, in Chinese.

I remember I’ve had it installed previously, so I did a search for it on my OSX: find /usr/local/texlive -name metafun\*, which listed the file metafun.mem from an earlier TLBasic2010 directory hierachy under texmf-var/web2c/metapost/metafun.mem. (I am now using TL2012Basic)

I thought I could just copy it to my local texmf tree under ~/Library/texmf/metapost, but

mpost --mem=metafun.mem file.mp

says it cannot find it.

So I would like to ask a) where can I find it on the internet, and b) where do I put the file so that metapost can find it?

  • 3
    Metapost in TeX Live 2012 doesn't read .mem files any more. Metafun is part of ConTeXt, so you need tlmgr install context; you call metafun with mpost --mem=metafun (no .mem extension required). – egreg Jan 15 '13 at 14:20
  • Thanks @egreg! Now I don't get any error about mpost not finding the metafun. Do you know if I need to still do something, because when I run the command as you showed, I don't see metapost loading the file (only: Preloading the plain mem file, version 1.004). Also I get an error when trying to call, what I presume, a metafun function drawpoints. – morbusg Jan 15 '13 at 16:24
  • I've added an answer showing that the necessary file are indeed read in; about drawpoints I really don't know: it is defined in mp-tool.mpii, but the details about it are surely in the documentation that you should be able to find at the Pragma-ADE site: pragma-ade.com/general/manuals/metafun-p.pdf – egreg Jan 15 '13 at 16:48

The metafun macros for Metapost are part of ConTeXt, so you need

tlmgr install context

For calling metafun from the command line, you can say

mpost --mem=metafun <filename>

although mpost doesn't load any more .mem files but instead inputs the corresponding files that would have been used for building the format, in this case metafun.mp. Indeed, if I try on a test file

mpost --mem=metafun test

I get in the log file

This is MetaPost, version 1.504 (kpathsea version 6.1.0)  15 JAN 2013 17:43
Preloading the plain mem file, version 0.63)

and this shows that the right files are loaded.

  • Thanks! Now I can see also those files being included when I run mpost. I’m not sure why it didn’t work earlier (maybe because of a same named tex-file along with using mptopdf), but now all is good. :-) – morbusg Jan 15 '13 at 17:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.