]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - share/doc/usd/22.trofftut/tt13
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / share / doc / usd / 22.trofftut / tt13
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).
4 .\"
5 .\"     @(#)tt13        8.1 (Berkeley) 6/8/93
6 .\" Copyright (C) Caldera International Inc. 2001-2002.  All rights reserved.
7 .\" 
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions are
10 .\" met:
11 .\" 
12 .\" Redistributions of source code and documentation must retain the above
13 .\" copyright notice, this list of conditions and the following
14 .\" disclaimer.
15 .\" 
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.
19 .\" 
20 .\" All advertising materials mentioning features or use of this software
21 .\" must display the following acknowledgement:
22 .\" 
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
27 .\" permission.
28 .\" 
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.
41 .\" 
42 .\" $FreeBSD$
43 .\"
44 .NH
45 Environments
46 .PP
47 As we mentioned, there is a potential problem
48 when going across a page boundary:
49 parameters like size and font
50 for a page title may well be different from those
51 in effect in the text when the page boundary occurs.
52 .UL troff
53 provides a very general way to deal with this and
54 similar situations.
55 There are three `environments',
56 each of which has independently settable versions of
57 many of the parameters associated with processing,
58 including size, font, line and title lengths,
59 fill/nofill mode, tab stops, and even partially collected lines.
60 Thus the titling problem may be readily solved by processing the main text
61 in one environment and titles in a separate one
62 with its own suitable parameters.
63 .PP
64 The command
65 .BD .ev\ n
66 shifts to environment
67 .BD n ;
68 .BD n
69 must be 0, 1 or 2.
70 The command
71 .BD .ev
72 with no argument returns to the
73 previous environment.
74 Environment names are maintained in a stack, so calls
75 for different environments may be nested and unwound consistently.
76 .PP
77 Suppose we say that the main text is processed in environment 0,
78 which is where 
79 .UL troff
80 begins by default.
81 Then we can modify the new page macro
82 .BD .NP
83 to process titles in environment 1 like this:
84 .P1 2
85 ^de NP
86 ^ev 1   \e" shift to new environment
87 ^lt 6i  \e" set parameters here
88 ^ft R
89 ^ps 10
90 \&... any other processing ...
91 ^ev     \e" return to previous environment
92 ^^
93 .P2
94 It is also possible to initialize the parameters for an environment
95 outside the
96 .BD .NP
97 macro,
98 but the version shown keeps all the processing in one place
99 and is thus easier to understand and change.