I am using TeXCount to perform a word count. I am using %TC:macro \macroname n
(http://app.uio.no/ifi/texcount/faq.html#newmacro) to treat macros differently (for example I have a 'to-do' macro). Can I count the contents of these macros and put this count in a custom category for HTML output? Their other
option ("count text as other text") puts the count in the same category as captions, etc. which is undesired.
MWE:
\documentclass[a4paper]{minimal}
\newcommand\todo[1]{\textcolor{red}{#1}}
\begin{document}
\todo{Insert some text here.}
\end{document}
Given a 'to-do' macro todo
which simply colours the enclosed text in red, I seek a TeXCount command like %TC:macro \todo [my_category]
which counts the number of words enclosed in \todo
and associates it with my_category
. It should produce something like the following.
File: mwe.tex
Encoding: ascii
Words in text: 0
Words in headers: 0
Words outside text (captions, etc.): 0
Number of headers: 0
Number of floats/tables/figures: 0
Number of math inlines: 0
Number of math displayed: 0
Number of words in my_category: 4
Subcounts:
text+headers+captions (#headers/#floats/#inlines/#displayed/#my_category)
0+0+0 (0/0/0/0/4) _top_
I appreciate that this may not be possible.
Thanks.
texcount
. Essentially you would create two such files and give counts for each. I use a script which wrapstexcount
and does all this automatically. The details depend on your code and OS, though. But that's the basic strategy.