imagedocbookfiguressubfigure

Docbook - more images in one figure


Is there in Docbook something similar to Subfig from LaTeX?

I want to put two images in a figure, side by side - how is this done in Docbook?


Solution

  • You can have two (or more) images inside single figure.

    <figure><title>The Pythagorean Theorem Illustrated</title>
    <mediaobject>
      <imageobject>
        <imagedata fileref="figures/pythag.png"/>
      </imageobject>
      <textobject><phrase>An illustration of the Pythagorean Theorem</phrase></textobject>
    </mediaobject>
    <mediaobject>
      <imageobject>
        <imagedata fileref="figures/pythag2.png"/>
      </imageobject>
      <textobject><phrase>the second</phrase></textobject>
    </mediaobject>
    </figure>
    

    But according to http://docbook.org/tdg/en/html/figure.html DocBook standard does not specify how these elements are to be presented with respect to one another. In other words, you have to develop your representation on your own.

    If you'd have XSLT for converting DocBook to HTML (like I do), you could add a CSS rule for images inside figure block to float.