96

Is there a PDF viewer out there for MacOSX that support automatic reload of (in my case LaTex generated) PDFs when they're modified by another application?

Eric
  • 2,587
  • 5
  • 23
  • 26
  • 2
    TeXShop can be configured to use an external editor. This effectively slaves its auto-updating viewer to whatever editor you like. Does this fit the bill? – qubyte Feb 01 '12 at 12:55
  • I'm currently using AquaMacs + latexmk to produce my PDFs, so I'm afraid no ;) Okular under Linux e.g. works just perfect, reloads the file and jumps automatically to the same position of the document I'd been before. Adobe Acrobat (Pro) just breaks and spills error messages when scrolling in a modified document... – Eric Feb 01 '12 at 12:59
  • 7
    I use Preview.app (the default PDF viewer which comes with OSX), and it reloads automatically the document. – morbusg Feb 01 '12 at 13:04
  • 3
    Skim is pretty good in this respect and has SyncTeX integration with Aquamacs out of the box. – egreg Feb 01 '12 at 13:05
  • @egreg: put this into an answer, or I'll do it ;-) – topskip Feb 01 '12 at 13:07
  • @PatrickGundlach Go forth (but mention also Preview and TeXShop) – egreg Feb 01 '12 at 13:08
  • @Eric: I think you misunderstood me. I mean that you can use your editor as you like, and just the previewer of TeXShop to display the result with auto-update (see my answer for details). – qubyte Feb 01 '12 at 13:23
  • 2
    @MarkS.Everitt: yes, I think I really misunderstood. Thanks for your effort. I'm trying different things at the moment and will also have a go on TeXShop. – Eric Feb 01 '12 at 13:43
  • 1
    Preview.app requires that you shift focus to it in order for it to reload the file. It won't do it if you keep typing in your editor, for example. – Mars May 25 '13 at 02:16

4 Answers4

90

Skim provides this feature. It also provides pdfsync synchronization, so I would consider it as the favorite PDF viewer for LaTeX!

To turn on the feature, go to Preferences in the main Skim menu, then find the Sync tab and from there select Check for file changes and Reload automatically.

Preferences to enable automatic reload

One nuisance about Skim is that on the first change it asks you if you really want to reload the document. There is, however, a hidden preference to disable this behavior:

defaults write -app Skim SKAutoReloadFileUpdate -boolean true 

Another potential nuisance: If you compile very large (that is, computation-intensive) documents, Skim sometimes gets out of sync with the file system or even crashes; for details look into this answer.

ahcox
  • 103
Daniel
  • 37,517
  • 2
    Thanks - I haven't used Skim for a while and here everything works as expected. Thanks! – Eric Feb 01 '12 at 13:45
  • 3
    Skim is great. Overall. But if you ask for any additional features, there's a good chance that you'll get a rude response from the programmers. I will be happy when someone creates a PDF reader as good as Skim with additional features such as the ability to change pages with a single key, and vertical split. Sigh. – Mars May 25 '13 at 02:12
  • 2
    Skim is a great program but ever since Yosemite, text rendered by Skim is very ugly (fuzzy and unclear), while Acrobat is crisp and clear. Somebody should definitely find a way to make Acrobat reload automatically… – yannis Oct 19 '14 at 17:13
  • @yannis Yes that is true, however, any amount of zooming will cause it to re-render and everything goes back to being crisp. Annoying though. The biggest drawback with Skim in my opinion is that it does not support native OSX fullscreen and the developers are remarkably oblivious to the obvious benefit. That is not usually a problem for texing. – oarfish Dec 09 '14 at 20:29
  • 3
    For those who considered not using Skim due to @oarfish's comment, this feature seems to have been added since. However, it seems you need to enable autoupdating by checking a box in "Skim > Preferences > Sync". – Brian McCutchon Oct 08 '15 at 22:56
  • Well, @Mars's comment about the developer is to the point. McBrainy's comment is correct but there is a scary warning just below that feature though. I think Skim is a nice viewer while writing something with latex (considering auto-reload and synctex) but I don't think it is fit for the daily usage... – Halil Sen Jan 26 '16 at 13:24
  • just a heads up - Skim doesn't support animations so these will appear blank. For animations preview doesn't work either so you need Adobe Acrobat which annoyingly doesn't support auto updated for whatever reason! – Alexander McFarlane Jun 17 '16 at 12:26
  • @AlexanderMcFarlane: Are you talking about embedding of video material? "Animations" is a somewhat ambiguous term here, since in the context of the beamer this is usually overlays or step-wise presentation of TikZ figures, which is perfectly supported. However, it is true that only Acrobat supports embedding of video material. To my knowledge, this holds for any PDF viewer on any platform. – Daniel Jun 17 '16 at 13:20
  • yes correct I mean actual video for example .mp4 format – Alexander McFarlane Jun 17 '16 at 13:22
  • Skim has not been updated for a while (since 2009!). Have they dropped it? Or it is perfect as it is? – a06e Aug 07 '17 at 12:45
  • @becko: Where have you been looking? Skim is updated about once per month. See https://sourceforge.net/projects/skim-app/files/Skim/ for a list of releases. – Daniel Aug 09 '17 at 13:43
  • 1
    @Daniel You are correct. I was looking at an outdated page, sorry. – a06e Aug 09 '17 at 16:12
