* 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
This commit is contained in:
parent
af5952eb0b
commit
20912b654b
@ -53,7 +53,7 @@ rec {
|
|||||||
# The type denotes the kind of dependency, which determines
|
# The type denotes the kind of dependency, which determines
|
||||||
# what extensions we use to look for it.
|
# what extensions we use to look for it.
|
||||||
deps = import (pkgs.runCommand "latex-includes"
|
deps = import (pkgs.runCommand "latex-includes"
|
||||||
{ src = key; }
|
{ rootFile = baseNameOf (toString rootFile); src = key; }
|
||||||
"${pkgs.perl}/bin/perl ${./find-includes.pl}");
|
"${pkgs.perl}/bin/perl ${./find-includes.pl}");
|
||||||
|
|
||||||
# Look for the dependencies of `key', trying various
|
# Look for the dependencies of `key', trying various
|
||||||
|
@ -45,6 +45,7 @@ while (<FILE>) {
|
|||||||
$bib =~ s/^\s+//; # remove leading / trailing whitespace
|
$bib =~ s/^\s+//; # remove leading / trailing whitespace
|
||||||
$bib =~ s/\s+$//;
|
$bib =~ s/\s+$//;
|
||||||
addName "misc", "$bib.bib";
|
addName "misc", "$bib.bib";
|
||||||
|
addName "misc", (basename($ENV{"rootFile"}, ".tex", ".ltx") . ".bbl");
|
||||||
}
|
}
|
||||||
} elsif (/\\includegraphics(\[.*\])?\{(.*)\}/) {
|
} elsif (/\\includegraphics(\[.*\])?\{(.*)\}/) {
|
||||||
my $fn2 = $2;
|
my $fn2 = $2;
|
||||||
|
@ -68,11 +68,15 @@ for auxFile in $(find . -name "*.aux"); do
|
|||||||
# Run bibtex to process all bibliographies. There may be several
|
# Run bibtex to process all bibliographies. There may be several
|
||||||
# when we're using the multibib package.
|
# when we're using the multibib package.
|
||||||
if grep -q '\\citation' $auxFile; then
|
if grep -q '\\citation' $auxFile; then
|
||||||
echo "RUNNING BIBTEX ON $auxFile..."
|
|
||||||
auxBase=$(basename $auxFile .aux)
|
auxBase=$(basename $auxFile .aux)
|
||||||
bibtex --terse $auxBase
|
if [ -e $auxBase.bbl ]; then
|
||||||
cp $auxBase.bbl $out
|
echo "SKIPPING BIBTEX ON $auxFile!"
|
||||||
runNeeded=1
|
else
|
||||||
|
echo "RUNNING BIBTEX ON $auxFile..."
|
||||||
|
bibtex --terse $auxBase
|
||||||
|
cp $auxBase.bbl $out
|
||||||
|
runNeeded=1
|
||||||
|
fi
|
||||||
echo
|
echo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user