summaryrefslogtreecommitdiff
path: root/default.svg.do
diff options
context:
space:
mode:
Diffstat (limited to 'default.svg.do')
-rw-r--r--default.svg.do19
1 files changed, 13 insertions, 6 deletions
diff --git a/default.svg.do b/default.svg.do
index 403fd2d..76a3b0b 100644
--- a/default.svg.do
+++ b/default.svg.do
@@ -1,12 +1,17 @@
1redo-ifchange $2.expr build/preview/preview.sty build/preview/prtightpage.def build/preamble.tex 1redo-ifchange $2.expr build/preview/preview.sty build/preview/prtightpage.def build/preamble.tex
2INPUT=$(realpath $2.expr) 2INPUT=$(realpath $2.expr)
3TDIR=$(mktemp -d --tmpdir=/tmp) 3TDIR=$(mktemp -d --tmpdir=/tmp)
4PREAMBLE=$(realpath build/preamble.tex)
4 5
5cp build/preview/preview.sty build/preview/prtightpage.def build/preamble.tex $TDIR 6pushd $(dirname $2) >/dev/null
7TEXDIR=$(pwd)
8popd >/dev/null
6 9
7pushd $TDIR 10cp build/preview/preview.sty build/preview/prtightpage.def $TDIR
8latex -jobname=image <<EOF 11
9\input{preamble.tex} 12pushd $TDIR >/dev/null
13latex -jobname=image >/dev/null <<EOF
14\input{$PREAMBLE}
10\begin{document} 15\begin{document}
11\begin{preview} 16\begin{preview}
12\( 17\(
@@ -15,7 +20,9 @@ latex -jobname=image <<EOF
15\end{preview} 20\end{preview}
16\end{document} 21\end{document}
17EOF 22EOF
18popd
19 23
20dvisvgm --exact --no-fonts -o $3 $TDIR/image.dvi 2>&1 | sed -e '/depth=/!d;s/^.*depth=\(.*\)$/\1/' > $(dirname $2)/vertical-align 24dvisvgm --exact --no-fonts $TDIR/image.dvi 2>&1 | sed -e '/depth=/!d;s/^.*depth=\(.*\)$/\1/' > $TEXDIR/vertical-align
25cat $TDIR/image.svg
26popd >/dev/null
27
21rm -rf $TDIR \ No newline at end of file 28rm -rf $TDIR \ No newline at end of file