Document directionality

In TopLeaf the whole document has a directionality that controls the placement of fixed blocks and the way the book is bound. The document directionality is responsible for the selection of left and right page layouts, and in a multi-column page layout the order in which the data block columns are filled.

The document directionality is determined from the language associated with the document root element. The default document language can be declared as a publication formatting option or overridden by the language set by the xml:lang attribute or through the <text-properties lang="LA" /> directive.

A single stylesheet can be used for both RTL and LTR documents. Rather than swap the terms left and right when the document direction is RTL, the TopLeaf convention is that all right and left terms switch direction when RTL mode is in force. For example, if the document directionality is RTL, and the current page type declares separate left and right page layouts, TopLeaf selects the left page layout when processing a recto page, and the right page layout when processing a verso page. Inside and Outside alignment is not affected by the page directionality, with Inside always adjacent to the book binding.