Replacing PDFView with Skim is something that I've been thinking about for a while, but it hasn't been a high priority. Happily, Al Kasprzyk provided a script to make that replacement in a comment to the earlier post. For convenience, I'll reproduce it here, with syntax highlighting:
Perhaps the greatest difference is that Al uses the
displaylinescript included with Skim, instead of just opening the PDF created from the LaTeX document. Thus, instead of having
latexmkopen the preview, he handles it himself. behaviorally, the preview is shown in Skim, with the current line selected in SEE being visible in Skim.
We can rewrite my earlier script to take a similar approach. Without either following Al's script exactly or avoiding looking at it, I came up with this:
The differences between the two scripts are minor. Apart from some formatting choices, there are just a few differences. First, I set the
PATHenvironment variable. I'm pretty sure Al must have done so as well, but he didn't include it in his comment. Second, I have an extra layer of quoting for what I called the
PRODUCT; based on restrictions for LaTeX file names, these are superfluous. Third is the obvious and essential difference of which viewer we call.
Right now, there is no change in behavior between my earlier script and the one I present above. However, I no longer need to define anything in a
.latexmkrcfile, which is helpful in making a portable LaTeX mode. Better, though, is that the obvious parallels between Al's script and mine can be taken advantage of. Next time.