[Tex/LaTex] print word count

countersword count

The journal I am submitting to requires a count of the words on the title page. I can of course run texcount on the .tex document and put the number in, but it seems that I should be able to automate this.

For tables and figures (which are also required), I can simply use the totcount package. Is there something equivalent for words? Or can I store the output of texcount in such a way that I can call it on a subsequent pdflatex run?

Best Answer

Here is the solution using bashful. Note that you need to run latex or pdflatex using -shell-escape option

\documentclass{article}
\usepackage{bashful}
\pagestyle{empty}
\bash
texcount -sum -1 tmp.tex
\END
\begin{document}    
This file has \emph{\bashStdout} words.
\end{document}

: