#!/bin/bash REFRESH_HOSTS="numrel07.cct.lsu.edu topf.wg" function pdf { pdflatex $1.tex bibtex $1 pdflatex $1.tex pdflatex $1.tex # Only use/refresh xpdf on some hosts if echo "$REFRESH_HOSTS" | grep -q `hostname`; then pgrep -f "xpdf -remote 127.0.0.1 $1.pdf" 2>&1 > /dev/null if [ $? == 0 ]; then xpdf -remote 127.0.0.1 -reload -raise else xpdf -remote 127.0.0.1 $1.pdf & fi fi } cd figs for i in *.dia; do base=`expr match "$i" '\([^\.]*\)'` if [ "$base.dia" -nt "$base.pdf" ]; then inkscape -A $base.pdf $base.dia fi done cd - pdf mojave rm -rf *.aux *.blg *.log *.out *.toc