First, let's look at viewing the compilation product. Previously, I'd just used the LaTeX file name to define the PDF file name, and sent it to PDFView using AppleScript. With the new approach, I need a shell script defining the default behavior, and an AppleScript invoking the shell script from SEE. The shell script is:
Note that the new definition nowhere assumes that we will produce a PDF file as output; it could be used with
latexto produce a DVI, for instance.
The AppleScript is:
The shell script uses the same
SEE_LATEX_VIEWERenvironment variable used for compiling; I'll adapt the compilation script a little to allow separate viewing behavior for the two cases, defaulting to both using the
SEE_LATEX_VIEWERcontents. Essentially, this consists of changing just one line, replacing with Note that the AppleScript uses the same code to read from the same plist of environment settings as the compilation script--no changes were needed to accommodate the new settings.
Second, let's examine cleaning up the auxiliary files. The shell script is:
The cleanup behavior can be defined in a
SEE_LATEX_CLEANUPvariable, used to set the
CLEANUPvariable. The default value for
CLEANUPis to remove files with the same name as the LaTeX file but with different filename extensions. The list of extensions (aux, bbl, blg, dvi, log, out, ps, pdf, pdfsync, toc) is pretty arbitrary, being essentially what were created for my own writings.
The associated AppleScript is:
Again, the bulk of the script is unchanged, with no changes at all to the portions handling the environment settings.