XML technologies / DocBook / Block elements / Graphics / Creating figures

(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)

The preceding elements only hold graphic content. Often, a figure also needs a title, an entry in a list of figures and numbering based on parent structural elements. For this, use the element figure:

Example: Figure using figure

<figure>
  <title>Nürnberg bei Nacht</title>
  <mediaobject>
    <imageobject role="html">
      <imagedata fileref="nuernberg.png"/>
    </imageobject>
    <imageobject role="fo">
      <imagedata fileref="nuernberg.pdf"/>
    </imageobject>
  </mediaobject>
</figure>

For figures that do not need a title, use informalfigure. Apart from the title, it behaves like figure.

You can also use multiple mediaobject elements. Other elements within figure are possible too, although the first two are likely to be the most common. DocBook does not specify their relative arrangement, rendering or how the figure is anchored in the text. This often leads to awkward page breaks in print. Figures may then be placed at more suitable positions on subsequent pages, depending on the publishing system.

  

back to top