I am currently writing a document using Overleaf, a Latex-editing service that provides an automatic word count. However, I do not know how it provides it nor how accurate it is.
I am looking for a way to include Overleaf’s total word count of my document in the output pdf automatically.
If inserting the exact number the Overleaf displays is not possible (i.e., because nobody knows how Overleaf counts words or whatever other reason), any other approximation of my document’s word count will suffice. The whole point is to avoid having to check the word count and writing it down every time I share my piece of work.
There are many questions about word count, but none that asks specifically how to include the total word count in the output pdf (and if there is one and I missed it, feel free to link me there!).
Thank you all very much for your time.
texcountcommand line program (see, for example, https://tex.stackexchange.com/q/527602/107497). I'm not sure if Overleaf would let you use the necessary\write18andtexcount. Having tagged this with [tag:overleaf], I'm pretty sure that one of their support staff will chime in at some point (possibly after the weekend). – Teepeemm Jan 22 '22 at 22:52texcountas @Teepeemm suggests. Some details can be found in our Help at http://overleaf.com/learn/how-to/Is_there_a_way_to_run_a_word_count_that_doesn%27t_include_LaTeX_commands%3F and in the example at https://www.overleaf.com/latex/templates/customising-texcount/dqvrqghbtmbc -- both show how to define and use\quickwordcount{main}and\quickcharcount{main}which should do what you're looking for. Would this help? – yo' Jan 23 '22 at 10:03\quickwordcount{…}is4238 (errors:105) words. My problems with\quickwordcount{…}are four: (1) it inserts a new line, which prevents me from writing “Word count: X,XXX words“ in a single line; (2) I don’t know what these 105 errors are or why they are there, (3) the count is very inaccurate, (4) there is no comma separator for the thousands. Any help with these issues? – EoDmnFOr3q Jan 23 '22 at 10:39-qfrom\detailtexcountand then it will show more information about those errors (I assume that will fix (3) as well). (1) If there aren't any errors, then\quickwordcountwon't have the newline. (4) A comma separator will require string formatting. – Teepeemm Jan 23 '22 at 19:35!!! Invalid \verb: delimier required. !!!and!!! Encountered } without corresponding {. !!!. Moreover, at the very beginning, it says:!!! File not found or not readable: name.tex !!!. However, the document compiles just fine… Regarding (4), how do I do that “string formatting”? To be honest, I am very lost here… – EoDmnFOr3q Jan 23 '22 at 20:43