Penguin
Diff: LatexWordcount
EditPageHistoryDiffInfoLikePages

Differences between version 6 and previous revision of LatexWordcount.

Other diffs: Previous Major Revision, Previous Author, or view the Annotated Edit History

Newer page: version 6 Last edited on Tuesday, August 23, 2005 4:02:13 pm by JohnMcPherson Revert
Older page: version 5 Last edited on Tuesday, August 23, 2005 4:01:27 pm by JohnMcPherson Revert
@@ -50,16 +50,17 @@
 ---- 
  
 !!Option 3 - dvi2tty 
 As you can guess from the name, this is designed for rendering a .dvi file to a terminal (or to a file). 
-The disadvantage of this is that you have to be using plain latex instead of pdflatex, so that you can generate a .dvi file. [IMHO] This is a better approach than the previous two because LaTeX has already parsed the source files so it doesn't need to worry about tex/latex commands, but the format still has enough information to keep words intact (except where TeX has hyphenated words at the margin). 
+The disadvantage of this is that you have to be using plain latex instead of pdflatex, so that you can generate a .dvi file. [IMHO] this is a better approach than the previous two because LaTeX has already parsed the source files so it doesn't need to worry about tex/latex commands, but the format still has enough information to keep words intact (except where TeX has hyphenated words at the margin). 
 <verbatim> 
 # -w100 means format for 100 chars wide 
 # perl to remove punctuation so wc doesn't count them 
+# and remove hyphenation at the end of lines  
 dvi2tty -w100 /path/to/file.dvi \ 
  | perl -pe 's/-$// || s/$/ /; chomp; s/[-\._|]//g' | wc -w 
 </verbatim> 
  
  
 You want the <tt>dvi2tty</tt> package in Debian Sarge, 
 dev-tex/dvi2tty in Gentoo, or get it from 
 <tt>ftp://ftp.mesa.nl/pub/dvi2tty/dvi2tty-5.3.1.tar.gz</tt>