I am trying to get synctex to work with Emacs (29.1) and skim (1.7.8) on osx (15.3.2).
Backward search from skim works fine.
Forward search works fine from Terminal, but I cannot get it to work from Emacs. Well, first I had trouble to give Emacs permission to control Skim, but now it works and forward search works by command line from inside Emacs terminal!
But forward search does not work in Emacs: when I launch the pdf viewer from auctex (C-c C-c runs "open -a /Applications/Skim.app/Contents/SharedSupport/displayline %n %o %b") nothing happens. Skim does not launch if it the file in question isn't opened yet, and if it is opened, it does not move to the correct line (%n argument). No error message. Similarly, command C-c C-v does nothing at all.
Incidentally, if I change to view command "Skim" below, Skim launches fine from Emacs. The trouble seems to be with displayline.
What could be missing?? I have spent much time on this, but I couldn't find any help on the web.
Here are the pertinent parts of my init.el file:
(add-hook 'TeX-mode-hook #'(lambda () (TeX-PDF-mode 1))) (setq ;; Set the list of viewers for Mac OS X. TeX-view-program-list '(("Skim" "open -a /Applications/Skim.app %o") ("displayline" "open -a /Applications/Skim.app/Contents/SharedSupport/displayline %n %o %b")) ;; Select the viewers for each file type. TeX-view-program-selection '((output-pdf "displayline"))) (server-start) (add-hook 'LaTeX-mode-hook (lambda () (push '("latexmk" "latexmk -recorder- -pdf %t" TeX-run-TeX nil t :help "Run latexmk on file") TeX-command-list))) (add-hook 'TeX-mode-hook '(lambda () (setq TeX-command-default "latexmk"))) (setq TeX-source-correlate-start-server t TeX-source-correlate-mode t) Also my .latexmkrc file:
$pdf_previewer = 'open -a Skim'; $pdflatex = 'pdflatex -synctex=1 -interaction=nonstopmode'; @generated_exts = (@generated_exts, 'synctex.gz');