Paragraph directionality

The paragraph directionality determines the base direction — left-to-right or right-to-left — assigned to neutral text surrounded by text of differing directions in the content of the paragraph. Paragraph directionality controls the interpretation of line breaking, alignment, margins, indents, and list item labels declared by the current paragraph style. It is assigned at the point at which content is first added to a paragraph and remains in force until the paragraph ends.

Where a paragraph is assembled by merging the content of one or more elements, the paragraph directionality is assigned at the beginning of the merged content. For example, the paragraph directionality for a list-item or labeled paragraph is determined by the directionality in force at the start of the label. In the case of a page or column footnote, the directionality for the footnote body is determined by the directionality in force at the start of the footnote label.

Paragraph directionality is determined by:

  1. a block mapping’s paragraph style where this explicitly declares the direction as LTR or RTL.

  2. the directionality of the parent block mapping from within which the paragraph is rendered. The parent mapping either sets or inherits an explicitly declared paragraph direction.

  3. The directionality of the language specified by the {language} system variable.

Rather than swap the terms left and right when the paragraph direction is RTL, the TopLeaf convention is that all right and left terms switch direction when RTL mode is in force. For example, the First left indent in a paragraph with RTL directionality performs exactly the same function as its LTR equivalent, except that the indent is on the right side of the block.