Closed Nbelles closed 2 years ago
Try the following commands from the terminal, stop when you get the first one that works:
latexindent latexindent.pl perl latexindent.pl
latexindent should be available from any directory, as it should be in your path. You shouldn't have to use the leading "./" as in
./latexindent.pl
Here is the output from running the following commands:
[computer:~]
[Nathaniel]% latexindent
zsh: exec format error: latexindent
[computer:~]
[Nathaniel]% latexindent.pl
zsh: command not found: latexindent.pl
[computer:~]
[Nathaniel]% perl latexindent.pl
Can't open perl script "latexindent.pl": No such file or directory
[computer:~]
[Nathaniel]% cd /usr/local/texlive/2021basic/texmf-dist/scripts/latexindent/
[computer:latexindent]
[Nathaniel]% perl latexindent.pl
Please enter text to be indented: (press CTRL+D when finished)
[computer:latexindent]
[Nathaniel]%
This looks like it's a problem with your path.
Is your texlive path in your PATH variable? The first option should work fine.
How would I check that?
On Linux I think the command is
echo $PATH
I think it's similar on Mac, https://stackoverflow.com/questions/14617041/how-can-i-see-the-current-value-of-my-path-variable-on-os-x#:~:text=You%20need%20to%20use%20the,contents%20as%20a%20command%20name .
On Sun, 13 Feb 2022, 20:06 Nathaniel.Belles, @.***> wrote:
How would I check that?
— Reply to this email directly, view it on GitHub https://github.com/cmhughes/latexindent.pl/issues/339#issuecomment-1038394537, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQ7CYHDMD3D4WASWWDLTZLU3AFM7ANCNFSM5OH2UWSQ . 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: @.***>
Here's what my path looks like right now: /opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Wireshark.app/Contents/MacOS:/Applications/Visual Studio Code.app/Contents/Resources/app/bin:/Users/Nathaniel/Library/Python/3.8/bin
I don't see the texlive path you posted previously in that path.
On Sun, 13 Feb 2022, 20:12 Nathaniel.Belles, @.***> wrote:
Here's what my path looks like right now: /opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Wireshark.app/Contents/MacOS:/Applications/Visual Studio Code.app/Contents/Resources/app/bin:/Users/Nathaniel/Library/Python/3.8/bin
— Reply to this email directly, view it on GitHub https://github.com/cmhughes/latexindent.pl/issues/339#issuecomment-1038397839, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQ7CYA6TQ76PLKFX25YBDLU3AGC7ANCNFSM5OH2UWSQ . 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: @.***>
Which path do I need to add to it? Just /usr/local/texlive
or /usr/local/texlive/2021basic/texmf-dist/scripts
or /usr/local/texlive/2021basic/texmf-dist/scripts/latexindent
?
Does your pdflatex work from the terminal...? What steps do you normally follow to get your texlive working?
On Sun, 13 Feb 2022, 20:19 Nathaniel.Belles, @.***> wrote:
Which path do I need to add to it? Just /usr/local/texlive or /usr/local/texlive/2021basic/texmf-dist/scripts or /usr/local/texlive/2021basic/texmf-dist/scripts/latexindent?
— Reply to this email directly, view it on GitHub https://github.com/cmhughes/latexindent.pl/issues/339#issuecomment-1038401675, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQ7CYCIBKVJAEFHD2KYUQDU3AG3LANCNFSM5OH2UWSQ . 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: @.***>
Yes, running pdflatex test.tex
(the same test.tex file as before) works just fine.
Can you add usr/local/texlive/2021basic/texmf-dist/scripts to your path?
I'm closing this, let me know if it isn't resolved.
Sorry I wasn't able to get back to this until just now.
I've added that directory to my path and I get the error zsh: permission denied: latexindent
I just tried doing a which latexindent
to see if my terminal knows where it exists and it returns latexindent not found
@cmhughes Just tagging you in case you didn't see the notifications because this is closed.
I'm afraid I don't have much to add to what I've said already in this thread already.
The problem appears to be one centered on your path variable. You need to get your path variable set up so that includes the directory that latexindent is installed in.
This varies from operating system to operating system. For example, on Linux I can edit my bashrc file.
It's not clear to me if every user of your operating system has the same issue. I would hope not and hope that I would have heard from others prior to now.
In summary : you need to find a way to update your path variable to include the directory latexindent is installed in.
On Wed, 23 Feb 2022, 19:51 Nathaniel.Belles, @.***> wrote:
@cmhughes https://github.com/cmhughes Just tagging you in case you didn't see the notifications because this is closed.
— Reply to this email directly, view it on GitHub https://github.com/cmhughes/latexindent.pl/issues/339#issuecomment-1049154378, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQ7CYFVQFEISLL37PWWI23U4U3FLANCNFSM5OH2UWSQ . 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 were mentioned.Message ID: @.***>
Which user does latexindent.pl belong to? Maybe it has been installed as root and needs to have its permissions changed?
Please provide the following when posting an issue:
I'm not sure exactly what the source of what might be causing this issue but I believe I have it setup in VSCode such that it runs latexindent on file save. It attempts to run latexindent but fails according to the LaTeX Workshop output (as seen in the output below). Walking through the pieces of the command, I do have latexindent installed at that location
/usr/local/texlive/2021basic/texmf-dist/scripts/latexindent/latexindent.pl
.I tried opening a terminal on my computer and opening that directory and running the latexindent.pl using
./latexindent.pl
it give the error:zsh: exec format error: latexindent
even though runningperl latexindent.pl
works just finePlease enter text to be indented: (press CTRL+D when finished)
.I have a feeling it is potentially wrong with my latexindent install because when I try running it from the terminal it gives me that error shown above, otherwise I would think that it might be something wrong with the LaTeX Workshop module of VSCode.
Thanks for any insight.
original .tex code
yaml settings
N/A
actual/given output
From LaTeX Workshop output tab in VSCode: [19:23:48] Start formatting with latexindent. [19:23:48] Formatting with command /usr/local/texlive/2021basic/texmf-dist/scripts/latexindent/latexindent -c="/Users/Nathaniel/" "/Users/Nathaniel/__latexindent_temp.tex" -y=defaultIndent: ' ' [19:23:48] Formatting failed: spawn /usr/local/texlive/2021basic/texmf-dist/scripts/latexindent/latexindent EACCES [19:23:48] stderr: [19:23:48] Formatting failed with exit code -13 [19:23:48] stderr:
desired or expected output
N/A
anything else
N/A