emacs-latex-preview-server/public/tex2png.sh
2024-06-22 00:54:56 -06:00

11 lines
286 B
Bash
Executable file

#!/bin/sh
file="$1"
[ "$file" ] || exit 1
out="${file%.tex}.png"
makepng() {
latex -interaction nonstopmode "$file" >/dev/null 2>&1 || return 1
dvipng -D 150 -T tight -bg Transparent -o "$out" "${file%.tex}.dvi" >/dev/null 2>&1 || return 1
}
makepng && echo "$out" || exit 1