diff options
Diffstat (limited to 'default.svg.do')
-rw-r--r-- | default.svg.do | 19 |
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 @@ | |||
1 | redo-ifchange $2.expr build/preview/preview.sty build/preview/prtightpage.def build/preamble.tex | 1 | redo-ifchange $2.expr build/preview/preview.sty build/preview/prtightpage.def build/preamble.tex |
2 | INPUT=$(realpath $2.expr) | 2 | INPUT=$(realpath $2.expr) |
3 | TDIR=$(mktemp -d --tmpdir=/tmp) | 3 | TDIR=$(mktemp -d --tmpdir=/tmp) |
4 | PREAMBLE=$(realpath build/preamble.tex) | ||
4 | 5 | ||
5 | cp build/preview/preview.sty build/preview/prtightpage.def build/preamble.tex $TDIR | 6 | pushd $(dirname $2) >/dev/null |
7 | TEXDIR=$(pwd) | ||
8 | popd >/dev/null | ||
6 | 9 | ||
7 | pushd $TDIR | 10 | cp build/preview/preview.sty build/preview/prtightpage.def $TDIR |
8 | latex -jobname=image <<EOF | 11 | |
9 | \input{preamble.tex} | 12 | pushd $TDIR >/dev/null |
13 | latex -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} |
17 | EOF | 22 | EOF |
18 | popd | ||
19 | 23 | ||
20 | dvisvgm --exact --no-fonts -o $3 $TDIR/image.dvi 2>&1 | sed -e '/depth=/!d;s/^.*depth=\(.*\)$/\1/' > $(dirname $2)/vertical-align | 24 | dvisvgm --exact --no-fonts $TDIR/image.dvi 2>&1 | sed -e '/depth=/!d;s/^.*depth=\(.*\)$/\1/' > $TEXDIR/vertical-align |
25 | cat $TDIR/image.svg | ||
26 | popd >/dev/null | ||
27 | |||
21 | rm -rf $TDIR \ No newline at end of file | 28 | rm -rf $TDIR \ No newline at end of file |