[OS X TeX] texcount

Daniel Becker daniel.becker at uni-rostock.de
Mon Feb 23 12:19:11 EST 2009


Hallo -

I just found out that MacTeX / TeXLive 2008 contains the command  
"texcount" that can be used to count words of a LaTeX-file. It can  
handle included files and produces an html-file with its results.

I think that it works much better than "detex" that is used in TeXShop  
internally for the Edit -> Statistics Menu-Item

Below you can find an "TeXShop-Engine" that counts the words of  
your .tex-file and produces two html-files with the results. And opens  
them.

Thought this might be interesting for others who need to count words....

Daniel



Content of my .engine file in ~/Library/TeXShop/Engines/texcount.engine:


#!/bin/tcsh

set path= ($path /usr/texbin /usr/local/bin)
set filename = "$1"
set htmlname = "${filename:r}-texcount.html"
set htmlname2 = "${filename:r}-texcount-short.html"

# all details
# run texcount and produce an html-file with the result
texcount -html -inc -v "$1" > "$htmlname"
#open the html-file
open "$htmlname"

# only the counts
# run texcount and produce an html-file with the result
texcount -html -inc -v0 "$1" > "$htmlname2"
#open the html-file
open "$htmlname2"

#end of the "engine"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4647 bytes
Desc: not available
URL: <http://email.esm.psu.edu/pipermail/macosx-tex/attachments/20090223/a843364d/attachment.p7s>


More information about the MacOSX-TeX mailing list