Skip to main content

2. Formatting Commands

The text/enriched formatting commands all begin with and end with , affecting the formatting of the text between those two tokens. The commands are described here, grouped according to type.

Font-Alteration Commands​

The following formatting commands are intended to alter the font in which text is displayed, but not to alter the indentation or justification state of the text:

Bold -- causes the affected text to be in a bold font. Nested bold commands have the same effect as a single bold command.

Italic -- causes the affected text to be in an italic font. Nested italic commands have the same effect as a single italic command.

Fixed -- causes the affected text to be in a fixed width font. Nested fixed commands have the same effect as a single fixed command.

Smaller -- causes the affected text to be in a smaller font. It is recommended that the font size be changed by two points, but other amounts may be more appropriate in some environments. Nested smaller commands produce ever-smaller fonts, to the limits of the implementation's capacity to reasonably display them, after which further smaller commands have no incremental effect.

Bigger -- causes the affected text to be in a bigger font. It is recommended that the font size be changed by two points, but other amounts may be more appropriate in some environments. Nested bigger commands produce ever-bigger fonts, to the limits of the implementation's capacity to reasonably display them, after which further bigger commands have no incremental effect.

Underline -- causes the affected text to be underlined. Nested underline commands have the same effect as a single underline command.

While the "bigger" and "smaller" operators are effectively inverses, it is not recommended, for example, that "" be used to end the effect of "". This is properly done with "".

Fill/Justification Commands​

Initially, text/enriched text is intended to be displayed fully filled with appropriate kerning and letter-tracking as suits the capabilities of the receiving user agent software. Actual line width is left to the discretion of the receiver, which is expected to fold lines intelligently (preferring soft line breaks) to the best of its ability.

The following commands alter that state. Each of these commands force a line break before and after the formatting environment if there is not otherwise a line break. For example, if one of these commands occurs anywhere other than the beginning of a line of text as presented, a new line is begun.

Center -- causes the affected text to be centered.

FlushLeft -- causes the affected text to be left-justified with a ragged right margin.

FlushRight -- causes the affected text to be right-justified with a ragged left margin.

FlushBoth -- causes the affected text to be filled and padded so as to create smooth left and right margins, i.e., to be fully justified.

Nofill -- causes the affected text to be displayed without filling or justification.

The center, flushleft, flushright, and flushboth commands are mutually exclusive, and, when nested, the inner command takes precedence.

Whether or not text is justified by default (that is, whether the default environment is flushleft, flushright, or flushboth) is unspecified, and depends on the preferences of the user, the capabilities of the local software and hardware, and the nature of the character set in use. On systems where justification is considered undesirable, the flushboth environment may be identical to the default environment. Note that justification should never be performed inside of center, flushleft, flushright, or nofill environments. Note also that for some non-ASCII character sets, full justification may be fundamentally inappropriate.

Indentation Commands​

Initially, text/enriched text is displayed using the maximum available margins. Two formatting commands may be used to affect the margins.

Indent -- causes the running left margin to be moved to the right. The recommended indentation change is the width of four characters, but this may differ among implementations.

IndentRight -- causes the running right margin to be moved to the left. The recommended indentation change is the width of four characters, but this may differ among implementations.

A line break is NOT forced by a change of the margin, to permit the description of "hanging" text. Thus for example the following text:

Now is the time for all good horses to come to the aid of their stable, assuming that any stable is really stable.

would be displayed in a 40-character-wide window as follows:

Now is the time for all good horses to
come to the aid of their stable,
assuming that any stable is
really stable.

Miscellaneous Commands​

Excerpt -- causes the affected text to be interpreted as a textual excerpt from another source, probably a message being responded to. Typically this will be displayed using indentation and an alternate font, or by indenting

lines and preceding them with "> ", but such decisions are
up to the implementation. (Note that this is the only
truly declarative markup construct in text/enriched, and
as such doesn't fit very well with the other facilities,
but it describes a type of markup that is very commonly
used in email and has no procedural analogue.) Note that
as with the justification commands, the excerpt command
implicitly begins and ends with a line break if one is not
already there.

Param -- Marks the affected text as command parameters, to be interpreted or ignored by the text/enriched interpreter, but NOT to be shown to the reader. The syntax of the parameter data (whatever appears between the initial "

" and the terminating "") is left undefined by this memo, to be defined by text/enriched extensions in the future. However, the format of such data must NOT contain nested commands, and either must NOT use the "<" character or must use it in a way that is compatible with text/enriched parsing. That is, the end of the parameter data should be recognizable with EITHER of two algorithms: simply searching for the first occurence of "" or parsing until a balanced "" command is found. In either case, however, the parameter data should NOT be shown to the human reader.

Balancing and Nesting of Formatting Commands​

Pairs of formatting commands must be properly balanced and nested. Thus, a proper way to describe text in bold italics is:

<bold><italic>the-text</italic></bold>

or, alternately,

<italic><bold>the-text</bold></italic>

but, in particular, the following is illegal
text/enriched:

<bold><italic>the-text</bold></italic>

The nesting requirement for formatting commands imposes a slightly higher burden upon the composers of text/enriched bodies, but potentially simplifies text/enriched displayers by allowing them to be stack-based. The main goal of text/enriched is to be simple enough to make multifont, formatted email widely readable, so that those with the capability of sending it will be able to do so with confidence. Thus slightly increased complexity in the composing software was deemed a reasonable tradeoff for simplified reading software. Nonetheless, implementors of text/enriched readers are encouraged to follow the general Internet guidelines of being conservative in what you send and liberal in what you accept. Those implementations that can do so are encouraged to deal reasonably with improperly nested text/enriched data.

Unrecognized formatting commands​

Implementations must regard any unrecognized formatting command as "no-op" commands, that is, as commands having no effect, thus facilitating future extensions to "text/enriched". Private extensions may be defined using formatting commands that begin with "X-", by analogy to Internet mail header field names.

In order to formally define extended commands, a new Internet document should be published.