Skim 1.4.4(78).
I've created a function in Emacs that should revert the PDF, however, it is not reverting. The manual revert button in the menu bar still works.
(defun latexmk ()
".latexmkrc contains the following entries (WITHOUT the four backslashes):
$pdflatex = 'pdflatex -file-line-error -synctex=1 %O %S && (cp \"%D\" \"%R.pdf\")';
$pdf_mode = 1;
$out_dir = '/tmp';"
(interactive)
(setq tex-file buffer-file-name)
(setq pdf-file (concat "/tmp/" (car (split-string (file-name-nondirectory buffer-file-name) "\\.")) ".pdf"))
(setq line (format "%d" (line-number-at-pos)))
(setq skim "/Applications/Skim.app/Contents/SharedSupport/displayline")
(setq tex-output (concat "*" (file-name-nondirectory buffer-file-name) "*") )
(setq latexmk "/usr/local/texlive/2012/texmf-dist/scripts/latexmk/latexmk.pl")
(setq latexmkrc "/Users/HOME/.0.data/.0.emacs/.latexmkrc")
(if (buffer-modified-p)
(save-buffer))
(delete-other-windows)
(set-window-buffer (split-window-horizontally) (get-buffer-create tex-output))
(with-current-buffer tex-output (erase-buffer))
(set-process-sentinel
(start-process "clean" nil latexmk "-C" "-r" latexmkrc tex-file)
(lambda (p e) (when (= 0 (process-exit-status p))
(message (format "The process named `%s' %s" p e))
(set-process-sentinel
(start-process "compile" tex-output latexmk "-r" latexmkrc tex-file)
(lambda (p e) (when (= 0 (process-exit-status p))
(message (format "The process named `%s' %s" p e))
(start-process "displayline" "*Messages*" skim "-r" "-b" line pdf-file tex-file)
(switch-to-buffer (get-file-buffer tex-file))
(if (get-buffer-process (get-buffer tex-output))
(process-kill-without-query (get-buffer-process (get-buffer tex-output))))
(kill-buffer tex-output)
(delete-other-windows)))) ))))
"Check for file changes" in preferences is checked, however, that doesn't catch it either.
Not sure what you are doping wrong. But the -r option does revert for me when call the script from the command line (on 10.6.9). So the feature just works, nd it must be in what else you're doing. But I know too little about lisp to debug your script (you should do that yourself.)
Perhaps you're calling it wrong, or you don't make the latex in a compatible way. Building the pdf in a different location can also give problems with synctex, and perhaps gives problems in reverting as a result.
It could also be precisely because you do check for file changes. That should not be done together: either you explicitly revert (like with the -r option), or you do it automatically, otherwise they can work against each other.
The "-r" option seems to be working correctly now.
I've now unchecked the "Check for file changes".
I removed: net.sourceforge.skim-app.skim.bookmarks.plist.
I removed: net.sourceforge.skim-app.skim.LSSharedFileList.plist
I removed: net.sourceforge.skim-app.skim.plist
I had previously run from the terminal the following command, which I am assuming only modified the above-mentioned *.plist:
defaults write -app Skim SKAutoReloadFileUpdate -boolean true
I'll test it out on my other computers over the next few days and see if that resolves the issue.
Last edit: lawlist 2013-09-21