+function latexdiff () {
+ # wdiff -n \
+ # -w $'\033[30;43m'"[$1]"$'\033[30;41m ' -x $'\033[0m' \
+ # -y $'\033[30;43m'"[$2]"$'\033[30;42m ' -z $'\033[0m' \
+ # $*
+
+ wdiff -n \
+ -w $'\033[30;41m' -x $'\033[0m' \
+ -y $'\033[30;42m' -z $'\033[0m' \
+ $*
+
+ # | \grep $'\033'"\|section{"
+}
+
+# Looks for the most recent .log and pdflatex + bibtex the
+# corresponding tex file
+
+function rl () {
+ RECENT_LOG=$(ls -t $(find -maxdepth 1 -name "*.log" -type f) | head -1)
+
+ if [ ${RECENT_LOG} ]; then
+ FILEBASE="${RECENT_LOG/.log/}"
+
+ if [ -f "${FILEBASE}.tex" ]; then
+
+ pdflatex "${FILEBASE}"
+ bibtex "${FILEBASE}"
+ pdflatex "${FILEBASE}"
+ pdflatex "${FILEBASE}"
+
+ if [ "$1" ]; then
+ if [ "$1" == "-v" ] || [ "$1" == "--view" ]; then
+ xpdf "${FILEBASE}.pdf"
+ elif [ "$1" == "-p" ] || [ "$1" == "--print" ]; then
+ lpr "${FILEBASE}.pdf"
+ else
+ echo "Usage: rl [-v|--view] [-p|--print]" >&2
+ echo "Unknown option $1" >&2
+ return 1
+ fi
+ fi
+
+ else
+
+ echo "Can not find a tex file corresponding to the most recent log (${RECENT_LOG/.log/})." >&2
+ return 1
+
+ fi
+
+ else
+ echo "Can not find a recent log." >&2
+ return 1
+ fi
+}
+
+