26

This is simple with TeXShop installed. First launch TeXShop, and go into the preferences. In the second tab there is a tick box title called Automatic Preview Update. Make sure it's ticked.

enter image description here

Now ok that, and quit TeXShop (you need to quit and reopen to make it honour the preference). Now all you need to do is open the pdf you're working on with TeXShop, and the TeX file in your editor of choice. Any changes to the pdf will make the viewer refresh.

As you're using AquaMacs, you'll probably need to enable SyncTeX (if you want it) in the AucTeX options. There are more instructions on that here.

qubyte
  • 17,299
  • 9
    TexShop viewer will steal focus when autoload. Is there any way to make it stay in the background? I don't want to manually switch back to my editor for changes. – Rio Apr 05 '14 at 21:35
  • 13
    @Rio, this can be done by typing defaults write TeXShop BringPdfFrontOnAutomaticUpdate NO in the terminal. – Alexander Kachkaev Jul 01 '14 at 22:02
  • 1
    Thanks @Alexander Kachkaev! No idea how you knew it in 2014, because I was looking for a solution to this problem in 2021! – Alexander Kachkaev May 06 '21 at 18:41
  • @AlexanderKachkaev haha, thanks a lot! – Descrates Nov 26 '21 at 22:15
  • 1
    Thanks to both @AlexanderKachkaev's! I did this in 2014 (or so) and needed to look it up again in 2021. (There are too many defaults to easily find the one you want.) – Ethan Duckworth Dec 11 '21 at 17:15
8

The Mac default viewer preview does this. As long as you make some other application active, when you bring preview to the front, the reload occurs.

For me, I use LaTeX to generate the new pdf in one application and when I bring the preview version back up, the changes have been reloaded.

Joel
  • 2,429
  • Nope, it doesn't. – Walter May 26 '18 at 21:39
  • 2
    Preview 10.0 on OSX 10.13.3 (High Sierra) does. So has every other version I've tried over the years. What are you running? – Joel May 27 '18 at 09:10
  • 1
    I can confirm that preview version 10.0 running on macOS High Sierra 10.13.6 automatically reloads the file content when switching between an editor and viewer using +tab. – breandan Dec 29 '18 at 22:51
8

As OS X has built-in capability of displaying PDF, there are several application based on it. Preview.app is shipped with OS X, Skim is a sourceforge project and TeXShop (mentioned in another answer) is shipped with MacTeX. All of these support automatic reloading. Note that these viewers have a few limitations compared to the Adobe Reader, for example they cannot display layers (OCGs) selectively, they do not execute JavaScript and have a few other problems (see for example the recent question about hyphenation and searchable pdf).

topskip
  • 37,020
  • This is a good point, and is most apparent (to me) when using the animate package. – qubyte Feb 01 '12 at 13:22
  • 4
    @Patrick: as far as Preview.app is concerned there appears to be a bug; there's no need to manually reload the file but one hast to switch processes first in order to get Preview to notice, that a file modification occurred. Can somebody please verify this behavior? – Eric Feb 01 '12 at 13:47
  • 4
    @Eric: It is like that and (I remember reading in some Apple forum that this is "by design"). Solution: Use Skim :-) – Daniel Feb 01 '12 at 14:53