Typst Fumadocs

Align

Documentation for the `align` function.

Aligns content horizontally and vertically.

Example

Let's start with centering our content horizontally:

Loading compiler...

To center something vertically, use horizon alignment:

Loading compiler...

Combining alignments

You can combine two alignments with the + operator. Let's also only apply this to one piece of content by using the function form instead of a set rule:

Loading compiler...

Nested alignment

You can use varying alignments for layout containers and the elements within them. This way, you can create intricate layouts:

Loading compiler...

Alignment within the same line

The align function performs block-level alignment and thus always interrupts the current paragraph. To have different alignment for parts of the same line, you should use fractional spacing instead:

Loading compiler...
#align(
  alignment,
  body
) -> content

Parameters

Prop

Type

On this page