Text in which spaces, tabs, and line feeds must be preserved. Content is typically displayed in monofont to preserve character alignment.
The <preformat> element is typically used for machine-related communication such as ASCII art and error message reports, in which whitespace such as tabs, line feeds, and spaces should be preserved.
Position: The @position attribute may be used to indicate whether this element must be anchored at its exact location within the text, or whether it may float, for example, to the top of the next page, next column, to the end of a logical file, or within a separate window. For the typical <preformat> element, the “float or anchor” decision will be governed by the size of the object. For example, short preformat fragments are typically anchored whereas longer preformats are typically placed elsewhere such as in a separate window or at the end of the document.
Equations: The MathML elements to describe equations are not permitted within <preformat>. If equations are encountered within computer code, they can be tagged using the element <named-content> to preserve the fact that they were equations or the element <styled-content> to preserve that fact that they were set in a math font.
<!ELEMENT preformat %preformat-model; >
Expanded Content Model
(#PCDATA | alt-text | long-desc | email | ext-link | uri | inline-supplementary-material | related-article | related-object | hr | bold | fixed-case | italic | monospace | overline | overline-start | overline-end | roman | sans-serif | sc | strike | underline | underline-start | underline-end | ruby | alternatives | inline-graphic | private-char | chem-struct | inline-formula | tex-math | mml:math | abbrev | milestone-end | milestone-start | named-content | styled-content | fn | target | xref | sub | sup | x | attrib | permissions)*
Any combination of:
- Text, numbers, or special characters
- Accessibility Elements
- Linking Elements
- <inline-supplementary-material> Inline Supplementary Material Metadata
- Related Material Elements
- <hr> Horizontal Rule
- Emphasis Elements
- <bold> Bold
- <fixed-case> Fixed Case
- <italic> Italic
- <monospace> Monospace Text (Typewriter Text)
- <overline> Overline
- <overline-start> Overline Start
- <overline-end> Overline End
- <roman> Roman
- <sans-serif> Sans Serif
- <sc> Small Caps
- <strike> Strike Through
- <underline> Underline
- <underline-start> Underline Start
- <underline-end> Underline End
- <ruby> Ruby Annotation Wrapper
- <alternatives> Alternatives For Processing
- Inline Display Elements
- <chem-struct> Chemical Structure (Display)
- <inline-formula> Formula, Inline
- Math Elements
- Other Inline Elements
- <fn> Footnote
- <target> Target of an Internal Link
- <xref> X (cross) Reference
- Baseline Change Elements
- <x> X - Generated Text and Punctuation
- Ownership Elements
This element may be contained in:
<abstract>, <ack>, <alternatives>, <app>, <app-group>, <bio>, <body>, <boxed-text>, <chem-struct>, <chem-struct-wrap>, <disp-formula>, <disp-quote>, <fig>, <floats-group>, <glossary>, <license-p>, <named-content>, <notes>, <p>, <ref-list>, <sec>, <styled-content>, <supplementary-material>, <table-wrap>, <td>, <term>, <th>, <trans-abstract>
... <preformat preformat-type="dialog"> C:\users\lap make 'make' is not recognized as: - an internal or external command - an operable program - a batch file </preformat> ...
... <preformat preformat-type="poem"> it’s spring and the goat-footed balloonMan whistles far and wee </preformat> ...