akgul@TRBILUN.BITNET (Mustafa Akgul) (02/12/91)
There is a program called TEXTR for this purpose. You can get it from NETLIB. I am including the README file. It can be obtained from various FTP cites also. %%% README file Please read this file before you install the program. Troff-to-TeX translator version .5, October, 16, 1986. Copyright (C) 1986 Kamal Al-Yahya. Copying of this package is permitted without prior permission provided it is not done for profit, this copyright notice is kept, and any changes made to the package are clearly documented. I would very much appreciate any comments or suggestions. My e-net address is kamal@hanauma.stanford.edu (You might have some problems reaching me directly on this address.) Please, note that this is a preliminary version. Known bugs are documented in the bugs file. There will certainly be unexpected bugs. Some bugs will not cause the translated document to be unprintable but will give a result different from your what you expect. The program may not do a 100% translation the first time. However, having it do 90% (or even more) is very much possible unless you have one of those papers that give horrible math combinations. Currently, the program translates most ms macros, most equations, and some plain troff commands. man macros are not included yet, so translation of manuals (especially the headers and footers) may not be good enough. INSTALLATION INSTRUCTIONS In short, type ``make'' and then run it on the document (try the testfile): textr testfile > testfile.tex In details: - In the makefile, define the destination of the executable (default is current directory). Also, if the optimizer in your machine is buggy, delete the -O flag. - type ``make'' to produce the executable, called ``textr''. - The program needs a \lefheader{}, \rightheader{}, and \footer{} macros that we have on our sight but is not included in sep.tex. (The reason is that it is pretty complicated with latex; it involves creating a new pagestyle). You don't have to add these macros to sep.tex, but if the document changes headers and footers, you may want to do it manually in the translated document. - move sep.tex to your macros directory. USING THE TRANSLATOR You can run the program either by textr < file > file.tex or textr file > file.tex You are most likely to get messages on the standard error telling you about things it encounters and cannot do. Now you have the translated document. Look at it and see if you can spot a major error. Run it through latex. If it runs and produces the dvi, then print it. If you get latex error messages modify the translated document accordingly and repeat the latex run, and so on. I usually get away with one or two iterations. %%%%% I received many requests for an early version of the troff-to-tex translator, much more than I'd anticipated! Besides the large number of requests, mail to/from our system is terrible. Some of those who tried to reach me, were not able to do so. On my part, I was also unable to reply to some people; mail keeps coming back. I therefore apologize that I cannot fulfill individual requests with one exception. The exception is that you don't have ftp and my mail to you does not bounce back! I will send it to be put on the distribution tape sooner than I'd planed. Since we don't have anonymous ftp on our system, I will also send it NOW to the University of Washington so that you can ftp it from there. PLEASE NOTE: this is a preliminary release. Unexpected bugs are not impossible (known bugs are documented). Also, there are unrecognized troff commands that will be added in the future if necessary. Some notes about the translator: - I concentrated on math mode and ms macros. They constitute the bulk of the papers written here. I have used it to translate a few documents with no problems. It also has some plain nroff-troff macros, but not many (since people here rarely use them, it was OK). - I decided to make the translated document to be in LaTeX not plain TeX since LaTeX is more widely used here. - The translator is written in C. - documentation is scarce; will add more in the future. %%%%%% Best regards Mustafa Akgul Bilkent University Ankara