Sophie

Sophie

distrib > Fedora > 18 > i386 > by-pkgid > cd7d0ba81c9ec04c8d786ade2e67e2dd > files > 17

latexmk-4.37-1.fc18.noarch.rpm

# 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;
}