---
title: "anchored.insert: Insert Anchored Object — Layout kit command — Kition"
description: "Anchors objects in a story at a text position, inline or above line, with offsets."
canonical: "https://developer.kition.ai/docs/kits/layout/commands/anchored.insert"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/layout/commands/anchored.insert](https://developer.kition.ai/docs/kits/layout/commands/anchored.insert)

# anchored.insert

**Insert Anchored Object.** Anchors objects in a story at a text position, inline or above line, with offsets.

- Kit: Layout 0.1.0 (.klayout); reference: [Layout kit commands](https://developer.kition.ai/docs/kits/layout.md)
- Changes the document: yes
- Acts on: `ids` (a list of ids), which a run step’s `on` fills

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `align` | `"left" \| "center" \| "right"` | no |  |
| `edge` | `string` | no | read by the command beside its listed parameters |
| `ids` | `(integer \| string)[]` | no |  |
| `keepWithinColumn` | `boolean` | no |  |
| `objectPoint` | `integer` | no | 0 to 8 |
| `pos` | `integer` | no | a text position |
| `position` | `"inline" \| "aboveLine" \| "custom"` | no |  |
| `refPoint` | `integer` | no | 0 to 8 |
| `spaceAfter` | `number` | no |  |
| `spaceBefore` | `number` | no |  |
| `story` | `integer` | no | a story id from file.inspect |
| `to` | `string` | no | read by the command beside its listed parameters |
| `xOffset` | `number` | no | points |
| `xRelative` | `"anchor" \| "textFrame" \| "columnEdge" \| "pageMargin" \| "pageEdge"` | no |  |
| `yOffset` | `number` | no | points |
| `yRelative` | `"anchor" \| "textFrame" \| "columnEdge" \| "pageMargin" \| "pageEdge"` | no |  |

## Call through layout_run

```text
layout_run {
  "path": "<file>.klayout",
  "steps": [{ "command": "anchored.insert" }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `align`, `edge`, `ids`, `keepWithinColumn`, `objectPoint`, `pos`, `position`, `refPoint`, `spaceAfter`, `spaceBefore`, `story`, `to`, `xOffset`, `xRelative`, `yOffset`, `yRelative`. layout_run answers the step’s result in `completed[i].result`.

## Result

The kit gives no result schema for this command.

## Parameter schema

```json
{
  "additionalProperties": false,
  "properties": {
    "align": {
      "enum": [
        "left",
        "center",
        "right"
      ],
      "type": "string"
    },
    "edge": {
      "description": "read by the command beside its listed parameters",
      "type": "string"
    },
    "ids": {
      "items": {
        "description": "an id",
        "oneOf": [
          {
            "type": "integer"
          },
          {
            "type": "string"
          }
        ]
      },
      "type": "array",
      "x-khp-types": [
        "Item"
      ]
    },
    "keepWithinColumn": {
      "type": "boolean"
    },
    "objectPoint": {
      "description": "0 to 8",
      "type": "integer"
    },
    "pos": {
      "description": "a text position",
      "type": "integer"
    },
    "position": {
      "enum": [
        "inline",
        "aboveLine",
        "custom"
      ],
      "type": "string"
    },
    "refPoint": {
      "description": "0 to 8",
      "type": "integer"
    },
    "spaceAfter": {
      "type": "number"
    },
    "spaceBefore": {
      "type": "number"
    },
    "story": {
      "description": "a story id from file.inspect",
      "type": "integer",
      "x-khp-types": [
        "Story"
      ]
    },
    "to": {
      "description": "read by the command beside its listed parameters",
      "type": "string"
    },
    "xOffset": {
      "description": "points",
      "type": "number"
    },
    "xRelative": {
      "enum": [
        "anchor",
        "textFrame",
        "columnEdge",
        "pageMargin",
        "pageEdge"
      ],
      "type": "string"
    },
    "yOffset": {
      "description": "points",
      "type": "number"
    },
    "yRelative": {
      "enum": [
        "anchor",
        "textFrame",
        "columnEdge",
        "pageMargin",
        "pageEdge"
      ],
      "type": "string"
    }
  },
  "type": "object"
}
```

Generated from the command list of @kition/layout-darwin-arm64@0.1.0 and the kit itself (layout_commands through @kition/cli@0.1.1, built from KitionAI/kition-layout@8767a18).
