Inline vs anchored positioning
What inline, above-line and custom placement of an anchored object do to the object and to the lines around it, as InDesign lays them out.
AnchoredPosition chooses whether an anchored object takes part in the text's lines (inline, above line) or floats against a reference (custom).
In short An inline object is a character of its line: as wide as the object, standing on the baseline, and the line makes room for it. An above-line object gets a line of its own above the anchor's line, aligned in the column. A custom object is placed against a reference, the text frame, column, margins or page, and takes no room in the text at all; it moves only because its anchor moves. The measurements on this page were taken from InDesign laying out test documents.
Inline: a character as wide as the object
With AnchoredPosition="InlinePosition" the object sits in the line at its anchor:
- Width. It takes the width of its visible box: the outline plus half the stroke on each side. A 30 pt wide box with a 0.5 pt stroke takes 30.5 pt.
- Height. Its visible bottom sits on the baseline.
AnchorYoffsetraises it. - Auto leading. The line moves down until the object's top clears the line above by the usual gap that auto leading leaves; only the part above the baseline counts, so a lowered object does not push the next line. The line after returns to its own leading.
- Fixed leading. The leading holds, and a tall object overlaps the line above.
- First line of a frame. The object's height counts as the line's ascent: the baseline is the frame's top plus the object's rise.
- Too tall. A line that no longer fits in its frame goes to overset with its object, even as the frame's first line.
Above line: a line of its own
With AnchoredPosition="AboveLine" the object leaves the run of characters:
- The anchor takes no width in its line.
- The anchor's line moves down by the object's height plus the space after it
(
AnchorYoffset), and keeps its own leading below that. HorizontalAlignmentplaces the object at the left, centre or right of the column.AnchorSpaceAboveadds space above the object.
The object still moves with the text: add a line above the anchor and object and line move down together.
Custom: placed against a reference
With AnchoredPosition="Anchored" the object leaves the lines entirely. Its position comes
from matching its AnchorPoint to a point of the reference named by
HorizontalReferencePoint and VerticalReferencePoint, with the alignments and the
AnchorXoffset and AnchorYoffset offsets (see
anchored objects). A
vertical reference such as LineBaseline or LineXHeight measures from the anchor's line,
so the object follows the anchor down the page; PageEdge or PageMargins pin one axis to
the page while the other can still follow the anchor.
A custom object takes no room in its line. To keep text from running under it, give it a text
wrap (TextWrapPreference).
Text wrap
An anchored object can carry a TextWrapPreference, like any page item. For a custom object
this is what pushes the surrounding text away; an inline object already has its room in the
line.
In Paged: inline objects take their width and lift their line by these rules, matched to InDesign within a quarter of a point in a dedicated test; above-line objects take their own line and alignment.
AnchorSpaceAboveis not applied yet. Custom objects are placed against their references. Text wrap around an anchored object is not applied, so text runs under a custom object. Supported · verified Supported · verified
Frequently asked questions
What are the three placement modes?
InlinePosition, in the line like a character; AboveLine, on its own line above the anchor's
line; and Anchored, custom placement against a reference point.
How wide is an inline object in its line? As wide as its visible box: the outline plus half the stroke on each side.
Does an inline object change the line spacing? With auto leading, yes: the line moves down so the object clears the line above. With fixed leading, no: the object overlaps upward.
Does a custom-positioned object push text aside? Not by itself. It takes no room in the lines; give it a text wrap to keep text away.
What does AnchorYoffset do?
For an inline object it raises the object above the baseline; for an above-line object it is
the space below the object; for a custom object it is the vertical offset from the reference.
Anchored objects
The element model of an IDML anchored object, a page item nested in a CharacterStyleRange, and every attribute of its AnchoredObjectSetting.
Cross-references & hyperlinks
How an IDML document points at the web and at itself — hyperlinks, bookmarks, cross-references, index markers and tables of contents, and where each lives.