I installed texlive-metapost in Linux Mint (similar to Ubuntu), and each time I compile a MetaPost figure which contains a label, the compiler finishes the job, but the picture is not saved as ps, i.e. I cannot open it. I am thinking that maybe mpost does not compile latex formulas, but the compiler still doesn't give a result even when the formulas do not contain Latex. What is the problem, and what can I do?

I noticed that in the online live previewer which can be found here the mp file compiles with no problems. Is there a similar compiler for MetaPost, which can be installed (for which you write the code in the left side and in the right side you get the preview, like Gummi?)?

Thank you.

  • It would be useful if you showed an example that fails. – egreg Mar 12 '12 at 20:52

MetaPost will not typeset the labels, that task is handed over to TeX. Make sure, you have TeX set up in your metapost file. Here's a simple example that typesets the labels with LaTeX and prints "Hello World!". Save the file as file.mp and run it through MetaPost.


beginfig (1)
        label(btex Hello World! etex, origin);

Here's an example that typesets the labels with ConTeXt (save the file as file.tex and run context file).

        label(textext("Hello World!"), origin);

This should get you started.

  • Do you know why those lines are needed? For example, first I added everything but the line prologues:=3 and the figure did not compile. verbatimtex is a tex distribution? Thank you for your help :) – Beni Bogosel Mar 12 '12 at 21:03
  • @BeniBogosel: For information about verbatimtex see the MetaPost man page, for ConTeXt related stuff see the Mpgraphic wiki and for the prologues have a look at chapter 8.1 in the MetaPost manual. – Marco Mar 12 '12 at 21:57

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.