Tell me more ×
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.

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

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

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.