Figure floats

A float is a characteristic of a formatting object that lets it float to a different location on the page. This assumes that the object doesn't have to maintain its strict location in the sequence of text. A figure can move the top or side of a printed page, or the side of an HTML page, and the text can adjust to its new location. If it is to one side, then the text can wrap around the opposite side.

Note

Not all XSL-FO processors support floats. The current version of FOP does not, for example. Other processors may have limitations when handling floats. Check your processor documentation.

Each type of float has a name to indicate its position:

left
right
start
end
inside
outside
before
none

These are described in more detail in the section “A sidebar as side float”.

What about floating to the bottom of a printed page? That float location is not part of the XSL-FO 1.0 specification. It could be done using the XSL-FO footnote mechanism, but the DocBook XSL stylesheets don't do that.

You can make a figure float using any of these methods:

Whatever value you assign to the float or floatstyle attribute is used to create the appropriate property in the HTML or print output. When you specify a float for HTML output, it will appear in the HTML as follows:

<div class="figure-float" style="float: left;">
...

FO output looks something like this:

<fo:float float="left">
  <fo:block ...>Figure 1.1. My figure</fo:block>
  <fo:external-graphic src="url(images/mypicture.png)"/>
</fo:float>

For print output, you can also customize how side floats are handled for any element. See the section “Custom side float” for details.