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!

  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – user31729
    Mar 12 '14 at 14:54


%TC:group comment 0 0

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

%TC:group comment 0 0
  two three four five six seven eight

$ 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
  • 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). Mar 13 '14 at 9:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.