[ESS] Oppening pdf files from ESS

Vitalie Spinu vitosmail at rambler.ru
Thu Nov 6 15:28:29 CET 2008


Tanks a lot Kevin,

It was indeed the line (shell-command (concat pdfviewer " " namestem ".pdf  
&")))
which did not do the job. I am using v.3.3.7 of ess and emacs 22.2.1. Have  
seen the sources for 3.3.9, the old line is still there.

The problem probably stems in "shell-command" not recognising spaces in  
file names, for instance

(shell-command (concat "c:/Program Files/Adobe/Reader  
8.0/Reader/AcroRd.exe" "D:/works/elsberg.pdf &"))

returns

'c:/Program' is not recognized as an internal or external command,operable  
program or batch file.

Thanks once again,
Vitalie.


On Thu, 06 Nov 2008 01:44:29 +0100, Kevin Wright <kw.statr at gmail.com>  
wrote:

> Which version of ess are you using?  I think I had a problem similar
> to yours, but it seems to be okay now.
>
> Here is my ess-swv-PDF.
>
> (defun ess-swv-PDF ()
>   "Create a PDF file ('pdflatex') and display it."
>   (interactive)
>   (let* ((buf (buffer-name))
> 	 (namestem (file-name-sans-extension (buffer-file-name)))
> 	 (latex-filename (concat namestem ".tex"))
> 	 (tex-buf (get-buffer-create " *ESS-tex-output*"))
> 	 (pdfviewer (ess-get-pdf-viewer))
> 	 (pdf-status))
>     ;;(shell-command (concat "pdflatex " latex-filename))
>     (message "Running pdfLaTeX on '%s' ..." latex-filename)
>     (switch-to-buffer tex-buf)
>     (setq pdf-status
> 	  (call-process "pdflatex" nil tex-buf 1 latex-filename))
>     (if (not (= 0 pdf-status))
> 	(message "** OOPS: error in 'pdflatex' (%d)!" pdf-status)
>       ;; else: pdflatex probably ok
> ;      (shell-command (concat pdfviewer " " namestem ".pdf &")))
>   (w32-shell-execute "open" (concat namestem ".pdf") nil 1))
>     (switch-to-buffer buf)
>     (display-buffer tex-buf)))
>
> Kevin Wright
>
>
>
> On Wed, Nov 5, 2008 at 11:29 AM, Vitalie Spinu <vitosmail at rambler.ru>  
> wrote:
>> Dear ESS Community,
>>
>> I have troubles with opening pdf files from ESS under Windows using
>> ess-swv-Pdf. Pdflatex runs ok, but at the final stage the error:
>>
>> Foxit Reader.exe c:/spinus/works/EuroQol/elsberg.pdf: exited abnormally  
>> with
>> code 1.
>>
>> strikes. Same story for acrobat reader.
>>
>> From command prompt can easily open it:
>> "C:\Program Files\Foxit Software\Foxit Reader\Foxit Reader.exe"
>> "c:/spinus/works/EuroQol/elsberg.pdf
>>
>> Thanks for any suggestions.
>>
>> --
>> Spinu Vitalie
>> Erasmus University Rotterdam
>> Tinbergen Institute
>> Burg Oudlaan 50, H09-10
>> NL 3062 PA Rotterdam
>> +31 10 4088924
>>
>> ______________________________________________
>> ESS-help at stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/ess-help
>>




More information about the ESS-help mailing list