# [tex-live] apparent bug in detex

cfrees at imapmail.org cfrees at imapmail.org
Mon Nov 1 02:23:20 CET 2010

On Mon 1st Nov, 2010 at 01:46, Zdenek Wagner seems to have written:

> Hi,
> I think that detex is not a proper tool for calculating the amount of
> the text. Imagine the following plain TeX document:
>
> \def\word{word}
> \newcount\num
> \loop \word \space \ifnum\num<10000 \advance\num1 \repeat
> \bye
>
> This creates 10 full pages of text but detex + wc says 4 3 17

It works reasonably well for things like papers, though. I can't
imagine that sort of construction being a problem there. In any case,
it is currently what TeXShop uses and it is very handy to be able to
get statistics in TeXShop without having to change applications. I know
it is not entirely accurate at the best of times.

I would like to be able to get an accurate word count in some way. But
there doesn't seem to be a good way of doing this for (La)TeX documents.

If I can't get an accurate count, an overestimate is usually better
than an underestimate because I'm usually trying to get something
within a word limit. And footnotes need to be included in my counts.

I would also like to be able to get quick statistics in TeXShop.

Usually, I've relied on TeXShop's statistics and, thus, detex.  Right
now I'm using the 2009 version of detex although this is something of a
hack.

I just discovered texcount which can give me a more accurate result
although it isn't perfect either.

But, anyway, if it is regarded as a feature to count some footnotes but
not others, so be it. I think that's a strange feature, but who am I to
say?

Best,
cfr

> 2010/11/1 Norbert Preining <preining at logic.at>:
>> Hi,
>>
>> On Mo, 01 Nov 2010, Dr. Clea F. Rees wrote:
>>>       Test\footnote{ a footnote}  \emph{it} quickly.
>>> then detex gives:
>>>       Test  a footnote  it quickly.
>>> but detex -l gives:
>>>       Test   it quickly.
>>
>> Probably this is on purpose?
>>
>> In TeX mode it does not know what \footnote does, so assumes it
>> creates more or less the text that is contained in the argument, like
>>        \it
>> or something.
>>
>> In LaTeX mode it knows that \footnote creates something which
>> is out of the running text, so it removes the text, as it does *NOT*
>> belong to the running text.
>>
>> I consider this behaviour correct.
>>
>>
>> Best wishes
>>
>> Norbert
>> ------------------------------------------------------------------------
>> Norbert Preining            preining@{jaist.ac.jp, logic.at, debian.org}
>> JAIST, Japan                                 TeX Live & Debian Developer
>> DSA: 0x09C5B094   fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094
>> ------------------------------------------------------------------------
>> SYMOND'S YAT (n.)
>> The little spoonful inside the lid of a recently opened boiled egg.
>>                        --- Douglas Adams, The Meaning of Liff
>>
>
>
>
>