textfiles/programming/FORMATS/rtfspec.txt

2276 lines
90 KiB
Plaintext

======================================================================
Microsoft Product Support Services Application Note (Text File)
GC0165: RICH-TEXT FORMAT (RTF) SPECIFICATION
======================================================================
Revision Date: 6/92
No Disk Included
The following information applies to using RTF version 1.0 with
Microsoft MS-DOS(R), Windows(TM), OS/2(R), and Apple(R) Macintosh(R)
Applications.
--------------------------------------------------------------------
| INFORMATION PROVIDED IN THIS DOCUMENT AND ANY SOFTWARE THAT MAY |
| ACCOMPANY THIS DOCUMENT (collectively referred to as an |
| Application Note) IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY |
| KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO |
| THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A |
| PARTICULAR PURPOSE. The user assumes the entire risk as to the |
| accuracy and the use of this Application Note. This Application |
| Note may be copied and distributed subject to the following |
| conditions: 1) All text must be copied without modification and |
| all pages must be included; 2) If software is included, all files |
| on the disk(s) must be copied without modification [the MS-DOS(R) |
| utility DISKCOPY is appropriate for this purpose]; 3) All |
| components of this Application Note must be distributed together; |
| and 4) This Application Note may not be distributed for profit. |
| |
| Copyright (c) 1989-1992 Microsoft Corporation. All Rights Reserved.|
| Microsoft and MS-DOS are registered trademarks and Windows is a |
| trademark of Microsoft Corporation. OS/2 is a registered trademark |
| licensed to Microsoft Corporation. Apple, Macintosh, and TrueType |
| are registered trademarks and QuickDraw is a trademark of Apple |
| Computer, Inc. IBM and Personal System/2 are registered trademarks |
| of International Business Machines Corporation. PostScript is a |
| registered trademark of Adobe Systems, Inc. Times Roman, Palatino, |
| and Helvetica are registered trademarks of Linotype AG and/or its |
| subsidiaries. Swiss is a trademark of Bitstream, Inc. ITC Zapf |
| Chancery is a registered trademark of the International Typeface |
| Corporation. MathType is a trademark of Design Science, Inc. This |
| document was created using Microsoft Word for Windows. |
--------------------------------------------------------------------
OVERVIEW
========
The rich-text format (RTF) standard is a method of encoding formatted
text and graphics for easy transfer between MS-DOS, Windows, OS/2, and
Apple Macintosh applications.
The RTF standard provides a format for text and graphics interchange
that can be used with different output devices, operating
environments, and operating systems. RTF uses the ANSI, PC-8,
Macintosh, or IBM PC character set to control the representation and
formatting of a document, both on the screen and in print. With the
RTF standard, you can transfer documents created under different
operating systems and with different software applications among those
operating systems and applications.
Software that takes a formatted file and turns it into an RTF file is
called a "writer." An RTF writer separates the application s control
information from the actual text and writes a new file containing the
text and the RTF groups associated with that text. Software that
translates an RTF file into a formatted file is called a "reader."
RTF SYNTAX
==========
An RTF file consists of unformatted text, control words, control
symbols, and groups. For ease of transport, a standard RTF file can
consist of only 7-bit ASCII characters. However, Word for Windows uses
8-bit characters in the RTF stream given to converter DLLs.
A "control word" is a specially formatted command that RTF uses to
mark printer control codes and information that applications use to
manage documents. A control word takes the following form:
\<LetterSequence>[<NumericParameter>]<delimiter>
For example:
A B C
| | |
| ----- |
\ r t f 1
A A backslash begins each control word
B Letter sequence
C Numeric parameter
The "Letter Sequence" is made up of uppercase or lowercase alphabetic
characters between A and Z inclusive.
The "Numeric Parameter" begins with a digit or a minus sign (-). The
range of the values for the numeric parameter is -32,767 through
32,767. However, Microsoft Word for Windows, Word for OS/2, and Word
for the Macintosh restrict the range to -31,680 through 31,680. If a
numeric parameter immediately follows the control word, this parameter
becomes part of the control word and the delimiter follows the
parameter.
The "delimiter" marks the end of an RTF control word or symbol. A
delimiter can be one of the following:
- A space. If a space delimits a control word, the space does not
appear in the document. Any characters following the delimiter,
including spaces, do appear in the document. For this reason, you
should use spaces only where necessary; do not use spaces merely to
break up RTF code.
- A backslash (\), opening brace ({), or closing brace (}). These
characters are used to mark the beginning of a new control word or
symbol, the beginning of a group, and end of a group, respectively.
More information about control symbols and groups is provided later
in this document.
- Any character other than a letter or a digit. In this case, the
character terminates the control word but is not actually part of
the control word. The character is considered part of the document
text.
Some control words govern properties that have only two states (for
example, bold, which is either turned on or turned off). When such a
control word has no parameter or has a nonzero parameter, it is
assumed that the control word turns on the property. When such a
control word has a parameter of 0 (zero), it is assumed that the
control word turns off the property. For example, \b turns on bold,
whereas \b0 turns off bold.
A "control symbol" consists of a backslash followed by a single,
nonalphabetic character. For example, \~ represents a nonbreaking
space. Control symbols take no delimiters.
A "group" consists of text and control words or control symbols
enclosed in braces ({ }). The opening brace indicates the start of the
group and the closing brace indicates the end of the group. Each group
specifies the text affected by the group and the different attributes
of that text. The RTF file can also include groups for fonts, styles,
screen color, pictures, footnotes, annotations, headers and footers,
summary information, fields, and bookmarks, as well as document-,
section-, paragraph-, and character-formatting properties. If the
font, style, screen color, and summary information groups and document
formatting properties are included, they must precede the first plain-
text character in the document. These groups form the RTF file header.
If the group for fonts is included, it should precede the group for
styles. If any group is not used, it can be omitted. The groups are
discussed in the following sections.
Certain groups, referred to as "destinations," mark the beginning of a
collection of related text that could appear at another position, or
destination, within the document. Destinations can also be text that
is used but should not appear within the document at all. Destinations
are sometimes distinguished from other groups by a \* control symbol
immediately following the opening brace of the group. The \* is
followed by a control word that defines the type of the destination.
This control symbol identifies destinations whose related text should
be ignored if the RTF reader does not recognize the destination. (RTF
writers should follow the convention of using this control symbol when
adding new control words.) Destinations whose related text should be
inserted into the document even if the RTF reader does not recognize
the destination should not use \*. An example of a destination is the
\footnote group, where the footnote text follows the control word.
Formatting specified within a group affects only the text within that
group. Generally, text within a group inherits the formatting of the
text in the preceding group. However, Microsoft implementations of RTF
assume that the footnote, header and footer, and annotation groups
(described later in this document) do not inherit the formatting of
the preceding text. Therefore, to ensure that these groups are always
formatted correctly, you should set the formatting within these groups
to the default with the \sectd, \pard, and \plain control words, and
then add any desired formatting.
The control words, control symbols, and braces constitute control
information. All other characters in the file are plain text. The
following is an example of plain text that does not exist within a
group:
...
\linex0endnhere \pard\plain \fs20 This is plain text.
...
The phrase, "This is plain text" is not part of a group and is treated
as document text.
As previously mentioned, the backslash (\) and braces ({ }) have
special meaning in RTF. To use these characters as text, precede them
with a backslash, as follows:
\\
\{
\}
CONVENTIONS OF AN RTF READER
============================
The reader of an RTF stream is concerned with the following:
- Separating control information from plain text
- Acting on control information
- Collecting and properly inserting text into the document, as
directed by the state of the current group
The process of acting on control information is designed to be
relatively simple. Some control information only contributes special
characters to the plain text stream. Other information changes the
"program state," which includes properties of the document as a whole,
or changes a collection of "group states," which applies to parts of
the document.
As previously mentioned, a group state can specify the following:
- The "destination," or part of the document that the plain text is
constructing
- Character formatting properties, such as bold or italic
- Paragraph formatting properties, such as justified or centered
- Section formatting properties, such as the number of columns
- Table formatting properties, which define the number of cells and
dimensions of a table row
An RTF reader performs the following procedure:
1. The reader reads the next character.
2. If the next character is:
- An opening brace, the reader stores the current state of the
document on the stack.
- A closing brace, the reader retrieves the current state of
the document from the stack.
- A backslash, the reader marks the beginning of an RTF
control. The reader collects the control word or control
symbol and its parameter, if any, and carries out the action
prescribed for that control. The meaning of each of the
controls is discussed in the section "Contents of an RTF
File" in this document. The read pointer is left on the next
nonspace delimiter following the control.
- Anything other than an opening brace, closing brace, or
backslash, the reader assumes that the character is plain
text and writes the character to the current destination
using the current formatting properties.
3. The reader then reads the next character.
If the RTF reader does not recognize a particular control word or
control symbol, the reader ignores it. When the reader encounters a
control word or control symbol preceded by an opening brace, the
reader recognizes the control as part of a group. The reader saves the
current state on the stack but does not change the state. When the
reader encounters a closing brace, the reader retrieves the current
state from the stack, thereby resetting the current state. If the \*
control symbol precedes the unknown control word, \* defines a
destination group and is preceded by an opening brace. The RTF reader
will discard all text and subgroups up to and including the brace that
closes this group.
For control words or control symbols recognized by the RTF reader, the
possible actions are as follows:
Action Description
------ -----------
Change The RTF reader changes the destination to
destination the destination described in the table
entry. Destination changes are legal only
immediately after an opening brace. (Other
restrictions may also apply; for example,
footnotes cannot be nested.) Many
destination changes imply that the current
property settings will be reset to their
default settings. Examples of control
words that change the destination are
\footnote, \header, \footer, \pict, \info,
\fonttbl, \stylesheet, and \colortbl.
Change The RTF reader changes the property as
formatting described in the table entry. The entry
property specifies whether a parameter is required.
Insert special The reader inserts into the document the
character character code or codes described in the
table entry.
Insert special The reader inserts into the document the
character and character code or codes described in the
perform action table entry and performs whatever other
action the entry specifies. For example,
when Microsoft Word interprets \par, Word
inserts a paragraph mark in the document,
along with the paragraph properties
belonging to that paragraph mark.
CONTENTS OF AN RTF FILE
=======================
An RTF file can contain combinations of the following elements:
THE RTF VERSION
===============
An entire RTF file is considered a group and must be enclosed in
braces. The control word \rtf<N> must follow the opening brace. The
numeric parameter <N> identifies the version of the RTF standard used.
The RTF standard described in this document is version 1.0.
THE CHARACTER SET
=================
After specifying the RTF version, you must declare the character set.
The control word for the character set must precede any plain text or
any table control words. The RTF specification currently supports the
following character sets:
Control Word Character Set
------------ -------------
\ansi ANSI (the default)
\mac Apple Macintosh
\pc IBM(R) PC Code Page 437
\pca IBM PC Code Page 850, used by IBM Personal
System/2(R) (not implemented in version 1.0 of
Microsoft Word for OS/2)
The Font Table
--------------
This group begins with the control word \fonttbl and contains
descriptions of fonts. All fonts available to the RTF writer can be
included in the font table, even if the document doesn t use all the
fonts.
A font is defined by a font number, a font family, and a font name as
shown in the following example:
A B C D
| | | |
-------- | ------- ---------
{\fonttbl\f0\froman Tms Rmn;}...
A Control word
B Font number
C Font family
D Font name
Semicolons separate one font from the next. The font numbers represent
the full font definitions in the group and vary with each document.
The font families are listed below:
Control Word Font Family
------------ -----------
\fnil Unknown or default fonts (the default)
\fRoman Roman, proportionally spaced serif fonts (for
example, Times Roman(R) and Palatino(R))
\fswiss Swiss(TM), proportionally spaced sans serif fonts
(for example, Swiss Helvetica(R))
\fmodern Fixed-pitch serif and sans serif fonts (for
example, Courier and Pica)
\fscript Script fonts (for example, Cursive)
\fdecor Decorative fonts (for example, Old English and
ITC Zapf Chancery(R))
\ftech Technical, symbol, and mathematical fonts (for
example, Symbol)
If an RTF file uses a default font, the default font number is
specified with the \deff<N> control word, which must precede the font-
table group. The RTF writer supplies the default font number used in
the creation of the document as the numeric argument <N>. The RTF
reader then translates this number through the font table into the
most similar font available on the reader s system.
THE STYLE SHEET
===============
The style sheet group begins with the control word \stylesheet. This
group contains definitions and descriptions of the various styles used
in the document. The style sheet is declared only once, before any
document text. All styles in the document s style sheet can be
included, even if not all the styles are used.
Control Word Meaning
------------ -------
\sbasedon<N> Defines the number of the style on which the
current style is based. Word for Windows defaults
to the Normal style--style number 222--if
\sbasedon is omitted.
\snext<N> For paragraph styles, \snext defines the style
automatically assigned to a paragraph created
following the paragraph with the current style.
If \snext omitted, the next paragraph is given
the same style as the current paragraph.
\keycode Specified within the description of a style in
the style sheet in the RTF header. The syntax for
this group is {\*\keycode <Keys>} where <Keys>
are the characters used in the key code. For
example, a Normal style may be defined {\s0
{\*\keycode \shift\ctrl n}Normal;} within the RTF
style sheet. See the "Special Characters" control
words for the characters outside of the
alphanumeric range that can be used.
An example of an RTF style sheet and styles follows:
...
--
| {\stylesheet{\fs20 \sbasedon222\snext10{keycode \shift...}
A---| {\s1 \ar \fs20 \sbasedon0\snext1 FLUSHRIGHT}{\s2\fi...}
| \sbasedon0snext2 IND:}}
--
...
--
| \widowctrl\ftnbj\ftnrestart \sectd \linex0\endnhere
| \pard\plain \fs20 This is Normal style.
B---| \par \pard\plain \s1
| This is right justified. I call this style FLUSHRIGHT.
| \par \pard\plain \s2
| This is an indented paragraph. I call this style IND...
--
\par}
...
A Style sheet
B Styles applied to text
This is Normal Style.
This is right justified. I call this style FLUSHRIGHT.
This is an indented paragraph. I call this style IND. It produces
a hanging indent.
In this example, PostScript(R) is declared but not used. Some of the
control words in this example are discussed in the following sections.
THE COLOR TABLE
===============
Screen colors, character colors, and other color information are
contained in the color table group. The control word \colortbl begins
this group. Additional control words for red, green, and blue and the
foreground and background colors then use parameter values (0-255)
corresponding to the color indexes used by Microsoft Windows to define
the amount of red, green, and blue that makes up a color. For more
information on color setup, see your Windows documentation.
The following are valid control words for this group:
Control Word Meaning
------------ -------
\red<N> Red index
\green<N> Green index
\blue<N> Blue index
\cf<N> Foreground color (the default is 0)
\cb<N> Background color (the default is 0)
Each definition must be delimited by a semicolon, even if the
definition is omitted. If a color definition is omitted, the RTF
reader uses its default color. In the example that follows, three
colors are defined. The first color is omitted, as shown by the
semicolon following the \colortbl control word.
...
{\colortbl;\red0\green0\blue0;\red0\green0\blue255;}
...
The following example defines a block of text in color (where
supported). Note that the cf/cb index is the index of an entry in the
color table, which represents a red/green/blue color combination.
...
{\f1\cb1\cf2 This is colored text. The background is color
1 and the foreground is color 2.
...
If the file is translated for software that does not display color,
the reader ignores the color table group.
PICTURES
========
An RTF file can include picture files created with other applications.
These files are in hexadecimal (the default) or binary format. The
control word \pict begins this group. Control words that define and
describe the picture parameters follow the \pict control word. These
control words are listed in the following table (some measurements in
this table are in twips; a twip is one-twentieth of a point):
General
--------------------------------------------------------------------
Control Word Meaning
------------ -------
\macpict The source file of the picture is QuickDraw(TM).
\pmmetafile<N> The source file of the picture is an OS/2
metafile; the <N> argument identifies the
metafile type.
\wmetafile<N> The source file of the picture is a Windows
metafile; the <N> argument identifies the
metafile type (the default is 1, meaning the
metafile type is MM_TEXT).
\dibitmap<N> The source file of the picture is a device
independent bitmap; the <N> argument identifies
the bitmap type (the default is 0).
\wbitmap<N> The source file of the picture is a bitmap; the
<N> argument identifies the bitmap type (the
default is 0, meaning that the bitmap is a
logical bitmap).
Bitmap Information
--------------------------------------------------------------------
Control Word Meaning
------------ -------
\wbmbitspixel<N> The number of bitmap bits per pixel (the default
is 1).
\wbmplanes<N> The number of bitmap planes (the default is 1).
\wbmwidthbytes<N> The bitmap width in bytes.
Picture Size, Scaling, and Cropping
--------------------------------------------------------------------
Control Word Meaning
------------ -------
\picw<N> The <xExt> field if the picture is a metafile;
the picture width in pixels if the picture is a
bitmap or is from QuickDraw.
\pich<N> The <yExt> field if the picture is a metafile;
the picture height in pixels if the picture is a
bitmap or from QuickDraw.
\picwgoal<N> The desired width of the picture in twips.
\pichgoal<N> The desired height of the picture in twips.
\picscalex<N> The horizontal scaling value; the <N> argument is
a value representing a percentage (the default is
100).
\picscaley<N> The vertical scaling value; the <N> argument is a
value representing a percentage (the default is
100).
\picscaled Scales the picture to fit within the specified
frame; used only with \macpict pictures.
\piccropt<N> The top cropping value in twips; a positive value
crops toward the center of the picture; a
negative value crops away from the center, adding
a space border around the picture (the default is
0).
\piccropb<N> The bottom cropping value in twips; a positive
value crops toward the center of the picture; a
negative value crops away from the center, adding
a space border around the picture (the default is
0).
\piccropl<N> The left cropping value in twips; a positive
value crops toward the center of the picture; a
negative value crops away from the center, adding
a space border around the picture (the default is
0).
\piccropr<N> The right cropping value in twips; a positive
value crops toward the center of the picture; a
negative value crops away from the center, adding
a space border around the picture (the default is
0).
Picture Border
--------------------------------------------------------------------
Control Word Meaning
------------ --------
\brdrs A single picture border.
\brdrdb A double picture border.
\brdrth A thick picture border.
\brdrsh A shadow picture border.
\brdrdot A dotted picture border.
\brdrhair A hairline picture border.
\brdrw<N> <N> is the width in twips of the picture border
line. This control should follow the picture
border controls \brdrt, \brdrr, \brdrb, and
\brdrl.
\brdrcf<N> <N> is the color of the picture border from the
color table in the RTF header. This control
should follow the picture border controls \brdrt,
\brdrr, \brdrb, and \brdrl.
Picture Background Shading
--------------------------------------------------------------------
Control Word Meaning
------------ -------
\shading<N> <N> is the shading of the picture in hundredths
of a percent.
\bghoriz Specifies a horizontal background pattern for the
picture.
\bgvert Specifies a vertical background pattern for the
picture.
\bgfdiag Specifies a forward diagonal background pattern
for the picture (\\\\).
\bgbdiag Specifies a backward diagonal background pattern
for the picture (////).
\bgcross Specifies a cross-hatched background pattern for
the picture.
\bgdcross Specifies a diagonal cross-hatched background
pattern for the picture.
\bgdkhoriz Specifies a dark horizontal background pattern
for the picture.
\bgdkvert Specifies a dark vertical background pattern for
the picture.
\bgdkfdiag Specifies a dark forward diagonal background
pattern for the picture (\\\\).
\bgdkbdiag Specifies a dark backward diagonal background
pattern for the picture (////).
\bgdkcross Specifies a dark cross-hatched background pattern
for the picture.
\bgdkdcross Specifies a dark diagonal cross-hatched
background pattern for the picture.
\cfpat<N> <N> is the line color of the background pattern.
\cbpat<N> <N> is the background color of the background
pattern.
Picture Data
--------------------------------------------------------------------
Control Word Meaning
------------ -------
\bin<N> The picture is in binary format; the numeric
parameter <N> is the number of bytes that follow.
The \wbitmap control word is optional; if neither \wmetafile nor
\macpict is specified, the picture is assumed to be a Windows bitmap.
If \wmetafile is specified, the <N> argument can be one of the
following types:
Type <N> Argument
---- -------------
MM_TEXT 1
MM_LOMETRIC 2
MM_HIMETRIC 3
MM_LOENGLISH 4
MM_HIENGLISH 5
MM_TWIPS 6
MM_ISOTROPIC 7
MM_ANISOTROPIC 8
If \pmmetafile is specified, the <N> argument can be one of the
following types:
Type <N> Argument
---- -------------
PU_ARBITRARY 4
PU_PELS 8
PU_LOMETRIC 12
PU_HIMETRIC 16
PU_LOENGLISH 20
PU_HIENGLISH 24
PU_TWIPS 28
Be careful with spaces following control words when dealing with
pictures in binary format. When reading files, RTF considers the first
space after a control word the delimiter and subsequent spaces part of
the document text. Therefore, any extra spaces are attached to the
picture, with unpredictable results.
RTF writers should not use the carriage-return/linefeed (CRLF)
combination to break up pictures in binary format. If they do, the
CRLF is treated as literal text and considered part of the picture
data.
The picture in hexadecimal or binary format follows the picture-group
control words. The following example illustrates the group format:
A B C D E
| | | | |
-------- ------- ------ ------------- ----------
{\pict\wbitmap0\picw170\pich77\wbmbitspixel1\wbmplanes1
F G
| |
--------------- -----------
\wmbwidthbytes22\picwgoal505
H--- \pichgoal221
I--- \picscalex172
J--- \picscaley172
- 49f2000000000273023d1101a030
| 3901000a000000000273023d98
| 0048000200000275
| 02040000200010275023e000000000
K--| 273023d000002b90002b90002
| b90002b90002b9
| 0002b90002b90002b90002b90002b90002
| b92222b90002b90002b90
| 002b90002b9
- 0002b90002b90002b90002b9000
...
A Source
B Width
C Height
D Bits per pixel
E Bitmap planes
F Width of picture in bytes
G Desired picture width
H Desired picture height
I Horizontal scaling value
J Vertical scaling value
K Hexadecimal data
NOTE: The controls \pichgoal, \picscalex, and \picscaley in
this example are on separate lines for the purpose of
illustration only. In actual RTF code, they can be included on
the same line.
FOOTNOTES
=========
The group containing footnote text begins with the control word
\*\footnote. Footnotes are anchored to the character that immediately
precedes the footnote group. If automatic footnoting is defined, the
group can be preceded by a footnote reference character, identified by
the control word \chftn.
The following is an example of a group containing footnotes:
...
\ftnbj\ftnrestart \sectd \\linemod0\linex0\endnhere
\pard\plain \ri1170 \fs20 {pu6 Mead's landmark study has been
amply annotated.\chftn
A--| {\*\footnote \pard\plain \s246 \fs20 {\up6\chftn }See Sahlins,
| Bateson, and Geertz for a complete bibliography.}
It was her work in America during the Second World War,
however, that forms the basis for the paper. As others have
noted, \chftn
A--| {\*\footnote \pard\plain \s246 \fs20 {\up6\chftn}
| A complete bibliography will be found at the end of the
| chapter.}
this period was a turning point for Margaret Mead.}
\par
...
Mead's landmark study has been amply annotated.1 It was her
work in America during the Second World War, however, that
forms the basis for this paper. As others have noted,2 this
period was a turning point for Margaret Mead.
1 See Sahlins, Bateson, and Geertz for a complete
bibliography.
2 A complete bibliography will be found at the end of the
chapter.
A: Footnotes
For other control words relating to footnotes, see the sections titled
"Document Formatting Properties," "Section Formatting Properties," and
"Special Characters" later in this document.
ANNOTATIONS
===========
The group containing annotation text begins with the control word
\*\annotation. Annotations are anchored to the character that
immediately precedes the annotation group. The group must be preceded
by an annotation reference character identified by the control word
\chatn. The annotation reference character must in turn be preceded by
a group that begins with the control word \*\atnid and that contains
the identification text for the author of the annotation. An example
of annotation text follows:
...
An example of a paradigm might be Newtonian physics or
Darwinian biology.{\v\fs16 {\atnid bz}\chatn{\*\annotation
\pard\plain \s224 \fs20 {field{fldinst page \\*"'Page:
'#\line'"}{\fldrslt}}{\fs 16 \chatn }
How about some examples that deal with social science?
That's what this paper is about.}}
...
HEADERS AND FOOTERS
===================
Headers and footers are treated as separate groups in RTF. Different
headers and footers can be defined for different sections in the
document. If none is defined for a given section, the headers and
footers from the previous section (if any) are used. These groups must
precede the first plain-text character in the document section to
which they apply.
The control words \header and \footer begin these groups. These
control words can be replaced by the following control words, as
appropriate:
Control Word Meaning
------------ -------
\headerl The header is on left pages only.
\headerr The header is on right pages only.
\headerf The header is on the first page only.
\footerl The footer is on left pages only.
\footerr The footer is on right pages only.
\footerf The footer is on the first page only.
The \headerl and \headerr and \footerl and \footerr control words are
used in conjunction with the \facingp control word, and the \headerf
and \footerf control words are used in conjunction with the \titlepg
control word. For more information, see "Document Formatting
Properties" and "Section-Formatting Properties" in this document.
SUMMARY INFORMATION
===================
The RTF file can also contain a summary information group, which is
translated but not displayed with the text. This information can
include the title, author, keywords, comments, and other information
specific to the file. This information is for use by a document-
management utility, if available.
This group begins with the control word \info. Some applications, such
as Word, ask the user to type this information when saving the
document in its native format. If the document is then saved as an RTF
file or translated into RTF, the RTF writer specifies this information
using the following control words. These control words are
destinations, and both the control words and the text should be
enclosed within braces ({ }).
Control Word Meaning
------------ -------
\title The title of the document
\subject The subject of the document
\author The author of the document
\operator The person who last made changes to the document
\keywords Selected keywords for the document
\comment Comments; text is ignored
\version<N> The version number of the document
\doccomm Comments displayed in Word s Summary Info dialog
box
The RTF writer can automatically enter other control words, including
the following:
Control Word Meaning
------------ -------
\vern<N> The internal version number
\creatim The creation time
\revtim The revision time
\printim The last print time
\buptim The backup time
\edmins<N> The total editing time (in minutes)
\yr<N> The year
\mo<N> The month
\dy<N> The day
\hr<N> The hour
\min<N> The minute
\nofpages<N> The number of pages
\nofwords<N> The number of words
\nofchars<N> The number of characters
\id<N> The internal ID number
Entries without the <N> parameter have the \yr \mo \dy \hr \min
format. An example of a summary information group follows:
...
{\info{\title The Panda's Thumb}{\author Stephen J.
Gould}{\keywords science natural history }}
FIELDS
======
The field group contains the text of Word fields. For more detailed
information on fields, choose Help in Microsoft Word for Windows.
The field group begins with the control word \field. The following
control words can follow the \field control word:
Control Word Meaning
------------ -------
\flddirty A formatting change has been made to the field
result since the field was last updated.
\fldedit The text has been added to, or removed from, the
field result since the field was last updated.
\fldlock A field is locked and cannot be updated.
\fldpriv A result is not in a form suitable for display
(for example, binary data used by fields whose
result is a picture).
Two subgroups are available within the \field group. They must be
enclosed within braces ({ }) and begin with the following control
words:
Control Word Meaning
------------ -------
\*\fldinst Field instructions
\fldrslt The most recently calculated result of the field
The \fldrslt control word should be included even if no result has
been calculated because even readers that do not recognize fields can
generally include the value of the \fldrslt group in the document.
An example of field text follows:
A B C
| | |
----- -------------- -----------------
{\field\fldedit{\fldinst author}{\fldrslt Joe Smith}}\par\pard
{\field{\fldinst time \\@ "h:mm AM/PM"}{\fldrslt 8:12 AM}}
----- ----------------------------- -----------------
| | |
A B C
A Begins field group
B Field instructions
C Field result
INDEX ENTRIES
=============
The index entry group begins with the control word \xe. Following this
control word is the text of the index entry and other optional control
words that further define the index entry.
If the text of the index entry is not formatted as hidden text with
the \v control word, the text is put into the document as well as into
the index. For more information on the \v control word, see "Character
Formatting Properties" in this document. Similarly, the text of the
\txe subgroup, described later in this section, becomes part of the
document if it is not formatted as hidden text.
The following control words can also be used:
Control Word Meaning
------------ -------
\bxe Formats the page number or cross-reference in bold
\ixe Formats the page number or cross-reference in
italic
The following control words are destinations within the \xe group and
are followed by text arguments. These control words and their
arguments must be enclosed within braces ({ })
Control Word Meaning
------------ -------
\txe <Text> The text argument is to be used instead of
a page number.
\rxe <BookmarkName> The text argument is a bookmark for the
range of page numbers.
An example of an index entry follows:
A B C D E F
| | | | | |
-- ------------- --------------- ------------- --- ---
{\xe{\v Index Entry}{\rxe Index Range}{\txe See Index}\bxe \ixe }
A Begins index-entry group
B Entry text
C Bookmark defining range of pages
D Replacement for page number
E Bold entry in index table
F Italic entry in index table
TABLE OF CONTENTS ENTRIES
=========================
The table of contents entry group begins with the control word \tc. It
is followed by the text of the table of contents entry and other
optional control words that further define the group.
As with index entries, text that is not formatted as hidden with the
\v character-formatting control word is put into the document. The
following control words can also be used in this group:
Control Word Meaning
------------ -------
\tcf<N> The type of table being compiled; <N> is mapped
by existing Microsoft software to a letter
between A and Z (the default is 67, which maps to
C and is used for tables of contents).
\tcl<N> The level number (the default is 1).
OBJECTS
=======
Objects are structures in a document that contain a data portion and a
result portion. The data portion generally appears hidden to the
application that produced the document. A separate application uses
the data and supplies the result or appearance of the data. This
appearance is the result portion of the object. Some examples of
objects include object linking and embedding (OLE) objects and Edition
Manager Subscriber objects on the Macintosh platform.
In RTF, the results of objects are represented so that RTF readers
that don t understand objects or don t use a particular type of object
are able to use the current result in place of the object. This allows
the appearance of the object to be maintained through the conversion
even though the object functionality is lost. For this reason, it is
important for RTF writers to supply the object result. The format of
the result should be standard RTF.
The data portion of an OLE object is the structure produced from the
OLE SaveToStream function. Some OLE clients rely on the OLE system to
render the object, and a copy of the result is not available to the
RTF writer for that application. For these cases, the object result
can be obtained from the structure produced from the OLE SaveToStream
function.
An object group is defined by the control word \object. These objects
can be either embedded objects, OLE links, or subscriber objects on
the Macintosh platform. If the RTF reader s application does not use
the type of object represented, then all the object information and
data should be ignored and the object result should be inserted into
the document in place of the object.
Each object comes with optional information about the object, a
required data group that contains the object data, and an optional
result that contains the last display of the object. This result
contains standard RTF. It is the responsibility of the RTF writer to
provide the result so that existing RTF readers will be able to
display the object without having full object support.
The syntax for this group is as follows:
{\object [\objemb|\objlink|\objautlink|\objsub|\objpub|\objicemb]
[\linkself] [\objlock] [{\*\objclass <Name>}] [{\*\objname <Name>}]
[\rsltmerge] [\rsltrtf|\rslttxt|\rsltpict|\rsltbmp] [\objsetsize]
[\objalign<N>] [\objtransy<N>] [\objh<N> \objw<N>]
[\objcropt<N>][\objcropb<N>][\objcropl<N>][\objcropr<N>]
[\objscalex<N>][\objscaley<N>] {\*\objdata[{\*\objalias[\bin<N>]
<Data>} {\*\objsect[\bin<N>] <Data>}] [\bin<N>] <Data>}<Result>}
See the \result control word in the following table for a description
of <Result>:
Object Type
--------------------------------------------------------------------
Control Word Meaning
------------ -------
\objemb An object type of OLE embedded object. If no type
is given for the object, the object is assumed to
be of type \objemb.
\objlink An object type of OLE link.
\objautlink An object type of OLE autolink.
\objsub An object type of Macintosh Edition Manager
subscriber.
\objicemb An object type of MS Word for Macintosh Installable
Command (IC) Embedder.
Object Information
--------------------------------------------------------------------
Control Word Meaning
------------ -------
\linkself The object is a link to another part of the same
document.
\objlock Locks the object from any updates.
\objclass The syntax for the group is {\*\objclass <Name>}
where <Name> is the name of the object class. This
is optional in the \object group.
\objname The syntax for group is {\*\objname <Name>} where
<Name> is the name of the specific object instance.
This is optional in the \object group.
Object Size, Position, Cropping, and Scaling
--------------------------------------------------------------------
Control Word Meaning
------------ -------
\objh<N> <N> is the original object height in twips.
\objw<N> <N> is the original object width in twips.
\objsetsize Forces the object server to set the object s
dimensions to those specified by the client.
\objtransy<N> <N> is the distance in twips an object should be
moved vertically with respect to the baseline. This
control word is needed to place MathType(TM)
equation objects correctly in line. This is an
optional control of the \object group.
\objcropt<N> <N> is the top cropping distance in twips.
\objcropb<N> <N> is the bottom cropping distance in twips.
\objcropl<N> <N> is the left cropping distance in twips.
\objcropr<N> <N> is the right cropping distance in twips.
\objscalex<N> <N> is the horizontal scaling percentage.
\objscaley<N> <N> is the vertical scaling percentage.
Object Data
--------------------------------------------------------------------
Control Word Meaning
------------ -------
\objdata The \objdata subgroup is required to be in the
\object group. The syntax for this group is
{\*\objdata[{\*\objalias[\bin<N>]
<Data>}{\*\objsect[\bin<N>] <Data>}][\bin<N>]
<ObjectData>} where <ObjectData> represents the
complete data of the object. If the \bin<N> option
is used, then <N> represents the number of bytes of
binary data. Otherwise, the <ObjectData >is in
hexadecimal.
\objalias This group contains the Alias Record for the
publisher object for the Macintosh Edition Manager.
If the \bin control is used, the data is in binary
numerical format. Otherwise, it is represented in
the RTF stream in hexadecimal.
\objsect This group contains the Section Record for the
publisher object for the Macintosh Edition Manager.
If the \bin control is used, the data is in binary
numerical format. Otherwise, it is represented in
the RTF stream in hexadecimal.
Object Result
--------------------------------------------------------------------
Control Word Meaning
------------ -------
\rsltrtf Forces the result to be RTF, if possible.
\rsltpict Forces the result to be a Windows metafile or
MacPict image, if possible.
\rsltbmp Forces the result to be a bitmap, if possible.
\rslttxt Forces the result to be plain text, if possible.
\rsltmerge Uses the formatting of the current result whenever
a new result is obtained.
\result The result group is optional in the \object group.
It contains the last update of the result of the
object. The data of the result group should be
standard RTF so that RTF readers that don t
understand objects or the type of object
represented can use the current result in the
object s place to maintain the object's appearance.
The syntax for this group is {\result <ResultData>}
where <ResultData> is standard RTF syntax.
BOOKMARKS
=========
This group contains two control words: \*\bkmkstart, which indicates
the start of the specified bookmark, and \*\bkmkend, which indicates
the end of the specified bookmark. A bookmark is shown in the
following example:
...
\pard\plain \fs20 Kuhn believes that science, rather than
discovering in experience certain structured
relationships, actually creates (or already participates in)
a presupposed structure to which it fits the data.
{\bkmkstart paradigm} Kuhn calls such a presupposed
structure a paradigm.{\bkmkend paradigm}
...
If a bookmark covers a partial selection of columns of a table,
\bkmkcolf<N> is used to denote the first column of a table covered by
a bookmark and \bkmkcoll<N> is used to denote the last column. If
\bkmkcolf is not included, the first column of the table is used as
the first column for the bookmark. If \bkmkcoll is not included, the
last column of the table is used for the bookmark. These controls are
used within the \*\bkmkstart group following the \bkmkstart control.
For example, {\*\bkmkstart\bkmkcolf2\bkmkcoll5 Table1} places the
bookmark "Table1" on columns 2 through 5 of a table.
MACINTOSH EDITION MANAGER PUBLISHER OBJECTS
===========================================
These controls define the RTF controls used to define publisher
objects for the Macintosh Edition Manager. The range of publisher
objects are marked as bookmarks; therefore, these controls are all
used within the \bkmkstart group. The RTF syntax for a publisher
object is:
{\*\bkmkstart\bkmkpub[\pubauto]{\*\objalias[\bin]
<Data>}{\*\objsect[\bin] <Data>} <BookmarkName>}
Control Word Meaning
------------ -------
\bkmkpub The bookmark marks a Macintosh Edition Manager
publisher object.
\pubauto The publisher object will automatically update all
Macintosh Edition Manager subscribers of this
object whenever it is edited.
\objalias This group contains the Alias Record for the
publisher object for the Macintosh Edition Manager.
If the \bin control is used, the data is in binary
format. Otherwise, it is in hexadecimal.
\objsect This group contains the Section Record for the
publisher object for the Macintosh Edition Manager.
If the \bin control is used, the data is in binary
format. Otherwise, it is in hexadecimal.
DOCUMENT FORMATTING PROPERTIES
==============================
This section specifies the attributes of the document, such as margins
and footnote placement. These attributes must precede the first plain-
text character in the document.
The control words that specify document formatting are listed in the
following table (the measurements are in twips).
The default values are used for omitted control words.
Control Word Meaning
------------ -------
\deftab<N> The default tab width (the default is 720).
\hyphhotz The hyphenation hot zone (the amount of space at
the right margin in which words are hyphenated--the
default for Word is 360 twips).
\linestart<N> The beginning line number (the default is 1).
\fracwidth Uses fractional character widths when printing
(QuickDraw only).
\*\nextfile The destination; the argument is the name of the
file to print or index next; must be enclosed with
braces.
\*\template The destination; the argument is the name of a
related template file; must be enclosed with
braces.
\makebackup The backup copy is made automatically when the
document is saved.
\defformat Tells the RTF reader that the document should be
saved in RTF format.
\psover Prints PostScript over the text.
\deflang<N> Defines the default language used in the document
when character formatting is reset with the \plain
control word. See "Character Formatting Properties"
in this document for a list of possible values for
<N>.
Footnotes
--------------------------------------------------------------------
Control Word Meaning
------------ -------
\ftnsep The text argument separates footnotes from the
document.
\ftnsepc The text argument separates continued footnotes
from the document.
\ftncn The text argument is a notice for continued
footnotes.
\endnotes Print the footnotes at the end of the section (the
default).
\enddoc Print the footnotes at the end of the document.
\ftntj Print the footnotes beneath text.
\ftnbj Print the footnotes at the bottom of the page.
\ftnstart<N> The beginning footnote number (the default is 1).
\ftnrestart The footnote numbers restart at each section.
Page Information
--------------------------------------------------------------------
Control Word Meaning
------------ -------
\paperw<N> The paper width (the default is 12,240).
\paperh<N> The paper height (the default is 15,840).
\margl<N> The left margin (the default is 1,800).
\margr<N> The right margin (the default is 1,800).
\margt<N> The top margin (the default is 1,440).
\margb<N> The bottom margin (the default is 1,440).
\facingp Facing pages (activates odd/even headers and
gutters).
\gutter<N> The gutter width (the default is 0).
\margmirror Switches margin definitions on left and right pages.
\landscape Landscape format.
\pgnstart<N> The beginning page number (the default is 1).
\widowctrl Widow control.
Revision Marks
--------------------------------------------------------------------
Control Word Meaning
------------ -------
\revisions Turns on revision marking.
\revprop<N> Argument indicates how revised text will be
displayed: 0 for no properties shown; 1 for bold; 2
for italic; 3 for underline (the default); 4 for
double underline.
\revbar<N> Vertical lines mark altered text, based on the
argument: 0 for no marking; 1 for left margin; 2
for right margin; 3 for outside (left on left
pages, right on right pages; the default).
SECTION FORMATTING PROPERTIES
=============================
This group specifies section formatting properties, which apply to the
text FOLLOWING the control word, with the exception of the section
break control words (those beginning with \sbk). Section break control
words describe the break PRECEDING the text.
Section Formatting Control Words
--------------------------------------------------------------------
Control Word Meaning
------------ -------
\sectd Reset to the default section properties.
\endnhere Endnotes included in the section.
\binfsxn<N> <N> is the printer bin used for the first page of
the section. If this control is not defined, the
first page uses the same printer bin as defined by
the \binsxn<N> control.
\binsxn<N> <N> is the printer bin used for the pages of the
section.
Section Break
--------------------------------------------------------------------
Control Word Meaning
------------ -------
\sbknone No section break.
\sbkcol The section break starts a new column.
\sbkpage The section break starts a new page (the default).
\sbkeven The section break starts at an even page.
\sbkodd The section break starts at an odd page.
Columns
--------------------------------------------------------------------
Control Word Meaning
------------ -------
\cols<N> The number of columns for "snaking" (the default is
1).
\colsx<N> The space between columns in twips (the default is
720).
\linebetcol Insert a line between columns.
Line Numbering
--------------------------------------------------------------------
Control Word Meaning
------------ -------
\linemod<N> The line number modulus amount to increase each line
number (the default is 1).
\linex<N> The default value for <N> is 360 if \linex is
omitted. A value of 0 for <N> means the automatic
distance for the application reading the RTF file.
\linestarts<N> The beginning line number (the default is 1).
\linerestart The line numbers restart at the \linestarts value.
\lineppage The line numbers restart on each page.
\linecont The line numbers continue from the preceding
section.
Page Information
--------------------------------------------------------------------
Control Word Meaning
------------ -------
\pgwsxn<N> <N> is the page width in twips. A \sectd control
resets the value to that specified by \paperw<N> in
the document properties.
\pghsxn<N> <N> is the page height in twips. A \sectd control
resets the value to that specified by \paperh<N> in
the document properties.
\marglsxn<N> <N> is the left margin of the page in twips. A
\sectd control resets the value to that specified by
\margl<N> in the document properties.
\margrsxn<N> <N> is the right margin of the page in twips. A
\sectd control resets the value to that specified by
\margr<N> in the document properties.
\margtsxn<N> <N> is the right margin of the page in twips. A
\sectd control resets the value to that specified by
\margr<N> in the document properties.
\margbsxn<N> <N> is the top margin of the page in twips. A \sectd
control resets the value to that specified by
\margt<N> in the document properties.
\guttersxn<N> <N> is the width of the gutter margin for the
section in twips. A \sectd control resets the value
to that specified by \gutter<N> in the document
properties. If facing pages is turned off, the
gutter will be added to the left margin of all
pages. If facing pages is turned on, the gutter will
be added to the left side of odd-numbered pages and
the right side of even-numbered pages.
\lndscpsxn Page orientation is in landscape format. To mix
portrait and landscape sections within a document,
the \landscape control should not be used so that
the default for a section is portrait, which may be
overridden by the \lndscpsxn control.
\titlepg The first page has a special format.
\headery<N> The header is <N> twips from the top of the page
(the default is 720).
\footery<N> The footer is <N> twips from the bottom of the page
(the default is 720).
Page Numbers
--------------------------------------------------------------------
Control Word Meaning
------------ -------
\pgnstarts<N> The beginning page number (the default is 1).
\pgncont The continuous page numbering (the default).
\pgnrestart The page numbers restart at the \pgnstarts value.
\pgnx<N> The page number is <N> twips from the right margin
(the default is 720).
\pgny<N> The page number is <N> twips from the top margin
(the default is 720).
\pgndec The page-number format is decimal.
\pgnucrm The page-number format is uppercase Roman numerals.
\pgnlcrm The page-number format is lowercase Roman numerals.
\pgnucltr The page-number format is uppercase letters.
\pgnlcltr The page-number format is lowercase letters.
Vertical Alignment
--------------------------------------------------------------------
Control Word Meaning
------------ -------
\vertalt The text is top aligned on the page (the default).
\vertal The text is bottom aligned on the page.
\vertalc The text is centered vertically on the page.
\vertalj The text is justified vertically on the page.
PARAGRAPH FORMATTING PROPERTIES
===============================
This group specifies paragraph formatting properties. To ensure
compatibility with previous versions of RTF, if border properties are
specified, the border segment control word (\brdrt,\brdrb,\brdrl,
\brdrr, or \box) must precede the control word(s) that specify the
pattern for the border.
Paragraph Formatting Control Words
--------------------------------------------------------------------
Control Word Meaning
------------ -------
\pard Resets to the default paragraph properties.
\s<N> Designates the reference number of the style in the
RTF document; if a style is referenced within the
document, style properties must be included along
with the style reference in the document text.
\intbl The paragraph is part of a table.
\keep Keep the paragraph intact.
\keepn Keep the paragraph with the next paragraph.
\noline No line numbering.
\pagebb Break the page before the paragraph.
\sbys Side-by-side paragraphs.
Alignment
--------------------------------------------------------------------
Control Word Meaning
------------ -------
\ql Left aligned (the default)
\qr Right aligned
\qj Justified
\qc Centered
Indentation
--------------------------------------------------------------------
Control Word Meaning
------------ -------
\fi<N> First-line indent (the default is 0).
\li<N> Left indent (the default is 0).
\ri<N> Right indent (the default is 0).
Spacing
--------------------------------------------------------------------
Control Word Meaning
------------ -------
\sb<N> Space before (the default is 0).
\sa<N> Space after (the default is 0).
\sl<N> Space between lines. If this control word is missing
or if \s1000 is used, the line spacing is
automatically determined by the tallest character in
the line; if <N> is a positive value, this size is
used only if it is taller than the tallest character
(otherwise, the tallest character determines the
size); if <N> is a negative value, the absolute
value of <N> determines the size, even if it is
shorter than the tallest character.
Tabs
--------------------------------------------------------------------
Control Word Meaning
------------ -------
\tx<N> The tab position in twips from the left margin.
\tqr A flush-right tab.
\tqc A centered tab.
\tqdec A decimal tab.
\tb<N> A bar tab position in twips from the left margin.
\tldot Leader dots.
\tlhyph Leader hyphens.
\tlul A leader underline.
\tlth A leader thick line.
\tleq A leader equal sign.
Paragraph Borders
--------------------------------------------------------------------
Control Word Meaning
------------ -------
\brdrt Border top.
\brdrb Border bottom.
\brdrl Border left.
\brdrr Border right.
\brdrbtw Consecutive paragraphs with identical border
formatting are considered part of a single group
with the border information applying to the entire
group. To have borders around individual paragraphs
within the group, the \brdrbtw control must be
specified for that paragraph.
\brdrbar Box border outside (right side of odd-numbered
pages, left side of even-numbered pages).
\box Border around the paragraph.
\brdrs Single-thickness border.
\brdrth Thick border.
\brdrsh Shadowed border.
\brdrdb Double border.
\brdrdot Dotted border.
\brdrhair Hairline border.
\brdrw<N> <N> is the width in twips of the paragraph border
line. This control should follow the paragraph
border controls \brdrt, \brdrr, \brdrb, and \brdrl.
\brdrcf<N> <N> is the color of the paragraph border from the
color table in the RTF header. This control should
follow the paragraph border controls \brdrt, \brdrr,
\brdrb, and \brdrl.
\brsp<N> Space in twips between borders and the paragraph.
Paragraph Shading and Background Pattern
--------------------------------------------------------------------
Control Word Meaning
------------ -------
\shading<N> <N> is the shading of the paragraph in hundredths of
a percent.
\bghoriz Specifies a horizontal background pattern for the
paragraph.
\bgvert Specifies a vertical background pattern for the
paragraph.
\bgfdiag Specifies a forward diagonal background pattern for
the paragraph (\\\\).
\bgbdiag Specifies a backward diagonal background pattern for
the paragraph (////).
\bgcross Specifies a cross-hatched background pattern for the
paragraph.
\bgdcross Specifies a diagonal cross-hatched background
pattern for the paragraph.
\bgdkhoriz Specifies a dark horizontal background pattern for
the paragraph.
\bgdkvert Specifies a dark vertical background pattern for the
paragraph.
\bgdkfdiag Specifies a dark forward diagonal background pattern
for the paragraph (\\\\).
\bgdkbdiag Specifies a dark backward diagonal background
pattern for the paragraph (////).
\bgdkcross Specifies a dark cross-hatched background pattern
for the paragraph.
\bgdkdcross Specifies a dark diagonal cross-hatched background
pattern for the paragraph.
\cfpat<N> <N> is the line color of the background pattern.
\cbpat<N> <N> is the background color of the background
pattern.
POSITIONED OBJECTS AND FRAMES
=============================
The following paragraph-formatting control words specify the location
of a paragraph on the page. Consecutive paragraphs with the same frame
formatting are considered to be part of the same frame. For two framed
paragraphs to appear at the same position on a page, they must be
separated by a paragraph with different or no frame information.
Control Word Meaning
------------ -------
\absw<N> <N> is the width of the frame in twips.
\absh<N> <N> is the height of the frame in twips. A positive
number indicates the minimum height of the frame,
and a negative number indicates the exact height of
the frame. A value of 0 indicates that the height of
the frame adjusts to the contents of the frame. Zero
is the default for frames where no height is given.
Horizontal Position
--------------------------------------------------------------------
Control Word Meaning
------------ -------
\phmrg Use the margin as the horizontal reference frame.
\phpg Use the page as the horizontal reference frame.
\phcol Use the column as the horizontal reference frame.
This is the default if no horizontal reference frame
is given.
\posx<N> Positions the frame <N> twips from the left edge of
the reference frame.
\posxc Centers the frame horizontally within the reference
frame.
\posxi Positions the paragraph horizontally inside the
reference frame.
\posxo Positions the paragraph horizontally outside the
reference frame.
\posxr Positions the paragraph to the right within the
reference frame.
\posxl Positions the paragraph to the left within the
reference frame. This is the default if no
horizontal positioning information is given.
Vertical Position
--------------------------------------------------------------------
Control Word Meaning
------------ -------
\pvmrg Use the margin as the vertical reference frame.
\pvpg Use the page as the vertical reference frame.
\pvpara Positions the reference frame vertically relative to
the top of the top-left corner of the next unframed
paragraph in the RTF stream. This is the default if
no vertical frame positioning information is given.
\posy<N> Positions the paragraph <N> twips from the top edge
of the reference frame.
\posyil Positions the paragraph vertically to be in line.
\posyt Positions the paragraph at the top of the reference
frame.
\posyc Centers the paragraph vertically within the
reference frame.
\posyb Positions the paragraph at the bottom of the
reference frame.
Text Wrapping
--------------------------------------------------------------------
Control Word Meaning
------------ -------
\dxfrtext<N> Distance in twips of a positioned paragraph from the
main text flow in all directions. In Word for
Windows 2.0, this control affects only the
horizontal distance from the text on each side of
the frame.
\dyfrtext<N> <N> is the vertical distance in twips from the text
above and below the frame.
The following is an example of absolute-positioned text in a document:
A
|
... -------------
\par \pard \pvpg\phpg\posxc\posyt\absw5040\dxfrtest173 abs pos para1
\par \pard \phmrg\posxo\posyc\dxfrtext1152 abs pos para2
-------------
|
A
A: Text to be positioned
TABLES
======
There is no RTF table group. A table is a collection of paragraphs,
and a table row is a continuous sequence of paragraphs partitioned
into cells. The \intbl paragraph formatting control word identifies
the paragraph as part of a table. This control is inherited between
paragraphs that do not have paragraph properties reset with a \pard.
The last paragraph of a cell is terminated by a cell mark (the \cell
control word), and the row is terminated by a row mark (the \row
control word). The following control words further define the table:
Control Word Meaning
------------ -------
\trowd Sets the table row defaults.
\trgaph<N> Half the space between the cells of a table row in
twips.
\cellx<N> Moves the right boundary of a table cell, including
its half of the space between cells.
\clmgf The first cell in a range of table cells to be
merged.
\clmrg The contents of the table cell are merged with those
of the preceding cell.
Cell Borders and Shading
--------------------------------------------------------------------
Control Word Meaning
------------ -------
\clbrdrb The bottom table cell border.
\clbrdrt The top table cell border.
\clbrdrl The left table cell border.
\clbrdrr The right table cell border.
Row Formatting
--------------------------------------------------------------------
Control Word Meaning
------------ -------
\trql Left-justifies a table row with respect to its
containing column.
\trqr Right-justifies a table row with respect to its
containing column.
\trqc Centers a table row with respect to its containing
column.
\trleft<N> The position of the leftmost edge of the table with
respect to the left edge of its column.
\trrh<N> The height of a table row in twips; when 0, the
height is sufficient for all the text in the line;
when positive, the height is guaranteed to be at
least the specified height; when negative, the
absolute value of the height is used, regardless of
the height of the text in the line.
Cell Shading and Background Pattern
--------------------------------------------------------------------
Control Word Meaning
------------ -------
\clshdng<N> <N> is the shading of a table cell in hundredths of
a percent. This control should be included in RTF
along with cell border information.
\clbghoriz Specifies a horizontal background pattern for the
cell.
\clbgvert Specifies a vertical background pattern for the
cell.
\clbgfdiag Specifies a forward diagonal background pattern for
the cell (\\\\).
\clbgbdiag Specifies a backward diagonal background pattern for
the cell (////).
\clbgcross Specifies a cross-hatched background pattern for the
cell.
\clbgdcross Specifies a diagonal cross-hatched background
pattern for the cell.
\clbgdkhor Specifies a dark horizontal background pattern for
the cell.
\clbgdkvert Specifies a dark vertical background pattern for the
cell.
\clbgdkfdiag Specifies a dark forward diagonal background pattern
for the cell (\\\\).
\clbgdkbdiag Specifies a dark backward diagonal background
pattern for the cell (////).
\clbgdkcross Specifies a dark cross-hatched background pattern
for the cell.
\clbgdkdcross Specifies a dark diagonal cross-hatched background
pattern for the cell.
\clcfpat<N> <N> is the line color of the background pattern.
\clcbpat<N> <N> is the background color of the background
pattern.
The following example shows some table text:
...
\par \trowd \trqc\trgaph108\trrh280\trleft36
\clbrdrt\brdrth \clbrdrl\brdrth \clbrdrb\brdrdb
\clbrdrr\brdrdb \cellx3636\clbrdrt\brdrth
...
CHARACTER FORMATTING PROPERTIES
===============================
The last group controls character formatting properties. A control
word preceding plain text turns on the specified attribute. Some
control words (indicated in the following table by an asterisk
following the description) can be turned off by the control word
followed by 0 (zero). For example, \b turns on bold, whereas \b0 turns
off bold.
The character formatting control words are listed in the following
table:
Control Word Meaning
------------ -------
\plain Resets application s default character formatting
properties.
\b Turns on bold.*
\caps Turns on all uppercase.*
\deleted Marks the text as deletion revision marked.*
\dn<N> Sets the subscript position in half-points (the
default is 6).
\expnd<N> Sets the expansion or compression of the space
between characters in quarter-points; a negative
value compresses the space (the default is 0).
\f<N> Identifies the font number.
\fs<N> Sets the font size in half-points (the default is
24).
\i Turns on italic.*
\outl Turns on outline.*
\revised Indicates that text has been added since revision
marking was turned on.
\scaps Turns on small capitals.*
\shad Turns on shadow.*
\strike Turns on strikethrough.
\ul Turns on continuous underline. \ul0 turns off all
underlining.
\uld Turns on dotted underline.
\uldb Turns on double underline.
\ulnone Turns off all underlining.
\ulw Turns on word underline.
\up<N> Sets the superscript position in half-points (the
default is 6).
\v Turns on hidden text.*
\lang<N> Applies a language to a character. <N> is a number
corresponding to a language. The following table
defines the standard languages used by Microsoft.
This table was generated by the Unicode group for
use with TrueType(R) and Unicode. A \plain control
resets the language property to the language defined
by \deflang<N> in the document properties.
Language Name Language ID
------------- -----------
No Language 0x0400
Albanian 0x041c
Arabic 0x0401
Bahasa 0x0421
Belgian Dutch 0x0813
Belgian French 0x080c
Brazilian Portuguese 0x0416
Bulgarian 0x0402
Catalan 0x0403
Croato-Serbian (Latin) 0x041a
Czech 0x0405
Danish 0x0406
Dutch 0x0413
English (Aus.) 0x0c09
English (U.K.) 0x0809
English (U.S.) 0x0409
Finnish 0x040b
French 0x040c
French (Canadian) 0x0c0c
German 0x0407
Greek 0x0408
Hebrew 0x040d
Hungarian 0x040e
Icelandic 0x040f
Italian 0x0410
Japanese 0x0411
Korean 0x0412
Norwegian (Bokmal) 0x0414
Norwegian (Nynorsk) 0x0814
Polish 0x0415
Portuguese 0x0816
Rhaeto-Romanic 0x0417
Romanian 0x0418
Russian 0x0419
Serbo-Croatian (Cyrillic) 0x081a
Simplified Chinese 0x0804
Slovak 0x041b
Spanish (Castilian) 0x040a
Spanish (Mexican) 0x080a
Swedish 0x041d
Swiss French 0x100c
Swiss German 0x0807
Swiss Italian 0x0810
Thai 0x041e
Traditional Chinese 0x0404
Turkish 0x041f
Urdu 0x0420
To read negative \expnd values from Word for the Macintosh, an RTF
reader should use only the low-order 6 bits of the value read. Word
for the Macintosh does not emit negative values for \expnd. Instead,
it treats values from 57 through 63 as -7 through -1, respectively
(the low-order 6 bits of 57 through 63 are the same as -7 through 1).
SPECIAL CHARACTERS
==================
The RTF standard includes control words for special characters. If a
special character control word is not recognized by the RTF reader,
the control word is ignored, and the text following it is considered
plain text. The RTF specification is flexible enough to allow new
special characters to be added for interchange with other software.
The special RTF characters are listed in the following table:
Control Word Meaning
------------ -------
\chdate The current date (as in headers).
\chdpl The current date in long format; for example,
Tuesday, June 28, 1992.
\chdpa The current date in abbreviated format; for example,
Tue, Jun 28, 1992.
\chtime The current time (as in headers).
\chpgn The current page number (as in headers).
\chftn An automatic footnote reference (the footnotes
follow in a group).
\chatn An annotation reference (the annotation text follows
in a group).
\chftnsep An anchoring character for the footnote separator.
\chftnsepc An anchoring character for the footnote
continuation.
\cell The end of a table cell.
\row The end of a table row.
\par The end of a paragraph.
\sect The end of a section and a paragraph.
\page A required page break.
\column A required column break.
\line A required line break (no paragraph break).
\tab A tab character; the same as ASCII 9.
\emdash An em (--) dash. This is character 151 in the ANSI
character set and character 208 in the Macintosh
character set.
\endash An en (-) dash. This is character 150 in the ANSI
character set and character 209 in the Macintosh
character set.
\bullet A bullet character. This is character 149 in the
ANSI character set and character 165 in the
Macintosh character set.
\lquote An opening single quotation mark. This is character
145 in the ANSI character set and character 212 in
the Macintosh character set.
\rquote A closing single quotation mark. This is character
146 in the ANSI character set and character 213 in
the Macintosh character set.
\ldblquote An opening double quotation mark. This is character
147 in the ANSI character set and character 210 in
the Macintosh character set.
\rdblquote A closing double quotation mark. This is character
148 in the ANSI character set and character 211 in
the Macintosh character set.
\| A formula character.
\~ A nonbreaking space.
\- An optional hyphen.
\_ A nonbreaking hyphen.
\: Specifies a subentry in an index entry.
\* Marks a destination whose text should be ignored if
not understood by the RTF reader.
\'hh A hexadecimal value, based on the specified
character set (may be used to identify 8-bit
values).
\alt The ALT modifier key. Used to describe shortcut-key
codes for styles.
\shift The SHIFT modifier key. Used to describe shortcut-
key codes for styles.
\ctrl The CTRL modifier key. Used to describe shortcut-key
codes for styles.
Specifies a function key where <N> is the function
key number. Used to describe shortcut-key codes for
styles.
NOTE: An ASCII 9 is accepted as a tab character. A carriage return
(character value 13) or linefeed character (character value 10)
will be treated as a \par control if the character is preceded by
a backslash. You must include the backslash, or RTF ignores the
control word. (You may also want to insert a carriage-
return/linefeed pair without backslashes at least every 255
characters for better text transmission over communication lines.)