我在线上浏览了类似的问题,但是没有一个解决方案允许我使用synctex与Emacs一起工作。具体来说,一旦我对.tex进行更改,latexmk和skim将成功重新编译并更新pdf,但是我无法从tex跳到pdf 。特别是,当我执行命令+ Shift +鼠标左键时,Emacs确实跳到了skim中的pdf,但是不在正确的位置。
除其他外,我关注了this solution:这是我的〜/ .emacs文件:
(defun toggle-fullscreen ()
"Toggle full screen"
(interactive)
(set-frame-parameter
nil 'fullscreen
(when (not (frame-parameter nil 'fullscreen)) 'fullboth)))
(global-auto-revert-mode t)
;; make latexmk available via C-c C-c
;; Note: SyncTeX is setup via ~/.latexmkrc (see below)
(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")))
;; use Skim as default pdf viewer
;; Skim's displayline is used for forward search (from .tex to .pdf)
;; option -b highlights the current line; option -g opens Skim in the background
(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")))
(server-start); start emacs in server mode so that skim can talk to it
和我的〜/ .latexmkrc文件:
$pdflatex = 'pdflatex -interaction=nonstopmode -synctex=1 %O %S';
$pdf_previewer = 'open -a skim';
$clean_ext = 'bbl rel %R-blx.bib %R.synctex.gz';
你们当中有人知道如何跳转到pdf才能工作吗?
我在OS X 10.11.2上,使用Skim 1.4.22,Aquamacs 3.4,latexmk 4.43a和pdfTeX 3.14159265-2.6-1.40.16(TeX Live 2015)。