cat /proc/claus

because blogs never go out of style!

Word count of multi-file Latex project

2022 March 05

Today I learned a nice trick to get the total word count of a latex project with multiple files:

detex *.tex | wc -w

screenshot of a bash shell. A directory with a few tex files is shown, as well as the result of the command "detex *.tex | wc -w"

detex does a pretty decent job of extracting commands from a latex file, and wc, of course, gets a word count. What surprised me was that detex did the sensible thing when presented with multiple files and merged all the output together. Gotta love the "small tools" unix philosophy.

Tagged: #bash, #latex, #tech, #tips, #unix, #wc,