diff options
author | Karl Berry <karl@freefriends.org> | 2022-03-17 20:30:35 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-03-17 20:30:35 +0000 |
commit | c389b7299225b11856320fa1561f9b1ca35bbc6b (patch) | |
tree | 924a04ffd988fc845b43e88880a21664b97340d5 /Master/texmf-dist/doc/support/latexmk/example_rcfiles/chapterbib-latexmkrc | |
parent | 3917441f015eb84d969489a2dfb8e0c85142d0c0 (diff) |
latexmk (17mar22) (branch)
git-svn-id: svn://tug.org/texlive/branches/branch2021.final@62768 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/support/latexmk/example_rcfiles/chapterbib-latexmkrc')
-rw-r--r-- | Master/texmf-dist/doc/support/latexmk/example_rcfiles/chapterbib-latexmkrc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Master/texmf-dist/doc/support/latexmk/example_rcfiles/chapterbib-latexmkrc b/Master/texmf-dist/doc/support/latexmk/example_rcfiles/chapterbib-latexmkrc index e5c2cb62501..5a613382d1c 100644 --- a/Master/texmf-dist/doc/support/latexmk/example_rcfiles/chapterbib-latexmkrc +++ b/Master/texmf-dist/doc/support/latexmk/example_rcfiles/chapterbib-latexmkrc @@ -26,11 +26,17 @@ sub bibtex_fix { if ( $base_bare eq $root ) { print "--- Will run bibtex on modified '$root.aux' file\n"; my $aux_mod_base = $base."-mod"; - local $out_fh = new FileHandle "> $aux_mod_base$ext"; + + # Open output (modified aux file) here rather than in fix_aux, and + # make the relevant variables local. This is instead opening both + # files in fix_aux itself. The reason: fix_aux calls itself + # recursively, but must always write to the same file. + open( local $out_fh, ">", $aux_mod_base$ext ); if (!$out_fh) { die "Cannot write to '$aux_mod_base$ext'\n"; } local $level = 0; fix_aux( $source ); close $out_fh; + # Override source, dest, and basenames, since they are to have the path given # in the arguments to this subroutine, instead of the path given in the # corresponding names in the rule. Latexmk may change directory before @@ -51,7 +57,7 @@ sub fix_aux { # removing \bibdata and \bibstyle lines that were in included .aux files. my $aux_file = $_[0]; print "Processing '$aux_file'\n"; - my $aux_fh = new FileHandle $aux_file; + open( my $aux_fh, "<", $aux_file ); if (!$aux_fh) { die "$My_name: Couldn't read aux file '$aux_file'\n"; } $level++; while (<$aux_fh>) { |