skip to Main Content

I installed latex workshop in VSCODE (on Mac OS), but the pdf does not build. Instead it throws the error:

Recipe terminated with fatal error: spawn pdflatex ENOENT.

Does anyone know the solution as I would have assumed the package would work by simply installing?

2

Answers


  1. Chosen as BEST ANSWER

    I found this issue to occur when launching VSCODE from the anaconda GUI. Launching VSCODE directly in launchpad on MAC OS did not through any errors and simply compiled and built the pdf. Hence, this issue appears to be specific to the anaconda installation and launch.


  2. You need to install MacTex for Latex Workshop to work. After installing MacTex, you’ll see TexLive Utility which you will use to install all the packages.

    If you have all of it installed, then it throws an error because the environment variable is not set in PATH. You can check this by typing
    echo $PATH in your terminal or reading the error message in the log.

    To fix this:

    1. Open your Library folder and navigate over to TexShop. Open "Engines" and move latexmk engine from "inactive" back to "Engines" folder.

      Engines Folder

    2. After doing this, you have to add /usr/local/texlive/2022/bin/universal-darwin to your $PATH.

    3. Open Terminal and type ls -a to view all files.

    4. Type open .zshrc in the terminal and add /usr/local/texlive/2022/bin/universal-darwin: after bin:. Save the text editor and close it.

      Adding to $PATH

    5. Now, type source .zshrc in the terminal.

    Restart your Visual Studio Code, and it should work. Type echo $PATH in Terminal and you should be able to see the path we just added.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search