10

My version of Emacs and AUCTeX[1] uses

TeX-evince-sync-view

for viewing pdf.

This command is not working for some reason. Evince is launched but Emacs freezes and I have an error

Couldn't find the Evince instance for file XXX

I don't have the time to debug it and, moreover, I don't need the sync feature.

So, I'm trying to view pdf in a old-fashioned (simple) way (without sync). I tried this code (which used to work several years ago):

(setq TeX-view-program-list '(("Evince" "evince --page-index=%(outpage) %o")))
(setq TeX-view-program-selection '((output-pdf "Evince")))

But there is no change in Emacs. (I still have the problematic command

TeX-evince-sync-view

as default command.)

I tried to do the same but with the graphical interface (Tools>customize AUCTeX>Tex Command>TeX view>Tex-view-program-selection selecting "just" Evince) but no change.

How can I set Evince without sync as the default command for viewing pdf?

[1]Emacs 23.4.1 and AUCTeX 11.85-1 but I have the same problem with emacs-snapshot 24.3.50.1.

17
  • 2
    Does it help if you change ("Evince" "evince --page-index=%(outpage) %o") to just ("Evince" "evince %o")?
    – N.N.
    Apr 5, 2013 at 12:02
  • this is not an answer to your question, but could you try a newer emacs? <a>gnu.org/software/emacs/#Obtaining</a> and install auctex from a repository instead? i've tested both 24.2 and 24.3 and have had no problems.
    – user28659
    Apr 8, 2013 at 7:56
  • I have already a very up-to-date version of Emacs (24.3.50.1) (thanks to Julien Danjou and his "emacs-snapshot" Debian package (emacs.naquadah.org)) and the last version (11.87) of auctex. What works for you? Did you successfuly change the viewing command in pdf mode?
    – ppr
    Apr 8, 2013 at 14:24
  • 1
    Did you try to use emacs -q and then evaluate the suggested configuration in *scratch*? Using emacs -q is a way to see if the local configuration is the reason for the problem as it disables .emacs.
    – N.N.
    Apr 8, 2013 at 17:16
  • 1

2 Answers 2

8

Solution: to use `TeX-view-program-list' in order to define a new viewer description (which contains an Evince command without sync). This new command will override the description of Evince defined in `TeX-view-program-list-builtin' (which contains the problematic command TeX-evince-sync-view).

To do so :

M-x customize-variable <RET> TeX-view-program-list <RET>
  <INS>
    Name = Evince
    Command = evince --page-index=%(outpage) %o

I have no idea why this code in .emacs does not work:

(setq TeX-view-program-list '(("Evince" "evince --page-index=%(outpage) %o")))
2

Via configuration, I find the following works:

(defun my-LaTeX-mode()
  (add-to-list 'TeX-view-program-list '("Evince" "evince --page-index=%(outpage) %o"))
  (setq TeX-view-program-selection '((output-pdf "Evince")))
  ; Other mode specific config
  )
(add-hook 'LaTeX-mode-hook 'my-LaTeX-mode)

You must log in to answer this question.

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