latex-preview-pane-update couldn't find "pdflatex" directory when emacs loading hello.tex

310 Views Asked by At

I run my hello.tex file. But it always has the warning:

Error running timer ‘latex-preview-pane-update’: (file-error "Searching for program" "No such file or directory" "pdflatex")

I've checked .emacs file. I've been adding script in .emacs.

(setenv "PATH" "/Library/TeX/texbin:$PATH" t)
(latex-preview-pane-enable)

But it still dosen't work. How can I do now?

1

There are 1 best solutions below

3
Rorschach On

You need to update the exec-path. Your solution should work with call-process-shell-command, but that uses call-process. So, you want something like

(cl-pushnew "/Library/TeX/texbin" exec-path :test #'equal)

Then, you can check the program is found with (executable-find "pdflatex").