Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!bionet!ames!amdahl!pyramid!athertn!joshua From: joshua@athertn.Atherton.COM (Flame Bait) Newsgroups: alt.sources Subject: mm2me.awk, translates troff files, mm to me Message-ID: <11734@joshua.athertn.Atherton.COM> Date: 18 Aug 89 01:25:00 GMT Reply-To: joshua@atherton.COM (Flame Bait) Organization: Atherton Technology, Sunnyvale, CA Lines: 37 # # MM2ME.AWK (version 1.0) # By Joshua Levy joshua@atherton.com home:(415)968-3718 # {decwrl|sun|hpda}!athertn!joshua work:(408)734-9822 # # Converts mm documents to me documents. # Sleeze hack solution, quick to write, but only does 80% of the job. # # usage: awk -f mm2me.awk output.me # # You must go over the output of this program, and translate some of the # macros by hand. Most of these macros are on the first page (ie. TL, # AU, AF, etc). If you make any improvements to this code, please send # them to me. Thanks. # $1==".P" { $1 = ".pp" ; } $1==".HU" { $1 = ".uh" ; $NF = $NF "\n.pp" ; } $1==".BL" { mark = "\\(bu" ; next ; } $1==".LE" { mark = "" ; next ; } $1==".LI" { $1 = ".ip " mark ; } $1==".nr" { print ".\\\" NR hack: " $0 ; next ; } $1==".PH" { $1 = ".he" ; } $1==".PF" { $1 = ".fo" ; } $1==".SP" { $1 = ".sp" ; } $1==".IP" { $1 = ".ip" ; } $1==".LP" { $1 = ".lp" ; } $1==".KS" { $1 = ".(b" ; } $1==".KE" { $1 = ".)b" ; } $1==".FS" { $1 = ".(f" ; } $1==".FE" { $1 = ".)f" ; } $1==".RS" { $1 = ".in +5" ; } $1==".RE" { $1 = ".in -5" ; } $1==".DS" { $1 = ".(b" ; } $1==".DE" { $1 = ".)b" ; } $1==".XP" { $1 = ".xp" ; } $1==".AI" { $1 = ".sp 1" } { print $0 ; }