Module 1: Common Structure, Elements, and Attributes

4. Non-Textual Phenomena

Textual documents often include non-textual phenomena such as images and graphics (illustrations, diagrams, drawings, artwork, ...). These non-textual phenomena serve different purposes: some are an integral part of the text, e.g., in comic books and graphic novels, others just function as illustrations to the text; some are essential for a good understanding of the text, others add very little to that text. The decision how to encode these non-textual materials is once more up to the encoder and the encoding policy in force.

From a structural point of view, images and graphics may be anchored to a particular point in the text. This inline location can be indicated by using the empty element <graphic>. Typically, a @url attribute will reference a digital representation of the image. This can be a local path or a reference to an online image or graphical file.

<p xmlns="http://www.tei-c.org/ns/1.0">'Plenty of options', he thought, sat on a bench and opened the book he had taken from the Whoopledywhaaian National Library.
<graphic url="http​://www​.whoopledywhaa​.info​/library​/facade​.png"/>
It was titled 'While thou art here', by Sir Edmund Peckwood.
<graphic url="wtatcover​.jpg"/>
While reading the first sentence, his placid expression turned to a certain je ne sais quoi: 'For the first time in twenty​-five years, Dr Burt Diddledygook decided not to turn up to the annual meeting of the Royal Academy of Whoopledywhaa.</p>
Example 38. Encoding an image with <graphic>.

Alternatively, encoded binary data representing an inline graphic or image may be embedded directly within the document. In this case, the <binaryObject> element may be used to represent an encoded version of its binary data.

An image or a graphic will often be accompanied by associated text such as a caption, a label, or a heading which may be encoded using <head>. More extensive comments or discussions on the figure or graphic may be given inside one or more <p> or <ab> elements. Both the graphic or figure (<graphic> or <binaryObject>), associated text(s) (<head>, <p> or <ab>), and descriptions of the image (<figDesc>) are grouped in a wrapping <figure> element:

<figure xmlns="http://www.tei-c.org/ns/1.0">
<graphic url="http​://www​.whoopledywhaa​.info​/library​/facade​.png"/>
<head>The National Library of Whoopledywhaa.</head>
</figure>
<figure xmlns="http://www.tei-c.org/ns/1.0">
<graphic url="wtatcover​.jpg"/>
<head>Figure 2. The cover of the first print edition of "While thou art here" by Sir Edmund Peckwood from the rare books collection of the National Library of Whoopledywhaa.</head>
</figure>
Example 39. Grouping information related to a graphical element inside <figure>.

Summary

The <figure> element is used to contain images, captions, and textual descriptions of the pictures. The images themselves are specified using the <graphic> element, whose @url attribute provides the location of an image and whose optional @n and @xml:id attributes provide opportunities for numbering and identification.

Figures consisting of several figures or sub-figures can be encoded with nesting <figure> elements:

<figure xmlns="http://www.tei-c.org/ns/1.0" n="2">
<figure n="2a">
<graphic url="wtatcoverfront​.jpg"/>
<head>Front</head>
</figure>
<figure n="2b">
<graphic url="wtatcoverback​.jpg"/>
<head>Back</head>
</figure>
<head>Figure 2. Front and back cover of the first print edition of "While thou art here" by Sir Edmund Peckwood from the rare books collection of the National Library of Whoopledywhaa.</head>
</figure>
Example 40. Encoding composite figures with nesting <figure> elements.

Note, how in the previous example the different nesting figures are numbered in an @n attribute. This is one of the global attributes available to all TEI elements. For a discussion of this and other global attributes, see section 5.

For the purpose of reading devices that cannot represent images, e.g., reading software for the visually impaired, a description of the figure or graphic may be supplied by the editor of the electronic text in a <figDesc> element:

<figure xmlns="http://www.tei-c.org/ns/1.0">
<graphic url="http​://www​.whoopledywhaa​.info​/library​/facade​.png"/>
<head>The National Library of Whoopledywhaa.</head>
<figDesc>The figure shows the front of the National Library of Whoopledywhaa with the two typical towers in the so called Whooply​-Gothic style. The towers are 145 metres high and the facade of the building is 48 metres wide. The 16 windows in the front are made of recycled stained glass windows of the nearby Saint​-Morkel​'s church which now serves as a swimming pool.</figDesc>
</figure>
Example 41. Providing an editorial description of a graphic element with <figDesc>.

Reference

For more information on the treatment of non-textual phenomena in TEI, see Module 3: Prose, section 4.2, and chapter 14 Tables, Formulæ, and Graphics of the TEI Guidelines.