TypstDocumentation

hShowable
Question mark

Insert horizontal spacing into a paragraph.

The spacing can be a length or a fractional. In the latter case, the remaining space on the line is distributed among all fractional spacings according to their relative fractions.

Example

#circle(fill: red)
#h(1fr)
#circle(fill: yellow)
#h(2fr)
#circle(fill: green)
Preview

Mathematical Spacing

In mathematical formulas, you can additionally use these constants to add spacing between elements: thin, med, thick, quad`.

Parameters
Question mark

amount
relative lengthfractionRequiredPositional
Question mark

How much spacing to insert.

weak

If true, the spacing collapses at the start or end of a paragraph. Moreover, from multiple adjacent weak spacings all but the largest one collapse.

#h(1cm, weak: true)
We identified a group of
_weak_ specimens that fail to
manifest in most cases. However,
when #h(8pt, weak: true)
supported
#h(8pt, weak: true) on both
sides, they do show up.
Preview