diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/latexmk/example_rcfiles/clean_pattern_latexmkrc |
Initial commit
Diffstat (limited to 'support/latexmk/example_rcfiles/clean_pattern_latexmkrc')
-rw-r--r-- | support/latexmk/example_rcfiles/clean_pattern_latexmkrc | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/support/latexmk/example_rcfiles/clean_pattern_latexmkrc b/support/latexmk/example_rcfiles/clean_pattern_latexmkrc new file mode 100644 index 0000000000..b15507c623 --- /dev/null +++ b/support/latexmk/example_rcfiles/clean_pattern_latexmkrc @@ -0,0 +1,30 @@ +# To allow more general pattern in $clean_ext instead of just an +# extension or something containing %R. +# This is done by overriding latexmk's cleanup1 subroutine. + +# Here is an example of a usefule application: +$clean_ext = "*-eps-converted-to.pdf"; + +sub cleanup1 { + # Usage: cleanup1( directory, pattern_or_ext_without_period, ... ) + # + # The directory is a fixed name, so I must escape any glob metacharacters + # in it: + print "========= MODIFIED cleanup1 cw latexmk v. 4.39 and earlier\n"; + my $dir = fix_pattern( shift ); + + # Change extensions to glob patterns + foreach (@_) { + # If specified pattern is pure extension, without period, + # wildcard character (?, *) or %R, + # then prepend it with directory/root_filename and period to + # make a full file specification + # Else leave the pattern as is, to be used by glob. + # New feature: pattern is unchanged if it contains ., *, ? + (my $name = (/%R/ || /[\*\.\?]/) ? $_ : "%R.$_") =~ s/%R/$dir$root_filename/; + unlink_or_move( glob( "$name" ) ); + } +} #END cleanup1 + + + |