Next: , Previous: , Up: ms Body Text   [Contents][Index]


4.6.5.5 Typeface and decoration

The ms macros provide a variety of ways to style text. Attend closely to the ordering of arguments labeled pre and post, which is not intuitive. Support for pre arguments is a GNU extension.10

Macro: .B [text [post [pre]]]

Style text in bold, followed by post in the previous font style without intervening space, and preceded by pre similarly. Without arguments, ms styles subsequent text in bold until the next paragraphing, heading, or no-argument typeface macro call.

Macro: .R [text [post [pre]]]

As B, but use the roman style (upright text of normal weight) instead of bold. Argument recognition is a GNU extension.

Macro: .I [text [post [pre]]]

As B, but use an italic or oblique style instead of bold.

Macro: .BI [text [post [pre]]]

As B, but use a bold italic or bold oblique style instead of upright bold. This is a Tenth Edition Research Unix extension.

Macro: .CW [text [post [pre]]]

As B, but use a constant-width (monospaced) roman typeface instead of bold. This is a Tenth Edition Research Unix extension.

Macro: .BX [text]

Typeset text and draw a box around it. On terminal devices, reverse video is used instead. If you want text to contain space, use unbreakable space or horizontal motion escape sequences (\~, \SP, \^, \|, \0 or \h).

Macro: .UL [text [post]]

Typeset text with an underline. post, if present, is set after text with no intervening space.

Macro: .LG

Set subsequent text in larger type (two points larger than the current size) until the next type size, paragraphing, or heading macro call. You can specify this macro multiple times to enlarge the type size as needed.

Macro: .SM

Set subsequent text in smaller type (two points smaller than the current size) until the next type size, paragraphing, or heading macro call. You can specify this macro multiple times to reduce the type size as needed.

Macro: .NL

Set subsequent text at the normal type size (the amount in the PS register).

pre and post arguments are typically used to simplify the attachment of punctuation to styled words. When pre is used, a hyphenation control escape sequence \% that would ordinarily start text must start pre instead to have the desired effect.

The CS course's students found one C language keyword
.CW static ) \%(
most troublesome.

The foregoing example produces output as follows.

The CS course’s students found one C language keyword (static)
most troublesome.

You can use the output line continuation escape sequence \c to achieve the same result (see Line Continuation). It is also portable to older ms implementations.

The CS course's students found one C language keyword
\%(\c
.CW \%static )
most troublesome.

groff ms also offers strings to begin and end super- and subscripting. These are GNU extensions.

String: \*[{]
String: \*[}]

Begin and end superscripting, respectively.

String: \*[<]
String: \*[>]

Begin and end subscripting, respectively.

Rather than calling the CW macro, in groff ms you might prefer to change the font family to Courier by setting the FAM string to ‘C’. You can then use all four style macros above, returning to the default family (Times) with ‘.ds FAM T’. Because changes to FAM take effect only at the next paragraph, CW remains useful to “inline” a change to the font family, similarly to the practice of this document in noting syntactical elements of ms and groff.


Next: , Previous: , Up: ms Body Text   [Contents][Index]