tecosaur / LaTeX-Utilities

An add-on to LaTeX Workshop that provides some features that go beyond the bare essentials
MIT License
474 stars 28 forks source link

TeXCount failed #374

Closed DarvidTorres closed 1 year ago

DarvidTorres commented 1 year ago

Bug Report

Disable all the other extensions except for LaTeX Workshop and LaTeX Utilities, and check that you still see this issue.

You still see this issue?: Yes, I still see this issue

Describe the bug

I keep on receving the message "TeXCount failed. Please refer to LaTeX Utilities Output for details" every time I open a .tex file, everything works as it should, except that I just don't seem to know what is causing the message.

I got the texcount.pl script set to PATH, but I don't know what to do to the Count Word: Args setting.

To Reproduce

Steps to reproduce the behaviour:

You can work with .tex files with no problem, render de PDF and everything is ok, the extensions settings are set as default but I keep on receiving the "TeXCount failed. Please refer to LaTeX Utilities Output for details" message. I tryied then to download the texcount.pl script and set the PATH in the LaTeX Utilities extension, and keep seeing the error message.

Expected behaviour

There shouldn't be a "TeXCount failed. Please refer to LaTeX Utilities Output for details" error message every time you open a .tex file.

Logs

"TeXCount failed. Please refer to LaTeX Utilities Output for details"

Desktop

Additional context

I don't know if this is an issue or there's another place to ask questions. Thanks

leoleoasd commented 1 year ago

Please paste the logs here image

DarvidTorres commented 1 year ago

[17:03:34] Initializing LaTeX Utilities. [17:03:34] Live Snippets Loaded [17:03:34] Completion Watcher Initialised [17:03:34] TexCount args: -merge,-brief [17:03:34] Cannot count words: spawn UNKNOWN, undefined [17:03:34] LaTeX Utilities Started [17:03:34] LaTeX Utilities version: 0.4.9 [17:04:01] onDidChangeActiveTextEditor_tex_wordcounter [17:04:35] onDidChangeActiveTextEditor_tex_wordcounter [17:04:35] TexCount args: -merge,-brief [17:04:35] Cannot count words: spawn UNKNOWN, undefined [17:04:45] onDidChangeActiveTextEditor_tex_wordcounter [17:04:46] onDidChangeActiveTextEditor_tex_wordcounter [17:04:46] TexCount args: -merge,-brief [17:04:46] Cannot count words: spawn UNKNOWN, undefined [17:04:55] onDidChangeActiveTextEditor_tex_wordcounter [17:05:02] onDidSaveTextDocument_tex_wordcounter [17:05:05] onDidChangeActiveTextEditor_tex_wordcounter [17:05:05] TexCount args: -merge,-brief [17:05:05] Cannot count words: spawn UNKNOWN, undefined [17:05:09] onDidChangeActiveTextEditor_tex_wordcounter

leoleoasd commented 1 year ago
  1. please check your latex-utilities.countWord.path config, make sure it's your texcount.pl.
  2. please run texcount.pl your_tex_file.tex manually from command line and make sure it works.
  3. If the above steps don't work, try manually install this version and re-produce the bug, then paste the logs latex-utilities-0.4.9.zip
DarvidTorres commented 1 year ago

Okay,

  1. There it is the file that I donwloaded from this page: https://app.uio.no/ifi/texcount/download.html image

Then I set the latex-utilities.countWord.path to the file but the error message still appears.

image image

  1. I run the texcount.pl my_tex_file.tex and it doesn't work, what should I do in this case?

image

leoleoasd commented 1 year ago
  1. try use full path C:\TexCount\texcount.pl in terminal
  2. What tex distribution are you using? AFAIK most distributions come with pre-included texcount
DarvidTorres commented 1 year ago

Using the full path it works, there's a window that opens but it's really fast I can't see what it says, but there's no problem with my terminal. The error message is still appearing

image

image

I have this LaTex distribution

image

leoleoasd commented 1 year ago

https://tex.stackexchange.com/questions/239199/latex-distributions-what-are-their-main-differences which one in this list are you using?

DarvidTorres commented 1 year ago

I have MiKTeX distribution

leoleoasd commented 1 year ago

Can you try a tex file whose name doesn't have space in it? Also try looking for texcount in somewhere like C:\Program Files\MiKTeX\miktex\bin

DarvidTorres commented 1 year ago

I found the texcount.pl file within the folder where my MiKTeX distribution is found, then I changed the path in the extension settings to it. I also changed the name of my file so it doesn't have spaces. The rendering, the syntax highlight, everything goes well, except that I still receive the error message. I disabled the extension and the message goes away, then restart VScode and enable the extension, and the message is there again :(

image

image

image

leoleoasd commented 1 year ago

can you try the vsix I uploaded earlier? that should provide more logs

DarvidTorres commented 1 year ago

I installed the extension manually via de vix file you provided, and here's the output, it seems to me that the error is this one: "spawn UNKNOWN, undefined" (whatever that means)

image

image

leoleoasd commented 1 year ago

https://github.com/facebook/create-react-app/issues/12465 can you try disabling your anti-virus software?

DarvidTorres commented 1 year ago

The only anti-virus I have is the Microsoft Defender Antivirus, and by setting it off, diesabling the extension, then relaunching VScode and enabling it again, the message is still there :( I guess I'm just going to disable the error notifications from VScode so it doesn't bothers me. Thank you

image

leoleoasd commented 1 year ago

You can set latex-utilities.message.error.show to false to disable error logs from latex-utilies. Sorry that I can't provide more help, this weird error seems only happening on your machine

UlisesFco commented 1 year ago

I also had this problem. I fixed it by defining latex-utilities.countWord.path as the texcount.exe file path from the MikTeX installation folder (C:\Users\ulise\AppData\Local\Programs\MiKTeX\miktex\bin\x64\texcount.exe in my case) instead of the one from the texcount.pl file.

pnulty commented 9 months ago

Also have this problem on on Mint Linux

MalcolmMielle commented 7 months ago

I have this problem on fedora

leoleoasd commented 7 months ago

@onulty @MalcolmMielle Can you paste the log inside the output panel of vscode? make sure to select "LaTeX-Utilities" tab and please try running texcount in your terminal

MalcolmMielle commented 7 months ago

My bad I realized that I was missing a bunch of dependencies :(. My bad, sorry for the noise!

tomasrei commented 2 weeks ago

I also had this problem. I fixed it by defining latex-utilities.countWord.path as the texcount.exe file path from the MikTeX installation folder (C:\Users\ulise\AppData\Local\Programs\MiKTeX\miktex\bin\x64\texcount.exe in my case) instead of the one from the texcount.pl file.

Thanks for this! I have TeX Live and this made it work (if I use the command palette, I can't recall how it worked before the bug as it was so long ago!)