Each section in the RTF file has the following syntax:
<section><secfmt>* <hdrftr>? <para> + (\sect <section>)?
At the beginning of each section, there may be some section-formatting control words (described as <secfmt> in the section text syntax description). These control words specify 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. These control words can appear anywhere in the section, not just at the start.
Note that if the \sectd control word is not present, the current section inherits all section properties defined in the previous section.
The section-formatting control words are listed in the following table.
Control word | Meaning |
\sect | New section. |
\sectd | Reset to default section properties. |
\endnhere | Endnotes included in the section. |
\binfsxnN | N is the printer bin used for the first page of the section. If this control is not defined, then the first page uses the same printer bin as defined by the \binsxnN control. |
\binsxnN | N is the printer bin used for the pages of the section. |
\dsN | Designates section style. If a section style is specified, style properties must be specified with the section. |
\pnseclvlN | Used for multilevel lists. This property sets the default numbering style for each corresponding \pnlvlN control word (bullets and numbering property for paragraphs) within that section. This is a destination control word. |
\sectunlocked | This section is unlocked for forms. |
Section Break | |
\sbknone | No section break. |
\sbkcol | Section break starts a new column. |
\sbkpage | Section break starts a new page (the default). |
\sbkeven | Section break starts at an even page. |
\sbkodd | Section break starts at an odd page. |
Columns | |
\colsN | Number of columns for "snaking" (the default is 1). |
\colsxN | Space between columns in twips (the default is 720). |
\colnoN | Column number to be formatted; used to specify formatting for variable-width columns. |
\colsrN | Space to right of column in twips; used to specify formatting for variable-width columns. |
\colwN | Width of column in twips; used to override the default constant width setting for variable-width columns. |
\linebetcol | Line between columns. |
Line Numbering | |
\linemodN | Line-number modulus amount to increase each line number (the default is 1). |
\linexN | Distance from the line number to the left text margin in twips (the default is 360). The automatic distance is 0. |
\linestartsN | Beginning line number (the default is 1). |
\linerestart | Line numbers restart at \linestarts value. |
\lineppage | Line numbers restart on each page. |
\linecont | Line numbers continue from the preceding section. |
Page Information | |
\pgwsxnN | N is the page width in twips. A \sectd resets the value to that specified by \paperwN in the document properties. |
\pghsxnN | N is the page height in twips. A \sectd resets the value to that specified by \paperhN in the document properties. |
\marglsxnN | N is the left margin of the page in twips. A \sectd resets the value to that specified by \marglN in the document properties. |
\margrsxnN | N is the right margin of the page in twips. A \sectd resets the value to that specified by \margrN in the document properties. |
\margtsxnN | N is the top margin of the page in twips. A \sectd resets the value to that specified by \margtN in the document properties. |
\margbsxnN | N is the bottom margin of the page in twips. A \sectd resets the value to that specified by \margbN in the document properties. |
\guttersxnN | N is the width of the gutter margin for the section in twips. A \sectd resets the value to that specified by \gutterN from 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. |
\margmirsxn | Switches margin definitions on left and right pages. Used in conjunction with \facingp. |
\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 | First page has a special format. |
\headeryN | Header is N twips from the top of the page (the default is 720). |
\footeryN | Footer is N twips from the bottom of the page (the default is 720). |
Page Numbers | |
\pgnstartsN | Beginning page number (the default is 1). |
\pgncont | Continuous page numbering (the default). |
\pgnrestart | Page numbers restart at \pgnstarts value. |
\pgnxN | Page number is N twips from the right margin (the default is 720). This control word is understood but not used by current versions (6.0 or later) of Word. |
\pgnyN | Page number is N twips from the top margin (the default is 720). This control word is understood but not used by current versions (6.0 or later) of Word. |
\pgndec | Page-number format is decimal. |
\pgnucrm | Page-number format is uppercase roman numeral. |
\pgnlcrm | Page-number format is lowercase roman numeral. |
\pgnucltr | Page-number format is uppercase letter. |
\pgnlcltr | Page-number format is lowercase letter. |
\pgnhnN | Indicates which heading level is used to prefix a heading number to the page number. This control word can only be used in conjunction with numbered heading styles. 0 specifies to not show heading level (the default). Values 1-9 correspond to heading levels 1 through 9. |
\pgnhnsh | Hyphen separator character. This separator and the successive ones appear between the heading level number and the page number. |
\pgnhnsp | Period separator character. |
\pgnhnsc | Colon separator character. |
\pgnhnsm | Em-dash (—) separator character. |
\pgnhnsn | En-dash (–) separator character. |
Vertical Alignment | |
\vertalt | Text is top-aligned (the default). |
\vertalb | Text is bottom-aligned. |
\vertalc | Text is centered vertically. |
\vertalj | Text is justified vertically. |
Bidirectional Controls | |
\rtlsect | This section will snake (newspaper style) columns from right to left. |
\ltrsect | This section will snake (newspaper style) columns from left to right (the default). |
Text Flow | |
\stextflow | Section property for specifying text flow. 0Text flows left to right and top to bottom 1Text flows top to bottom and right to left, vertical 2Text flows left to right and bottom to top 3Text flows right to left and top to bottom 4Text flows left to right and top to bottom, vertical 5Text flows vertically, non-vertical font |
Page Borders | |
\pgbrdrhead | Page border surrounds header. |
\pgbrdrfoot | Page border surrounds footer. |
\pgbrdrt | Page border top. |
\pgbrdrb | Page border bottom. |
\pgbrdrl | Page border left. |
\pgbrdrr | Page border right. |
\brdrartN | Page border art; the N argument is a value from 1-165 representing the number of the border. |
\pgbrdroptN | 8Page border measure from text. Always display in front option is set to off. 32Page border measure from edge of page. Always display in front option is set to on. 40Page border measure from edge of page. Always display in front option is set to off. |
\pgbrdrsnap | Align paragraph borders and table edges with page border. |
The color, width, border style, and border spacing keywords for page borders are the same as the keywords defined for paragraph borders.
Headers and footers are RTF destinations. Each section in the document can have its own set of headers and footers. If no headers or footers are defined for a given section, the headers and footers from the previous section (if any) are used. Headers and footers have the following syntax:
<hdrftr> | '{' <hdrctl> <para>+ '}' <hdrftr>? |
<hdrctl> | \header | \footer | \headerl | \headerr | \headerf | \footerl | \footerr | \footerf |
Note that each separate <hdrftr> group must have a distinct <hdrctl> introducing it.
Control word | Meaning |
\header | Header on all pages. This is a destination control word. |
\footer | Footer on all pages. This is a destination control word. |
\headerl | Header on left pages only. This is a destination control word. |
\headerr | Header on right pages only. This is a destination control word. |
\headerf | Header on first page only. This is a destination control word. |
\footerl | Footer on left pages only. This is a destination control word. |
\footerr | Footer on right pages only. This is a destination control word. |
\footerf | Footer on first page only. This is a destination control word. |
The \headerl, \headerr, \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. Many RTF readers will not function correctly if the appropriate document properties are not set. In particular, if \facingp is not set, then only \header and \footer should be used; if \facingp is set, then only \headerl, \headerr, \footerl, and \footerr should be used. Combining both \facingp and \titlepg is allowed. You should not use \header to set the headers for both pages when \facingp is set. You can use \headerf if \titlepg is not set, but no header will appear. For more information, see "Document Formatting Properties" on page 20 and "Section Formatting Properties" on page 26 of this Application Note.
If the previous section had a first page header or footer and had \titlepg set, and the current section does not, then the previous section's first page header or footer is disabled. However, it is not destroyed; if subsequent sections have \titlepg set, then the first page header or footer is restored.