Typst: option to shrink wide display equations to the text width #15280
Replies: 1 comment
|
Thanks for the clear example. Wide display equations have come up before in other formats, which is probably where the overlap is:
None of them cover Typst, so this case is still open. For Typst you can get shrink-to-fit today with a show rule in ---
format:
typst:
include-in-header:
- text: |
#show math.equation.where(block: true): it => layout(size => context {
let w = measure(it).width
if w > size.width { scale(size.width / w * 100%, reflow: true, it) } else { it }
})
---
This is only my opinion, not a maintainer decision. |
Uh oh!
There was an error while loading. Please reload this page.
A display equation wider than the text area extends into the margin and past the page edge in Typst output.
The last term ends at x = 594pt on a 612pt-wide page.
Proposal
An opt-in document option that shrinks display equations wider than the text area to fit, for example with
scaleinsidelayout. Shrinking changes the font size of the equation, so I don't think it should be the default.Would an option like this be accepted, and is there a preferred name and place for it, such as under
typstformat options?All reactions