Binding

Mappings can be used to create a binding between some lines of content so that they will appear together in the output. This concept is referred to as keep together in some rendering systems.

Lines that are bound together cannot appear on different pages, or in different columns in a multi-column layout. A common use for binding is to ensure that a title appears on the same page as the material it introduces.

Binding should be defined only when necessary. If the amount of content bound together exceeds the depth of the area defined by the layout an error may occur, and the output format may be compromised.

A binding can be explicitly created by a mapping, or it can be implicitly created by a typesetting structure or constraint.

Explicit binds

An explicit bind can be created by a block mapping. The types of binds are:

  • bind to following creates a bind between content at the end of one block and the following paragraph;

  • bind to previous creates a bind between content at the start of a block and the previous paragraph;

  • bind element content creates a bind between all content enclosed by the current element.

A bind between paragraphs ensures that the content at the end of a paragraph and the content at the start of the following paragraph will appear in the same column. It is still possible for a break to occur in either paragraph. Breaks within paragraphs are controlled by the widow and orphan settings

Implicit binds

An implicit bind will be created for content defined by:

Widows and orphans

In typesetting terminology, widows and orphans are lines in a larger paragraph that appear by themselves at the top or bottom of a page or column, and are generally considered to be undesirable.

For example, if a minimum of 2 lines is allowed at the bottom of a page, then there is an implicit bind placed between the first 2 lines of each paragraph. Note that this will have no effect on paragraphs that consist of a single line.

Control of widow and orphan lines is set from the Paragraph tab of a mapping.

Internal boundaries

Changing to a new page type within bound content creates an internal boundary within that content. Where bound element content that spans an internal boundary cannot be positioned on the same page, TopLeaf allocates a portion of the content immediately before and after the internal boundary to the same page. The depth of the allocated content can be controlled by adjusting the stylesheet split-minheight mapping property.

You can also use the <binding-properties/> directive to ensure that bound content that spans one or more internal boundaries always appears on the same page, or if column breaks are permitted when bound content is allocated to a page.

Image scaling

In some cases it may be necessary for TopLeaf to reduce the size of images in order to place bound content. See the section on image scaling in the Mapping Guide for more information.