Cell Anchoring
How to anchor cell outputs to locations in your Word document so they update automatically when you rerun code.
Prerequisites: Notebook Basics — create a notebook and run a cell before anchoring.
An anchor is a named placeholder inside a Word document that InkRider manages. When you run a cell that has an anchor, the output is automatically written to that location in the document. Run the cell again with new data and the anchor updates in place instead of requiring manual copy-and-paste.
What an Anchor Is
Anchors are built on Word's content controls, which are a native Office feature that marks a region of a document with a tag. InkRider uses those tags to identify where each cell's output should go.
Each anchor is tied to a specific cell in a specific notebook. The relationship is stored inside the document, so it survives saves, shares, and reopens.
Creating an Anchor
Automatic Anchor at the Cursor
- Click in the Word document at the location where you want the output to appear.
- In the InkRider panel, click Run on the cell (or press Shift+Enter).
InkRider inserts a content control at the cursor position and fills it with the cell's output. The anchor is created and associated with that cell in a single step.
Manual Anchor Creation
You can also create an anchor without running the cell first:
- Position the cursor in the Word document.
- In the cell toolbar, click the anchor icon (or right-click the cell and choose Anchor to document).
This creates an empty content control at the cursor. The next time the cell runs, its output fills the anchor.
Batch Anchor Creation
When importing notebooks or building a batch execution queue, InkRider can create anchors for all selected cells in one operation. This is the fastest way to set up a multi-cell document workflow before running the batch.
What Gets Inserted
The output type inserted into an anchor depends on the cell:
| Output type | What is inserted |
|---|---|
| Plain text / stdout | Formatted text paragraph |
| Markdown | Rendered markdown, including headings, lists, bold/italic, and code blocks |
| Markdown with math | LaTeX equations rendered as native Word equations (OMML) |
| HTML | HTML output converted to Word content (tables, text) |
| Images (PNG, JPEG) | Inline images embedded in the document |
| Error output | Error text in a monospace style |
If InkRider does not recognize the output format it inserts a plain-text placeholder so the anchor is never left blank.
Updating an Anchor
Rerunning the cell clears the content control and writes the new output. The document cursor does not move. Any formatting inside the content control that InkRider did not place (manually typed text, manual formatting) is discarded on the next update.
If you need to preserve manually edited text alongside computed output, keep them in separate paragraphs outside the anchor.
Navigating to an Anchor
Click the locate in document icon on a cell to jump to the anchor's position in the Word document. This is useful in longer documents where the anchor is out of view.
Frozen Anchors
You can lock anchors to prevent accidental modification. When anchors are frozen, InkRider marks each content control as read-only at the Office level. The computed content is still visible and the document is fully readable, but the anchored regions cannot be directly edited.
Toggle freezing from the InkRider header (lock icon) or from the notebook's context menu.
Drift Detection
If the Word document is edited externally (sent to a colleague, opened in another app, or manually restructured), anchor content controls may be moved, split, or deleted. InkRider periodically checks whether the anchors it registered still match what is in the document.
When drift is detected, the affected cells are marked with a warning badge. You can:
- Recreate: place the cursor at the new target location and re-anchor the cell
- Ignore: run the cell anyway; InkRider will insert at the best matching anchor it can find
Multiple Anchors for One Cell
If you copy a content control (by duplicating the paragraph in Word) and paste it elsewhere in the document, InkRider recognizes both controls as anchors for the same cell. When the cell runs, both copies receive the output. This is useful for repeating the same computed value in multiple places (e.g., a summary in both a header and a table).
Removing an Anchor
Right-click the cell and choose Remove anchor to disconnect the cell from its content control. The content control is removed from the document and the text that was inside it is deleted. The cell itself and its last output remain visible in the notebook.
To remove only the content control wrapper while keeping the text, use the Unanchor option. This converts the content control into plain document text that InkRider will no longer manage.
Anchors and the Anchors Viewer
The Anchors Viewer tool (available from the tools panel) lists every active anchor in the current document. For each anchor it shows:
- the source notebook and cell
- the current sync state (up to date, drift, missing)
- the last execution timestamp
- a button to navigate directly to the anchor location in the document