#!/usr/bin/env bash
while inotifywait -e modify .; do
xelatex -interaction=nonstopmode -halt-on-error latex
done