I want to use latexindent on my file. When I run the code
latexindent.exe myfile.tex
I get the following error.
Can't locate LatexIndent/Document.pm in @INC (you may need to install the LatexIndent::Document module) (@INC contains: /c/Users/adali/AppData/Local/Programs/MiKTeX 2.9/scripts /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl) at C:\Users\adali\AppData\Local\Programs\MiKTeX 2.9\scripts/latexindent\latexindent.pl line 27.
BEGIN failed--compilation aborted at C:\Users\adali\AppData\Local\Programs\MiKTeX 2.9\scripts/latexindent\latexindent.pl line 27.
(By the way latexindent.pl myfile.tex
also gives the same error. And I checked my local files and there is a file called 'latexindent.pl' but not an '.exe' version. And I checked I have Perl 5v32 as well, so this is not a Perl issue.)
latexindent manual reccomends the following code, saying that ''latexindent.pl ships with a script to help with this process; if you run the following script, you should be prompted to install the appropriate modules.''
perl latexindent-module-installer.pl
When I run it, I get the warning:
Can't open perl script "latexindent-module-installer.pl": No such file or directory
I tried to use ''latex-indent-module-installer.exe'' hoping that the manual does not mention Windows version, but I get the same error.
The solution in How to use latexindent in TeXStudio on Windows? does not work as well. After I downloaded latexindent manually and put it in C:\Program Files\MiKTeX 2.9\scripts\latexindent
I still get the error that
Can't locate LatexIndent/Document.pm in @INC (you may need to install the LatexIndent::Document module) (@INC contains: /c/Users/adali/AppData/Local/Programs/MiKTeX 2.9/scripts /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl) at C:\Users\adali\AppData\Local\Programs\MiKTeX 2.9\scripts/latexindent\latexindent.pl line 27.
BEGIN failed--compilation aborted at C:\Users\adali\AppData\Local\Programs\MiKTeX 2.9\scripts/latexindent\latexindent.pl line 27.
from the error message I surmise that latexindent does not look into the file that I put the executable into.
So it seems there are two problems.
- Miktex does not install the latexindent package fully (The package was available in Miktex, and I even updated it once I encountered the problem)
- latexindent does not search all the root texmf files one configures by Miktex.
C:\Program Files\MiKTeX 2.9\scripts\latexindent
but I still get the error