I am using TexShop and was wondering if there is an easy way to find the wordcount in a document ?
The way I do it now is copy and paste the PDF document into Word to calculate the word count. Is there a way I can do this directly from the PDF file in MACOS's Preview ? Or through LaTeX directly ?
Asked
Active
Viewed 3.4k times
8
Razor
- 2,691
2 Answers
10
TexCount will do a word count for you and also break it down per section etc.
Available both as a web-app as well as a download, and comes packaged with TeX Live. Can be invoked in the command line with texcount mytexfile.tex.
Werner
- 603,163
Ubiquitous
- 2,566
9
You could try detex document.tex | wc -w
(detex does a decent, but not perfect, job at eliminating LaTeX commands, if you use such to write part of the text, the count will be off. And I don't remember offhand how it handles accents, i.e. l'H\^opital might give too many words).
vonbrand
- 5,473
-
-
1
-
I don't mean to be bothersome, but can you please provide more info ? Where is the command line ? How do I run it ? – Razor Apr 12 '13 at 18:22
-
I don't know Mac that well, but it is a Unixy system. There should be some way to get a terminal where you can enter commands, in that you can
cdto where your document lives. Sorry I can't help more. – vonbrand Apr 12 '13 at 18:29 -
Oh okay I got you. Mac uses
Terminal. So Icdinto the folder and run this ? Will try it now. – Razor Apr 12 '13 at 18:30
texcountcomes with TeX Live, and can be invoked from the commandline (assuming Bash, or equivalent) as follows:texcount mytexfile.tex. It is much better thandetex+wc. – jon Apr 12 '13 at 19:22