mm2me.awk, translates troff files, mm to me

Flame Bait joshua at athertn.Atherton.COM
Fri Aug 18 11:25:00 AEST 1989


#
# MM2ME.AWK (version 1.0)
# By Joshua Levy                     joshua at 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 <input.mm >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 ; }



More information about the Alt.sources mailing list