#! /bin/bash -e


# Converts a plain text file to PDF with monospace font,
# Using LaTeX

usage="$0 [ -landscape | -portrait ] [-iso | -iso-latin-1 | -utf8 ] [ -8pt|-9pt|-10pt|-11pt|-12pt|-14pt|-17pt|-20pt ] [ -twocolumn ] < INFILE.txt > OUTFILE.pdf"

name="/tmp/ttp$$"

err="${name}.err"
pdf="${name}.pdf"

${STOLFIHOME}/lib/do-text-to-pdf.sh ${name} $* 

if [[ -s ${err} ]]; then
  cat ${err} 1>&2
  /bin/rm ${err}
elif [[ -s ${pdf} ]]; then
  echo "PDF generated ${pdf}" 1>&2
  /bin/cat ${pdf}
else
  echo "command failed" 1>&2
fi
#/bin/rm -f ${name}.{pdf,dvi,aux,log,err}
