w:bidi (Bidirectional Paragraph Layout)

Sets the paragraph direction to right-to-left, enabling bidirectional text layout for Arabic, Hebrew, or other RTL scripts.

Parent elements

Description

w:bidi is a toggle property that sets the base writing direction of a paragraph to right-to-left (RTL). When active:

  • The paragraph is laid out from right to left.
  • Paragraph alignment values are mirrored (left means right-aligned, right means left-aligned).
  • Indents and tab stops are measured from the right margin.

It is defined in ECMA-376 Part 1 §17.3.1.6.

This property does not affect individual runs within the paragraph — per-run directionality is controlled by w:rtl in w:rPr.

Attributes

Attribute Type Possible Values Description
w:val ST_OnOff true, false, 1, 0, on, off Sets paragraph to RTL layout. Omit to inherit.

Examples

<!-- Arabic paragraph flowing right-to-left -->
<w:p>
  <w:pPr>
    <w:bidi/>
    <w:jc w:val="right"/>
  </w:pPr>
  <w:r>
    <w:rPr><w:rtl/></w:rPr>
    <w:t>هذا نص عربي</w:t>
  </w:r>
</w:p>

Notes

  • For a fully RTL paragraph, set both w:bidi on w:pPr and w:rtl on w:rPr for each run.
  • w:jc w:val="right" in a bidi paragraph has the visual effect of left-aligned text (because the base direction is RTL).
  • The Unicode Bidi Algorithm (UBA) still applies within each run.