[Tex/LaTex] How to get TeXCount working in TeXnicCenter

miktextexniccenterword count

Sorry this is a bit specific, but I could really use some help.
I am trying to work out a good way of getting a word count for my thesis. I do most of my editing on windows, via TeXnicCenter v1 and MikTeX2.9.

The TeXCount webpage implies that MikTeX should come with TeXCount installed, and I see texcount.exe under C:\ProgramFiles\MiKTeX 2.9\miktex\bin\x64 but I don't understand how to use it.

I have seen the following question Using TeXcount with TeXnicCenter on this site, but I decided to go down the route suggested on this thread
http://www.latex-community.org/forum/viewtopic.php?f=36&t=730 because it seemed to me some folks had actually got it working, but it hasn't helped me yet.

I followed the instructions

  1. Install ActivePerl
  2. in TeXnicCenter go to /Tools/Customize/tools/new(insert)/
  3. Fill in:
    WordCount
    command: "cmd /K texcount"
    Arguments: "-inc '%pm'"

At this point it seems to try to run MiKTeX 2.8 but I have no idea why! And then throws up an error message saying "The Perl script could not be found."

I am not surprised, I can't find it either. It is not installed in MiKTeX 2.9\scripts. I have downloaded it myself and put TeXcount_3_0_0_24 into that directory, but I am not confident that this path is being scanned by MiKTeX, and again I am not sure how to make that happen. I tried putting it elsewhere and providing MiKTeX with a new location, but MiKTeX just told me it was "Not a TDS-compliant root directory".

I am rather stumped. I don't want to have to go putting copies of perl scripts and executables into all my directories as the final post suggested.

Alternatively, if you think I am crazy to be going down this route, can anyone recommend a free pdf word counting tool? I'd prefer texcount because my word limit does not include captions, references etc and it's a faff to strip them out.

As a last resort I can ftp everything across to linux and try to install TeXCount there, but I'd prefer to stick with my laptop if I can.

Best Answer

I guess I will answer my question, although it isn't solved as such - but at least I can use TeXcount on windows via what seems to me a very linuxy method!

  1. I installed ActivePerl
  2. I have MikTex installed which has texcount.exe as listed in the question
  3. I hunted around for texcount.pl but still haven't found it - which makes me wonder whether the executable actually contains compiled perl?
  4. I did attempt to run the commands as stated in the original question, and MiKTex did claim to be doing a package install, but I stopped watching so I don't know what it actually did!

Anyway, the outcome is that I can now fire up a command prompt, go to the directory containing my tex file, and run texcount -html my_file.tex >my_file_wc.html and get sensible readable output.