nsbin/old/latex2pdf
Nico Schottelius 844c1b8170 more cleanups
Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
2009-12-29 18:25:27 +01:00

35 lines
831 B
Bash
Executable file

#!/bin/sh
# Date: 04-04-04 (04-April 2004)
# Last Changed: 04-04-04 (04-April 2004)
# Author: Nico Schottelius <Nico-linux AT Schottelius DOT Org>
# Description: Convert latex to pdf with support for tableofcontents
#
if [ $# -lt 1 ]; then
echo `basename $0`': file(s) (may ommit .tex extension)'
echo 'Hey, hey guy, what to convert ?'
exit 1
fi
for mfile in $@; do
# .texfile
if [ -f "$mfile" ]; then
texfile="$mfile"
dvifile="${mfile%.tex}"
else
if [ -f "$mfile".tex ]; then
texfile="$mfile".tex
dvifile="$mfile"
fi
fi
if [ -z "$texfile" ]; then
echo "No such file: $mfile. Skip."
break
fi
# use three times (table of contents problem)
latex "$texfile" && latex "$texfile" && latex "$texfile" && dvipdfm -p a4 "$dvifile"
done