Added latexps.
authorFredrik Tolf <fredrik@dolda2000.com>
Sun, 26 Nov 2017 20:06:58 +0000 (21:06 +0100)
committerFredrik Tolf <fredrik@dolda2000.com>
Sun, 26 Nov 2017 20:06:58 +0000 (21:06 +0100)
latexps [new file with mode: 0755]

diff --git a/latexps b/latexps
new file mode 100755 (executable)
index 0000000..852b87b
--- /dev/null
+++ b/latexps
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+set -e
+
+inf=-
+ouf=-
+
+dir="$(mktemp -d /tmp/latex.XXXXXX)"
+trap 'rm -r "$dir"' EXIT
+
+cat "$inf" >"$dir/file.tex"
+
+for pass in 1 2; do
+    (cd "$dir"; latex file.tex >&2)
+done
+
+(cd "$dir"; dvips file)
+
+if [ "$ouf" = - ]; then
+    cat "$dir/file.ps"
+else
+    cat "$dir/file.ps" >"$ouf"
+fi