-
Notifications
You must be signed in to change notification settings - Fork 539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Formatting failed error #376
Comments
This extension actually supports formating using latexindent if you have it installed. The log should explain why it didn't work. |
and how do i find that mysterious log? ;) |
You can find it by clicking on |
I am having this same issue now after using the extension for some time. I have latexindent installed and the Output has no information in it. |
All right I found the problem.
|
Do you see |
I've been looking for
There is something fishy with MiKTeX. Apparently the small |
I am working with TeXLive on macOS, so I don't think the above fix works for me. I currently have |
you can still try to fall back on installing the perl interpreter and either it will work as is or employ approach similar to mine. |
There are two possible log messages: if the extension can't find latexindent at all (possible issue with MiKTeX) you should see |
Neither of those applies to me because the output log is empty (see my comment above). |
If you don't use |
Neither of those applies to me either. As I said PS: Win 7, MiKTex 2.9. |
Do you use Latex Workshop 3.12.1 or later (logging for formatting was added with 3.12.1) ? Latexindent in your PATH means |
So I just installed MiKTeX on Windows to reproduce this issue. Here is how I got it to work:
|
Thanks for looking into that. As I said
So, I assume, it requires the modules that you listed above. The exe file that one extracts from the |
I would guess that the latexindent in your PATH is the one provided by MiKTeX or the placeholder provided by MiKTeX (this would require you to install perl as described above). It would be interesting whether format on save works if you delete the latexindent provided by MiKTeX and add the one you downloaded to the PATH. If this works one possible solution would be to provide a config option for Latex Studio to specify the directory where latexindent is installed. |
I wrote exactly this a couple of messages ago. |
I will look into adding a config option. Your message described a workaround using the toolchain though and I was interested whether the detection would work if you have the downloaded version in your PATH. With a config option this won't be an issue though so it might be the best solution for Windows. |
I've created a PR for the config option, so once PRs #381 and #383 are merged you can set the config option |
@quicky84 James just released a new version which contains the fixes described above. Could you please test whether the issue is now resolved? |
I am afraid I can't as I moved from win to mac. |
@thedadams , can u format ur code? (Not saving after formatting) Or u already solved it? It seems it's just one case of failure. I'm a Mac User too. My issue is unable to format codes. As @quicky84 said, the problem might be in
If so, here is a shortcut.
More details u can found in this issue in Atom-beaultifier. |
@yenwu Yes, I fixed it. I was missing some perl modules. Thanks for checking. |
I encountered the same problem on Windows, and I'm using MiKTeX and Strawberry Perl distributions. Turns out it's due to two perl modules missing: cpan -fi Log::Log4perl
cpan Log::Dispatch |
Encountered the same problem on Mac. Here are the packages I installed to make it work.
|
Installed all these packages and get the error
|
After I tried many many times in two days I solved it. Solution is that : "latex-workshop.latexindent.path" in vs code settings you can change to your path ,just like this Before of this, you should download latexindent.exe from latexindent . I find that installing from MikTeX console packages isn't working, so you'd best installed by yourself. |
This worked for me on Windows 10. Thank you! |
@fabiocapasso93 unfortunately this cannot be fixed on the extension side. This is up to the user to set the paths of the different tools properly on his installation. Also, see the wiki page. Feel free to suggest improvements for this page if you think it is detailed enough. |
In my case, File::HomeDir needs force install
|
Thank you, @him229! Your solution worked for me for However, |
@adam-erickson Provided you already have latexindent installed on your Mac, In Visual Studio Code's settings, go to |
Description
When I activate globally "editor.formatOnSave" (as is done for a while it seems in VSCode), I get this error, everytime I save a Latex file:
I suspect this has something to do wit the fact that I need to enable "formatOnSave" on a global level now, to have it working for my Python programming.
I guess your package does not support formatting, which is why I get this error?
I deactivated the error message by adding this language-specific setting to my settings, like so:
So, I'm fine, I was just wondering if there is actually automatic formatting available for this extension somehow? I will close this issue immediately, but wanted to create the issue for somebody else to find.
The text was updated successfully, but these errors were encountered: