Richtext

This section summarizes the text/richtext type. A full explanation of richtext can be found in RFC 1341, the MIME specification.

Richtext is a simple markup language for plain text, like LaTeX or nroff or Scribe. A document in richtext format consists of plain text ``marked up'' with formatting commands. The formatting commands are used to change fonts, to format paragraphs, and to lay out pages. For those with some word processing experience, MIME richtext isn't in any way related to Microsoft Richtext.

The formatting commands are words surrounded by angle brackets (<>), such as <bold>. Each occurrence of a command is balanced later on by a negating command beginning with a forward slash or solidus (/), such as </bold>.

There are only three exceptions to this balancing rule:

  1. The command <lt>, which represents a literal < character.
  2. The command <nl>, which represents a required line break. (Otherwise, CRLFs in the data are treated as equivalent to a single SPACE character.)
  3. The command <np>, which represents a page break.

The list of pre-defined richtext commands follows.

Font selection commands:
\begin{rtlist}
\item[bigger] -- subsequent text is displayed in a bigger font.
\...
...s a superscript.
\item[underline] -- subsequent text is underlined.
\end{rtlist}

Paragraph formatting commands:
\begin{rtlist}
\item[center] -- subsequent text is centered.
\item[excerpt] -- s...
...ont or otherwise set them apart from
the main text of the message.
\end{rtlist}

Page layout commands:
\begin{rtlist}
\item[footing] -- subsequent text is interpreted as a page footin...
...[samepage] -- subsequent text is grouped, if possible, on one page.
\end{rtlist}

Character set selection commands:
\begin{rtlist}
\item[iso-8859-{\it X\/}] (for any value of {\it X} that is legal...
...equent text is
interpreted as text in the US-ASCII character set.
\end{rtlist}

Miscellaneous commands:
\begin{rtlist}
\item[comment] -- subsequent text is interpreted
as a comment, n...
...} is allowed.
\item[no-op] -- has no effect on the subsequent text.
\end{rtlist}

Each positive formatting command affects all subsequent text until the matching negative formatting command. Such 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, alternatively,

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

but, in particular, the following is illegal richtext:

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

No special behavior is required for the Tab (aka HT or control-I) character, but when fixed-width fonts are in use, the common semantics of the TAB character may be observed, i.e. that a Tab moves to the next column position that is a multiple of 8.

A line break (CRLF) is interpreted as a soft line break, which is treated as horizontal white space. To include a hard line break (one that must be displayed as such), the <nl> or <paragraph> formatting constructs should be used.

Consider this richtext body fragment:

<bold>Now</bold> is the time for
<italic>all</italic> good men
 <smaller>(and <lt>women>)</smaller> to
<ignoreme></ignoreme> come

to the aid of their
<nl>
beloved <nl><nl>country. <comment> Stupid
quote! </comment> -- the end

The example fragment above represents this formatted text:

Now is the time for all good men (and <women>) to come to the aid of their
beloved

country. – the end

Note that the final display of a message in richtext format may be quite different from that which was intended, simply because display devices and richtext implementations may differ in capabilities. A richtext message that may display beautifully with full italic and bold characters on an X Window System display may look terrible on a 24-by-80 fixed-font ASCII terminal that can only show plain or bold text blocks.

Richtext message parts are specified with the type text/richtext. To compose a message with richtext parts, these mhn directives may be used:


To insert a text file containing richtext formatting commands:

#text/richtext filename

To compose a portion of a draft with richtext:
#<text/richtext
lines of text with richtext formatting commands
#

Of course, external body parts may also be specified with the directive #@text/richtext followed by appropriate parameters (see section [*]).