From 5689d7338e3ace6ed2f59809c629e6a8f92fe4b0 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 8 Jan 2009 09:54:04 +0000 Subject: [PATCH] * Support LaTeX documents that have multiple bibliographies (using the multibib package). svn path=/nixpkgs/trunk/; revision=13723 --- pkgs/misc/tex/nix/run-latex.sh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/pkgs/misc/tex/nix/run-latex.sh b/pkgs/misc/tex/nix/run-latex.sh index 0b6e29988fe..ecce893950b 100644 --- a/pkgs/misc/tex/nix/run-latex.sh +++ b/pkgs/misc/tex/nix/run-latex.sh @@ -61,13 +61,18 @@ runLaTeX echo -if grep -q '\\citation' $rootNameBase.aux; then - echo "RUNNING BIBTEX..." - bibtex --terse $rootNameBase - cp $rootNameBase.bbl $out - runNeeded=1 - echo -fi +# Run bibtex to process all bibliographies. There may be several when +# we're using the multibib package. +for auxFile in $(find . -name "*.aux"); do + if grep -q '\\citation' $auxFile; then + echo "RUNNING BIBTEX ON $auxFile..." + auxBase=$(basename $auxFile .aux) + bibtex --terse $auxBase + cp $auxBase.bbl $out + runNeeded=1 + echo + fi +done if test "$runNeeded"; then