cmhughes / latexindent.pl

Perl script to add indentation (leading horizontal space) to LaTeX files. It can modify line breaks before, during and after code blocks; it can perform text wrapping and paragraph line break removal. It can also perform string-based and regex-based substitutions/replacements. The script is customisable through its YAML interface.
GNU General Public License v3.0
884 stars 84 forks source link

latexindent on texlive broken #404

Closed tdegeus closed 1 year ago

tdegeus commented 1 year ago

Running

$ latexindent --version

outputs

Can't locate File/HomeDir.pm in @INC (you may need to install the File::HomeDir module) (@INC contains: /usr/local/texlive/2022/texmf-dist/scripts/latexindent /Library/Perl/5.30/darwin-thread-multi-2level /Library/Perl/5.30 /Network/Library/Perl/5.30/darwin-thread-multi-2level /Network/Library/Perl/5.30 /Library/Perl/Updates/5.30.3 /System/Library/Perl/5.30/darwin-thread-multi-2level /System/Library/Perl/5.30 /System/Library/Perl/Extras/5.30/darwin-thread-multi-2level /System/Library/Perl/Extras/5.30) at /usr/local/texlive/2022/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm line 24.
BEGIN failed--compilation aborted at /usr/local/texlive/2022/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm line 24.
Compilation failed in require at /usr/local/texlive/2022/texmf-dist/scripts/latexindent/LatexIndent/Verbatim.pm line 23.
BEGIN failed--compilation aborted at /usr/local/texlive/2022/texmf-dist/scripts/latexindent/LatexIndent/Verbatim.pm line 23.
Compilation failed in require at /usr/local/texlive/2022/texmf-dist/scripts/latexindent/LatexIndent/Lines.pm line 23.
BEGIN failed--compilation aborted at /usr/local/texlive/2022/texmf-dist/scripts/latexindent/LatexIndent/Lines.pm line 23.
Compilation failed in require at /usr/local/texlive/2022/texmf-dist/scripts/latexindent/LatexIndent/Document.pm line 30.
BEGIN failed--compilation aborted at /usr/local/texlive/2022/texmf-dist/scripts/latexindent/LatexIndent/Document.pm line 30.
Compilation failed in require at /Library/TeX/texbin/latexindent line 27.
BEGIN failed--compilation aborted at /Library/TeX/texbin/latexindent line 27.

Note that I am on macTeX and that according to the "TeX Live Utility" I am on

latexindent.pl, version 3.19.1, 2022-12-04
cmhughes commented 1 year ago

Can you install the required perl modules?

https://latexindentpl.readthedocs.io/en/latest/sec-appendices.html#manually-installing-modules

On Tue, 27 Dec 2022, 13:49 Tom de Geus, @.***> wrote:

Running

$ latexindent --version

outputs

Can't locate File/HomeDir.pm in @INC (you may need to install the File::HomeDir module) @.*** contains: /usr/local/texlive/2022/texmf-dist/scripts/latexindent /Library/Perl/5.30/darwin-thread-multi-2level /Library/Perl/5.30 /Network/Library/Perl/5.30/darwin-thread-multi-2level /Network/Library/Perl/5.30 /Library/Perl/Updates/5.30.3 /System/Library/Perl/5.30/darwin-thread-multi-2level /System/Library/Perl/5.30 /System/Library/Perl/Extras/5.30/darwin-thread-multi-2level /System/Library/Perl/Extras/5.30) at /usr/local/texlive/2022/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm line 24. BEGIN failed--compilation aborted at /usr/local/texlive/2022/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm line 24. Compilation failed in require at /usr/local/texlive/2022/texmf-dist/scripts/latexindent/LatexIndent/Verbatim.pm line 23. BEGIN failed--compilation aborted at /usr/local/texlive/2022/texmf-dist/scripts/latexindent/LatexIndent/Verbatim.pm line 23. Compilation failed in require at /usr/local/texlive/2022/texmf-dist/scripts/latexindent/LatexIndent/Lines.pm line 23. BEGIN failed--compilation aborted at /usr/local/texlive/2022/texmf-dist/scripts/latexindent/LatexIndent/Lines.pm line 23. Compilation failed in require at /usr/local/texlive/2022/texmf-dist/scripts/latexindent/LatexIndent/Document.pm line 30. BEGIN failed--compilation aborted at /usr/local/texlive/2022/texmf-dist/scripts/latexindent/LatexIndent/Document.pm line 30. Compilation failed in require at /Library/TeX/texbin/latexindent line 27. BEGIN failed--compilation aborted at /Library/TeX/texbin/latexindent line 27.

Note that I am on macTeX and that according to the "TeX Live Utility" I am on

latexindent.pl, version 3.19.1, 2022-12-04

— Reply to this email directly, view it on GitHub https://github.com/cmhughes/latexindent.pl/issues/404, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQ7CYFOWSWKM3TEP7KFY2DWPLXVBANCNFSM6AAAAAATKOFDWE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

tdegeus commented 1 year ago

That would be a work-around, though I wonder if it has be done with texlive's perl? Anyway, I just wanted to report this for the benefit of the library, as a 'work-around' I am using pre-commit and/or the conda-forge package, so I am good to go.

The reason I reported is that I though that maybe the Makefile.PL is not properly used for the texlive package such that the dependency is indeed not included in the package

cmhughes commented 1 year ago

Many thanks.

I'd argue this is the solution , not a workaround.

I don't have any influence over texlive perl, and the communication I've had with the team about dependency leads me to believe that I can't add anything.

On Tue, 27 Dec 2022, 15:44 Tom de Geus, @.***> wrote:

That would be a work-around, though I wonder if it has be done with texlive's perl? Anyway, I just wanted to report this for the benefit of the library, as a 'work-around' I am using pre-commit and/or the conda-forge package, so I am good to go.

The reason I reported is that I though that maybe the Makefile.PL is not properly used for the texlive package such that the dependency is indeed not included in the package

— Reply to this email directly, view it on GitHub https://github.com/cmhughes/latexindent.pl/issues/404#issuecomment-1365999699, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQ7CYDSNFQV2ARGAGRS25TWPMFF5ANCNFSM6AAAAAATKOFDWE . You are receiving this because you commented.Message ID: @.***>

sadid commented 9 months ago

In my case, on a Archlinux machine, it resolved by adding the missing package perl-yaml-tiny. Despite having the latest texlive installed through pacman, the latexindent.pl was broken, mirroring the OP's issue.

Sharing in case someone finds it helpful. Also see PR #510 and Issue #342 .