I am using the following macro to count the number of words in a journal article:
\usepackage{xesearch}
\newcounter{words}
\newenvironment{wordcount}{%
\setcounter{words}{0}
\SearchList!{wordcount}{\stepcounter{words}}
{a?,b?,c?,d?,e?,f?,g?,h?,i?,j?,k?,l?,m?,
n?,o?,p?,q?,r?,s?,t?,u?,v?,w?,x?,y?,z?}
\UndoBoundary{'}
\SearchOrder{p;}}{%
\StopSearching}
I then use:
\begin{wordcount}
blah blah blah
\end{wordcount}
to count the words between. However, I need to indicate the word count on the title page which preceeds the part of the document I want a word count for. Is there some way to insert the counter value at a point in the document that lies before the counter environment?
Thanks
Steve
aux
file so that it is available on the next run (just like labels…)\DeclareTotalCounter{words}
. It will give you the\totalwords
command.