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 .\" @(#)tt09 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.
45 Titles, Pages and Numbering
47 This is an area where things get tougher,
48 because nothing is done for you automatically.
49 Of necessity, some of this section is a cookbook,
50 to be copied literally until you get some experience.
52 Suppose you want a title at the top of each page,
56 .tl 'left top'center top'right top'
63 ^he 'left top'center top'right top'
64 ^fo 'left bottom'center bottom'right bottom'
66 to get headers and footers automatically on every page.
67 Alas, this doesn't work so easily in
69 a serious hardship for the novice.
70 Instead you have to do a lot of specification (or use
71 a macro package, which makes it effortless).
73 You have to say what the actual title is (easy);
74 when to print it (easy enough);
75 and what to do at and around the title line (harder).
76 Taking these in reverse order,
77 first we define a macro
79 (for `new page') to process
80 titles and the like at the end of one page
81 and the beginning of the next:
86 \&.tl 'left top'center top'right top'
90 To make sure we're at the top of a page,
91 we issue a `begin page' command
93 which causes a skip to top-of-page
97 Then we space down half an inch,
101 should be self explanatory; later we will discuss parameterizing the titles),
102 space another 0.3 inches,
107 at the bottom of each page,
108 we have to say something like
109 `when the text is within an inch
110 of the bottom of the page,
113 This is done with a `when' command
118 (No `.' is used before NP;
119 this is simply the name of a macro, not a macro call.)
121 `measure up from the bottom of the page',
123 `\-1i' means `one inch from the bottom'.
127 command appears in the input outside the definition of
129 typically the input would be
138 As text is actually being output,
140 keeps track of its vertical position on the page,
141 and after a line is printed within one inch from the bottom,
150 at the specified place,
151 which is `sprung' when that point is passed.)
153 causes a skip to the top of the next page
157 then prints the title with the appropriate margins.
171 like several other commands,
176 That is, all the input text collected but not yet printed
177 is flushed out as soon as possible,
178 and the next input line is guaranteed to start
179 a new line of output.
187 this would cause a break in the middle
188 of the current output line when a new page is started.
189 The effect would be to print the left-over part of that line
190 at the top of the page, followed by the next input line on a new output line.
203 no break is to take place _
205 currently being filled
209 be forced out before the space or new page.
211 The list of commands that cause a break
212 is short and natural:
214 ^bp ^br ^ce ^fi ^nf ^sp ^in ^ti
220 regardless of whether you use a
224 If you really need a break, add a
226 command at the appropriate place.
228 One other thing to beware of _
229 if you're changing fonts or point sizes a lot,
231 if you cross a page boundary
232 in an unexpected font or size,
233 your titles come out in that size and font
234 instead of what you intended.
235 Furthermore, the length of a title is independent of the current line length,
236 so titles will come out at the default length of 6.5 inches
237 unless you change it,
238 which is done with the
242 There are several ways to fix the problems of point sizes
244 For the simplest applications, we can change
246 to set the proper size and font for the title,
247 then restore the previous values, like this:
253 ^ft R \e" set title font to roman
254 ^ps 10 \e" and size to 10 point
255 ^lt 6i \e" and length to 6 inches
256 ^tl 'left'center'right'
257 ^ps \e" revert to previous size
258 ^ft P \e" and to previous font
268 work if the fields in the
270 command contain size or font changes.
274 `environment' mechanism,
275 which we will discuss in Section 13.
277 To get a footer at the bottom of a page,
281 some processing before
285 or split the job into a footer macro invoked
286 at the bottom margin and a header macro invoked
287 at the top of the page.
288 These variations are left as exercises.
291 Output page numbers are computed automatically
292 as each page is produced (starting at 1),
293 but no numbers are printed unless you ask for them explicitly.
294 To get page numbers printed,
295 include the character
300 the position where you want the number to appear.
305 centers the page number inside hyphens, as on this page.
306 You can set the page number at any time
309 which immediately starts a new page numbered
313 which sets the page number for the next page
314 but doesn't cause a skip to the new page.
317 sets the page number to
319 more than its current value;