Word Count – How to Count All Characters Including Spaces

word count

How can I count the number of characters in the compiled version of a Latex file? This should include spaces and all of the document (index, footnotes, bibliography etc)

Best Answer

This is probably as much as you can get

pdftotext document.pdf -enc UTF-8 - | wc -m

For DVI files one can use

catdvi -e UTF-8 -s document.dvi | wc -m

(Thanks to Bob for having pointed to the -enc option and to catdvi.)