Sign up ×
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.

This question already has an answer here:

Is it possible to tell latexmk to execute mpost after each compilation run if has changed?

I tried to create a custom latexmkrc rule:

add_cus_dep('mp', '1', 0, 'mpost');
sub mpost {
 system "mpost $name" ;
 return 0;

But this does not seem to work

share|improve this question

marked as duplicate by Heiko Oberdiek, dustin, Claudio Fiandrino, Guido, m0nhawk Sep 16 '13 at 15:31

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

This code is copied from part of the answer to another question, at, but some lines which are essential to make the code work are missing. – John Collins Dec 7 '11 at 16:00

1 Answer 1

This seems to work:

add_cus_dep('mp', '1', 0, 'mpost');
sub mpost {
 return system("mpost $_[0].mp");

See answer to question on latexmk and feynmp for a more complete solution.

share|improve this answer
@JohnCollins Thanks for the edit – egreg Dec 7 '11 at 21:42

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