summary refs log tree commit diff
path: root/pkgs/misc/tex/nix/run-latex.sh
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2011-03-26 00:14:28 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2011-03-26 00:14:28 +0000
commit20912b654bd125c0c33ba78f04d4001e3d1a059d (patch)
tree84eb506871d0999999238fa9ff3ab92c668bda05 /pkgs/misc/tex/nix/run-latex.sh
parentaf5952eb0b75956b92dfd21df1660a1a84c4c81a (diff)
downloadnixpkgs-20912b654bd125c0c33ba78f04d4001e3d1a059d.tar
nixpkgs-20912b654bd125c0c33ba78f04d4001e3d1a059d.tar.gz
nixpkgs-20912b654bd125c0c33ba78f04d4001e3d1a059d.tar.bz2
nixpkgs-20912b654bd125c0c33ba78f04d4001e3d1a059d.tar.lz
nixpkgs-20912b654bd125c0c33ba78f04d4001e3d1a059d.tar.xz
nixpkgs-20912b654bd125c0c33ba78f04d4001e3d1a059d.tar.zst
nixpkgs-20912b654bd125c0c33ba78f04d4001e3d1a059d.zip
* runLaTeX: detect the existence of a pre-generated .bbl file and use
  it.  Useful if you're supposed to stick a \balancecolumns in the
  middle of the file.

svn path=/nixpkgs/trunk/; revision=26522
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