Skip to content

Dynamic cells with map-cells option #122

Answered by PgBiel
KaliszS asked this question in Q&A
Discussion options

You must be logged in to vote

Do you mean you just want to display all elements of langs as cells in the table? If so, you can use spreading of arrays into arguments1, combined with map2 to transform the array:

#tablex(
  // ... options and stuff ...
  ..langs.map(x => lang(x, level))
)

Footnotes

  1. https://typst.app/docs/reference/foundations/arguments/

  2. https://typst.app/docs/reference/foundations/array/#definitions-map

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@KaliszS
Comment options

@PgBiel
Comment options

Answer selected by KaliszS
@KaliszS
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #121 on February 15, 2024 20:27.