---
{
  "id": "platform.doc.formatting-and-page-layout",
  "topic": "doc",
  "title": "Anchored formatting and page layout",
  "locale": "en",
  "version": "2026-07-24",
  "summary": "Doc formatting uses exact visible-text anchors, while page settings are a validated partial merge reported through metadata rather than Markdown.",
  "content": "`format_text` anchors an exact `matchText` substring inside one paragraph or heading, including paragraphs inside lists. `occurrence` is 1-based across document scan order. A match cannot span blocks. `format_block` changes only the first paragraph or heading containing `matchText`; call it repeatedly with more specific anchors to change multiple blocks.\n\nIf the action reports “matchText was not found in the document,” do not claim success. Read the latest Doc, inspect the actual visible text and whitespace in its lossy Markdown projection, then choose a longer unique anchor. Formatting anchors are audit-redacted. A text `style` or block `attrs` object must contain at least one field. Font, size, color, highlight, alignment, line-height, and indent constraints come from the live registry schema and runtime validation, not a copied list in this card.\n\n`set_page_settings` is a partial merge: only supplied keys change and an empty object is invalid. Defaults are A4 portrait, 25.4 mm on every side, empty header/footer, and page numbers off. Header and footer each allow 500 characters; margins allow 0–60 mm. Invalid values return `invalid_arguments`.\n\nPage settings control printed or exported presentation, but `get_doc` Markdown does not show them. Confirm effective values from metadata `pageSettings`, not from `contentMd`.\n",
  "aliases": [
    "format text",
    "format block",
    "matchText",
    "page settings",
    "page numbers",
    "margins",
    "text alignment",
    "字型",
    "頁面設定"
  ],
  "tags": [
    "doc",
    "formatting",
    "page-layout",
    "anchors"
  ],
  "relatedActions": [
    "arinova.doc.get_doc",
    "arinova.doc.set_page_settings",
    "arinova.doc.format_text",
    "arinova.doc.format_block"
  ],
  "relatedActionPrefixes": [],
  "url": "https://docs.arinova.ai/en/kb/doc/formatting-and-page-layout/"
}
---

`format_text` anchors an exact `matchText` substring inside one paragraph or heading, including paragraphs inside lists. `occurrence` is 1-based across document scan order. A match cannot span blocks. `format_block` changes only the first paragraph or heading containing `matchText`; call it repeatedly with more specific anchors to change multiple blocks.

If the action reports “matchText was not found in the document,” do not claim success. Read the latest Doc, inspect the actual visible text and whitespace in its lossy Markdown projection, then choose a longer unique anchor. Formatting anchors are audit-redacted. A text `style` or block `attrs` object must contain at least one field. Font, size, color, highlight, alignment, line-height, and indent constraints come from the live registry schema and runtime validation, not a copied list in this card.

`set_page_settings` is a partial merge: only supplied keys change and an empty object is invalid. Defaults are A4 portrait, 25.4 mm on every side, empty header/footer, and page numbers off. Header and footer each allow 500 characters; margins allow 0–60 mm. Invalid values return `invalid_arguments`.

Page settings control printed or exported presentation, but `get_doc` Markdown does not show them. Confirm effective values from metadata `pageSettings`, not from `contentMd`.
