跳到主要内容

page-args-from-aspect-ratio

page-args-from-aspect-ratio(aspect-ratio)(source)

Convert an aspect ratio string to page configuration arguments.

For the built-in Typst presentation paper sizes ("16-9" and "4-3"), returns a paper key. For other ratios (e.g. "16-10", "3-2"), returns explicit width and height keys computed from the 16-9 base width (841.89pt).

Example:

config-page(..utils.page-args-from-aspect-ratio("16-10"))
Parameters

aspect-ratio : str

The aspect ratio string in "W-H" format where W and H are positive numbers. E.g., "16-9", "4-3", "16-10".

Returns: dictionary