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
VimtexCountWords inaccurate on range (apa7 document class) #2935
Comments
That's fascinating. The vimtex/autoload/vimtex/misc.vim Lines 45 to 56 in 9dc34df
When you use a selection, VimTeX will create a temporary file that keeps the current preamble. Notice that you will get 7 words even if you remove the |
Yes, that's precisely what happens. Notice that the word count of this temp file is the count that |
Thanks for walking me through the VimTeX part of it. I'll open an issue on the texcount git, it sadly does look pretty stale (last commit is 4 years ago and it has 3 open issues and 1 pr). Or would you be open to including a workaround? From some quick testing the behavior also seems to appear if you change the class to minimal. If it is a bug with |
I think that is a good idea, even if it is apparently state. However, the maintainer did reply to the existing issues, so he might still suddenly be motivated to fix things?
Well, it seems somewhat fragile to add workarounds for |
Description
as the title states, when using the apa7 document class
VimtexCountWords
gives an inaccurate word count when done over a range. From my (minimal) testing, it seems to include the title.The odd thing is, if you run it over the entire document it seems to give the correct word count. Not sure how I'd go about debugging it further (and if it's an issue that belongs here or on the apa7 package).
Would love to take a shot at it, but I'll need some pointers to get started :)
Steps to reproduce
minimal latex file
if you highlight the "some text." line, and run
:'<,'>VimtexCountWords
it'll say it's 4 long. ("some text." + "A title")if you highlight the "some more text" line, and run
:'<,'>VimtexCountWords
it'll say it's 5 long. ("some more text." + "A title")If you highlight nothing and run
:VimtexCountWords
it'll give you the correct word count of 7.Expected behavior
When following the steps, I'd expect to only get the word count of the selection.
Actual behavior
Currently I get the selection and the title.
Do you use a latexmkrc file?
no
VimtexInfo
The text was updated successfully, but these errors were encountered: