Skip to content

Misaligned Matrix/Vector Brackets #1617

Closed

Description

@ParadaCarleton

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

Activity

  1. added
    bug
    on Jun 29, 2023
  2. user202729 commented on Jul 2, 2023

    @user202729
    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

  3. added
    math
    on Jul 3, 2023
  4. added
    feature request
    and removed
    bug
    on Nov 14, 2023
  5. Enter-tainer commented on May 14, 2024

    @Enter-tainer
    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} $$

  6. Enter-tainer commented on May 14, 2024

    @Enter-tainer
    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
  7. Enter-tainer commented on May 14, 2024

    @Enter-tainer
    Contributor

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

  8. Enter-tainer commented on May 16, 2024

    @Enter-tainer
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestmath

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions