Recipe terminated with fatal error: spawn latexmk ENOENT.

  • Analysis
    Version info: VS code:1.50.0, Tex Live:2019/Debian, LaTex Workshop:8.13.2
  • Action
    Make sure your operation is correct by referencing to official guideline and VS Code + LaTeX.
    1. Install TexLive: TeXLive即LaTeX的编译环境, Use latex --help or latex -version to check the installation status and result. For me, I just used sudo apt install texlive-latex-base to install it.
    2. Install LaTex Workshop Plugin
    3. PATH related, Does the executable exist?
      See the OUTPUT of LaTex Workshop and got:
[16:26:14] BUILD command invoked.
[16:26:14] Current workspace folders: ["file:///home/shane/repo/hello-world"]
[16:26:14] Current workspaceRootDir: /home/shane/repo/hello-world
[16:26:14] Found root file from active editor: /home/shane/repo/hello-world/toExplore/LaTex/template/IS2019_paper_kit/IS2019_paper_kit/LaTeX/template.tex
[16:26:14] Keep using the same root file: /home/shane/repo/hello-world/toExplore/LaTex/template/IS2019_paper_kit/IS2019_paper_kit/LaTeX/template.tex.
[16:26:14] Building root file: /home/shane/repo/hello-world/toExplore/LaTex/template/IS2019_paper_kit/IS2019_paper_kit/LaTeX/template.tex
[16:26:14] Build root file /home/shane/repo/hello-world/toExplore/LaTex/template/IS2019_paper_kit/IS2019_paper_kit/LaTeX/template.tex
[16:26:14] Recipe step 1: latexmk, -synctex=1,-interaction=nonstopmode,-file-line-error,-pdf,-outdir=/home/shane/repo/hello-world/toExplore/LaTex/template/IS2019_paper_kit/IS2019_paper_kit/LaTeX,/home/shane/repo/hello-world/toExplore/LaTex/template/IS2019_paper_kit/IS2019_paper_kit/LaTeX/template
[16:26:14] cwd: /home/shane/repo/hello-world/toExplore/LaTex/template/IS2019_paper_kit/IS2019_paper_kit/LaTeX
[16:26:14] LaTeX build process spawned. PID: undefined.
[16:26:14] LaTeX fatal error: spawn latexmk ENOENT, . PID: undefined.
[16:26:14] Does the executable exist? PATH: /home/shane/anaconda3/bin:/home/shane/anaconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
[16:26:14] The current SHELL: /bin/bash
  • Solution
    From Github, this seems to be correct solution shown as below,

Replicating the value of PATH in the env field of the plugin recipe resolves the issue. For some reason, it looks like VSCode does not retrieve the $PATH from the shell. I did not have this issue until today, quite possibly until the latest VSCode update, released this morning (GMT).(https://github.com/James-Yu/LaTeX-Workshop/issues/1742)
But how to replicate the value of PATH in the env field of the plugin recipe?

[201027] Make it work
After uninstalled texlive-latex-base by sudo apt-get autoremove --purge texlive-latex-base, and re-install texlive 2020, I got ‘Command ‘tex’ not found’ when I type tex --version.

Then I followed guideline texlive-en.pdf, and the following lines to ‘$HOME/.profile’:

PATH=/usr/local/texlive/2020/bin/x86_64-linux:$PATH; export PATH
MANPATH=/usr/local/texlive/2020/texmf-dist/doc/man:$MANPATH; export MANPATH
INFOPATH=/usr/local/texlive/2020/texmf-dist/doc/info:$INFOPATH; export INFOPATH

Then I run source ~/.profile to reload .profile

And read version was succeeded.

Then I installed LaTex workshop in VS code, and it run well.

Lesson learn

  1. Follow guide of Latex Workshop instead of thinking it by yourself. For me, I just made a mistake in installing Tex Live.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值