Emacs Auctex Integration – How to Use Okular with Emacs Auctex for Enhanced Workflow

auctexemacsokular

When I follow subham soni's instructions to connect emacs with Okular, I get the error message "Symbol's function definition is void: nil" when emacs tries to call the viewer "Command: (default View)" Any idea why this happens ?

My complete .emacs file is the following:

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.  
 '(TeX-source-correlate-method (quote synctex))
 '(TeX-source-correlate-mode t)
 '(TeX-source-correlate-start-server t)
 '(TeX-view-program-list (quote (("Okular" ("okular %o") "okular --unique %o#src:%n%b"))))
 '(TeX-view-program-selection (quote (((output-dvi has-no-display-manager) "dvi2tty") ((output-dvi style-pstricks) "dvips and gv") (output-pdf "Okular") (output-dvi "xdvi") (output-pdf "Evince") (output-html "xdg-open"))))
 '(delete-selection-mode nil)
 '(mark-even-if-inactive t)
 '(scroll-bar-mode (quote right))
 '(transient-mark-mode 1))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

Best Answer

Remove the line

'(TeX-view-program-list (quote (("Okular" ("okular %o") "okular --unique %o#src:%n%b"))))

It has a wrong format and anyway is useless if you use a recent AUCTeX version (11.88 or above), Okular is correctly configured out-of-the-box.