0

After moving to zsh and installing MacTeX, I can run pdflatex fine from the Terminal.

$ which pdflatex /Library/TeX/texbin/pdflatex 

I copy that location, itself a soft link

 /Library/tex/texbin: lrwxr-xr-x /Library/tex/texbin/ -> ../.DefaultTeX/Contents/Programs/texbin 

(which presumably will ultimately lead to /usr/local/texlive/2023/bin/universal-darwin) to my .emacs

(setq shell-file-name "zsh") (setq exec-path (append exec-path '( "/Library/TeX/texbin/latexmk/" ))) 

Yet when running the C-c C-e l o Org export-to-latex dance, I get

zsh:1: command not found: latexmk 
3
  • That exec-path is used for Emacs, not zsh. Commented Jun 29, 2023 at 15:52
  • @shynur .. and it is indeed Emacs that is looking for latexmk. I don't see your point. Commented Jun 29, 2023 at 15:54
  • zsh:1: command not found: latexmk... Commented Jun 29, 2023 at 15:56

1 Answer 1

2

Try this:

(setenv "PATH" (concat "/Library/TeX/texbin/latexmk/" path-separator (getenv "PATH"))) 

Perhaps PATH can be inherited from Emacs when process zsh is created.

1
  • +1 - Even better, Emacs would inherit PATH from whoever started it and you wouldn't have to mess with PATH in Emacs. But GUIs have tended to make that more difficult than it was when everything was started from a login shell. Commented Jun 29, 2023 at 20:13

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.