7

Is there a way to stop texcount from counting words in \begin{comment}...\end{comment} blocks? It seems to skip only comments starting with %

Thank you very much in advance!

lockstep
  • 250,273
Dimitar
  • 71

1 Answers1

7

Add

%TC:group comment 0 0

somewhere near the top of your file. See http://app.uio.no/ifi/texcount/faq.html#newgroup.


\documentclass{article}
\usepackage{verbatim}
%TC:group comment 0 0
\begin{document}
one
\begin{comment}
  two three four five six seven eight
\end{comment}
\end{document}

$ texcount tc.tex
File: tc.tex
Encoding: ascii
Words in text: 1
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
Sean Allred
  • 27,421
  • 4
    Just to elaborate... Starting with version 3 of TeXcount, you can use named parsing rules instead of the numerical codes, as well as envir as an alias of group: e.g. the line %TC:envir comment [] ignore is equivalent to %TC:group comment 0 0 where the arguments indicate the number of arguments taken ([] = 0 = none) and their rules, and the rule for parsing the environment (ignore = 0). – Einar Rødland Mar 13 '14 at 09:32