* Scan for BibTeX files included by \bibliography.
* Automatically run BibTeX when necessary (i.e., when there are \citations in the aux file). svn path=/nixpkgs/trunk/; revision=3222
This commit is contained in:
parent
6ce80304a5
commit
fe0981babd
@ -15,8 +15,6 @@ for (my $n = 0; $n < @ARGV; $n += 2) {
|
||||
my $fullPath = $ARGV[$n];
|
||||
my $relPath = $ARGV[$n + 1];
|
||||
|
||||
print "$fullPath <- $relPath\n";
|
||||
|
||||
createDirs $relPath;
|
||||
|
||||
symlink $fullPath, $relPath or die "cannot create symlink `$relPath'";
|
||||
|
@ -33,6 +33,9 @@ rec {
|
||||
args = [ ./find-includes.pl ];
|
||||
|
||||
rootFile = toString rootFile; # !!! hacky
|
||||
|
||||
# Forces rebuilds.
|
||||
hack = __currentTime;
|
||||
};
|
||||
|
||||
}
|
@ -50,7 +50,13 @@ while (scalar @workset > 0) {
|
||||
my $fn2 = $2;
|
||||
die "absolute path! $fn2" if substr($fn2, 0, 1) eq "/";
|
||||
push @workset, $path . "/" . $fn2 . ".cls";
|
||||
}
|
||||
} elsif (/\\bibliography\{(.*)\}/) {
|
||||
foreach my $bib (split /,/, $1) {
|
||||
$bib =~ s/^\s+//; # remove leading / trailing whitespace
|
||||
$bib =~ s/\s+$//;
|
||||
push @workset, $path . "/" . $bib . ".bib";
|
||||
}
|
||||
}
|
||||
# !!! also support \usepackage
|
||||
}
|
||||
|
||||
|
@ -25,9 +25,9 @@ fi
|
||||
|
||||
$latex $rootName
|
||||
|
||||
if grep -q '\\bibitem' $rootNameBase.bbl; then
|
||||
if grep -q '\\citation' $rootNameBase.aux; then
|
||||
bibtex $rootNameBase
|
||||
fi
|
||||
fi
|
||||
|
||||
$latex $rootName
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user