2

On Ubuntu 20.04 I installed texlive from the terminal using

$ sudo apt install texlive
$ sudo apt install texlive-latex-recommended

I can compile a minimal example from the terminal without error, but when using LaTex Workshop in Visual Studio Code (actually Codium), it complains with the error

"Can not find latexindent in PATH."

And indeed I cannot find latexindent either. I tried

$ whereis latexindent
latexindent:

While

$ whereis latex

results in

/usr/bin/latex /usr/share/man/man1/latex.1.gz

I cannot find latexindent manually in /usr/bin/latex either, which should be my TexLive installation folder, right?

I searched the web a lot and tried to install latexindent manually:

$ tlmgr install latexindent
/usr/bin/tlmgr: unexpected return value from verify_checksum: -5

Then I tried

$ tlmgr install latexindent --verify-repo=none

Which results in an error where I don't know what to do:

tlmgr: package latexindent is not relocatable, cannot install it in user mode!
4
  • 1
    google suggests you need apt-get install texlive-extra-utils specifically it lead me to command-not-found.com/latexindent Aug 18 at 11:15
  • 1
    A few things: You have chosen to install texlive from a linux dist. This has consequences. (1) tlmgr is crippled and cannot be used to install packages. (2) the linux dists split texlive up into smaller linux dist packages and it is a huge pain to figure out which to actually install. My recommentation: install apt-file, run sudo apt-file update to have it update its data base then you can try apt-file search latexindent and it should then tell you which linux package provides latexindent
    – daleif
    Aug 18 at 11:28
  • @DavidCarlisle This did work! whereis latexindent now finds the file. Unfortunately VS Code now returns a new unspecific error. But I think you should make an answer of your comment. @daleif Thanks, that is useful information. How would you recommend installing texlive on Ubuntu?
    – smcs
    Aug 18 at 12:22
  • documentation of latexindent.pl updated to include this as of c630b73
    – cmhughes
    Aug 21 at 9:25
4

If you use a linux system packaged version of texlive then the files are grouped in to larger collections to be managed by apt (or whatever linux package manager you are using). It's probably possible to query the repository directly to discover which collection holds any file but a simple google query such as apt packge latexindent is usually enough. Here I turned up this site which shows that you need

sudo apt install texlive-extra-utils 
4
  • That's why I always promote apt-file
    – daleif
    Aug 18 at 13:17
  • @daleif yes I saw your comment but as I know nothing I didn't add anything here, feel free to add another answer or add to this one if there is some general advice to use. Aug 18 at 13:23
  • Just noticed the URL you use, that is a super useful tool (which I would assume is connected to something similar to apt-file)
    – daleif
    Aug 18 at 13:51
  • 1
    @daleif I have no idea how reliable it is, it just turned up as google result Aug 18 at 13:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.