summaryrefslogtreecommitdiff
path: root/svgtex.sh
diff options
context:
space:
mode:
Diffstat (limited to 'svgtex.sh')
-rwxr-xr-xsvgtex.sh15
1 files changed, 7 insertions, 8 deletions
diff --git a/svgtex.sh b/svgtex.sh
index b7c590b..04c372e 100755
--- a/svgtex.sh
+++ b/svgtex.sh
@@ -21,8 +21,7 @@ set -e
tmp=$(mktemp -p /tmp)
eqn=$(cat /dev/stdin)
-echo "---- begin assembly: ----"
-printf "%s\n" "$eqn"
+printf "[ok] \teqn: %s\n" "$eqn"
echo "\\\documentclass[10pt,fleqn]{standalone}
\\\usepackage{standalone,amsmath,amssymb,xcolor}
@@ -35,18 +34,18 @@ echo "\\\end{document}" >> $tmp
# now this is where the fun begins
-latex -interaction=batchmode $tmp
+latex -interaction=batchmode $tmp > /dev/null
-[ -f tmp.dvi ] || { echo "---- [FATAL] tex output failed ----" ; exit 1 ; } # make sure output exists before continuing
+[ -f tmp.dvi ] || { printf "%s \tFATAL: tex output failed\n" "[->]" ; exit 1 ; } # make sure output exists before continuing
-echo "[ok] tex finished typesetting"
+printf "[ok] \ttex finished typesetting\n"
-dvisvgm tmp.dvi -f ttf -T S2
+dvisvgm tmp.dvi -f ttf -T S2 > /dev/null 2>&1
-echo "[ok] conversion to svg"
+printf "[ok] \tconversion to svg\n"
mv tmp.svg $1 # final move to desired path
rm tmp.aux tmp.log tmp.dvi $tmp # cleanup
-echo "---- build complete: $1 ----"
+printf "%s \tbuild complete: %s\n" "[->]" "$1"