Commit | Line | Data |
---|---|---|
8340f87c BJ |
1 | .NH |
2 | Fonts and Special Characters | |
3 | .PP | |
4 | .UL troff | |
5 | and the typesetter allow four different fonts at any one time. | |
6 | Normally three fonts (Times roman, italic and bold) and one collection of special characters | |
7 | are permanently | |
8 | mounted. | |
9 | .P1 2 | |
10 | .ft R | |
11 | abcdefghijklmnopqrstuvwxyz 0123456789 | |
12 | ABCDEFGHIJKLMNOPQRSTUVWXYZ | |
13 | .ft I | |
14 | abcdefghijklmnopqrstuvwxyz 0123456789 | |
15 | ABCDEFGHIJKLMNOPQRSTUVWXYZ | |
16 | .ft B | |
17 | abcdefghijklmnopqrstuvwxyz 0123456789 | |
18 | ABCDEFGHIJKLMNOPQRSTUVWXYZ | |
19 | .ft R | |
20 | .P2 | |
21 | The | |
22 | greek, mathematical symbols and miscellany | |
23 | of the special font are | |
24 | listed in Appendix A. | |
25 | .PP | |
26 | .UL troff | |
27 | prints in roman unless told otherwise. | |
28 | To switch into bold, use | |
29 | the | |
30 | .BD .ft | |
31 | command | |
32 | .P1 | |
33 | ^ft B | |
34 | .P2 | |
35 | and for italics, | |
36 | .P1 | |
37 | ^ft I | |
38 | .P2 | |
39 | To return to roman, use | |
40 | .BD .ft\ R ; | |
41 | to return to the previous font, | |
42 | whatever it was, | |
43 | use either | |
44 | .BD .ft\ P | |
45 | or just | |
46 | .BD .ft . | |
47 | The `underline' command | |
48 | .P1 | |
49 | ^ul | |
50 | .P2 | |
51 | causes the next input line to print in italics. | |
52 | .BD .ul | |
53 | can be followed by a count to | |
54 | indicate that more than one line is to be italicized. | |
55 | .PP | |
56 | Fonts can also be changed within a line or word | |
57 | with the in-line command | |
58 | .BD \ef : | |
59 | .P1 | |
60 | \fBbold\fIface\fR text | |
61 | .P2 | |
62 | is produced by | |
63 | .P1 | |
64 | \efBbold\efIface\efR text | |
65 | .P2 | |
66 | If you want to do this so the previous font, whatever it was, | |
67 | is left undisturbed, insert extra | |
68 | .BD \efP | |
69 | commands, like this: | |
70 | .P1 | |
71 | \efBbold\efP\efIface\efP\efR text\efP | |
72 | .P2 | |
73 | Because only the immediately previous font is remembered, | |
74 | you have to restore the previous font after each change | |
75 | or you can lose it. | |
76 | The same is true of | |
77 | .BD .ps | |
78 | and | |
79 | .BD .vs | |
80 | when used without an argument. | |
81 | .PP | |
82 | There are other fonts available besides the standard set, | |
83 | although you can still use only four at any given time. | |
84 | The command | |
85 | .BD .fp | |
86 | tells | |
87 | .UL troff | |
88 | what fonts are physically mounted on the typesetter: | |
89 | .P1 | |
90 | ^fp 3 H | |
91 | .P2 | |
92 | says that the Helvetica font is mounted on position 3. | |
93 | (For a complete list of fonts and what they look like, | |
94 | see the | |
95 | .UL troff | |
96 | manual.) | |
97 | Appropriate | |
98 | .BD .fp | |
99 | commands should appear at the beginning of your document | |
100 | if you do not use the standard fonts. | |
101 | .PP | |
102 | It is possible to make a document relatively independent | |
103 | of the actual fonts used to print it | |
104 | by using font numbers instead of names; | |
105 | for example, | |
106 | .BD \ef3 | |
107 | and | |
108 | .BD .ft~3 | |
109 | mean `whatever font is mounted at position 3', | |
110 | and thus work for any setting. | |
111 | Normal settings are roman font on 1, italic on 2, | |
112 | bold on 3, | |
113 | and special on 4. | |
114 | .PP | |
115 | There is also a way to get `synthetic' bold fonts | |
116 | by overstriking letters with a slight offset. | |
117 | Look at the | |
118 | .BD .bd | |
119 | command in [1]. | |
120 | .WS | |
121 | .PP | |
122 | Special characters have four-character names beginning with | |
123 | .BD \e( , | |
124 | and they may be inserted anywhere. | |
125 | For example, | |
126 | .P1 | |
127 | \(14 + \(12 = \(34 | |
128 | .P2 | |
129 | is produced by | |
130 | .P1 | |
131 | \e(14 + \e(12 = \e(34 | |
132 | .P2 | |
133 | In particular, | |
134 | greek letters are all of the form | |
135 | .BD \e(*\- , | |
136 | where | |
137 | .BD \- | |
138 | is an upper or lower case roman letter | |
139 | reminiscent of the greek. | |
140 | Thus | |
141 | to get | |
142 | .P1 | |
143 | \(*S(\(*a\(mu\(*b) \(-> \(if | |
144 | .P2 | |
145 | in bare | |
146 | .UL troff | |
147 | we have to type | |
148 | .P1 | |
149 | \e(*S(\e(*a\e(mu\e(*b) \e(\(mi> \e(if | |
150 | .P2 | |
151 | That line is unscrambled as follows: | |
152 | .P1 | |
153 | .ta 1i 2i 3i | |
154 | \e(*S \(*S | |
155 | ( ( | |
156 | \e(*a \(*a | |
157 | \e(mu \(mu | |
158 | \e(*b \(*b | |
159 | ) ) | |
160 | \e(\(mi> \(-> | |
161 | \e(if \(if | |
162 | .P2 | |
163 | A complete list of these special names occurs in Appendix A. | |
164 | .PP | |
165 | In | |
166 | .UL eqn | |
167 | [2] | |
168 | the same effect can be achieved with the input | |
169 | .P1 | |
170 | SIGMA ( alpha times beta ) \-> inf | |
171 | .P2 | |
172 | which is less concise, but clearer to the uninitiated. | |
173 | .PP | |
174 | Notice that | |
175 | each | |
176 | four-character name is a single character | |
177 | as far as | |
178 | .UL troff | |
179 | is concerned _ | |
180 | the | |
181 | `translate' command | |
182 | .P1 | |
183 | ^tr \e(mi\e(em | |
184 | .P2 | |
185 | is perfectly clear, meaning | |
186 | .P1 | |
187 | ^tr \(mi\(em | |
188 | .P2 | |
189 | that is, to translate \(mi into \(em. | |
190 | .PP | |
191 | Some characters are automatically translated into others: | |
192 | grave \(ga and acute \(aa accents (apostrophes) become open and close single quotes | |
193 | `~'; | |
194 | the combination of ``...'' is generally preferable to the double quotes "...". | |
195 | Similarly a typed minus sign becomes a hyphen -. | |
196 | To print an explicit \- sign, use | |
197 | .BD \e- . | |
198 | To get a backslash printed, use | |
199 | .BD \ee . |