From 8e78b998c6e407fa9985b5cc4399b22901e50039 Mon Sep 17 00:00:00 2001 From: ntjess Date: Sat, 2 Sep 2023 15:24:48 -0500 Subject: [PATCH] Allow relative width in `fit-to-width` --- utils/utils.typ | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/utils.typ b/utils/utils.typ index 880359f..510978e 100644 --- a/utils/utils.typ +++ b/utils/utils.typ @@ -133,6 +133,8 @@ style(styles => { let content-size = measure(content, styles) let content-width = content-size.width + // Convert percent/em into concrete units + let width = measure(h(width), styles).width if width < content-width { let ratio = width / content-width * 100% // The first box keeps content from prematurely wrapping