Skip to content

Demo vault

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

Download the English demo vault

Width routing ​

A single image does not have a fixed width: wider ratios take more of the column, and only images below the float threshold sit beside text.

The four ratios ​

markdown
![21:9](assets/ratio/ratio-21x9.svg)
![16:9](assets/ratio/ratio-16x9.svg)

![1:1](assets/ratio/ratio-1x1.svg)
![9:16](assets/ratio/ratio-9x16.svg)

Start with the two wide ones:

A 21:9 image at 75% of the column and a 16:9 at 60%, both centred

A 21:9 image takes 75% of the column (569px in a 760px column); being past the float threshold it is centred. A 16:9 takes 60% (458px) and is also centred — it sits exactly on the threshold, and a little narrower would start floating.

Now the two narrow ones:

A square at 40% floating left and a 9:16 portrait at 28% floating right

The square takes 39% (297px); below the threshold it floats left, leaving room for text on the right. The 9:16 keeps only 28% (213px) and floats right. The alternation comes from the template's float alignment, not from randomness.

Where the curve comes from ​

The width percentage is a piecewise power function of the ratio r (width ÷ height). The median ratio defaults to 1.5, meaning a 3:2 photo lands on exactly half the column; towards the extremes the width approaches the limits.

Two settings shift the whole curve:

SettingDefaultEffect
Width gain50 (neutral)higher makes wide images wider and narrow ones narrower
Median ratio1.5which ratio maps to 50% of the column

To replace the curve entirely, use template rules.

When the curve does not apply ​

ConditionResult
ag:width is presentthat percentage is used, no computation
computed width > floatMax (60% by default)centred block, no float
column width < mobileBreakpoint (600px by default)always a centred block
the image is in a galleryrow splitting decides, the curve is not consulted

One practical consequence ​

Cropping changes the ratio, so it also changes the width: a 16:9 image cropped to 1:1 narrows from nearly full-column to about half. Expected behaviour, not a bug — see Cropping.

Next ​