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

Misaligned Matrix/Vector Brackets #1617

Closed
1 task done
ParadaCarleton opened this issue Jun 29, 2023 · 5 comments · Fixed by #4153
Closed
1 task done

Misaligned Matrix/Vector Brackets #1617

ParadaCarleton opened this issue Jun 29, 2023 · 5 comments · Fixed by #4153
Labels
feature request New feature or request math Related to math syntax, layout, etc.

Comments

@ParadaCarleton
Copy link

Description

The lack of alignment looks a bit weird to me:
image

Reproduction URL

No response

Operating system

Web app

Typst version

  • I am using the latest version of Typst
@ParadaCarleton ParadaCarleton added the bug Something isn't working label Jun 29, 2023
@user202729
Copy link
Contributor

it seems to make sense to "insert" a strut into each alignment cell like TeX does.

The problem is even more pronounced if there are more rows.

image

@reknih reknih added the math Related to math syntax, layout, etc. label Jul 3, 2023
@laurmaedje laurmaedje added feature request New feature or request and removed bug Something isn't working labels Nov 14, 2023
@Enter-tainer
Copy link
Contributor

$
mat(a,b;c,d)mat(x;y)=
x mat(a;c)+y mat(b;d)=
mat(a x+b y;c x+d y)
$

looks like this which doesn't look good
image

While latex looks like this:

$$ \begin{bmatrix} a & b \\ c & d \end{bmatrix}\begin{bmatrix} x \\ y \end{bmatrix} = x\begin{bmatrix} a \\ c \end{bmatrix} + y\begin{bmatrix} b \\ d \end{bmatrix} = \begin{bmatrix} ax + by \\ cx + dy \end{bmatrix} $$

@Enter-tainer
Copy link
Contributor

There are 2 thing different:

  1. it looks like there is a minimal height limit in latex: note the [a, c] is not that small in latex
  2. typst stretches [ax + by, cx + dy] too high. In latex it's smaller

@Enter-tainer
Copy link
Contributor

Enter-tainer commented May 14, 2024

LaTeX set a minimal height for each matrix cell, it is the same as an invisible (

@Enter-tainer
Copy link
Contributor

You may want to try https://typst.app/universe/package/natrix . It somehow "fix"es this bug. The root cause is that LaTeX will pad the height of each matrix cell to a certain minimal height and typst doesn't do it at this moment. I will also try fix this in rust.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request math Related to math syntax, layout, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants