summary refs log tree commit diff
path: root/pkgs/misc/tex/nix/run-latex.sh
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/misc/tex/nix/run-latex.sh')
-rw-r--r--pkgs/misc/tex/nix/run-latex.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/pkgs/misc/tex/nix/run-latex.sh b/pkgs/misc/tex/nix/run-latex.sh
index 58c7cac302f..6c18721eed6 100644
--- a/pkgs/misc/tex/nix/run-latex.sh
+++ b/pkgs/misc/tex/nix/run-latex.sh
@@ -68,11 +68,15 @@ 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)
-        bibtex --terse $auxBase
-        cp $auxBase.bbl $out
-        runNeeded=1
+        if [ -e $auxBase.bbl ]; then
+            echo "SKIPPING BIBTEX ON $auxFile!"
+        else
+            echo "RUNNING BIBTEX ON $auxFile..."
+            bibtex --terse $auxBase
+            cp $auxBase.bbl $out
+            runNeeded=1
+        fi
         echo
     fi