Skip to content
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 math.equation: set align(..) shall not break alignment points #4094

Merged
merged 3 commits into from May 15, 2024

Conversation

Leedehai
Copy link
Contributor

@Leedehai Leedehai commented May 7, 2024

Fixes #3973.

Note that the alignment points (i.e. the &s) in cases() do not have this left/right-alternating behavior, as specifically checked by this existing test (note the quad there):

--- math-cases ---
$ f(x, y) := cases(
  1 quad &"if" (x dot y)/2 <= 0,
  2 &"if" x divides 2,
  3 &"if" x in NN,
  4 &"else",
) $

If we unconditionally applied the left/right alternating behavior, then the output would be:
which is undesired.

Therefore, we should apply the alternating behavior in (almost) all situation but except for cases, where alignment points do not alternate.

@Leedehai Leedehai changed the title math.equation(align:..) shall not break alignment points show math.equation: set align(..) shall not break alignment points May 8, 2024
tests/suite/math/alignment.typ Outdated Show resolved Hide resolved
crates/typst/src/math/underover.rs Outdated Show resolved Hide resolved
crates/typst/src/math/row.rs Outdated Show resolved Hide resolved
@laurmaedje
Copy link
Member

Thanks!

Merged via the queue into typst:main with commit 484a0e6 May 15, 2024
6 checks passed
@Leedehai Leedehai deleted the align-3973 branch May 15, 2024 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

show math.equation: set align(...) breaks alignment points
2 participants