pdflatex command not working in Emacs terminal mode
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 su开发者_Python百科ggestion, 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
On OS X, environment variables for GUI programs are set in ~/.MacOSX/environment.plist
. There are many Emacs specific work arounds like using (setenv "PATH" (shell-command-to-string "echo -n $PATH"))
which you can find scattered across Stack Overflow and the internet in general.
精彩评论