# Metapost compiler freezes when I add labels

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.

prologues:=3;
verbatimtex
%&latex
\documentclass{minimal}
\begin{document}
etex

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


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

\starttext
\startMPpage
label(textext("Hello World!"), origin);
\stopMPpage
\stoptext


This should get you started.

-
Thank you. That solved the problem :) –  Beni Bogosel Mar 12 '12 at 20:58
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
Thank you very much –  Beni Bogosel Mar 12 '12 at 22:52