Skip to content

Error on spaced arguments within 2D math array #3774

Closed

Description

@frozolotl

Description

The following expression gives an error:

$mat(; ,)$
error: expected array, found content
  ┌─ ../../tmp/a.typ:1:6
  │
1 │ $mat(; ,)$
  │       ^

I'd expect it to work just like if there was no space.

It would be useful for this kind of thing:

$ mat(
    1, , ;
     ,1, ;
     , ,1;
  ) $

Reproduction URL

No response

Operating system

No response

Typst version

  • I am using the latest version of Typst

Activity

  1. added
    bug
    on Mar 23, 2024
  2. wrzian commented on Mar 24, 2024

    @wrzian
    Contributor

    A quick fix could be to try using empty strings? $mat(""; "",)$. Empty content, #[] should also work but is more characters to type.

  3. wrzian commented on Mar 24, 2024

    @wrzian
    Contributor

    Tbh, it might be nice to allow math mode to default to having empty content for arguments (but not code mode).

  4. frozolotl commented on Mar 24, 2024

    @frozolotl
    ContributorAuthor

    Tbh, it might be nice to allow math mode to default to having empty content for arguments (but not code mode).

    I think you misunderstand; empty arguments are already allowed.
    What is not allowed is a semicolon, followed by whitespace, followed by a comma. That's what this issue is about.

  5. added
    math
    syntax
    on Mar 24, 2024
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

    bugmathsyntax

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions