You can use the detex tool to strip LaTeX commands. If you do detex file.tex
, it will output to stdout. Then, you can use the diction tool to analyse your text, and suggest improvements. Putting it all together:
detex file.tex | diction -bs
This will strip the LaTeX, and pipe it into diction with suggestions and "beginner mistakes" enabled.
For Debian/Ubuntu:
sudo apt-get install diction texlive-extra-utils
This will install detex and diction, as well as several other useful tools.
Since you mentioned that you're using Emacs, there is also diction.el which provides diction integration with Emacs. You can do M-x diction-buffer
, and it will take care of detexing/dehtmling and show the diction results in a separate buffer. You can even hit enter on the individual results to be taken to approximately where the phrase is.
(If you do use diction.el, my version of detex didn't have the -C flag. I'm not sure of what it was meant to do, but if you search for 'detex -C' in the file, you can add other command line options if you want. Also, I recommend replacing 'diction -L' with 'diction -bsL')
PDFSync is the way to go. Also, compile your thesis with the lineno package for line numbering (you can find it on CTAN with docs).
When anyone annotates your PDF and send it to you, PDFSync will allow you to just click on the passage in the PDF in order to open your LaTeX file in the corresponding position. It will save a lot of time when searching for missing commas and such things. For people that cannot annotate your PDF, they can refer to page and line number (thanks to lineno), and that will also greatly speed up your ability to find the place you need to do corrections, because you can just open your own PDF, and thanks to PDFSync you will be able to open the LaTeX source in the right place.
This is what I do now for my LaTeX writing, and it works wonders when passing review versions around to co-authors. Moreover, line numbers are used by APS when they send proofs for papers about to be published (not sure why they don't do it for referee versions too, but ...), and that makes the communication of typesetting errors much easier.
Best Answer
If you look the source code of detex (written in C) you will see that it consists the main job is done by lex (lexical analyzers) with a help of the small sed script. I checked and detex is unfortunatelly not ported to Cygwin but my feeling is that you should be able to compile on Cygwin (you have flex (free lex), gcc, gnu sed etc).
Now other options which are not so sophisticated is to write your own sed (perl) script. Obviously you need to run that in Cygwin. I am at work right now and I am sure I have seen sed one-liners which can do decent job of detex-ing. I will try to find/write such a script and post here. I will also try to post 100 points bounty for such sed one-liner. If you Google you should be able to find Perl script which does that.
Edit: Try this script which uses dvi as an intermediate format and catdvi toll to strip LaTeX tags.
I also checked for people who wants to go dvi route dvi2tty does a marvelous job converting dvi file into plain text files. No additional processing is needed.
There is another one well known sed script tex2xml for converting tex2xml written by Tilmann Bitterberg. I will try to fix it to do conversion to plain ASCII.