[OS X TeX] texcount

Daniel Becker daniel.becker at uni-rostock.de
Mon Feb 23 18:19:11 CET 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://tug.org/pipermail/macostex-archives/attachments/20090223/a843364d/attachment.bin>


More information about the macostex-archives mailing list