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

Add an Explicit Type for Figures in Typst #9574

Closed
thekief opened this issue Mar 14, 2024 · 0 comments
Closed

Add an Explicit Type for Figures in Typst #9574

thekief opened this issue Mar 14, 2024 · 0 comments

Comments

@thekief
Copy link

thekief commented Mar 14, 2024

Describe your proposed improvement and the problem it solves.

Typst tries to parse the figure type based on the content, noteably raw, table, and image. When, e.g., overwriting the default table implementation, Typst cannot do the proper association anymore.

A fix for this issue would be to explicitly set a figure's kind property during the write of Typst files. So instead of generating

#figure(align(center)[#table(
    columns: 2,
    align: (col, row) => (auto, auto,).at(col),
    inset: 6pt,
    [Req],
    [Title],
    [Req-1234],
    [Do Some Stuff],
  )])

generating

#figure(
    align(center)[#table(
    columns: 2,
    align: (col, row) => (auto, auto,).at(col),
    inset: 6pt,
    [Req],
    [Title],
    [Req-1234],
    [Do Some Stuff],
  )],
  // identify the figure as a table
  kind: table
)

would allow Typst to properly identify figures again.

Describe alternatives you've considered.

Typst's scripting allows to overwrite several properties but everyone that changes default implementations would need to script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant