fit-to-height
fit-to-height(height: 1fr, width: auto, prescale-width: none, grow: true, shrink: true, reflow: true, force-height: false, body, ..args)(source)Fit content to specified/remaining height.
Example: #utils.fit-to-height[BIG]
height : length | fraction | relative default: 1fr
The height to fit the content to. For example, height: 50% will fit the content to half of the slide height. If given as a fraction, it will be based on the available height after everything else is evaluated, similar to how fractional lengths behave for table column widths. Default is 1fr which means to fit the content to the full available rest height.
width : length | fraction | relative default: auto
Will determine the width of the content after scaling. So, if you want the scaled content to fill half of the slide width, you can use width: 50%.
prescale-width : length | fraction | relative default: none
Allows you to make Typst's layout assume that the given content is to be laid out in a container of a certain width before scaling. For example, you can use prescale-width: 200% assuming the slide's width is twice the original.
grow : bool default: true
Indicates whether the content should be scaled up if it is smaller than the available height. Default is true.
shrink : bool default: true
Indicates whether the content should be scaled down if it is larger than the available height. Default is true.