PISCES / tools /render_fig.sh
Nabidnur's picture
PISCES (ARIES #1): code, paper, notebooks, results and figures
c09a3f4 verified
Raw History Blame Contribute Delete
677 Bytes
#!/usr/bin/env bash
# Render paper/figs/NAME.tex standalone to paper/figs/out/NAME.pdf and NAME.png (low priority).
# Runs from paper/ so that data/*.dat, macros.tex and the PlotNeuralNet .sty files resolve as in the paper.
set -euo pipefail
cd "$(dirname "$0")/../paper"; mkdir -p figs/out
for f in "$@"; do
nice -n 19 pdflatex -interaction=nonstopmode -halt-on-error -output-directory figs/out -jobname="$f" \
"\def\figfile{figs/$f.tex}\input{figs/standalone.tex}" > figs/out/$f.log 2>&1 || { grep -A5 "^!" figs/out/$f.log | head -20; exit 1; }
rm -f figs/out/$f.aux
nice -n 19 pdftoppm -r 220 -png -singlefile figs/out/$f.pdf figs/out/$f
echo "rendered $f"
done