TeX - LaTeX Asked by adal on February 25, 2021
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:UsersadaliAppDataLocalProgramsMiKTeX 2.9scripts/latexindentlatexindent.pl line 27.
BEGIN failed--compilation aborted at C:UsersadaliAppDataLocalProgramsMiKTeX 2.9scripts/latexindentlatexindent.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 FilesMiKTeX 2.9scriptslatexindent
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:UsersadaliAppDataLocalProgramsMiKTeX 2.9scripts/latexindentlatexindent.pl line 27.
BEGIN failed--compilation aborted at C:UsersadaliAppDataLocalProgramsMiKTeX 2.9scripts/latexindentlatexindent.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.
latexindent
package and putting it in a non-local texmf location.latexindent-module-installer
.if you still get a missing perl module error;
cpan -f -i <missingmodule>
from the command promptlatexindent.tex myfile.tex
a. Miktex does not properly install latexindent
b. latexindent-module-installer-pl
does not work on windows
c. cpan does download the missing modules without force installing from command prompt.
Correct answer by adal on February 25, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP