依存モジュールがインストールされていないためlatexindentが動かない
Manjaro LinuxにTeX Liveを入れ、LaTeX文書を書いています。
TeX Liveをインストールすると、LaTeXのフォーマッターであるlatexindent
コマンドも同時にインストールされます。
しかし、次のようなエラーが出てそのままでは動かない場合があります。
Can't locate YAML/Tiny.pm in @INC (you may need to install the YAML::Tiny module) (@INC contains: /usr/local/texlive/2021/texmf-dist/scripts/latexindent /usr/lib/perl5/5.34/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/5.34/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/5.34/core_perl /usr/share/perl5/core_perl) at /usr/local/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm line 21.
BEGIN failed--compilation aborted at /usr/local/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm line 21.
Compilation failed in require at /usr/local/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/Verbatim.pm line 22.
BEGIN failed--compilation aborted at /usr/local/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/Verbatim.pm line 22.
Compilation failed in require at /usr/local/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/Lines.pm line 22.
BEGIN failed--compilation aborted at /usr/local/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/Lines.pm line 22.
Compilation failed in require at /usr/local/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/Document.pm line 28.
BEGIN failed--compilation aborted at /usr/local/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/Document.pm line 28.
Compilation failed in require at /usr/local/texlive/2021/bin/x86_64-linux/latexindent line 27.
BEGIN failed--compilation aborted at /usr/local/texlive/2021/bin/x86_64-linux/latexindent line 27.
pacmanを使って依存モジュールを一つひとつインストールする
以前、Fedoraでも同じような状況に陥って似たような記事を書きましたが、要はエラーで言われている足りていないモジュールをインストールしてやれば動くと思います。
私の環境ではYAML::Tiny
とFile::HomeDir
、Unicode::GCString
が足らなかったので次のようにしました。
sudo pacman -S perl-yaml-tiny perl-file-homedir perl-unicode-linebreak