0

I updated my texlive to 2022 recently and found that the auto-compilation command in tex-mode running latexmk -pdf -pdflatex=xelatex --synctex=1 -interaction=nonstopmode -file-line-error file.tex throws this error:

/bin/sh: latexmk: command not found
TeX Output exited abnormally with code 127 at Mon May  9 15:51:01

My attempted solutions:

  1. I am pretty sure the new path of texlive2022 was added to my $PATH, I also tried echo $PATH in the built-in shell of Emacs, it also gives the correct path names.
  2. I've tried the answer in Trying to run a linux program in Emacs: command not found, i.e., add the path to ~/.profile, but it doesn't work as well.
  3. I also checked out using M-x getenv path, and it does contain the path inside emacs.
Drew
  • 77,472
  • 10
  • 114
  • 243
Cong Wen
  • 3
  • 2

1 Answers1

0

In fact, the third attempted solution works.

Put a line in config.el

(setenv "PATH" "...")

actually works.

Cong Wen
  • 3
  • 2
  • Did you set PATH to something different from the environment value? If yes, what did you change? – NickD May 10 '22 at 06:06
  • I set it to be precisely the environment value outside (its original value is different from that). – Cong Wen May 10 '22 at 21:29