Dear all For several years, I have had to produce short reports constrained by strict word limits. As is well known, this is not straightforward when using LaTeX, given that commands should not be counted as part of the text.
Until recently, I managed with a workaround based on *pandoc -t plain dummy.tex | wc -w* wrapped in a simple Emacs Lisp function. However, I have since discovered that /texcount/ has improved significantly since I last evaluated it a few years ago. I have therefore revised my Lisp code accordingly. As the output format of /texcount/ is somewhat awkward to parse, I relied on ChatGPT to help craft a suitable regular expression. Encouraged by the results, I developed a minor mode that displays the word count in the modeline, triggered by /after-save-hook/. Since I am not especially familiar with modeline customisation, I again sought assistance from ChatGPT. Unfortunately, on my 14-inch laptop screen—where many minor modes are active—the modeline entry was not always visible. I therefore opted to display the count in /header-line-format/ instead. I have attached the code below. It has been tested over several days on Linux. Would you consider including something along these lines in AUCTeX? I am aware that the mode relies on an external program (/texcount/), but this seems in line with other AUCTeX features that interface with external tools such as /latex/, /pdflatex/, /evince/, and so on. I have not tested the code on macOS. (Nor do I use Windows.) Kind regards Uwe Brauer
texcount-mode.el
Description: application/emacs-lisp
smime.p7s
Description: S/MIME cryptographic signature