[Tex/LaTex] Installing wordcount

installingword count

I need to count words in a paper. The journal I am writing for suggests to use wordcount.tex (and the related wordcount.sh). I am using TeX Live on a Mac and I could not find these files; I found them on the CTAN.

Now my question is: how should I install these files? Or where should I place them within the TeX Directory Structure?

Best Answer

Download the package at http://ctan.org/pkg/wordcount (i.e., http://mirrors.ctan.org/macros/latex/contrib/wordcount.zip), unpack it, extract its content (wordcount.tex and wourdcount.sh) and copy it in the same folder as your document. Let's assume this document is name test.tex, and that it is in the folder /home/work/.

Launch a console, go to /home/work/ using the command cd, i.e., do

cd /home/work/

Then give to your script wourdcount.sh the right to be executed:

chmod +x wourdcount.sh

You have to do all of the above only once. Once all of this is set up, a simple

./wourdcount.sh test.tex

should gives you what you want. Make sure that you can compile your document test.tex without errors, otherwise wourdcount.sh might not work.

If you are confused by Mac's terminal or uneasy with it, you could ask at https://apple.stackexchange.com/ or try apple support.

You might also want to compare wordcount's output with other software's count. For this, have a look at Is there any way to do a correct word count of a LaTeX document?