nixpkgs/pkgs/misc/tex/nix/run-latex.sh
Eelco Dolstra 6ce80304a5 * Handle subdirectories (e.g., \input{foo/bar.tex}). We don't yet
handle relative paths to parent directories (../foo/bar.tex).  This
  can be handled as was done in
  https://svn.cs.uu.nl:12443/repos/trace/nix/trunk/make/lib/compile-c.sh.
  The `copy-includes.pl' script is generic (not LaTeX specific), so it
  should eventually replace most of compile-c.sh and any future
  builders that have to set up a tree of symlinks to simulate the
  original directory hierarchy of the sources.

svn path=/nixpkgs/trunk/; revision=3220
2005-06-20 15:06:58 +00:00

42 lines
698 B
Bash

. $stdenv/setup
ensureDir $out
perl $copyIncludes $includes
#for i in $includes; do
# if test -d $i; then
# cp $i/* .
# else
# cp $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 '\\bibitem' $rootNameBase.bbl; 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