1 .\" SSC Reference card macros
3 .\" Copyright (C) 1996, Specialized System Consultants Inc. (SSC)
5 .\" These macros are free software; you can redistribute them and/or modify
6 .\" them under the terms of the GNU General Public License as published by
7 .\" the Free Software Foundation; either version 2 of the License, or
8 .\" (at your option) any later version.
10 .\" These macros are distributed in the hope that it will be useful,
11 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
12 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 .\" GNU General Public License for more details.
15 .\" You should have received a copy of the GNU General Public License
16 .\" along with this program; if not, write to the Free Software
17 .\" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 .\" Generic SSC "card" macros
20 .\" based on lots of other macros
21 .\" Last update: 4-25-91 ph
22 .\" attempting to get margins in the boxes Aug 3 09:43:48 PDT 1994
23 .ll 3i \" length of text line
24 .lt 3.2i \" length of title line
25 .de BT \" bottom of page trap
26 .sp |8.2i \" go to where we put footer
29 .tl ''\\*(CD\\n+(PN'' \" footer is just page number
30 . po 4i \" go to second column
31 .TP \" print header if any
35 .tl ''\\*(CD\\n+(PN'' \" footer is just page number
36 . po .5i \" go to first column
37 . bp \" force a new page (which will force header)
44 .\" put page header stuff here
45 .\" for example: .tl ''WOW!''
48 .\" .wh 8.1i BT \" set bottom of column trap
49 .nf \" don't fill lines
51 .nr CL 1 \" start with column = 1
52 .po .5i \" offset for first column
55 .de ST \" set tabs to normal places
56 .ta .2i .78i 1.2i 1.7i \" set tabs
59 From: bryang@chinet.chi.il.us (Bryan Glennon)
60 Box macro. Do a .mk z where the box is to start, and a .eb
61 where it is to end. Optional argument is a title to be centered
62 within the top box line.
67 Text, etc to be boxed...
68 .eb "Optional title goes here"
73 Text, etc to be boxed...
78 The macro name is eb <.de eb>. First thing we do is to go up on line
79 <.sp -1> and turn off fill mode <.nf>. Now it gets interesting: the
80 .ie is the if/else construct. We check the number of arguments provided
81 to the macro <\\n(.$> and if it is greater than 0 (meaning we have a title),
82 we do the rest of the .ie line, as follows:
84 \h'-.5n' - move left one-half of an n
85 \L'|\\nzu-1' - draw a vertical line <\L> to the
86 absolute position (|) given by \\nzu-1,
87 which is the position set with the .mk
88 command into register z <\\nz> in base
90 \l'(\\n(.lu+1n-\w'\\$1'u/2u)\(ul' - Draw a horizontal line <\l> with length
91 equal to the current line length
92 <\\n(.l> in base units <u> plus the
93 space required for an 'n' <1n>, minus
94 the width <\w> of the title string
95 <\\$1> in base units <u> divided by 2
96 <in base units <u>>. Draw the line
97 using the underline character, <\(ul>.
98 \v'.3m'\|\\$1\|\v'-.3m' - Move down the page 3/10 of an m,
99 <\v'.3m'>, output a 1/6 of an m space
100 <\|>, output the title <\\$1>, another
101 1/6 of an m space <\|>, and then move
102 up the page 3/10 of an m <\v'-.3m'>.
103 \l'...\(ul' - Draw the second part of the line, just
104 like the corresponding left half done
106 \L'-|\\nzu+1' - Draw a verticle line <\L> going down
107 the absolute distance <-|> from where
108 the macro was given to where the start
109 point was marked <\\nz> in base units
110 <u> plus one line <+1>
111 \l'|0u-.5n\(ul' - Draw a horizontal line to the absolute
112 position (|0) when the macro was
113 invoked, minus half an n <-.5n> using
114 the underline character <\(ul>.
116 The .el beings the else part, which is identical to the above, except
117 the string dosen't get printed. This makes the printing of the top
118 line much easier: just draw a line <\l> with width equal to the
119 current line plus the witdh of an n <\\n(.l+1n> using the underline
122 .de ES \" start "text in a box"
128 .de EB \" end "text in a box" -- optional box title as argument
135 \l'(\\n(.lu-\w'\\$1'u)/2u-.33m\(ul'\
136 \v'.3m'\|\\$1\|\v'-.3m'\
137 \l'(\\n(.lu-\w'\\$1'u)/2u\(ul'\
140 .el \h'-.5n'\L'|\\nzu-1'\l'\\n(.lu+1n\(ul'\L'-|\\nzu+1'\l'|0u-.5n\(ul'
143 .de SL \" draw single line (works in non-fill mode only)
148 .de Hl \" draw horizontal line
154 .de DL \" draw double line (works in non-fill mode only)
163 .nr PN 0 1 \" sets starting page number and auto-increment
164 .\" must define page header (if any) before here
166 .ds 3) \|\v'3p'\s+5\z\(sq\s0\v'-3p'\h'1.25p'\v'-.5p'3\v'.5p'\h'2p'
167 .\" old one .ds 2) \h'-1.5p'\v'1p'\s+4\z\(ci\s0\v'-1p'\h'3.25p'2
168 .ds 2) \|\v'-2.4p'\D'c.095id'\h'-5.15p'\v'2.4p'2\h'1.9p'
169 .ds dC \v'1p'\s+5\(bu\s0\v'-1p'\" for development commands
170 .ds tC \s+2\(dm\s0\" (for DWB) should be a triangle
171 .ds tP \s+2\(dm\s0\" (for other text processing) should be a triangle
172 .\" various trademark symbols
173 .ds Tm \v'-0.5m'\s8TM\s0\v'0.5m'
174 .ds Ts \v'-0.5m'\s4TM\s0\v'0.5m'
176 .\" mount Serifa fonts
181 .\" other assorted junk
183 .\" Fl requires extended version of troff
184 .de Fl \" draw fat horizontal line
192 .de Bx \" box for keys in text
194 \s-3\(br\|\fH\v'.18n'\\$1\v'-.18n\fP\|\(br\l'|0\(rn'\l'|0\(ul'\&\s0\|\\$2
196 .de Fn \" function name - left justified, gray background
197 .\" bold with gray for function name
203 \!! gsave ( ) stringwidth neg 0 rmoveto
204 \!! /Serifa-Bold findfont 8 scalefont setfont
205 \!! (\\$1) dup stringwidth pop 6 gsave dup 0 exch rlineto neg exch 0 rlineto
206 \!! 0 exch rlineto closepath .9 setgray fill grestore show