[Tex/LaTex] Configuring auctex for pdf viewer

auctexemacstexlive

I'm on Ubuntu 13.10, Emacs 24.3.50.1, TeX Live 2013, AucTeX 11.87.2 (from ELPA). I've followed the instructions given by this page on enabling Okular (I'd rather use Evince, though), but this doesn't seem to work. C-c C-c on an opened .tex file, gives me the choice Command: (default) LaTeX in the minibuffer, then again and the minibuffer returns, so I would have to type in a viewer name. I type okular . . . and nothing — that is, Okular starts, but there's no pdf of the tex showing. Any ideas what I'm doing wrong?

Best Answer

This addition to my .emacs finally did the trick:

(eval-after-load "tex"
  '(progn
     (setq TeX-view-program-list '(("Evince" "evince --page-index=%(outpage) %o")))
     ;(add-to-list 'TeX-command-list '("View" "evince %g" TeX-run-command nil t :help "Run evince on your document"))
     (setq TeX-view-program-selection '((output-pdf "Evince")))))

Note commented out suggestion from above. Got the basics from this discussion