tags:

views:

46

answers:

2

Hi All,

I started to use emacs for LateX editing again. Back in the days, it was configured automatically that C-c C-f would open the corresponding *.dvi file with evince. With the latest version of emacs, it does not do the same. Is there a way to open the doc with evince? (I am sure there is a way. It is emacs afterall).

Thanks!

A: 

I use this code with auctex-mode:

;; use evince for dvi and pdf viewer
;; evince-dvi backend should be installed
(setq TeX-view-program-selection
      '((output-dvi "DVI Viewer")
        (output-pdf "PDF Viewer")
        (output-html "Google Chrome")))
(setq TeX-view-program-list
      '(("DVI Viewer" "evince %o")
        ("PDF Viewer" "evince %o")
        ("Google Chrome" "google-chrome %o")))

You didn't mention if you're using auctex-mode or the old latex-mode that comes bundled with Emacs.

Bozhidar Batsov
+1  A: 

Depending on whether you are using AUCTeX or emacs' default LaTeX mode there are different configuration options to set this. I would suggest you have a look at them with customize-browse since the config strings can be pretty dense.

With AUCTeX

Browse to Emacs > Wp > Tex > AUCTeX > Tex Command > TeX View > TeX View Program Selection. Change the output-dvi viewer.

Plain LaTeX mode Browser to Emacs > Wp > Tex > Tex View > Tex Dvi View Command.

Also, instead of directly hardcoding evince I would suggest putting xdg-open there and configuring your preferred dvi-viewer in your desktop environment. Then you need to worry about only one place to configure this in the future.

honk