Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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)

/etc/gnome/defaults.list:

application/pdf=evince.desktop
application/x-bzpdf=evince.desktop
application/x-gzpdf=evince.desktop
application/postscript=evince.desktop
application/x-bzpostscript=evince.desktop
application/x-gzpostscript=evince.desktop
image/x-eps=evince.desktop
image/x-bzeps=evince.desktop
image/x-gzeps=evince.desktop
application/x-dvi=evince.desktop
application/x-bzdvi=evince.desktop
application/x-gzdvi=evince.desktop
image/vnd.djvu=evince.desktop
image/tiff=evince.desktop
application/x-cbr=evince.desktop
application/x-cbz=evince.desktop
application/x-cb7=evince.desktop
share|improve this question
    
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 Jun 3 '12 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.) –  Emanuel Berg Jun 3 '12 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 Jun 4 '12 at 0:51
    
There is, for starters: M-x customize-variable RET TeX-view-program-selection. –  jon Jun 4 '12 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 Jun 4 '12 at 1:24
show 3 more comments

1 Answer

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):

(custom-set-variables
;; 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.

share|improve this answer
    
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. –  Emanuel Berg Jun 8 '12 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 Jun 8 '12 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. –  Emanuel Berg Jun 8 '12 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 Jun 8 '12 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. –  Emanuel Berg Jun 8 '12 at 16:08
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.