I'm attempting to set up LaTeX to work with Emacs on my Mac, running OS X El Capitan 10.11.5. I can compile everything all right, but I'm unable to use forward/inverse searches with Skim.
From reading other answers, I've attempted to adjust my
~/.emacs, and create a
~/.latexmkrc file. Here is what I'm currently using:
;; Tells emacs where to find LaTeX. (let ((my-path (expand-file-name "/usr/local/bin:/usr/local/texlive/2016/bin/x86_64-darwin"))) (setenv "PATH" (concat my-path ":" (getenv "PATH"))) (add-to-list 'exec-path my-path)) ;; AucTeX settings (setq TeX-PDF-mode t) (add-hook 'LaTeX-mode-hook (lambda () (push '("latexmk" "latexmk -pdf %s" 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-view-program-selection '((output-pdf "PDF Viewer"))) (setq TeX-view-program-list '(("PDF Viewer" "/Applications/Skim.app/Contents/SharedSupport/displayline -b -g %n %o %b"))) (custom-set-variables '(TeX-source-correlate-method 'synctex) '(TeX-source-correlate-mode t) '(TeX-source-correlate-start-server t))
$pdflatex = 'pdflatex -interaction=nonstopmode -synctex=1 %O %S'; $pdf_previewer = 'open -a skim'; $clean_ext = 'bbl rel %R-blx.bib %R.synctex.gz';
I've also set my Sync settings in Skim to use the Emacs preset. Does anyone have any ideas or resources I could look at to attempt to get forward and inverse searches working? Thanks!
UPDATE: I've managed to get inverse search running. I was saving my
~/.latexmkrc file in Rich Text Format as opposed to plaintext. Converting to plaintext, going to
Skim -> Preferences -> Sync, selecting Custom and entering
/usr/local/bin/emacsclient appears to have corrected my inverse search issues.
Unfortunately, forward search is still not working. I can compile my TeX documents in Emacs just fine using
C-c C-c, but
C-c C-v does not go from the TeX file to the corresponding line in the PDF output in Skim. Once again, I would appreciate any advice on this!
UPDATE 2: Forward search appears to be working just fine now. The file I was originally experimenting on had spaces in the filename, which may have caused some hiccups with all this. Forward search works perfectly on one of my better named files.