[ESS] default pdf viewer for `ess-swv-PDF'

Patrick Drechsler patrick at pdrechsler.de
Wed May 2 16:01:38 CEST 2007


Hi,

what is the correct way to set a default PDF viewer for the function
`ess-swv-PDF' in current ESS?

I have tried setting the evironment variable `R_PDFVIEWER' as described
in R's help for `options'. But still only `evince' is used.

Then I copied the code directly from `ess-swv.el' to ~/.emacs and
modified it to use xpdf:

,----
|   (defun ess-swv-PDF ()
|     "Create a PDF file ('pdflatex') and display it."
|     (interactive)
|     (let* ((namestem (substring (buffer-name) 0 (search ".Rnw" (buffer-name))))
| 	   (tex-filename (concat namestem ".tex"))
| 	   (pdfviewer (file-name-nondirectory
| 		       (or ;(executable-find "evince")
| 			   ;(executable-find "kpdf")
| 			   (executable-find "xpdf")
| 			   (executable-find "acroread")))))
|       (shell-command (concat "pdflatex " tex-filename))
|       (shell-command (concat pdfviewer " " namestem ".pdf &"))))))
`----

Is there a suggested/better way of doing this?

Cheers

Patrick

PS: I'm using R-2.5.0 with ESS 5.3.4 on Ubuntu 6.06.
-- 
I'm not asleep. I'm just looking at my eyelids!




More information about the ESS-help mailing list