Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
    
It would be useful if you showed an example that fails. –  egreg Mar 12 '12 at 20:52

1 Answer 1

up vote 5 down vote accepted

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.

share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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