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