[texhax] conversion of .tex to .txt

Bernice Barnett jbbrus at ca.rr.com
Sat Feb 9 06:33:42 CET 2008

Grover Hughes wrote:
> 2008 February 8
> Hello-- I am writing you at the suggestion of Karl Berry, who has been 
> trying to help me with my problem, which is as follows:
> I work in DOS 6.22 and I have several files written in TeX which I 
> want to convert to straight ASCII. (These files do not contain math 
> symbols, just text stuff; they pertain to Pari/GP, and are tutorials 
> and explanations.) I can read these files, but they contain a lot of 
> symbols and characters which obviously don't belong in a purely ASCII 
> text, and while I can edit them out, it's a chore, as there are a lot 
> of 'em, and I'd rather have some software program to do the conversion 
> (i.e., editing) for me.
> I have a file called "tex2mail", which is stated to be such a 
> conversion program, but that introduces its own problems.
> In a file called README, I am told that I must convert the first line 
> in "tex2mail" so it will show "the correct full path name of your perl 
> executable".
> I have no idea what the "correct path name" should be, nor do I 
> have anything pertaining to "perl" (which I am told is some sort of 
> programming language itself).
> Also, the README file says that the invocation to cause the conversion 
> to take place is:
>    tex2mail [-linelength <bytesperline> ] [-debug <level> ] [-by_par] 
> [-TeX] [-ragged] [-noindent] < foo.tex > foo.txt
> in which I assume that "foo" would be replaced by the actual name of 
> the TeX file which I want to have converted. Is that correct? I tried 
> that, but (probably because I hadn't changed that pesky first line in 
> any way) all I got was an error message from DOS, about a bad command.
> Karl steered me to a program called "detex", which I downloaded, but 
> when I tried it, all I got was a message stating that it won't run 
> under DOS (which Karl warned me up front might well be the case). He 
> suggested that I explain my problem to you and to ask if you might 
> know of a binary (in detex, or whatever) which WOULD run in DOS and do 
> what I want. So, I'm asking!!
> Your help will be GREATLY appreciated!
> Grover Hughes   retiree, Sandia National Laboratory, Albuquerque, NM
> ghughes at magtel.com <mailto:ghughes at magtel.com>     (479) 675-9137
Perhaps you could process the file with tex or latex, as appropriate, 
then turn the output into pdf. Then using acrobat, the text can be 
extracted. If you don't have the necessary tools in your dos 
environment, perhaps a friend running another system could help you. By 
the way, this extraction path may do a more faithful job than just 
working on the original tex file.

-- Jeff Barnett

More information about the texhax mailing list