1
votes

I have the latest version of LaTeX Workshop installed on Visual Studio Code and, MikTex's latest version and ActivePerl:

This is perl 5, version 28, subversion 1 (v5.28.1) built for MSWin32-x64-multi-thread
(with 1 registered patch, see perl -V for more detail)
Copyright 1987-2018, Larry Wall
Binary build 0000 [25391a6d] provided by ActiveState http://www.ActiveState.com
Built Oct 28 2020 18:24:51

On a Windows 10 Pro 20H2 machine. I also have an IEEE Scientific Document project and it builds correctly, but when I try to format the document I get this error:`

[13:58:18] Start formatting with latexindent.
[13:58:18] Formatting with command latexindent -c,c:/Users/user/Desktop/path/,c:/Users/user/Desktop/path/__latexindent_temp.tex,-y=defaultIndent: '    ' 
[13:58:18] Formatting failed with exit code 2
[13:58:18] stderr: Can't locate YAML/Tiny.pm in u/INC
   (you may need to install the YAML::Tiny module)
   (@INC contains: C:/Users/user/AppData/Local/Programs/MiKTeX/scripts/latexindent C:/Perl64/site/lib C:/Perl64/lib)
   at C:/Users/user/AppData/Local/Programs/MiKTeX/scripts/latexindent/LatexIndent/GetYamlSettings.pm line 20.

(Line breaks added for readability.)

I have searched for instructions on how to install the missing YAML::Tiny module but with no success. I've seen a tool called ppm but that seems to not be available anymore, how can I install this and other missing packages? Thank you a lot.

1
Are you using the ActiveState Platform ?Håkon Hægland
cpan YAML::Tiny from a Windows console.ikegami

1 Answers

3
votes

If you're using the ActiveState Platform, you can simply:

    state install yaml-tiny

If you aren't using it, you can install the latest version of Perl 5.32 on Windows from the ActiveState Platform by running the following at a CMD prompt:

    powershell -Command "& $([scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://platform.activestate.com/dl/cli/install.ps1'))) -activate-default ActiveState/Perl-5.32"

And then you can either run the following for each package you need (State Tool works just like PPM):

    state install <packagename>

Or

    state import <CPANfile/Meta.json>