The <float-properties/> command

The <float-properties/> command can be used to control aspects of TopLeaf's float placement rules for all floats declared within the current and subsequent page segments. Float properties, if defined, must be declared in the $document mapping (in which case, the properties defined apply to all floats declared within the document), or immediately after selecting a new page type (in which case, the properties defined apply to all floats declared within the current and subsequent page segments).

Float properties are applied once per segment, and the settings applied remain in force until the end of the segment. This means that at the very latest, segment specific float properties must be defined before the first float is declared within that segment. You cannot use this directive to apply specific float-properties to individual floats within the same segment, nor is it valid to declare this directive from within the context of a float.

The command format is:

<float-properties 
 position="VPOS"
 top-percent="PERCENT" 
 bot-percent="PERCENT"
 separator-space="MEASURE"
 min-textheight="MEASURE"
/>

where:

The following table lists the permitted options for float placement:

Option Description
position

position specifies where TopLeaf will position float objects that cannot fit in the float reference column.

The permitted values for this option are:

  • top — position float objects at the top of the column.

  • bottom — position float objects at the bottom of the column.

  • auto — distribute float objects between the top and bottom of the column. This is the default.

top-percent

top-percent specifies the preferred maximum percentage depth available when placing floats at the top of a column.

If not specified, the default top-percent is determined by the preferred float position. When the position is:

  • top, the default is 70

  • bottom, the default is 0

  • auto, the default is 70

If the preferred float position is top or auto, TopLeaf will always attempt to place at least one float at the top of a column. Once at least one float has been placed, and the total height of the placed floats exceeds the top percentage, no further floats will be placed at the top of that column. To ensure that a maximum of one float is placed at the top of a column, set this value to 0.

If the preferred float position is bottom, float objects that are not placed in their float reference column will never be placed at the top of a subsequent column.

bot-percent

bot-percent specifies the preferred maximum percentage depth available when placing floats at the bottom of a column.

If not specified, the default bot-percent is determined by the preferred float position. When the position is:

  • top, the default is 0

  • bottom, the default is 70

  • auto, the default is 30

If the preferred float position is bottom or auto, TopLeaf will always attempt to place at least one float at the bottom of a column. Once at least one float has been placed, and the total height of the placed floats exceeds the bottom percentage, no further floats will be placed at the bottom of that column. To ensure that a maximum of one float is placed at the bottom of a column, set this value to 0.

If the preferred float position is top, float objects that are not placed in their float reference column will never be placed at the bottom of a subsequent column.

separator-space

separator-space specifies the minimum vertical gap between a float and adjacent content. In a data column, adjacent content is defined as the normal stream of content flowing into that column, automatically generated running headers or table headers, or even another float.

When a float is positioned at the top of a column, this value specifies a minimum gap below the float object. When a float is positioned at the bottom of a column, this value specifies the minimum gap above the float object.

The depth of the separator space is a measure that must be greater than or equal to zero. If not specified, it defaults to 0.

min-textheight

In a column containing one or more float objects, min-textheight specifies the minimum vertical space required before any non-float material is allocated to the column. If the remaining vertical space is less than this value, no non-float material will be included in the column. The minimum text height is a measure that must be greater than or equal to zero. If not specified, it defaults to 3pc.

Example

A style sheet declares the following command:

<float-properties position="top" top-percent="30" bot-percent="30"/>

This command specifies that at most 60% of the total column depth — at the top and bottom of the column— is available for the placement of floats. Now suppose that a float declared in a previous column is positioned at the top of the current column and occupies 70% of the column depth (this is permitted, because TopLeaf will always attempt to place at least 1 float at the top of a column). The maximum percentage available for floats has now been allocated. If a float is now declared within this column, it will be floated to the top of a subsequent column.