TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have found TeXcount extremely useful and, for all my needs so far, most accurate. Nonetheless, I have observed a strange behavior with TeXcount 3.0 (beta) when trying to make the script aware of files being included with the macro \InputIfFileExists.

Everything goes fine if I append the command directly in the script texcount.pl as follows:

my %TeXfileinclude=('\input'=>'input','\include'=>'texfile','\InputIfFileExists'=>'file');

But in order to not have this setting overwritten when upgrading to a next (or the same, but stable) version, I am using an options file. The line

%fileinclude \InputIfFileExists file

leads to some error when I run texcount. The error no longer appears and the scripting proceeds perfectly as soon as I comment that line with the hash sign, #, corresponding to Perl.

Is there something wrong with the way that I am proceeding?

share|improve this question
I am having a similar problem - amongst my preamble I have defined a new column type \newcolumntype{C}[1]{>{\centering\arraybackslash$}p{#1}<{$}} . Texcount only works when this line is commented out, it appears that the hash sign # is causing the problem. Perhaps its simply that the hash symbol isn't taken into account when texcount is parsing the source code? – oLas Apr 29 '13 at 9:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.