I am using emacs+skim to preview latex on macs, and I use auctex preview-latex from time to time. the problem is, after I run C-c C-p C-d in emacs to preview entire document, the pdf file is now deleted, and skim show a bunch of formulas (as Sumatra does on Windows). Then I recompile and run C-c C-v to see file in skim, but skill still shows a bunch of formulas in separate pages. While in Sumatra, it shows immediately the newly compiled pdf file, despite that it was deleted a while ago due to preivew-latex. Is there a way to fix this on mac?


This seems only to happen when the entire document is previewed in emacs, for example, C-c C-p C-e does not cause this problem.

At first skim ask permission to revert for every newly generated pdf file, but the "secret preference" mentioned in the post resolves the issue.

  • I just close Skim programmatically and open a new pdf, because I found a bug in Skim a few months ago -- although I cannot remember right now exactly what it was. However, that may be a non-AUCTeX solution -- I have both options. Here is a link to my setup -- I don't have any issues, but I don's use preview -- I just print a final pdf and if I don't like it, I revise the LaTeX source and generate a new pdf: Here is the first link: stackoverflow.com/a/22746845/2112489 and here is the second link: tex.stackexchange.com/a/156617/26911 – lawlist Jun 25 '14 at 5:20
  • @lawlist, thanks! I have no problem generating pdf, neither do I have to kill skim in terminal, there is a revert option in the menu list. However, as a lazy person, I am curious if this could be avoided, since Sumatra has no such problem. – davyjones Jun 26 '14 at 3:13
  • There are two Skim options to revert -- the non-hidden option in the Preferences (i.e., "Check for file changes" under the Sync menu), which probably gives you the yes / no option, and that is why you (like all of us) have Googled the hidden option: defaults write -app Skim SKAutoReloadFileUpdate -boolean true It sounds like you need to program in a close the current window on Skim, however, I haven't researched the Applescript equivalent (just close the entire program). I'll add to my todo-list a close window Applescript if no one resolves this for you. – lawlist Jun 26 '14 at 3:23
  • I'll need to pick it up again in the next few days (it's bedtime here in L.A.), but here is the applescript to close a window -- the idea is that you get rid of the window that contains an error without closing the entire application: (defun test () (interactive) (let ((script (concat "set myWindowTitle to \"envelope.pdf\"\n" "tell application \"System Events\"\n" "tell application \"Skim\" to close (every window whose name contains myWindowTitle)\n" "end tell\n" ))) (start-process "osascript-getinfo" nil "osascript" "-e" script))) Of course, we'll substitute envelope.pdf for the real one. – lawlist Jun 26 '14 at 5:47
  • I've incorporated the close-skim-window applescript into a non-AUCTeX solution in the elisp function latexmk in the following link: tex.stackexchange.com/a/156617/26911 The original poster could (in theory) use that type of mechanism to close the window of the improperly displayed *.pdf so that a new window gets generated during the compilation process. If someone would like to turn that into an AUCTeX solution for the original poster, please feel free to use my idea. – lawlist Jun 26 '14 at 16:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.