#!/bin/sh set -e subdirs=${1:-"slides handouts hws coursework"} for sd in $subdirs; do cd $sd for fl in *.tex; do echo $fl xelatex $fl | pr -to4 done cd .. done