It draws a red frame around the text using box and a black frame using cetz.draw.content.
Behavior in v0.2.2:
\n\nBehavior in v0.3.1:
\n\nI was previously using the old behavior to create simple UML class diagrams, e.g in v0.2.2
\n\nIt's built from a Typst grid wrapped in cetz.draw.content, which adds a rectangular frame. In v0.3.1 this instead looks like this:
Using text without descenders reduces the added padding but does not fully eliminate it, so there is also something else changed.
\nNow, I could create the frame using box, but this does not change the anchor points, so lines are then no longer connected to the bottom of the frame but end in empty space.
Is this change intended and if so, is there a way for me to restore the previous behavior?
","upvoteCount":1,"answerCount":4,"acceptedAnswer":{"@type":"Answer","text":"The previous sizing should be restored by wrapping your content in text(bottom-edge: \"baseline\", ...).
cetz.draw.content sizes content differently than box
#751
-
|
Since version v0.3.0, cetz's It draws a red frame around the text using Behavior in v0.2.2: Behavior in v0.3.1: I was previously using the old behavior to create simple UML class diagrams, e.g in v0.2.2 It's built from a Typst Using text without descenders reduces the added padding but does not fully eliminate it, so there is also something else changed. Now, I could create the frame using Is this change intended and if so, is there a way for me to restore the previous behavior? |
Beta Was this translation helpful? Give feedback.
-
|
The previous sizing should be restored by wrapping your content in |
Beta Was this translation helpful? Give feedback.
-
Perfect, that worked flawlessly. Feel free to close the issue if the change is intended. |
Beta Was this translation helpful? Give feedback.
-
|
The change was intended because of how inline math sizes. But maybe this should be a style key. I will convert this issue to a discussion. |
Beta Was this translation helpful? Give feedback.
-
|
Do you have some UML-Class diagram generation code you can share? I am also interested in doing this for very simple diagrams using Typst. |
Beta Was this translation helpful? Give feedback.
The previous sizing should be restored by wrapping your content in
text(bottom-edge: "baseline", ...).