[ Back to the WING home page ]
This is the home page of TexWordCount.pl, a perl script to count words in TeX and LaTeX documents. It is free to be distributed and used (personal, commercial or otherwise) by anyone, licensed under the Lesser GNU Public License (LGPL).
Download texWordCount.pl. Or fork or download from the distribution on GitHub. Requires perl.
TexWordCount owes much of its added functionality and code to
contributors which are incorporated in the current release. Sam
Tygier at http://www.tygier.co.uk/ added
\input and recursive
\include and more recently, for counting words with
non-breaking spaces (LaTeX "~"). Gregor Heinrich at http://www.arbylon.net/ added
handling of document classes with a chapter level (book,
report). Martin Magnusson modified it for running headers. Edward
Vigmond added proper counting words in captions. Michael Dayan
corrected bug in subsubsection counting.
If you use the script and find problems with its execution, please report them to me. If you have any fixes that would be even better.
Known bugs: Daniel Thomas reports that: "While using texWordCount.pl I noticed that using the -u option results in the file being word counted being modified in a rather dangerous manner likely to result in data loss if the user does not have a backup. (among other things the \inputs were permanently input and the end of the file was cut off completely.)"
> Currently to address this problem, we have disabled the -u flag when \inputs or \includes are detected and processed.
A more comprehensive version of word counting that has a UI is also available from: http://app.uio.no/ifi/texcount/index.html. You might want to try their tool out. Our tool is for fairly simple usage and for those environments that already have the prerequisites installed.