VisualStudioCode (with LatexWorkshop) gives spawn latexmk ENOENT, but latex is in the path. (MacOs)
Asked Answered
S

1

1

I'm unable to use LatexWorkshop+VSCode as I'm getting the known error LaTeX fatal error: spawn latexmk ENOENT, . PID: undefined.. I'm using a fresh install of TexLive (through MacTex on MacOs). Yet, although /Library/Tex/texbin is in my path (here is the output from echo $PATH):

/Users/myusername/.nvm/versions/node/v11.10.0/bin:/Users/myusername/miniconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/Users/myusername/.fig/bin.

Here are some other relevant system info.

> which perl
/usr/local/bin/perl
> which tlmgr
/Library/TeX/texbin/tlmgr
> which latexmk
/Library/TeX/texbin/latexmk

So, it seems that latex is in my path, but when I try to compile I inevitably get the following error:

LaTeX build process spawned. PID: undefined.
LaTeX fatal error: spawn latexmk ENOENT, . PID: undefined.
Does the executable exist? $PATH: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
Does the executable exist? $Path: undefined
The environment variable $SHELL: /bin/zsh

I even tried to force in LatexWorkshop settings by using the following in latexmk"env": { "TEXMFHOME": "/Library/TeX/texbin/latexmk" }

I already restarted VSCode several times (as well as the OS), and tried other solutions (e.g. these) but I just can't make this work. Can anyone help me here?

Splay answered 22/11, 2022 at 18:16 Comment(0)
P
0

I think there are two methods you can try.

  1. Use terminal code to launch a VS Code, rather than Finder. See: https://github.com/James-Yu/LaTeX-Workshop/issues/1414

  2. Use "PATH" rather than "TEXMFHOME" in env, see: https://github.com/James-Yu/LaTeX-Workshop/issues/1742. I don't know what "TEXMFHOME" means although it is an example in the LaTeX Workshop wiki.

Both methods are tried by myself and succeed.

Pangaro answered 14/3, 2023 at 8:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.