#!/usr/bin/expect -f # TeX wrapper as none of the interaction modes seem to be quite what I want. # Symlink this to tex, latex, pdflatex, ... and use in place of the originals. # Makes it quit out if it starts asking a question. And ctrl-c will work if it # asks something I haven't thought of. If you try to tex a file that doesn't # exist, you don't end up with a file called ".log" # # Iain Murray, March 2006 set timeout -1 regsub -all {[^/]*/} $argv0 {} prog spawn /usr/bin/$prog $argv match_max 100000 # Could have just this if I just want to ctrl-c out: # expect default while {1} { expect -re "^Please type another input file name: " { exit } -re "^\[?\] " { exit } -re "\[^\r\n\]*\[\r\n\]+" { } default { exit } }