%sccs.include.proprietary.roff%

@(#)tt03 8.1 (Berkeley) 06/08/93

Fonts and Special Characters

troff and the typesetter allow four different fonts at any one time. Normally three fonts (Times roman, italic and bold) and one collection of special characters are permanently mounted.

1 2 abcdefghijklmnopqrstuvwxyz 0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ

2 The greek, mathematical symbols and miscellany of the special font are listed in Appendix A.

troff prints in roman unless told otherwise. To switch into bold, use the .ft command

1 ^ft B

2 and for italics,

1 ^ft I

2 To return to roman, use .ft R ; to return to the previous font, whatever it was, use either .ft P or just .ft . The `underline' command

1 ^ul

2 causes the next input line to print in italics. .ul can be followed by a count to indicate that more than one line is to be italicized.

Fonts can also be changed within a line or word with the in-line command \ef :

1 boldface text

2 is produced by

1 \efBbold\efIface\efR text

2 If you want to do this so the previous font, whatever it was, is left undisturbed, insert extra \efP commands, like this:

1 \efBbold\efP\efIface\efP\efR text\efP

2 Because only the immediately previous font is remembered, you have to restore the previous font after each change or you can lose it. The same is true of .ps and .vs when used without an argument.

There are other fonts available besides the standard set, although you can still use only four at any given time. The command .fp tells troff what fonts are physically mounted on the typesetter:

1 ^fp 3 H

2 says that the Helvetica font is mounted on position 3. (The complete list of font sizes and styles depends on your typesetter or laser printer.) Appropriate .fp commands should appear at the beginning of your document if you do not use the standard fonts.

It is possible to make a document relatively independent of the actual fonts used to print it by using font numbers instead of names; for example, \ef3 and .ft 3 mean `whatever font is mounted at position 3', and thus work for any setting. Normal settings are roman font on 1, italic on 2, bold on 3, and special on 4.

There is also a way to get `synthetic' bold fonts by overstriking letters with a slight offset. Look at the .bd command in [1]. .WS

Special characters have four-character names beginning with \e( , and they may be inserted anywhere. For example,

1 \(14 + \(12 = \(34

2 is produced by

1 \e(14 + \e(12 = \e(34

2 In particular, greek letters are all of the form \e(*- , where - is an upper or lower case roman letter reminiscent of the greek. Thus to get

1 \(*S(\(*a\(mu\(*b) \(-> \(if

2 in bare troff we have to type

1 \e(*S(\e(*a\e(mu\e(*b) \e(-> \e(if

2 That line is unscrambled as follows:

1 \e(*S \(*S ( ( \e(*a \(*a \e(mu \(mu \e(*b \(*b ) ) \e(-> \(-> \e(if \(if

2 A complete list of these special names occurs in Appendix A.

In eqn [2] the same effect can be achieved with the input

1 SIGMA ( alpha times beta ) -> inf

2 which is less concise, but clearer to the uninitiated.

Notice that each four-character name is a single character as far as troff is concerned _ the `translate' command

1 ^tr \e(mi\e(em

2 is perfectly clear, meaning

1 ^tr -\(em

2 that is, to translate - into \(em.

Some characters are automatically translated into others: grave \(ga and acute \(aa accents (apostrophes) become open and close single quotes `\|'\|; the combination of ``...'' is generally preferable to the double quotes "...". Similarly a typed minus sign becomes a hyphen -. To print an explicit - sign, use \e\|- . To get a backslash printed, use \ee .