On Fri, 3 May 2002, Steve Litt wrote: >On Friday 03 May 2002 09:46 am, Matej Cepl wrote: >> On 3 May, Mark Hansel wrote: >> > If you are using a *nix, you can strip all the lyx and latex >> > lines from the file and pipe the text only to wc. The idea is >> > not mine and appeared on this list about half a year ago. I >> > have the command in a script that is sometimes useful. >> > >> > grep -v "[\]" $1|grep -v "$L yx 1.1" |grep -v "^$" >> > >> There is a program detex, which does basically the same as above >> oneliner (only in much more sophisticated manner), so you can do >> >> detex docname.tex | wc -w >> >> (yes, Virginia, both commands DO exist for both *nix and M$-* >> systems). > >Where would one get detex for Linux?
Try a latex repository. Google claims 2700 hits on detex+linux. ftp://sunsite.unc.edu/pub/Linux/apps/tex/ ftp://sunsite.unc.edu/pub/Linux/apps/tex/deTeX-2.6.README (tar.gz here): http://www.funet.fi/pub/Linux/util/TeX/ However, this does not do what you want. (My interest was piqued by Matej Cepel's response.) The program strips latex commands and all the '\' characters, but does not stip meta information, as required for an accurate word count. (Maybe there a command line options that get that job done and maybe it does the right thing with a pure latex file. But it does not do the right thing with a lyx file.) Here is the top of the output from a large document I am working on. Clearly useless for your purpose. #LyX 1.1 created this file. For more info see http://www.lyx.org/ 218 book _preamble authordate1-4 1.0 _preamble english latin1 default default default single Default a4 _geometry 0 _amsmath 0 portrait 2 2 -- Mark Hansel PO Box 41 Minnesota State University Moorhead Moorhead, MN 56563 ph: 218-236-2039 fax: 218-236-2593 [EMAIL PROTECTED] http://wwwcj.mnstate.edu