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