[Tex/LaTex] Missing latexindent from TeXLive full installation

latexindent

Even after sudo apt-get install texlive-full on Linux I'm apparently missing latexindent. I can't configure any command with this application within TeXstudio because I get the following, as an example:

Error: Could not start the command: latexindent.pl -w "main".tex

Same error within the terminal calling from the same directory where I downloaded latexindent from its GitHub repository.

I checked for Perl in my system via info perl; it's installed.

How is this fixed?

Best Answer

TeX Live on Unix-like systems creates symbolic links from the bin/architecture directory to the relevant script, but the symbolic file links always omit the file extensions. For example, bin/x86_64-linux/latexindent links to ../../texmf-dist/scripts/latexindent/latexindent.pl

This is more consistent with Unix file naming schemes, but the scripts are often distributed with an extension for the benefit of non-Unix-like systems, such as Windows. Since the script is distributed and is on CTAN with the extension, the manual often references the script name with the extension. (If the package/script author isn't aware of this behaviour then they won't think to mention it in the manual.)

Conversely, TeX distributions on Windows may convert the script into an executable, in which case the extension becomes .exe (such as latexindent.exe).

As @cmhughes commented below section 3 of the latexindent manual states:

In what follows, we will always refer to latexindent.pl, but depending on your operating system and preference, you might substitute latexindent.exe or simply latexindent.

Related Question