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

Alternate between right/left alignment in equations #936

Merged
merged 2 commits into from
May 11, 2023
Merged

Alternate between right/left alignment in equations #936

merged 2 commits into from
May 11, 2023

Conversation

SUPERCILEX
Copy link
Contributor

@SUPERCILEX SUPERCILEX commented Apr 22, 2023

Fixes #460

@rpitasky
Copy link
Contributor

rpitasky commented Apr 23, 2023

The cases test image does not look very nice? What still needs to be done here, and can I help you in any way?

@SUPERCILEX
Copy link
Contributor Author

Yeah that should be easily fixable with a parameter that starts with left alignment instead of right, just waiting on some other PRs to be merged.

@rpitasky
Copy link
Contributor

rpitasky commented Apr 23, 2023 via email

@SUPERCILEX
Copy link
Contributor Author

Yeah I meant a parameter in rust, not in typst.

@reknih reknih force-pushed the main branch 4 times, most recently from 102fa05 to b79121d Compare April 23, 2023 17:35
@Enivex
Copy link
Collaborator

Enivex commented Apr 23, 2023

image

That looks like a bug.

@Enivex
Copy link
Collaborator

Enivex commented Apr 23, 2023

Yeah that should be easily fixable with a parameter that starts with left alignment instead of right, just waiting on some other PRs to be merged.

In LaTeX the columns in cases are always left-aligned.
$$
\begin{cases}
a & x > y \
b+c & x\leq y+1
\end{cases}
$$

image

@rpitasky
Copy link
Contributor

rpitasky commented Apr 23, 2023 via email

@Enivex
Copy link
Collaborator

Enivex commented Apr 23, 2023

The only alignment that should be alternating from right to left is in the base equation environment. (Corresponding to align /alignat in latex)

Edit: Though like with matrices I guess it makes sense to make alignment optional for the one or two columns in the cases environment.

@SUPERCILEX
Copy link
Contributor Author

This is ready, but it requires #749. If we don't want to go with tabular alignment, I'll need some guidance on what it means to alternate between right/left alignment: #460 (comment)

@SUPERCILEX SUPERCILEX marked this pull request as ready for review April 24, 2023 09:53
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
tests/ref/math/matrix-alignment.png Outdated Show resolved Hide resolved
library/src/math/row.rs Outdated Show resolved Hide resolved
library/src/math/row.rs Outdated Show resolved Hide resolved
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
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.

How does alignment actually work?
4 participants