Preformatted Text


Used for preformatted text, such as computer code, in which white space (such as tabs, line feeds, and spaces) should be preserved

This element’s content typically is displayed or printed in a monofont to preserve character alignment.


Conversion Note: 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 code fragments are typically anchored whereas full programs are typically placed elsewhere such as in a separate window or at the end of a book (or book component).


alternate-form-of Alternate Form of Graphic, Media Object, Etc.
id Identifier
position Position
preformat-type Type of Preformatted Text
xml:lang Language
xml:space Space

Related Elements

Poetry may be tagged with the <preformat> element if spacing is critical, but usually poetry should be tagged with the <verse-group> element, which may not preserve the exact indentation as it is, but is likely to be displayed in a proportional font.

Model Information

Content Model

<!ELEMENT  preformat    %preformat-model;                            >


Any combination of:

This element may be contained in:

<abstract> Abstract; <ack> Acknowledgments; <app> Appendix; <app-group> Appendix Matter; <body> Body of the Book; <boxed-text> Boxed Text; <chem-struct> Chemical Structure (Display); <chem-struct-wrapper> Chemical Structure Wrapper; <disp-formula> Formula, Display; <disp-quote> Quote, Displayed; <fig> Figure; <gloss-group> Glossary Group; <glossary> Glossary Elements List; <named-content> Named Special (Subject) Content; <notes> Notes; <p> Paragraph; <ref-list> Reference List (Bibliographic); <sec> Section; <supplementary-material> Supplementary Material; <table-wrap> Table Wrapper; <td> Table Data Cell (XHTML table model); <term> Definition List: Term; <th> Table Header Cell (XHTML table model); <trans-abstract> Translated Abstract

Tagged Example

<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 id="bid.102">
<p>For conserved domains, the Accession number is 
based on the source database:
    Pfam:          pfam00049
    SMART:         smart00078
    LOAD:          LOAD Toprim
    CD:            cd00101
    COG:           COG5641