4

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

Torbjørn T.
  • 206,688
Mike
  • 41
  • This code is copied from part of the answer to another question, at http://tex.stackexchange.com/a/37350/8495, but some lines which are essential to make the code work are missing. – John Collins Dec 07 '11 at 16:00

1 Answers1

4

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.

egreg
  • 1,121,712