<preformat>
Preformatted Text
Text in which spaces, tabs, and line feeds must be preserved. Content is typically
displayed in monofont to preserve character alignment.
Remarks
The <preformat> element is typically used for
machine-related communication such as man-machine dialogs and error message reports with descriptions, 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 fragments
are typically anchored whereas longer preformats such as ASCII art are typically placed elsewhere such as in a separate window or at the end of the document.
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.
Attributes
Content Model
<!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 | serif | strike | underline | underline-start | underline-end | ruby | alternatives | inline-graphic | private-char | chem-struct | inline-formula | tex-math | mml:math | abbrev | index-term | index-term-range-end | milestone-end | milestone-start | named-content | styled-content | fn | target | xref | sub | sup | x | attrib | permissions)*
Description
Any combination of:
- Text, numbers, or special characters
- Accessibility Elements
- Linking Elements
- <inline-supplementary-material> Inline Supplementary Material
- 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
- <serif> Serif
- <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
- <sub> Subscript
- <sup> Superscript
- <x> X - Generated Text and Punctuation
- Ownership Elements
This element may be contained in:
<abstract>, <ack>, <alternatives>, <answer>, <app>, <app-group>, <bio>, <body>, <book-app-group>, <boxed-text>, <chem-struct>, <chem-struct-wrap>, <disp-formula>, <disp-quote>, <explanation>, <fig>, <floats-group>, <glossary>, <index>, <index-div>, <index-group>, <license-p>, <named-book-part-body>, <named-content>, <notes>, <option>, <p>, <question>, <question-preamble>, <ref-list>, <sec>, <see>, <see-also>, <see-also-entry>, <see-entry>, <styled-content>, <supplementary-material>, <table-wrap>, <td>, <term>, <th>, <toc>, <toc-div>, <toc-entry>, <toc-group>, <trans-abstract>
Example 1
Used to show a snippet of a computer message:
...
<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>
...
Example 2
Used to preserve unusual whitespace in a poem:
...
<preformat preformat-type="poem">
it’s
spring
and
the
goat-footed
balloonMan whistles
far
and
wee
</preformat>
...
Example 3
Used to preserve the lines in a poem (which might have been better tagged as a <verse-group>):
...
<body>
<disp-quote>
<preformat>... who would fardels bear,
To grunt and sweat under a weary life,
But that the dread of something after death,
The undiscover’d country from whose bourn
No traveller returns, puzzles the will
And makes us rather bear those ills we have
Than fly to others that we know not of?</preformat>
<attrib>William Shakespeare, Hamlet, Act III,
Scene IV</attrib>
</disp-quote>
<p>Shakespeare well understood the underpinning of
our society’s tenacious need to cling to life:
the fear of death, the fear of the unknown. Yes, we
acknowledge death is part of nature’s cycle,
but even as we do so, we struggle ...</p>
<sec>...</sec>
</body>
...
Example 4
Used to make a small table (which might have been better tagged as an <array>):
...
<list list-type="bullet">...
<list-item id="bid.101">
<p>Each 3D Domain identified in an MMDB record is
assigned a unique integer identifier that is appended to
the Accession number of the chain to which it belongs
(e.g., 1B8G A 2). This new Accession number becomes
its identifier in Entrez 3D Domains. New 3D Domain
identifiers are assigned whenever a new MMDB-ID is
assigned.</p>
</list-item>
<list-item id="bid.102">
<p>For conserved domains, the Accession number is
based on the source database:
<preformat>
Pfam: pfam00049
SMART: smart00078
LOAD: LOAD Toprim
CD: cd00101
COG: COG5641
</preformat>
</p>
</list-item>
</list>
...