On Sep 12, 2024, at 05:48-0400 Roger Lipsett <[email protected]> wrote:

> I have been unable to get Emacs/Auctex to sync properly with Skim. Skim is
> opened when I invoke the sync command, but does not scroll the PDF to the
> selected location. This is on an M2 Macbook running Sonoma 14.5, Emacs
> 29.4, Auctex 14.0.6 installed from ELPA, Skim 1.7.4.

Below is my relevant settings and I don't have problem with syncing AUCTeX and
Skim.  Of course make sure the paths are consistent with your system.


Good luck,
Kourosh

* Versions
- Emacs 29.4
- macOS Sonoma 14.6.1 with M3 chip
- AUCTeX 14.06
- Skim 1.7.4


* Emacs
#+begin_src emacs-lisp
(use-package tex
  :ensure auctex
  :custom
  (TeX-master nil)
  (TeX-newline-function 'reindent-then-newline-and-indent)
  
  ;; Configuration for PDF viewing
  (TeX-view-program-selection '((output-pdf "PDF Viewer")))
  (TeX-view-program-list
   '(("PDF Viewer" "/Applications/Skim.app/Contents/SharedSupport/displayline 
-r -b -g %n %o %b")))
  
  (TeX-source-correlate-mode t)
  (TeX-source-correlate-method 'synctex)
  (TeX-source-correlate-start-server t)

  ;; Function to revert the PDF buffer after compilation
  (TeX-after-compilation-finished-functions #'TeX-revert-document-buffer)

  ;; parse on save
  (TeX-auto-save t)
  ;; parse on load
  (TeX-parse-self t)
  ;; use hidden directories for AUCTeX files.
  (TeX-auto-local ".auctex-auto")
  ;; just save, don't ask before each compilation.
  (TeX-save-query nil)
  ;; export to pdf by default
  (TeX-PDF-mode t)
  ;; automatically insert braces after sub/superscript in `LaTeX-math-mode'.
  (TeX-electric-sub-and-superscript t)
  ;; don't show help buffer when step through errors
  (TeX-display-help nil)
  ;; so auctex offers autocomplete for width in includegraphics macro in beamer
  ;; see https://lists.gnu.org/archive/html/auctex/2023-11/msg00003.html
  (TeX-insert-macro-default-style 'show-all-optional-args)
  :config
  (add-hook 'TeX-after-compilation-finished-functions
          #'TeX-revert-document-buffer)
  :hook
  ((LaTeX-mode latex-mode TeX-mode tex-mode) . (lambda ()
                                                 (flyspell-mode 1)
                                                 (flyspell-buffer)
                                                 (visual-line-mode 1)
                                                 (LaTeX-math-mode 1)
                                                 (reftex-mode 1)
                                                 (setq TeX-PDF-mode t)
                                                 (setq 
TeX-source-correlate-method 'synctex)
                                                 (setq 
TeX-source-correlate-start-server t)))
)
#+end_src


* Skim
- On Sync tab in =PDF-TeX Sync support=, I have
  - Preset: Custom
  - Command: =/opt/homebrew/bin/emacsclient=
  - Arguments: --no-wait +%line "%file"
  


Reply via email to