#!/bin/bash # # Syntax: mkl [-h] # # Purpose: Processes the most recently changed .tex file in the # current directory by running mktex (i.e, latex, followed by # bibtex, followed by latex as many times as necessary to resolve # all references). # The -h flag shows the help info for this command. # Created: Aug 19, 1998 by Bart De Schutter # Last revised: Jan 24, 2008 by Bart De Schutter # # See http://www.deschutter.info/util/scripts.html for the latest version of # this script. # Status: public # Category: latex if [ $# -ge 1 -a "$1" = "-h" ]; then sed '/^$/q;/^#!/d;s/^# //;s/^#//' $0 >&2 exit 1 fi if [ $# -ne 0 ]; then echo >&2 echo >&2 "ERROR: ${0##*/} requires no input arguments." echo >&2 sed '/^$/q;/^#!/d;s/^# //;s/^#//' $0 >&2 exit 1 fi texfile=$((ls -t *.tex | head -1) 2>/dev/null) if [ -n "$texfile" ]; then echo "Processing $texfile ." mktex "$texfile" else echo "No tex files found." fi