Auto reload Latex-generated pdfs on MacOS

16 December 2018 in macos

I like to write my Latex docs in Atom and use Latexmk to watch for changes and recompile everything automatically. The problem is that on macOS, there aren’t that many pdf viewers supporting automatic file reload (e.g. in Adobe Acrobat there is no such feature). I was using Skim, which can reload changed files, but it for some reason this no longer works: Skim manages stops syncins the file after the first few updates (no idea why).

A solution is to open the pdf in TeXShop and keep editing the tex file in Atom, as described in this StackExchange post. TeXShop steals window focus when it reloads the pdf, which is very annoying – fortunately, this can be prevented by executing the following in the terminal (kudos to this comment):

defaults write TeXShop BringPdfFrontOnAutomaticUpdate NO