Skip to content

Add row function - can be used to style or transform a row#12

Merged
bluss merged 7 commits intomainfrom
rowfunction
Jul 5, 2025
Merged

Add row function - can be used to style or transform a row#12
bluss merged 7 commits intomainfrom
rowfunction

Conversation

@bluss
Copy link
Copy Markdown
Member

@bluss bluss commented Jul 1, 2025

The row function can be used to transform or style a whole row at a time. For example, row([a & b & c], map: strong) styles the row using strong. The row function is entirely optional. It has three arguments:

  • map - apply a function to each element
  • imap - apply a funtion to each element, and also receive its index
  • cell - set a dictionary of cell properties, e.g. fill and stroke on the whole row.

It is recommended to use the style row([...], map: ..) with the row markup as the first argument so that rows align well to each other.

Incidental changes in the same PR

  • Bugfix: [ ] (one or more spaces) now counts as a row
  • typst package gets the category visualization

@bluss
Copy link
Copy Markdown
Member Author

bluss commented Jul 1, 2025

The new manual page for the row function should hopefully describe this well:

row function.pdf

@bluss bluss force-pushed the rowfunction branch 3 times, most recently from e4d9faa to 39b02df Compare July 4, 2025 20:52
bluss added 4 commits July 5, 2025 00:42
We have [ ].func() == space; and for consistency we want this to be
treated as a row (not a stray other content/single item), because [] is
a row and [ ,] is a row, so [ ] should be too.
@bluss bluss merged commit ad4bbfc into main Jul 5, 2025
1 check passed
@bluss bluss deleted the rowfunction branch July 5, 2025 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant