views:

71

answers:

0

Hi, I have some problem with the Emacs terminal mode. I'm a mac user and I use Emacs downloaded from emacsformacosx.com; I installed also ESS and AucTex.

I work with R, LaTex, Sweve and, I menage all with Emacs. When I want to compile the Sweave file I open the terminal and I use the "R CMD Sweave myfile.Rnw" command to generate a myfile.tex file. After this I use "pdflatex myfile.tex" command, to compile the LaTex file.

All these command work well if used in the terminal application of osx but, the pdflatex command doesn't work if I use the Emacs teminal mode:

bash: pdflatex: command not found

Do you have any suggestion?

EDIT Thanks for your suggestion, I resolved my problem adding to my .emacs this:

(defun set-exec-path-from-shell-PATH ()
  (let ((path-from-shell 
      (replace-regexp-in-string "[[:space:]\n]*$" "" 
        (shell-command-to-string "$SHELL -l -c 'echo $PATH'"))))
    (setenv "PATH" path-from-shell)
    (setq exec-path (split-string path-from-shell path-separator))))
(when (equal system-type 'darwin) (set-exec-path-from-shell-PATH))

I found it at link text

Best Riccardo