From 89003325812a10228992bed715bd1e1ff98e7831 Mon Sep 17 00:00:00 2001 From: eeva Date: Mon, 6 Mar 2017 19:08:42 +0100 Subject: [PATCH] Build old latex documents --- scripts/prefix/bin/latex2pdf.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 scripts/prefix/bin/latex2pdf.sh diff --git a/scripts/prefix/bin/latex2pdf.sh b/scripts/prefix/bin/latex2pdf.sh new file mode 100755 index 0000000..b4cd73d --- /dev/null +++ b/scripts/prefix/bin/latex2pdf.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +if [[ $# -lt 1 ]] +then + echo "This script requires a .tex file" +fi + +FILENAME=$(basename $1 .tex) + +if ! latex ${FILENAME}.tex +then + exit 1 +fi + +if ! dvips -t a4 ${FILENAME}.dvi +then + exit 2 +fi + +if ! ps2pdf ${FILENAME}.ps +then + exit 3 +fi + +rm ${FILENAME}.dvi +rm ${FILENAME}.ps +rm ${FILENAME}.log +rm ${FILENAME}.aux