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.

This question already has an answer here:

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

I tried to create a custom latexmkrc rule:

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

But this does not seem to work

share|improve this question
    
This code is copied from part of the answer to another question, at tex.stackexchange.com/a/37350/8495, but some lines which are essential to make the code work are missing. –  John Collins Dec 7 '11 at 16:00
add comment

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.

1 Answer

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
1  
@JohnCollins Thanks for the edit –  egreg Dec 7 '11 at 21:42
add comment

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