Skip to main content

The PreTeXt Guide

Section 4.17 Figures

A <figure> is the most generic and flexible container for planar content. But be sure to read Section 3.13 so you are aware of the other possibilities. A figure has a <caption>, which will typically render below the content (even if authored early as metadata) and serves to provide an extra description of the content. So it may be several sentences long. There is also a <title>, which is typically not rendered as part of the figure. Instead it is used for cross-references, or in a list of figures, to identify the figure. So it should be very short and might just be a phrase, such as “Life Cycle of a Salamander.”
An <image> is likely the most frequent content in a <figure>. But you may also place a <video>, <audio>, <sidebyside>, or <sbsgroup>. Once completely implemented, an <interactive> is another possibility. (See Section 4.23 for more about the side-by-side construction.)
A special situation is when a <figure> is a panel of a <sidebyside>, which is itself inside a <figure>. Then the interior figure is subnumbered. For example, the exterior figure might be Figure 4.12, and if a panel of the <sidebyside> is the second interior figure it will be Figure 4.12(b). For example,
<figure>
    <caption>Salamanders at different life stages</caption>
    <sidebyside>
        <figure>
            <caption>Hatchling</caption>
            <image source="salamader-hatchling.jpg"/>
        </figure>
        <figure>
            <caption>Juvenile</caption>
            <image source="salamader-juvenile.jpg"/>
        </figure>
        <figure>
            <caption>Adult</caption>
            <image source="salamader-adult.jpg"/>
        </figure>
    </sidebyside>
</figure>
could result in the entire figure being Figure 4.12 and then the juvenile salamander photograph would be inside of Figure 4.12(b).