Skip to content
Achravso edited this page Jun 28, 2022 · 4 revisions

Here is a sample config which links EAF with the LaTeX compiler in emacs. When a .tex file is open, the Command>Compile and view (C-c C-a) option will compile the .tex file into a .pdf file and display it using EAF.

(add-to-list 'TeX-command-list '("XeLaTeX" "%`xelatex --synctex=1%(mode)%' %t" TeX-run-TeX nil t))
(add-to-list 'TeX-view-program-list '("eaf" eaf-pdf-synctex-forward-view))
(add-to-list 'TeX-view-program-selection '(output-pdf "eaf"))

Look https://github.com/emacs-eaf/eaf-pdf-viewer#latex-config

Doom Emacs

(setq +latex-viewers nil)
(eval-after-load "tex"
  '(progn
     (add-to-list 'TeX-command-list '("XeLaTeX" "%`xelatex --synctex=1%(mode)%' %t" TeX-run-TeX nil t))
     (add-to-list 'TeX-view-program-list '("eaf" eaf-pdf-synctex-forward-view))
     (add-to-list 'TeX-view-program-selection '(output-pdf "eaf"))
    ))
Clone this wiki locally