#!/usr/bin/env bash
set -euo pipefail
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
OUT="$HERE/build_atlas"
mkdir -p "$OUT"
cp "$HERE/../witness_atlas/witness_atlas.tex" "$OUT/"
cd "$OUT"
if ! command -v pdflatex >/dev/null 2>&1; then
  echo "pdflatex not found; compile locally in $OUT"
  exit 0
fi
pdflatex -interaction=nonstopmode witness_atlas.tex || true
pdflatex -interaction=nonstopmode witness_atlas.tex || true
echo "Built in $OUT"
