Pdflatex command does not work in Emacs terminal mode

I have a problem with Emacs terminal mode. I am a Mac user and I use Emacs, downloaded from emacsformacosx.com; I also installed ESS and AucTex.

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

All of these commands work well if they are used in the osx terminal application, but the pdflatex command does not work if I use Emacs temporary mode:

bash: pdflatex: command not found

Do you have any suggestions?

EDIT Thanks for your suggestion, I decided that the problem was added to my .emacs:

(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 in the link text

Best Riccardo


+3
source share
1 answer

In OS X, environment variables for graphics programs are set to ~/.MacOSX/environment.plist. There are many special Emacs tasks, such as usage (setenv "PATH" (shell-command-to-string "echo -n $PATH")), that you may find scattered across the stack overflow and the Internet in general.

+1
source

Source: https://habr.com/ru/post/1760422/


All Articles