blob: 403fd2dcbb1fd486886a837249b7c694af11e0b8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
redo-ifchange $2.expr build/preview/preview.sty build/preview/prtightpage.def build/preamble.tex
INPUT=$(realpath $2.expr)
TDIR=$(mktemp -d --tmpdir=/tmp)
cp build/preview/preview.sty build/preview/prtightpage.def build/preamble.tex $TDIR
pushd $TDIR
latex -jobname=image <<EOF
\input{preamble.tex}
\begin{document}
\begin{preview}
\(
\input{$INPUT}
\)
\end{preview}
\end{document}
EOF
popd
dvisvgm --exact --no-fonts -o $3 $TDIR/image.dvi 2>&1 | sed -e '/depth=/!d;s/^.*depth=\(.*\)$/\1/' > $(dirname $2)/vertical-align
rm -rf $TDIR
|