Skip to content

Demo vault

Every screenshot and code block on this page comes from the bundled demo vault.

Download the English demo vault

Float and wrap ​

A single image below the threshold floats to one side and text wraps into the remaining space; the float lasts until the next structural boundary.

Text wrapping ​

An image floating right with body text wrapping down its left side
markdown
![road|ag:layout=float|ag:side=right|ag:width=37%](assets/photo/04-road.jpg)

Once the image floats right, body text fills the space on the left. Wrapping only happens in reading view: Live Preview keeps the editing cursor stable and never lets text run beside the image, it only reserves the same width. That is why the same note has different paragraph heights in the two views.

Where a float ends ​

A float lives until the next structural boundary. Six structures end it by default:

BoundaryDefaultRisk when disabled
Headingonthe next section keeps hugging the image and may be squeezed
Code blockoncode sits beside the image and wraps badly
Math blockonformulas get compressed
Imageontwo images end up side by side, an accidental gallery
Tableoncolumns get squeezed
Quote / calloutonthe quote sticks to the image edge

Each one can be switched off in the "Float" section of the settings. Turning one off lets the float cross that structure, but the two blocks then sit side by side, which is rarely what you want.

When an image does not float ​

Both conditions must hold: the computed width is at most floatMax (60% by default), and the column is wider than mobileBreakpoint (600px by default). If either fails the image becomes a centred block.

You can also force it:

AnnotationResult
ag:layout=centerleaves the float, centred block
ag:side=centerthe same
ag:layout=floatfloats even above the threshold (use with care)
ag:side=left / rightpick the side

Gap ​

ag:gap=24px widens the space between a floated image and the body text. It does not change the gap between gallery cells — that one lives in the "Gallery image gap" setting.

This is a frequent misreading; see Pitfalls.

Next ​