#! /bin/perl 'di'; 'ig 00'; # # $Header: /share/store/roff/src/RCS/roff.pl,v 3.54 2004/05/17 08:22:16 root Exp root $ # $Locker: root $ # $Log: roff.pl,v $ # Revision 3.54 2004/05/17 08:22:16 root # *** empty log message *** # # Revision 3.53 2004/04/27 13:51:23 root # added A4 line to gs # # Revision 3.52 2004/04/27 13:26:59 root # PA level 1 now # (PS level 1 now). # # Revision 3.51 2004/04/27 13:23:35 root # added ghostscript filter to allow stuff to print properly # without this it all prints on one page. # # Revision 3.50 2004/04/26 10:30:30 root # amended to work with renamed macros: # tmac.m is now om.tmac (newer versions of groff) or tmac.om # whilst tmac.gm is now tmac.m and or m.tmac. # Fingers crossed !!!! # # Revision 3.49 2003/12/09 10:57:21 root # changed ghostview to gv. # # Revision 3.48 2003/12/09 10:56:33 root # *** empty log message *** # # Revision 3.47 2000/03/20 12:41:10 root # fixed to run under gtroff on linux. # this mainly entailed changing gtbl -> tbl etc # # Revision 3.46 1996/08/21 09:50:42 pete # added support for in-line letter head with # the .\"ROFF_LHEAD+ switch # # Revision 3.45 1996/05/22 08:33:54 pete # added code to spit -t dvi out on stdout # # Revision 3.44 1995/11/28 09:19:51 pete # added stuff for NAMAS logo at top of page, LHS. # Also a ROFF_NAMAS_TOP+ flag for embedding in documents. # #Revision 3.43 1995/11/27 16:57:54 pete #added initial NAMAS logo support # #Revision 3.42 1995/06/14 08:32:28 pete #Added code to recognise mgm macros and also to recognise #.\"ROFF_MACRO mm (or mgm) in the code # #Mgm macros have precedence # #Revision 3.41 1995/02/02 14:49:56 pete #Added capability to use bin3 of the Apple Pro 810 laser printer, so #can put letter heading etc in there. # #Revision 3.40 1995/01/24 16:34:36 pete #*** empty log message *** # #Revision 3.39 1994/11/10 10:59:52 pete #added -nodraft flag - tells roff to ignore ALL draft flags/switches # #Revision 3.38 1994/04/01 09:26:39 pete #added code to check for .\"ROFF_DRAFT+ to switch on draft mode # #Revision 3.37 1994/02/07 08:51:14 pete #As previous # #Revision 3.36 1994/02/07 08:50:27 pete #Addes 3 and 6 pages a page options # #Revision 3.35 1994/01/17 14:14:59 pete #Added support for different printers # #Revision 3.34 1993/12/06 08:34:48 pete #CHanged so that ghostview reads a PS file, and not\ # #Revision 3.33 1993/09/01 12:35:14 pete #added -f flag to grotty # #Revision 3.32 1993/05/10 13:36:42 pete #included check for .R1 to start refer # #Revision 3.31 1993/05/07 15:07:33 pete #Added support for new bib style options, refer, new help screen etc. # #Revision 3.30 1993/04/29 12:18:55 pete #Added support for DRAFT stuff to be printed on the page. # #Revision 3.29 1993/04/01 13:04:51 pete #*** empty log message *** # #Revision 3.26 1993/04/01 12:55:53 pete #fixed problem with description of math # #Revision 3.24 1993/04/01 12:51:41 pete #Added support for math pre-processor # #Revision 3.23 1993/02/17 11:22:04 pete #Added -Tgv option to use ghostview as previewer # #Revision 3.22 1992/12/08 12:09:16 pete #included bib macro files in FILES part of man page # #Revision 3.21 1992/12/08 12:03:50 pete #added man info about -b option # #Revision 3.20 1992/12/08 11:59:57 pete #Added -b option for bib style, added man page to script, changed method of detecting references (looks for matching [. .] on same line) . # #Revision 3.19 1992/12/07 14:04:30 pete #but don't do .HP lines ! # #Revision 3.18 1992/12/07 13:52:15 pete #looked for lines starting with 'fp also ... # #Revision 3.17 1992/12/07 13:34:25 pete #Added checking for fonts in positions 10 - 12 (groff 1.06 compatability # #Revision 3.16 1992/12/04 11:31:27 pete #Changed to work with groff 1.06, eg: removed flags for geqn and gpic, removed device specific macro stuff. # #Revision 3.15 1992/12/04 10:49:00 pete #*** empty log message *** # #Revision 3.14 1992/07/07 09:29:35 pete #added support for gspreview postscript previewer. # #Revision 3.13 1992/06/18 10:38:49 pete #Changed the -n option so it produces -rP for first page #numbering. # #Revision 3.12 1991/11/11 11:36:55 pete #lpr insufficient - had t o include grops in pipeline # #Revision 3.11 1991/11/11 11:30:21 pete #Added -printCommand support for groff 1.03 to allow printing #from the menu of gxditview. # #Revision 3.10 1991/09/05 15:35:24 pete #Changed support for -2 -4 and -8 options to print #multiple pages on 1 postscript page. # #Revision 3.9 1991/08/09 08:55:35 pete #changed the section where it looks for commands indicating specific #macros etc so that the `.` was quoted. # #Revision 3.8 1991/08/08 13:24:28 pete #added to help message that -ls = m&s news # #Revision 3.7 1991/07/25 13:58:40 pete #ttook out the grap statement - it was causing some problems # #Revision 3.6 1991/07/22 11:38:16 pete #added -msmtl to $trflag so that .hL macro works for h line drawing # #Revision 3.5 1991/07/18 09:35:04 pete #added some support for -Txdvi. squirts it into a file and #then runs xdvi on that file. #still some problems - xdvi doesn't know about the fonts groff uses, and #also a problem with writing the tmp file in some cases. # #Revision 3.4 1991/07/16 13:26:05 pete #fixed double pipeline bug in gxditview part # #Revision 3.3 1991/07/16 12:33:08 pete #added support for printing postscript to standard output #using -Tstdout # #Revision 3.2 1991/07/16 12:13:18 pete #*** empty log message *** # #Revision 3.1 1991/07/16 11:17:28 pete #tweaked help screens etc # #Revision 3.0 1991/07/15 16:21:19 pete #1st major revision to old ct code. Seems ok - probably many bugs. # # 25-01-91 - added support for 2 pages per sheet with multi.ps # 12-07-91 - changed to support groff on Sun Sparc. # 22-7-91 - make it read in the smtl macreo file in tmac.smtl - place all local macros there # 1-4-93 - added support for math preprocessor # load up the getopt.pl stuff ... require 'newgetopt.pl'; # SET UP VARIABLES $OPATH=$ENV{'PATH'}; $HOME=$ENV{'HOME'}; $TERM=$ENV{'TERM'}; $LOGNAME=$ENV{'LOGNAME'}; #$sqtroff="gtroff "; $sqtroff="troff "; $FONTS="/usr/local/lib/groff/font"; $LHEAD="/home/lib/text/lhead/lhead.ps"; # letter head postscript $NAMAS_HEAD="/home/lib/text/lhead/namas-pos-small.ps"; # NAMAS postscript $NAMAS_HEAD_TOP="/home/lib/text/lhead/namas-pos-small-top-lhs.ps"; # NAMAS postscript for top of page, LHS $DNEWS="/home/lib/text/lhead/newssheet.ps"; # dressing times postscript $MNEWS="/home/lib/text/lhead/m+s-news-sheet.ps"; # m&s news postscript $TEMPFILE="/tmp/sq$$"; $GVFILE="/tmp/gv$$"; $GSFILTER="gs -q -sPAPERSIZE=a4 -sDEVICE=pswrite -dNOPAUSE -dBATCH -dSAFER -dLanguageLevel=1 -sOutputFile=- -"; # SET UP THE HELP ROUTINE sub help { print " <<<< HELP SCREEN - $0 - \$Revision: 3.54 $ >>>> Only important/frequently used options are found here. Read the manual page (man roff) for the rest. $0 [-l mdptns] [-draft] [-land] [-lbl] [-version] [-t dev] [-mMACRO] [-23468cdeghptvwsvw] [-o pagelist ] [-n pagenumber] file . * = commands which might not yet work correctly !!! -bin3 use 3rd bin on apple printer -c chem preprocessor (doesn't work) -d debug flag -draft Draft (print draft in grey) -e eqn preprocessor * -g grap (doesn't work) -h help -land Print in Landscape -lbl lbl preprocessor -l[mdpt] letter heading - [mdpt]=SMTL n=Dress Tines, s=M+S News -mm mm macros (actually runs tmac.om now) -ms ms macros -mv mv macros -me me macros -man man macros -mvgrind mvgrind macros -mgm GNU mm macros -memo SMTL memo macro -namas Add NAMAS logo to bottom, LHS -namastop Add NAMAS logo to top, LHS -nobib stop bib from being used -nodraft overrides all draft flags -n i number pages starting from i -o i output pages in range i -p pic preprocessor -s small caps flag -tbl tbl preprocessor -t dev Preview output on device eg: X75, X100, ps, dvi, xdvi ascii, latin1, gs (ghostscript previewer), gv (ghostview) -version Print version and exit -v Print verbose command line and exit. -w turn on warnings -[248] multi-page option -printer If this message has just flashed off your screen, try running $0 -h | pg so that you can peruse the whole help screen. "; } # option parsing. This takes options in @ARGV $return_status= &NGetOpt( # "b:s", # bib style "bin3", # chem preprocessor (doesn't work) "c", # chem preprocessor (doesn't work) "d", # debug flag "draft", # Draft flag "nodraft", # will over-ride all Draft flags "e", # eqn flag "g", # grap flag (doesn';t work) "h", # help flag "land", # Landscape flag "lbl", # lbl flag "l:s", # letter heading flag "mm", # Macro Types "ms", "mv", "me", "man", "mvgrind", "mgm", "memo", "mdoc", "namas", "namastop", "nobib", # stop bib from being used "n=s", # number pages starting from .. "o=s", # pages to output "p", # pic flag "printer=s", # name of alternate printer "s", # Small Caps flag "tbl", # tbl flag "t=s", # terminal type "version", # Print version flag "v", # verbose flag "w", # warnings flag "2", # multi-page flag "3", # multi-page flag "4", # multi-page flag "6", # multi-page flag "8" # multi-page flag ); # thank you Larry Wall ! if ( $return_status == 0 ) { print STDERR "SORRY - illegal usage\n"; die "Please run $0 -h to see the help screen\n"; } # test arguments if ($opt_b) {$bibstyle=$opt_b; } if ($opt_nobib) {$nobib++; } if ($opt_bin3) {$bin3++; } if ($opt_c) {$chem++;$pic++; } if ($opt_d) { $debug++;} if ($opt_draft) {$draft++; } if ($opt_nodraft) {$nodraft++; } if ($opt_e) {$eqn++; } if ($opt_g) {$grap++;$pic++; print STDERR "-g grap option not currently supported\n";} if ($opt_h) {do help();exit 2;} if ($opt_land) { $gropflag = "$gropflag -l ";} if ($opt_lbl) {$lbl++; } if ($opt_namastop) { $namasfile = "$NAMAS_HEAD_TOP";} if ($opt_namas) { $namasfile = "$NAMAS_HEAD";} if ($opt_l =~ /[mdtp]/ ) { $lheadfile = "$LHEAD $NAMAS_HEAD"; $opt_l=""; } elsif ($opt_l =~ "n") { $lheadfile = "$DNEWS"; $opt_l=""; } elsif ($opt_l =~ "s") { $lheadfile = "$MNEWS"; $opt_l=""; } elsif ($opt_l ne "") { print STDERR "Unrecognised option -l <<$opt_l>>\n"; exit 2; } elsif ($opt_l eq "") { # if we HAVEN'T used -l on the command line } else { # opt_l is set but does not have a value $lheadfile = "$LHEAD"; } if ($opt_mm) { $macro .= "-mom ";} if ($opt_ms) { $macro .= "-ms ";} if ($opt_me) { $macro .= "-me ";} if ($opt_mv) { $macro .= "-mv ";} if ($opt_man) { $macro .= "-man ";} if ($opt_mvgrind) { $macro .= "-mvgrind ";} if ($opt_mgm) { $macro .= "-mm ";} if ($opt_memo) { $macro .= "-memo ";} if ($opt_mdoc) { $macro .= "-mdoc ";} # if ($opt_n) {$fpage="-n$opt_n"; } # WRONG ! see next line !! if ($opt_n) {$fpage="-rP$opt_n"; } # set register P to this !! mm macro # stuff from P 92, Gehani if ($opt_o) {$pages="-o$opt_o"; } if ($opt_p) {$pic++; } if ($opt_printer) {$PRINTER="-P $opt_printer"; } if ($opt_s) { $SCAP = "scap |";} if ($opt_tbl) {$table++; } if ($opt_t) { $tflag="$opt_t"; } if ($opt_version) { print "$0: \$Revision: 3.54 $ \n"; exit 0;} if ($opt_v) {$nop++; # Nop (no operation) $debug++; # set debug by default if nop chosen } if ($opt_w) { $warnflag= " -wall ";} # code for multiple pages - if more than one -2 -4 -8 flag, # only last one is used. if ($opt_2) { $multi="| psnup -2"; } if ($opt_3) { $multi="| psnup -3"; } if ($opt_4) { $multi="| psnup -4"; } if ($opt_6) { $multi="| psnup -6"; } if ($opt_8) { $multi="| psnup -8"; } # how deal with illegal arguments ??? # else {print "Unknown Argument.",$ARGV[0],"\n";exit 2;} # Now any arguments left in @ARGV are filenames, otherwise use stdio if ($#ARGV ge 0){ $args = join(' ',@ARGV); open (input,"soelim $args |$SCAP")||die "Can't open file.\n"; } else { open(input, "cat - |soelim|$SCAP")||die "Can't open stdin\n"; } do maketmp(); do set_term(); do makecmd(); do docmd(); sub maketmp { open(output,">$TEMPFILE")|| die "Can't open $TEMPFILE\n"; while() { if (/^\.MT/) { $mm++ ;} elsif (/^\.TS/) { $table++;} elsif (/^\.TH/) { $TH++;} elsif (/^\.SH/) { $SH++;} elsif (/^\.T |^\.A |^\.B /) { $mv++; } elsif (/^\.[PLI]P/) { $ms++;} elsif (/^\.G1/) { $grap++ ; print STDERR "Grap not currently supported\n"; $pic++;} elsif (/^\.PS/) { $pic++;} elsif (/^\.EQ/) { $eqn++;} elsif (/^\.L=/) { $lbl++;} elsif (/\{\{.*\}\}/) { $math++;} elsif (/^\.cstart/) {$chem++;} elsif (/\[\..+\.\]/) {$bib++;} elsif (/^\.R1/) { $refer++;} elsif (/^\.\[/) {$refer++;} elsif (/^\.[pnil]p/) {$me++;} # check for draftboiler stuff and automatically put into # draft mode elsif (/^\.\\\"ROFF_DRAFT\+/) {$draft++;} # draft mode elsif (/^\.\\\"ROFF_LHEAD\+/) { $lheadfile = "$LHEAD $NAMAS_HEAD"; } # check for macro package flags elsif (/^\.\\\"ROFF_MACRO[ \t]*mm/) {$mm++;} elsif (/^\.\\\"ROFF_MACRO[ \t]*mgm/) {$mgm++;} # check for NAMAS flags elsif (/^\.\\\"ROFF_NAMAS_TOP\+/) { $namasfile = "$NAMAS_HEAD_TOP"; } elsif (/^\.\\\"ROFF_NAMAS\+/) { $namasfile = "$NAMAS_HEAD"; } # check for mgm specific macros elsif(/^\.(APP|APPSK|BVL|COVER|COVEND|GETHN|GETPN|GETR|GETST|INITR|MC|MOVE|MULB|MULN|MULE|PGFORM|PGNH|SETR|TAB|VERBON|VERBOFF)/) {$mgm++;} # Error checking for fonts in positions 10, 11 & 12 - # to ensure compatability with groff 1.06 elsif (/^\.fp 10/) {do fonterr(); } elsif (/^\'fp 10/) {do fonterr(); } elsif (/^\.fp 11/) {do fonterr(); } elsif (/^\'fp 11/) {do fonterr(); } elsif (/^\.fp 12/) {do fonterr(); } elsif (/^\'fp 12/) {do fonterr(); } elsif (/^\.ds HF 12 11 10/) {do fonterr(); } elsif (/^\'ds HF 12 11 10/) {do fonterr(); } else {;} print output $_ ; } close(output); } sub makecmd { # work out letter headings # NOTE: command line arguments take precedence # Also, mgm > mm > man > ms if ($mgm ge 1 && $macro eq "" ) { $macro="-mm ";} if ($mm ge 1 && $macro eq "" ) { $macro="-mom ";} if ($TH ge 1 && $SH ge 1 && $macro eq "") { $macro="-man ";} if ($mv ge 1 && $macro eq "") { $macro="-mv ";} # if ($ms ge 1 && $macro eq "") { $macro="-ms ";} # if ($me ge 1 && $macro eq "") { $macro="-me ";} # if ($table ge 1) { $tbl="| tbl ";} # if ($grap ge 1) { print STDERR "NB: No grap preprocessor available yet\n"; } # if ($grap ge 1) { $grap="| ggrap ";} if ($eqn ge 1) {$eqn="| eqn ";} if ($math ge 1) {$math="| math ";} if ($pic ge 1) { $pic="| pic ";} if ($lbl ge 1) { $lbl="| lbl ";} if ($refer ge 1) { $refer="| refer ";} if ($bib ge 1) { if (-r "$HOME/INDEX") { $REFINDEX=" -p $HOME/INDEX "; } if ($nobib) { # don't use bib } else { # if ($bibstyle) { $bib="| bib -t$bibstyle $REFINDEX"; } else { $bib="| bib -tspem $REFINDEX"; } } } if ($chem ge 1) { $chem="| chem ";} } # now set up terminal type sub set_term { if ($tflag eq ""|| $tflag=~"ps|stdout|gs|gv") { # either PS or not requested any # type of device- defaults to PS if ($tflag eq "stdout") { $stdout++; } # make sure we know it goes to stdout if ($tflag eq "gs") { $gs++; } # make sure we know it goes to gspreview if ($tflag eq "gv") { $gv++; } # make sure we know it goes to ghostview $tflag="ps"; $trflag="$trflag -T$tflag"; # set to postscript macros # LETTER HEAD ETC # -namas processed before -lhead, because -l m will put # the NAMAS logo on anyway. if ($namasfile) { # if -namas flag been used $lhead1="(cat $namasfile ; "; $lhead2=")"; } if ($lheadfile) { # Letter heading set $lhead1="(cat $lheadfile ; "; $lhead2=")"; } if ($eqn) { # next 2 lines only needed for old groff/geqn #$eqndef="$FONTS/dev$tflag/eqnchar -"; #$eqnflag="-D -T$tflag $eqndef"; $eqnflag=" "; } if ($pic) { $picflag=" "; } $outfilt="grops $gropflag "; if ($draft && !defined $nodraft) { # add the draft filter to the out filter $draft = " -rC4 "; $outfilt="$outfilt | makedraft "; } if ($bin3) { $outfilt="$outfilt | bin3 "; } if ($stdout) { $spooler="| $GSFILTER "; # force to stdout for redirection to file etc } elsif ($gs) { # ghostscript previewer $spooler="$multi | gspreview"; } elsif ($gv) { # ghostview previewer # $spooler="$multi | ghostview -"; $spooler="$multi > $GVFILE ; gv $GVFILE ; rm $GVFILE"; } else { $spooler="$multi | $GSFILTER | lpr $PRINTER"; } } elsif ($tflag=~"X75|X100|X75-12|X100-12") { # X previewer $trflag="$trflag -T$tflag"; # X macro if ($eqn) { $eqnflag=" "; } if ($pic) { $picflag=" "; } $outfilt=" gxditview -printCommand \'grops $gropsflag | lpr\' -"; } elsif ($tflag=~"xdvi") { $trflag="$trflag -Tdvi"; # X macro if ($eqn) { # $eqndef="$FONTS/dev$tflag/eqnchar -"; $eqnflag=" "; } if ($pic) { $picflag=" "; } $outfilt=" grodvi"; $spooler=" > /tmp/$LOGNAME.dvi"; print STDERR "Now use xdvi previewer on /tmp/$LOGNAME.dvi.\n"; } elsif ($tflag=~"dvi") { $trflag="$trflag -Tdvi"; # X macro if ($eqn) { # $eqndef="$FONTS/dev$tflag/eqnchar -"; $eqnflag=" "; } if ($pic) { $picflag=" "; } $outfilt=" grodvi"; $spooler=" "; } elsif ($tflag=~"ascii|latin1") { $trflag="$trflag -T$tflag"; # ascii macro $outfilt="grotty -f "; $spooler=" | pg"; } else { # don't recognise this device print STDERR "Unrecognised device type $tflag\n"; } $trflag="$trflag -msmtl "; # force use of smtl macros } # Now the business ..... sub docmd { # $cmd= "$multicmd1 $lhead1 (cat $TEMPFILE $math $lbl $chem $refer $bib $grap $pic $picflag $tbl $eqn $eqnflag | $sqtroff $land $warnflag $macro $trflag $pages $fpage $draft | $outfilt $lhead2 $multicmd2) $spooler ;rm $TEMPFILE "; $cmd= "$multicmd1 $lhead1 (cat $TEMPFILE $math $lbl $chem $refer $bib $grap $pic $picflag $tbl $eqn $eqnflag | $sqtroff $land $warnflag $macro $trflag $pages $fpage | $outfilt $lhead2 $multicmd2) $spooler ;rm $TEMPFILE "; if ($debug) { print "$cmd\n"; } if ($nop) { # if nop set ; # do nothing } else { system "$cmd"; # otherwise, do the command } } sub fonterr { print STDERR "\n**** ERROR: Incorrect font position detected **** This line known to cause problems with groff 1.06: $_ Please run the program \"fixgroff-font\" on this file to ensure you don't encounter any problems. See Pete for further info/details. \n"; } ############################################################### ############################################################### # These next few lines are legal in both Perl and nroff. .00; # finish .ig 'di \" finish diversion--previous line must be blank .nr nl 0-1 \" fake up transition to first page again .nr % 0 \" start at page 1 '; __END__ ##### From here on it's a standard manual page ##### '\" t .de TQ .br .ns .TP \\$1 .. .TH ROFF 1 "4 December, 1992" "Roff Version 3" .SH NAME roff \- semi-intelligent front end for the groff document formatting system .SH SYNOPSIS .B roff [ .B \-[23468cdeghpsvw] ] [ .B \-bin3 ] [ .B \-draft ] [ .B \-land ] [ .B \-lbl ] [ .B \-version ] [ .BI \-l [mdpt] ] [ .BI \-[mm|ms|mv|me|mvgrind|mgm|memo|mdoc] ] [ .BI \-T dev ] [ .BI \-n num ] [ .BI \-b style ] [ .BI \-o list ] [ .BI \-printer printer-name ] [ .IR files \|.\|.\|.\| ] .SH DESCRIPTION .B roff is a semi-intelligent front-end to the groff document formatting systems. It will make a guess at what pre-processors and post-processor are required to print the document using the .B groff suite of programs (currently groff 1.06). Usually, it is sufficient to type .BI roff and roff will do all the hard work for you. .PP By default it will assume that the document is to be printed on a postscript laser printer. .PP Available devices are: .TP .B ps For PostScript printers and previewers .TP .B gs Produces PostScript output through the GhostScript gspreview previewer. .TP .B dvi For TeX dvi format (not supported yet) .TP .B X75 For a 75 dpi X11 previewer .TP .B X100 For a 100dpi X11 previewer .TP .B ascii For typewriter-like devices .TP .B latin1 For typewriter-like devices using the ISO Latin-1 character set. .TP .B stdout For postscript output to stdout - thus the output can be captured in a file and previewed with .B pageview. (Note that the groff output is not, by default compatible with pageview - if you want compatability you have to give grops some additional flags - see grops(1)). .LP The default device is .BR ps . Although it will try and guess which pre-processors to use, it can optionally be forced to preprocess with any of .BR gpic , .BR geqn , .BR gtbl , .BR chem , or .B scap. It runs .B gsoelim by default on .B all of its input. .PP It will try and determine which macro package to use from its input, and will also load any macros and eqn definitions required for a particular device. It will also spool the resulting output, the spooling device depending on the terminal that has been selected (eg: postscript goes to the printer, -Tascii through a pager to the screen etc). .LP Options without an argument can be grouped behind a single .BR \- . A filename of .B \- denotes the standard input. .LP If .B roff finds a line starting with .BR ".L=" , it assumes that the .B lbl preprocessor is required. .LP If .B roff finds .B "[." in a file, it assumes that this is the start of a reference, and that .BR bib , the bibliography preprocessor, is required. .SH OPTIONS All options are now parsed with the GNU style option parser, which is case insensitive, but allows long names. .TP .B \-h Print a help message. .TP .B \-[23468] Print 2,3,4,6 or 8 pages to a sheet. .TP .B \-bin3 Print out on whatever paper stock is in bin 3 of the Apple Pro 810 printer. .TP .B \-c Preprocess with chem macros - not yet implemented. .TP .B \-d Print out a debug line before executing the command. .TP .B \-draft Print out in draft format - the word DRAFT is printed in grey on every page (not double spaced as previously). .TP .B \-e Preprocess with geqn. .TP .B \-g Preprocess with grap - not yet implemented in gtroff system. .TP .B \-land Landscape mode .TP .B \-lbl Preprocess with lbl(1). .TP .B \-tbl Preprocess with gtbl. .TP .B \-p Preprocess with gpic. .TP .B \-s Preprocess with scap (turns consecutive capital letters into smaller point size for aesthetic effect). .TP .B \-version print out version number of .B roff. .TP .B \-v Print the pipeline on stdout instead of executing it. .TP .B \-w Turn on more gtroff warnings than usual. .TP .BI \-l arg Print the appropriate letter heading - .TS box; cb cb a a. arg letter heading _ m,d,p,t SMTL Letter Heading n Dressing Times Heading s M&S Newsheet Heading .TE .TP .BI \-t dev Prepare output for device .IR dev . The default device is .BR ps . Allowed devices are .BR X75 , .BR X100 , .BR ps , .BR gs , .BR gv , .BR stdout , .BR ascii , .BR latin1 , and .B dvi. .TP .BI \-o list Print out pages in .I list only. Eg: \-o 1,3-8,25 \(em prints out pages 1 followed by pges 3 to 8 and finally by page 25. .TP .BI \-printer printer-name Select the printer for output to go through, such as -printer apple800. .TP .BI \-m{arg} Forces use of .BI m {arg} macro package. Generally these will be .TS box; cb cb a a. arg macro package _ m mm macros s ms macros v mv viewgraph macros e me macro an man macros vgrind vgrind macros for printing programs mgm Gnu mm macros memo SMTL memo macros .TE .TP .BI \-n num Numbers first page printed as .I num. .TP .BI \-b style USes the bib macro package according to .I style. Defaults to bib style .I spem. Other legit styles are .I foot, used mainly for test methods and SOP's. .SH MISCELLANEOUS roff will recognise certain constructs in the document it is processing, and invoke the correct filter for that construct. For example, if it sees a .B ".TI" then it will invoke the .I tbl preprocessor. Of particular interest is the .I math(1) preprocessor, which looks for expressions of the type {\ {\ var=\[123.123\]\ }\ } See the man page for .I math for further details. .SH FILES .TP .B /usr/local/lib/groff/hyphen Hyphenation patterns .TP .BI /usr/local/lib/groff/tmac/tmac. name Macro file used by .BI \-m name\fR. .TP .BI /usr/local/lib/bmac/bib. name Macro file for bib style .IR name . .TP .BI /usr/local/lib/groff/font/dev name /DESC Device description file for device .IR name . .TP .BI /usr/local/lib/groff/font/dev name / F Font file for font .I F of device .IR name . .TP .BI /usr/local/lib/groff/font/dev name /eqnchar .B geqn definitions for device .IR name . .SH "SEE ALSO" .BR grog (1), .BR gtroff (1), .BR gtbl (1), .BR gpic (1), .BR geqn (1), .BR grops (1), .BR grodvi (1), .BR grotty (1), .BR groff_font (5), .BR groff_out (5), .BR groff_ms (7), .BR groff_me (7) .BR lpr (1) .BR lpq (1) .BR pageview (1) .br .I "Groff Character Names" .SH "AUTHOR" Peter Phillips, Surgical Materials Testing Laboratory, Bridgend, S. Wales. .SH "BUGS" If your document imports postscript code, it will not allow you to preview that postscript on a device other than the laser printer. The .B \-land option only prints in landscape format for postscript devices. If .B scap or .B gsoelim are run, this fact does not show up in the debug line.