-
-
Notifications
You must be signed in to change notification settings - Fork 873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
show figure: fig => fig.body
doesn't work anymore
#4633
Comments
TL;DR: it looks to me this behavior is intended. Since 0.11 (commit 5011510, May 17) is not in the main branch, I wanted to test this issue on the commit one day after 0.11's release (commit daf3ccb, May 18), but it turned out the codebase at that time is no longer compilable by the current Rust compiler (version 1.80.0). The dev environment is not yet fully hermit! (But including the toolchain in version control seems an overfill right now) So I checked out commit 45366c0 (Jun 24), where the Rust compiler was bumped from 1.77.0 to 1.79.0. The codebase is compilable, and this issue already existed on that commit. I downgraded to Rust 1.77.0 then checked out commit daf3ccb (May 18), and the issue did not exist on that commit. Fortunately, the big test runner refactoring was done back in April so I was able to run the tests. The bisection result between the above two commits indicated commit e6739ec caused this issue:
However, PR #4276, which created this commit, stated that the PR would "break users who assume that show figure: |
Thanks for the analysis; indeed, it looks like this is exactly intended. Though, can someone explain me why you would want that behavior? To me it seems counterintuitive, because I thought (Also note that the two other people, LaurenzV and Leedehai, who have seen the issue so far, first considered it an issue and hence didn't expect that behavior as well. Is there a part of the docs that explains how show rules of pre-styled elements are supposed to work?) And what is the current solution if I really just want to display the body of the figure, without any inherited styling? |
The show rule behaves exactly as before, except for alignment. Show rules always inherit styles, you can see this with headings too. But figure was doing a weird thing which didn't let you override the alignment, so after that PR it is properly a style which is configurable through A more general mechanism, such as some special form of the revoke rules proposal, would be needed to negate any inherited styles in a show rule, but this is not currently supported by Typst, and is orthogonal to the issue at hand. (If there isn't a separate issue requesting this, feel free to make one!) Edit: It is noteworthy that you can cancel all alignment by wrapping your figure in a |
Description
Consider the following document:
When you compile it with
typst 0.11.1 (50115102)
, it works properly. That is, it will show a normal, left-aligned block.However, if you compile it with the current
main
branch (commit c4dd6fa), it shows the text centered; so something went wrong.The text was updated successfully, but these errors were encountered: