ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* counting the words in a TeX document
@ 2006-08-05 16:45 Mojca Miklavec
  2006-08-05 17:02 ` Aditya Mahajan
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Mojca Miklavec @ 2006-08-05 16:45 UTC (permalink / raw)


Hello,

I would like to ask how difficult it would be to count the number of
words in a TeX/ConTeXt document. If it's too complex, please ignore
the rest of the message.


Most recipes for LaTeX say that it's best to do something like
"pdftotext" and then issue "wc" to count the words in the resulting
text file, but windows users don't have "wc" and sometimes you only
need to know the length of the abstract or so ...

Some time ago Hans mentioned that he counts the number of appearance
of single charactres, but I don't know how difficult it would be to
extend it to count the number of words.

The problem is not that well defined (how to handle equations, some
would probably want to exclude headers, footers, buttons, ...), but it
only needs to be an approximation and "backward compatibility" (in the
sense that counter would have to result in the same number after some
years) is not needed at all since algorithms might improve with time
and the resulting document doesn't really depend on that number, it
would only be written to the log file.

My idea for the interface would be something like

\startwordcount[abstract]
\startframedtext
Bla bla.
\stopframedtext
\stopwordcount

which would write something like "abstract: 2 words" to the log file

or

\startstatistics[abstract][words]
\startframedtext
Bla bla.
\stopframedtext
\stopstatistics

But this is really a low priority. I'm currently using Acrobat to copy
the text, then I paste it into Office and take a look at statistics
there when I need to obey some limitations.

So, if there's a simple solution, I would be glad to use it, but if it
takes too much time to implement it, it's probably not worth the
effort.

Thanks a lot,
    Mojca

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2006-08-08  7:54 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-05 16:45 counting the words in a TeX document Mojca Miklavec
2006-08-05 17:02 ` Aditya Mahajan
2006-08-05 17:52 ` gnwiii
2006-08-05 20:07 ` Hans Hagen
2006-08-06  0:31   ` Mojca Miklavec
2006-08-06 15:00     ` Hans Hagen
2006-08-06 17:27     ` Aditya Mahajan
2006-08-07  8:24       ` Mojca Miklavec
2006-08-07  9:22         ` Hans Hagen
2006-08-07 18:54           ` Mojca Miklavec
2006-08-07 20:55             ` Hans Hagen
2006-08-07 21:31               ` Mojca Miklavec
2006-08-08  0:49                 ` Aditya Mahajan
2006-08-08  7:54                 ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).