Work in progress — this reference is being written in the open. Unfinished pages are excluded from search engines.
Paged · IDML Reference
Stories & text

Stories & text

In IDML, all text lives in stories — streams of text broken into nested paragraph and character ranges, displayed by frames that can thread across pages.

Beginner· explanation

In IDML, all of a document's text lives in stories — separate from the frames that show it.

In short: A story is IDML's container for a stream of text. Each story is broken into nested ranges: runs that share a paragraph style, and inside those, runs that share character formatting, with the literal characters held in Content. Frames on pages then display a story rather than containing it, so one long story can thread through several frames, and any text that doesn't fit is overset. This section explains how stories are structured, how they flow across frames, and how to pull their text back out.

Text in IDML lives in stories. A story is a stream of text broken into ranges: runs of text that share a paragraph style, and within those, runs that share character formatting. Frames on pages then display a story; a long story can thread through several frames, and the text that doesn't fit is overset.

The pages below build up from the smallest story to the full element model, then cover the ways a story spans frames and carries computed text:

  • 🟢 Your first story — tutorial: the smallest story that renders a line.
  • 🔴 Story structure — reference: the StoryParagraphStyleRangeCharacterStyleRangeContent model.
  • 🔴 Threading and overset — explanation: how one story flows across frames, and what happens to text that doesn't fit.
  • 🟡 Text variables — reference: how computed text and page-number markers become characters.
  • 🟡 Extract all text — how-to: walk every story and concatenate its content.
  • 🔴 Why ranges, not spans — explanation: why IDML nests ranges instead of wrapping spans.

This section is also the reference's demonstration of the difficulty tiers and Diátaxis modes — the pages deliberately span all four modes and three tiers.

Frequently asked questions

What is a story in IDML? A story is IDML's container for a stream of text. It holds the text broken into nested paragraph and character ranges, lives in its own Stories/Story_*.xml part, and is referenced by the frames that display it rather than living inside any one frame.

How is text in a story structured? A story nests four levels deep: the Story element contains ParagraphStyleRange blocks (one per paragraph), each of which contains CharacterStyleRange blocks (one per run of uniform character formatting), each of which contains Content elements holding the literal text. See story structure for the full model.

Can one story appear in more than one frame? Yes. A single story can thread across several frames in a chain, composed once and poured into the frames in order; text that still doesn't fit at the end is overset. See threading and overset.

On this page