Paragraphs
Text structure and formatting in OOXML - paragraphs, runs, and text elements.
Paragraphs (w:p) are the fundamental building block of WordprocessingML. They contain runs (w:r), which contain text (w:t).
Structure
w:p (paragraph)
├── w:pPr (paragraph properties)
│ ├── w:pStyle (style reference)
│ ├── w:jc (justification)
│ └── w:spacing (line spacing)
└── w:r (run)
├── w:rPr (run properties)
│ ├── w:b (bold)
│ ├── w:i (italic)
│ └── w:sz (font size)
└── w:t (text)
Example
<w:p>
<w:pPr>
<w:jc w:val="center"/>
</w:pPr>
<w:r>
<w:t xml:space="preserve">Normal text, </w:t>
</w:r>
<w:r>
<w:rPr><w:b/></w:rPr>
<w:t>bold text</w:t>
</w:r>
<w:r>
<w:t xml:space="preserve">, and </w:t>
</w:r>
<w:r>
<w:rPr><w:i/></w:rPr>
<w:t>italic text</w:t>
</w:r>
</w:p>
Implementation Notes
Whitespace handling (All)
By default, leading/trailing whitespace in w:t is trimmed. Use xml:space="preserve" to keep spaces.
Empty paragraphs
Empty paragraphs are valid and commonly used for spacing. They render as a blank line with the paragraph's line height.