nixpkgs/pkgs/misc/tex/nix/run-latex.sh
Eelco Dolstra 3919b35495 * Add a dot2pdf function.
svn path=/nixpkgs/trunk/; revision=3232
2005-06-20 22:43:35 +00:00

43 lines
696 B
Bash

. $stdenv/setup
ensureDir $out
perl $copyIncludes $includes
for i in $extraFiles; do
if test -d $i; then
ln -s $i/* .
else
ln -s $i $(stripHash $i; echo $strippedName)
fi
done
rootName=$(basename $(stripHash "$rootFile"; echo $strippedName))
echo "root name is $rootName"
rootNameBase=$(echo "$rootName" | sed 's/\..*//')
if test -n "$generatePDF"; then
latex=pdflatex
else
latex=latex
fi
$latex $rootName
if grep -q '\\citation' $rootNameBase.aux; then
bibtex $rootNameBase
fi
$latex $rootName
makeindex $rootNameBase.idx
$latex $rootName
if test -n "$generatePDF"; then
cp $rootNameBase.pdf $out
else
cp $rootNameBase.dvi $out
fi