[Tex/LaTex] Use latexindent.pl with `BeautifyLatex` in sublime text


I was trying to use latexindent.pl with the package BeautifyLatex in SublimeText 3 on OS X El Capitan . When I tried to save tex file, there was an error:

Error: can't specify None for path argument

I googled about this error. The path of latexindent.pl became the suspect. Typing which latexindent on the terminal, I saw latexindent installed.

$ which latexindent

Typing echo $PATH on the terminal, I saw the current path includes /Library/TeX/texbin, which contains latexindent. Any idea?

Best Answer

There's a well-known issue with command-line tools in GUI applications on OS X, starting with El Capitan. Basically, when launched from the Dock, Spotlight, etc. they inherit a very restricted PATH (this was true on earlier versions of OS X, but you could usually adjust it somehow). However, this can be easily fixed by installing the Fix Mac Path plugin, which ensures the PATH in ST is the same as the PATH in the terminal.