[OS X TeX] Word count function?
Peter Pagin
peter.pagin at philosophy.su.se
Tue Jan 18 05:48:34 EST 2005
I wouldn't have thought that the inclusion of page numbers is a serious
problem for a word count. Assuming that each page numeral occurrence is
one word, deduct the number of pages of the output from the word count
result.
Best,
Peter
Maarten Sneep wrote:
> On 18 jan 2005, at 2:12, Themis Matsoukas wrote:
>
>> 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):
>
>
> Any means of automated counting is bound to be inacurate: please count
> the number of words in $E = mc^2$. Besides: if you use a bibliography,
> the number of words will be seriously underestimated, unless detex
> includes the .bbl files for you (the command \bibliography{} will
> introduce many pages). More commands that introduce significant
> lengths of text are known to exist.
>
> There is a trick that might work to some extend (leaving the maths as
> an unresolved issue): count the number of words in the output of
> dvi2tty instead of detex. Since this counts the words in the output of
> TeX, it is likely to generate a more accurate result, although it
> still leaves the problem of page numbers. To get around that issue:
> use tex4ht and count the words in the html output.
>
> Maarten
>
> --------------------- 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>
>
>
--
-----------------------------------------------------
Professor
Department of Philosophy, Stockholm University
106 91 Stockholm, Sweden
tel: +46-8-162813, fax: +46-8-152226
email: peter.pagin at philosophy.su.se
--------------------- 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 MacOSX-TeX
mailing list