# --- STAT 571 course notes build system --- # Default engine: lualatex (better Unicode + system-font support). # Override with `make ENGINE=pdflatex` if needed. ENGINE ?= lualatex MAIN = main LECTURES := $(wildcard lectures/*.tex) PDF1 = ../lec1-4.pdf PDF2 = ../lecs5-13.pdf PYTHON ?= python3 .PHONY: all clean distclean watch view mathpix split help help: @echo "make -- build $(MAIN).pdf" @echo "make watch -- continuous build via latexmk -pvc" @echo "make view -- open the built PDF" @echo "make mathpix -- submit handwritten PDFs to Mathpix and pull raw LaTeX" @echo "make split -- split Mathpix raw output into per-lecture chunks" @echo "make clean -- remove aux files" @echo "make distclean -- remove aux files and the built PDF" all: $(MAIN).pdf $(MAIN).pdf: $(MAIN).tex preamble.sty $(LECTURES) latexmk -$(ENGINE) -interaction=nonstopmode -halt-on-error $(MAIN).tex watch: latexmk -$(ENGINE) -pvc -interaction=nonstopmode $(MAIN).tex view: $(MAIN).pdf open $(MAIN).pdf mathpix: $(PYTHON) scripts/mathpix_extract.py --pdf $(PDF1) --pdf $(PDF2) --out raw split: $(PYTHON) scripts/split_lectures.py --raw raw --out raw/per-lecture clean: -latexmk -c rm -f *.aux *.log *.out *.toc *.fls *.fdb_latexmk *.synctex.gz lectures/*.aux distclean: clean -latexmk -C rm -f $(MAIN).pdf