Path: utzoo!attcan!uunet!cs.utexas.edu!rutgers!ucsd!helios.ee.lbl.gov!nosc!humu!uhccux!munnari.oz.au!basser!steve From: steve@basser.oz (Stephen Russell) Newsgroups: comp.sources.wanted Subject: Re: LOOKING FOR WAYS TO TRANSLATE TEX, NROFF AND PC WORDPROCESSOR FILS Summary: Use printer files as common interface Message-ID: <2263@basser.oz> Date: 24 Jun 89 13:00:55 GMT References: <4522@tekgen.BV.TEK.COM> Organization: Dept of Comp Sci, Uni of Sydney, Australia Lines: 24 In article <4522@tekgen.BV.TEK.COM> robertj@tekgen.BV.TEK.COM (Robert Jaquiss) writes: > > I am looking for translation programs. Specifically I >want to translate PC type word processor files to nroff or >tex. A technique I've found useful is to use the PC WP to generate a print file (ie, print to a file, not the printer) for a common printer such as an FX-80. I choose the FX80 as adornments like underlining, bold and italics, are indicated by simple escape sequences. This format is relatively easy to translate into nroff (or tex?), although some more smarts are needed to translate things like para breaks, headings, etc, and remove unneeded page layout features like margins for the printer. The advantage of this approach is the common interface - most (all?) WP programs can generate FX80 printer codes. It's certainly much easier than decoding yet another proprietary WP file format. Of course, things like tables are harder to translate into their equivalent Tbl code. If you're interested, I can post/mail a program I have here that does a reasonable job of converting FX80 to ms macro troff source. Apart from the translation of escape sequences, it recognises patterns like new paras in the input. This pattern matching is easy to modify for other input styles.