SPB Git

spb/wp28_uqo

Public
1.1 KB · 15 lines shellscript
1#!/bin/bash2# Validate paper/main.pdf: exists, non-empty, searchable text, no undefined refs/cites, page count, render spot-check pages to PNG.3set -e4cd "$(dirname "$0")/../paper"5test -s main.pdf || { echo "main.pdf missing/empty"; exit 1; }6pages=$(pdfinfo main.pdf | awk '/^Pages/ {print $2}'); echo "pages: $pages"7pdftotext -l 1 main.pdf - | tr -d " \n" | grep -qi "workingpaperno.28" && echo "title page OK (Working Paper No. 28)" || { echo "title page check FAILED"; exit 1; }8pdftotext main.pdf - | grep -c "Theorem" | xargs -I{} echo "occurrences of 'Theorem' in text: {}"9und=$(grep -c "undefined" main.log || true); echo "undefined references/citations warnings in main.log: $und"10ovf=$(grep -c "Overfull" main.log || true); echo "overfull boxes: $ovf"11mkdir -p ../results/figures/pdf_check12for pg in 1 2 10 $((pages/2)) $pages; do pdftoppm -f $pg -l $pg -r 60 -png main.pdf ../results/figures/pdf_check/page_$pg >/dev/null 2>&1 || true; done13echo "spot-check PNGs in results/figures/pdf_check/"14[ "$und" = "0" ] || { echo "WARNING: unresolved references remain"; }15
Files · 03c92a56d0693cfd935830864af130593cec5f03
Menu

Theme