[texworks] Wordcount

Daniel Becker daniel.becker at uni-rostock.de
Sat Aug 1 13:16:02 CEST 2009


Hallo -

in TeXShop (Mac) with TexLive2008 I am using texcount, see
http://folk.uio.no/einarro/Comp/texwordcount.html
It is one of the scripts that come with TeXLive. The maintainer is  
very helpful.

Below you can find a script that works fine on a Mac - you end up with  
a html-page that displays the result. In TeXShop, you can also use  
AppleScript to have a nicer display of the results, and to apply it  
only to selected text (rather the whole document), but as TeXCount is  
meant to be multiplatform, that is maybe not of interest here?

One could also use detex & wc. The results are ususally less accurate  
than those by texcount. But if you display two different results,  
users might get the idea that wordcounting is nothing that always  
works with 100% accuracy.

As the OP, I would be happy if TeXWorks would have a wordcount  
functionality.

Best,
Daniel



#!/bin/tcsh


# See also the documentation of texcount inside
# /usr/local/texlive/2008/texmf-dist/doc/support/texcount/
# for other variants to call texcount on your TeX-files


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"

#



More information about the texworks mailing list