The C-c C-v command in emacs. Sometimes it asks what viewer to use, and sometimes it just shows the document. If possible (within reasonable effort), I'd like it to never ask, just show.

Also, where is the default view tool command defined? I'd like to know how to set it, as I'd like to append options, so it (for example) will look like this evince --fullscreen (or just -f) instead of just evince.

The mode that I use is LaTeX/P.

(In response to a comment)


  • What is your desktop environment? Under Ubuntu 11.10, emacs (23.3.1) calls xdg-open, which you can set with the command xdg-mime. As far as I remember, it is reading from a defaults.list file; you may have one in something like ~/.local/share/applications or /etc/gnome/defaults.list. ... And, for what it's worth, C-c C-v never asks me about the viewer; have you changed your default view settings?
    – jon
    Commented Jun 3, 2012 at 23:12
  • In /etc/gnome/, I found the file you mentioned (see post edit). There were some evince related stuff there, but nothing to do (?). Isn't this something you fix within emacs, or put in your .emacs file? (I have not configured C-c C-v.) Commented Jun 3, 2012 at 23:36
  • Sorry, I was trying to find out simpler information but got sidetracked. I wasn't sure what your set-up was (GNOME), or if you had fiddled with your (system-wide) .pdf viewer settings. The first line you posted from defaults.list suggests that emacs shouldn't bother asking about which viewer to use..? Can you describe more explicitly when it does or doesn't ask? As for the --fullscreen option, I've never worried about that before. (I'll take a look, but others might be much quicker.)
    – jon
    Commented Jun 4, 2012 at 0:51
  • There is, for starters: M-x customize-variable RET TeX-view-program-selection.
    – jon
    Commented Jun 4, 2012 at 1:02
  • You can also customize TeX-output-view-style, but I can't get it to accept the -f option for some reason.
    – jon
    Commented Jun 4, 2012 at 1:24

1 Answer 1


First things first, if you don't know what you are doing, use the M-x customize-variable to modify TeX-output-view-style and TeX-view-program-selection; from these menus, you should be able to declare that you want to use evince --fullscreen for the first variable, and Evince for the second. If you do this, you should end up with the following in your .emacs (cut down to the relevant portions):

;; default warning comments from the customize-variable command
  '(TeX-output-view-style (quote (("^pdf$" "." "evince --fullscreen %o") ...<other options will be declared>...
  '(TeX-view-program-selection (quote ( ...< various options >... (output-pdf "Evince") ...)))

Note: do not cut and paste any of the above. I'm just showing you the parts that should be of interest to you.

With these settings, now C-c C-v and C-c C-c (once AUCTeX thinks it's the appropriate action) will use Evince with the --fullscreen option.

  • TeX-output-view-style seems to have no effect. I can put whatever there and it does not change the behavior. TeX-view-program-selection on the other hand, if I put something nonsensical there, it breaks the viewing altogether. Commented Jun 8, 2012 at 12:35
  • @EmanuelBerg -- did you use both at the same time? I took all this stuff, because I don't want to call Evince with --fullscreen, but when I made the changes, TeX-ouput-view-style listed several instances for pdf. I made all of them follow the pattern shown above; but do not try to give options to TeX-view-program-selection. Perhaps you could edit your question to show what you get in .emacs after using M-x customize-variable. (You can get rid of the defaults.list stuff, but it might be worth mentioning the OS/etc. for future readers of the question.)
    – jon
    Commented Jun 8, 2012 at 15:32
  • It looks like this: (custom-set-variables '(TeX-output-view-style (quote (("^pdf$" "." "evince --fullscreen %o")))) '(TeX-view-program-selection (quote ((output-pdf "Evince")))) ; and then some unrelated things. TeX-output-view-style does not seem to affect anything with or without TeX-view-program-selection. But TeX-view-program-selection works as we expect it to, replacing Evince with xpdf and you get a xpdf window instead. Commented Jun 8, 2012 at 16:00
  • Really? You made the change with M-x customize-variable, and it only made an addition for pdf? When I went through the process, it gave me settings for .pdf, .dvi, .html, etc.; in some cases 'double' settings (for reasons I don't know).
    – jon
    Commented Jun 8, 2012 at 16:03
  • Yes. I have GNU Emacs 23.4.1 and did exactly as you in LaTeX/P mode. Anyway, I'll start reading the documentation more closely and get back to you if I solve this. It seems such an easy fix it is too annoying to fail. Commented Jun 8, 2012 at 16:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .