Closed WannesMalfait closed 1 year ago
Yes, it seems to be an issue with figures. Issue #23 also mentioned something similar.
I'll take a look to this during the day to find a solution.
Thank you for reporting this bug! 😁
I've found an extra line that causes the bug. Probably it was left there during a refactorization of title rendering. Now it seems that the title is well-placed inside and outside a figure.
For more details, this was the extra line:
...
place(
top + props.title-style.boxed-style.anchor.x,
dx: props.title-style.boxed-style.offset.x,
dy: props.title-style.boxed-style.offset.y + if props.title-style.boxed-style.anchor.y == bottom {
-my-state.final(loc)
} else if props.title-style.boxed-style.anchor.y == horizon {
-my-state.final(loc)/2
},
block(
width: 100%, // <- Here. This was forcing the block to be 100% width, so the ``place`` won't take a visible effect on moving it
spacing: 0pt,
inset: (x: 1em),
showy-title(props)
)
)
Tell me if it now works for you to mark this as closed 🧐
Small note: Now showybox's latest version is 2.0.1 (locally, in this repository). So, if you try the new changes using showybox as a local package, don't forget to use #import "@preview/showybox:2.0.1" : *
instead of #import "@preview/showybox:2.0.0" : *
Works perfectly! (I just changed the one line in my preview folder). Will update to 2.0.1 when it is released. Thanks for the quick fix
Problem
When a
showybox
is placed inside a figure, the title box is not positioned correctly. The shadow does seem to be positioned correctly however.How to reproduce
This is a very simple example to reproduce the issue:
Additional info
I came across this issue when using the Lemmify package, which internally places content inside figures to be able to reference them easily.