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

Texlive 2021 doesn't install latexindent properly on Ubuntu 18.04 #342

Closed theairbend3r closed 2 years ago

theairbend3r commented 2 years ago

Hi, I recently installed Texlive 2021 and have been trying to get latexindent working.

I get an error when I try run latexindent --version or latexindent test.tex.

$ latexindent test.tex 
Can't locate YAML/Tiny.pm in @INC (you may need to install the YAML::Tiny module) (@INC contains: /home/akshaj/texlive/2021/texmf-dist/scripts/latexindent /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.26.1 /usr/local/share/perl/5.26.1 /usr/lib/x86_64-linux-gnu/perl5/5.26 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.26 /usr/share/perl/5.26 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /home/akshaj/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm line 21.
BEGIN failed--compilation aborted at /home/akshaj/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm line 21.
Compilation failed in require at /home/akshaj/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/Verbatim.pm line 22.
BEGIN failed--compilation aborted at /home/akshaj/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/Verbatim.pm line 22.
Compilation failed in require at /home/akshaj/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/Lines.pm line 22.
BEGIN failed--compilation aborted at /home/akshaj/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/Lines.pm line 22.
Compilation failed in require at /home/akshaj/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/Document.pm line 28.
BEGIN failed--compilation aborted at /home/akshaj/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/Document.pm line 28.
Compilation failed in require at /home/akshaj/texlive/2021/bin/x86_64-linux/latexindent line 27.
BEGIN failed--compilation aborted at /home/akshaj/texlive/2021/bin/x86_64-linux/latexindent line 27.

I built texlive 2021 from source and installed it in my home directory.

$ whereis latexindent
latexindent: /usr/local/bin/latexindent /home/akshaj/texlive/2021/bin/x86_64-linux/latexindent

$ which latexindent 
/home/akshaj/texlive/2021/bin/x86_64-linux/latexindent

#.bashrc
export PATH=/home/akshaj/texlive/2021/bin/x86_64-linux:$PATH

I've seen asnwers suggesting various methods like - apt-get install texlive-extra-utils or latexindent-module-installer. What's the recommended way to get latexindent working?

cmhughes commented 2 years ago

Can you install the Yaml tiny module?

On Tue, 22 Feb 2022, 15:55 Akshaj Verma, @.***> wrote:

Hi, I recently installed Texlive 2021 and have been trying to get latexindent working.

I get an error when I try run latexindent --version or latexindent test.tex.

$ latexindent test.tex Can't locate YAML/Tiny.pm in @INC (you may need to install the YAML::Tiny module) @.*** contains: /home/akshaj/texlive/2021/texmf-dist/scripts/latexindent /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.26.1 /usr/local/share/perl/5.26.1 /usr/lib/x86_64-linux-gnu/perl5/5.26 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.26 /usr/share/perl/5.26 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /home/akshaj/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm line 21. BEGIN failed--compilation aborted at /home/akshaj/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm line 21. Compilation failed in require at /home/akshaj/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/Verbatim.pm line 22. BEGIN failed--compilation aborted at /home/akshaj/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/Verbatim.pm line 22. Compilation failed in require at /home/akshaj/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/Lines.pm line 22. BEGIN failed--compilation aborted at /home/akshaj/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/Lines.pm line 22. Compilation failed in require at /home/akshaj/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/Document.pm line 28. BEGIN failed--compilation aborted at /home/akshaj/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/Document.pm line 28. Compilation failed in require at /home/akshaj/texlive/2021/bin/x86_64-linux/latexindent line 27. BEGIN failed--compilation aborted at /home/akshaj/texlive/2021/bin/x86_64-linux/latexindent line 27.

I built texlive 2021 from source and installed it in my home directory.

$ whereis latexindent latexindent: /usr/local/bin/latexindent /home/akshaj/texlive/2021/bin/x86_64-linux/latexindent

$ which latexindent /home/akshaj/texlive/2021/bin/x86_64-linux/latexindent

.bashrc

export PATH=/home/akshaj/texlive/2021/bin/x86_64-linux:$PATH

What's the recommended way to get latexindent working?

— Reply to this email directly, view it on GitHub https://github.com/cmhughes/latexindent.pl/issues/342, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQ7CYHR6GSL56KRIR345KDU4OWYTANCNFSM5PBZRECA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

cmhughes commented 2 years ago

https://latexindentpl.readthedocs.io/en/latest/sec-appendices.html#linux

theairbend3r commented 2 years ago

https://latexindentpl.readthedocs.io/en/latest/sec-appendices.html#linux

Oh, I didn't realise there was an installation page in the appendix. It is very useful! The instructions there solved my issue. Thank you! :smile:

cmhughes commented 2 years ago

Great to hear!

On Wed, 23 Feb 2022, 09:29 Akshaj Verma, @.***> wrote:

https://latexindentpl.readthedocs.io/en/latest/sec-appendices.html#linux

Oh, I didn't realise there was an installation page in the appendix. It is very useful! The instructions there solved my issue. Thank you! 😄

— Reply to this email directly, view it on GitHub https://github.com/cmhughes/latexindent.pl/issues/342#issuecomment-1048591151, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQ7CYCFSL7TTMCGUZ7JN73U4SSILANCNFSM5PBZRECA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>