web analytics
Skip to main content

The PreTeXt Guide

Section 20.2 <figure>

To provide a number and caption for an <image>, the <figure> element is used. Notice that the <caption> is authored at the beginning of the <figure> but is displayed below the <figure>'s content.
<figure xml:id="fig-graph">
  <caption>A small graph (from <pubtitle>Applied
  Combinatorics</pubtitle> by Keller and
  Trotter)</caption>
  <image source="small-graph" width="20%"/>
</figure>
Listing 20.2.1. Code to include a figure
The code in Listing 20.2.1 produces the following output:
Figure 20.2.2. A small graph (from Applied Combinatorics by Keller and Trotter)