summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/support/latexmk/example_rcfiles/mpost_latexmkrc
blob: 5bcfeb0fdfd637e1b3894428a9d7dc2d6826029e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# This shows how to use mpost, as used by the feynmp package.
# The feynmp package writes files with extension .mp, e.g., foo.mp,
# and these are to be converted by mpost to make postscript files,
# e.g., foo.1, which are later read in by dvips.
#
# A more complicated custom dependency is needed than normal, because:
# if the output directory ($out_dir) or the auxiliary directory
# ($out_dir) is set, mpost doesn't put its output in the correct
# place.

add_cus_dep( 'mp', '1', 0, 'mpost' );


sub mpost {
    my $file = $_[0];
    my ($name, $path) =  fileparse( $file );
    my $return = system "mpost \"$file\"";
        # Fix the problem that mpost puts its output and log files
        # in the current directory, not in the auxiliary directory
        # (which is often the same as the output directory):
    if ( ($path ne '') && ($path ne '.\\') && ($path ne './') ) {
        foreach ( "$name.1", "$name.log" ) { move $_, $aux_dir; }
    }
    return $return;
}