[OS X TeX] Skim SKAutoReloadFileUpdate
Adam R. Maxwell
amaxwell at mac.com
Thu Dec 18 10:30:05 EST 2008
On Dec 18, 2008, at 6:20 AM, Adam M. Goldstein wrote:
> OK, another question---how is what TeXShop does any different, and
> is there a difference between using it as an "external viewer" or as
> the source editor and viewer?
Yes, there is a difference.
> If the TS user pushes "typeset," does this provide the PDF viewer
> with information about when the typesetting process begins and so
> the viewer can wait to reload until it's ready?
TS runs an external process to typeset your document, so it knows when
that call is finished, and when it should open/reload the PDF.
TextMate uses a similar approach, since it launches the TeX process
(es) on your behalf. If that succeeds, it tells Skim (using Python):
os.system("/usr/bin/osascript -e " + """'tell application "Skim" to
revert (documents whose path is %s)' """%pdfPath)
...and does something similar for other viewers. This is trivial with
a shell script or makefile approach.
> But then if I use (say) emacs as my editor and TeXShop as a viewer,
> presumably the TeXShop PDF viewer doesn't have the information.
Correct. I just looked at the TS source, and TS evidently uses a one
second timer to poll for changes, then attempts to load the file when
it might be done. Skim uses a kqueue to get notified that a file has
changed, then reads the last few bytes of the PDF to see if it has a
trailer yet (Mike McCracken's suggestion in the thread I linked to
earlier).
> I have never had a problem with either the TS viewer or Skim in the
> reloading department.
Ever seen Skim reload the PDF twice during a pdflatex/bibtex/pdflatex/
pdflatex sequence? That's the performance side of the problem, since
it's not cheap to reload. Whether it's a problem in other respects
will depend on the speed of your machine and size of your document;
there is still a window for the race condition, but it's smaller (so
it'll possibly "work" most of the time, but there's no guarantee).
I believe that it's a design flaw to have this feature in a PDF
viewer, plain and simple, and people's expectations are based on other
formats. IIRC DVI and PostScript can be read/displayed as the file is
being created, whereas PDF needs the entire file written to disk
beforehand.
--
Adam
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2415 bytes
Desc: not available
URL: <http://email.esm.psu.edu/pipermail/macosx-tex/attachments/20081218/af1b3e7c/attachment.p7s>
More information about the MacOSX-TeX
mailing list