[OS X TeX] Word count function?

Themis Matsoukas matsoukas at adelphia.net
Tue Jan 18 02:12:57 CET 2005


On Jan 17, 2005, at 7:10 PM, Ettore Aldrovandi wrote:

> On Tue, Jan 18, 2005 at 12:56:42AM +0100, Maarten Sneep wrote:
>> On 18 jan 2005, at 0:50, Ettore Aldrovandi wrote:
>>
>>> 	detex file.tex|wc -w
>
>> And be sure to read
>>     http://www.tex.ac.uk/cgi-bin/texfaq2html?label=wordcount
>> to understand why the result might be way off.
>
> Didn't claim it is precise. [...] If it is mostly text, maybe the
> inaccuracy wouldn't be so serious.

Excalibur will count fairly accurately w/o including latex commands. 
You can invoke it through texshop via an applescript. I use the 
following (copied directly from the Macros menu):

--AppleScript

tell application "Excalibur"
   activate
   open POSIX file #FILEPATH#
end tell

tell application "texshop"
    close second window
end tell

-- by dafult, first window is console, second window is .tex


Themis

PS. This script closes the tex window to avoid having two versions of 
the same file open, one with the spelling corrected and one w/o. Remove 
the second tell statement if you don't like this feature. 

--------------------- Info ---------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
           & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>





More information about the macostex-archives mailing list