TransWikia.com

Texlive / LatexWorkshop - unable to Build or Preview Latex Files

TeX - LaTeX Asked by MrTony on July 29, 2021

I have installed TexLive on Ubuntu 20.04.1 LTS using

sudo apt-get install texlive

After this I created a file "text.tex" in Visual Studio Code. I installed the Plugin "Latex Workshop" and tried to preview or Build the .tex File.

I received the following error:

Recipe terminated with fatal error: spawn latexmk ENOENT.

According to this:

https://github.com/James-Yu/LaTeX-Workshop/issues/1742

The reason for this is, that something is wrong with the PATH Variable

I am not sure whether TexLive is actually included in my PATH:

Using echo $PATH yields:

/home/tony/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/mssql-tools/bin

I can use latex-v and which latex yields:

/usr/bin/latex

TexLive itself is located at:

/usr/share/texlive

I have tried to debug this by following the advice from the github page – I copied the content of m PATH variable into the "env" fields in the settings.json of LatexWorkshop, however, the error persists.

Someone solved a fairly similar problem here:
How can I get VS Code LaTeX Workshop to choose the correct Latex distribution? This was on Windows however.

I am not sure whether something is wrong with my TexLive installation, my PATH variable or something is buggy or falsely set up within VSCode/LatexWorkshop.

One Answer

On Ubuntu TeXLive is split into many Ubuntu packages (not related to LaTeX packages). Some of the software tools that come with TeXLive are also split into their own Ubuntu packages. And since installing the Ubuntu texlive package does not install everything TeXLive relatated, chances are that you are missing something.

In this case the Ubuntu package latexmk provides the latexmk tool.

I looked it up via apt-file search latexmk. Note that other Ubuntu packages match as well but that is mostly latexmkrc configuration files.

Note if you use the apt-file tool, remember to run sudo apt-file update from time to time. This updates the file lists that apt-file search searches.

Correct answer by daleif on July 29, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP