Add extra-show and allow custom number-gap#22
Open
lordkekz wants to merge 3 commits intoEpicEricEE:masterfrom
Open
Add extra-show and allow custom number-gap#22lordkekz wants to merge 3 commits intoEpicEricEE:masterfrom
lordkekz wants to merge 3 commits intoEpicEricEE:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thank you for this package!
This PR contains two changes. First, it adds the
extra-showparameter to theequatefunction which allows users to inject custom show rules or containers around each block equation handled by equate. Second, it adds thenumber-gapparameter of theequatefunction to allow users to customize the distance between the equation and the number. Both changes are backward compatible.Why add
extra-show?In my case, I wanted to set up my documents so that they can be exported both as PDF and as HTML. In plain Typst (without the equate package), you can use the following show rule to embed equations as SVG images:
However, the above does not work when using equate, because equate breaks up the
math.equationto create its layout. If you apply a show rule on inline equations, they show up, but their alignment is broken because equate's layout (spacing etc.) gets ignored during HTML export. So, I wanted to add some show rule that applies to the entire block equation even when using equate. With this PR, we can add this in the call toequatelike so:I also considered adding HTML support directly to equate, but I think this is better because it is more flexible and allows even further customization. Also this means that the equate won't depend on any experimental HTML features of Typst.