1 .\" This module is believed to contain source code proprietary to AT&T.
2 .\" Use and redistribution is subject to the Berkeley Software License
3 .\" Agreement and your Software Agreement with AT&T (Western Electric).
5 .\" @(#)tt12 8.1 (Berkeley) 6/8/93
6 .\" Copyright (C) Caldera International Inc. 2001-2002. All rights reserved.
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions are
12 .\" Redistributions of source code and documentation must retain the above
13 .\" copyright notice, this list of conditions and the following
16 .\" Redistributions in binary form must reproduce the above copyright
17 .\" notice, this list of conditions and the following disclaimer in the
18 .\" documentation and/or other materials provided with the distribution.
20 .\" All advertising materials mentioning features or use of this software
21 .\" must display the following acknowledgement:
23 .\" This product includes software developed or owned by Caldera
24 .\" International, Inc. Neither the name of Caldera International, Inc.
25 .\" nor the names of other contributors may be used to endorse or promote
26 .\" products derived from this software without specific prior written
29 .\" USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA
30 .\" INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR
31 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
32 .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
33 .\" DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE
34 .\" FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR
35 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
36 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
37 .\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
38 .\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
39 .\" OR OTHERWISE) RISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
40 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
49 macro to leave two extra inches of space just before section 1,
51 The cleanest way to do that is to test inside the
55 the section number is 1,
56 and add some space if it is.
59 command provides the conditional test
61 just before the heading line is output:
63 ^if \e\en(SH=1 ^sp 2i \e" first section only
66 The condition after the
68 can be any arithmetic or logical expression.
69 If the condition is logically true, or arithmetically greater than zero,
70 the rest of the line is treated as if
73 If the condition is false, or zero or negative,
74 the rest of the line is skipped.
76 It is possible to do more than one command if a condition is true.
77 Suppose several operations are to be done before section 1.
78 One possibility is to define a macro
81 if we are about to do section 1
86 --- processing for section 1 ---
95 An alternate way is to use the
100 ^if \e\en(SH=1 \e{--- processing
101 for section 1 ----\e}
107 must occur in the positions shown
108 or you will get unexpected extra lines in your output.
111 an `if-else' construction,
112 which we will not go into here.
114 A condition can be negated by preceding it with
116 we get the same effect as above (but less clearly) by using
121 There are a handful of
122 other conditions that can be tested with
124 For example, is the current page even or odd?
126 ^if o ^tl 'odd page title''- % -'
127 ^if e ^tl '- % -''even page title'
129 gives facing pages different titles and page numbers on the
130 outside edge when used inside an appropriate new page macro.
137 which tell you whether the formatter is
142 ^if t troff stuff ...
143 ^if n nroff stuff ...
146 Finally, string comparisons may be made in an
149 ^if 'string1'string2' stuff
157 The character separating the strings can be anything
159 not contained in either string.
160 The strings themselves can reference strings with