diff --git a/pkgs/misc/tex/nix/run-latex.sh b/pkgs/misc/tex/nix/run-latex.sh index 1db41f3c336..58c7cac302f 100644 --- a/pkgs/misc/tex/nix/run-latex.sh +++ b/pkgs/misc/tex/nix/run-latex.sh @@ -64,9 +64,9 @@ runLaTeX echo -# Run bibtex to process all bibliographies. There may be several when -# we're using the multibib package. for auxFile in $(find . -name "*.aux"); do + # Run bibtex to process all bibliographies. There may be several + # when we're using the multibib package. if grep -q '\\citation' $auxFile; then echo "RUNNING BIBTEX ON $auxFile..." auxBase=$(basename $auxFile .aux) @@ -75,6 +75,12 @@ for auxFile in $(find . -name "*.aux"); do runNeeded=1 echo fi + + # "\pgfsyspdfmark" in the aux file seems to indicate that PGF/TikZ + # requires a second run (e.g. to resolve arrows between pictures). + if grep -q pgfsyspdfmark $auxFile; then + runNeeded=1 + fi done