#!/bin/bash # Deterministic build of paper/main.pdf (latexmk, pdflatex + bibtex). Exit status reflects LaTeX errors. set -e cd "$(dirname "$0")/../paper" mkdir -p figures; cp ../results/figures/fig_*.pdf figures/ 2>/dev/null || true for f in mc_logit_small_m_p8 mc_logit_p20_p20 mc_logit_illcond_p8; do [ -f tables/$f.tex ] || echo "% not yet generated" > tables/$f.tex; done latexmk -pdf -interaction=nonstopmode -halt-on-error main.tex > ../logs/latexmk.log 2>&1 || { tail -40 ../logs/latexmk.log; exit 1; } grep -E "Warning.*(undefined|Citation|Reference)" main.log | sort | uniq -c | head -20 || true echo "pages: $(pdfinfo main.pdf | awk '/^Pages/ {print $2}')"