Xref: utzoo comp.sources.wanted:8551 comp.text:4780 Path: utzoo!yunexus!davecb From: davecb@yunexus.UUCP (David Collier-Brown) Newsgroups: comp.sources.wanted,comp.text Subject: Re: Interleaf to nroff or tex filter Keywords: interleaf, nroff, tex, filter Message-ID: <3395@yunexus.UUCP> Date: 25 Aug 89 12:38:21 GMT Article-I.D.: yunexus.3395 References: <308@stripe.ACA.MCC.COM> Organization: York U. Computing Services Lines: 60 beth@stripe.ACA.MCC.COM (Beth Paxton) writes: >Has anyone seen or written an Interleaf (ver. 4.0 - tps) to nroff >or Interleaf to tex filter? If so, from where could I retrieve >it? This could be **real hard**. If one writes a source->source translator, one needs to implement the mapping of all the interleaf options and configurations (or at least all the ones you use (:-)). This is a long task, since Tps is a rich, extensible system. It is well-documented, though: see below. The result of anything "simple" tends to be an information-losing translator! Writing a printerleaf-to-whatever translator is easier, but I'd want to make it a .pl -> .dvi translation, since the concepts are roughly the same: a machine-independent output file for post-filtering. I'd not try .pl to .tex or .nroff, I suspect you'd learn to hate yourself. After all this, I have to admit that I've written tps-to-whatever filters in awk. The TPS 4.0 (ascii) file format is well-documented, and the manual is available. (The printerleaf format is also documented, but I think there's a non-disclosure requirement). If you're trying to translate a **simple** subset into something equally simple, its easy. I may even still have a tps-to-code filter that writes all paragraphs tagged "" into the last-mentioned value of paragraphs tagged "". This thingie was used to extract code from documentation, so I could keep both the code and its explanation in the same place and maintain them simultaneously. From memory, the lisp hook was (resave-file current-object 'ascii) and the awk was BEGIN { outputFile = "erronious.tps"; inFile = 0; } /^/ { outputFile = $1; } /^/ { inFile = 1; continue; } /^>outputFile; continue; } } --dave (who used to work for Interleaf Canada, and still thinks that TPS was the best thing since sliced bread) c-b -- David Collier-Brown, | davecb@yunexus, ...!yunexus!davecb or 72 Abitibi Ave., | {toronto area...}lethe!dave Willowdale, Ontario, | Joyce C-B: CANADA. 223-8968 | He's so smart he's dumb.