latex-generate-pdf.sh improved