Generaltexcount | Exclude To-Do's

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
letty
Posts: 9
Joined: Fri Jan 01, 2010 5:33 pm

texcount | Exclude To-Do's

Post by letty »

Hi,

I use the "todonotes" package to insert margin notes into my work. These are only for my own reference, and I don't want to include them in my word count.

These notes look a little like this:

Code: Select all

\todo{Insert reference here}
I use "texcount" to count the words in my document. But I don't want these to-do notes to be counted in the word count. At the moment, texcount counts the example given above as 3 extra words.

I'm pretty sure that there should be a simple command to type into my document to tell "texcount" not to count words inside the to-do note curly brackets, but right now I can't work it out.

Can anyone help?

Many thanks

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Einar Andreas
Posts: 2
Joined: Mon Aug 01, 2011 8:14 pm

texcount | Exclude To-Do's

Post by Einar Andreas »

Hi,

I realise this answer may come a bit late...but if nothing else, someone else may stumble upon it.

To add a rule that ignores one parameter following the \todo macro, add the following code somewhere in the LaTeX code prior to the first use:

Code: Select all

%TC:macro \todo 1
where the 1 indicates the number of parameters \todo takes and that should be ignored, or

Code: Select all

%TC:macro \todo [0]
which indicates that \todo takes one parameter which should be processed using "status 0" (which means ignore).

Due to the % at the start, TeX/LateX will consider this line a comment, but TeXcount will parse lines on the form %TC:... as TeXcount instructions.

Einar
Post Reply