Hi,
I have a Julia package which creates tables:
One of the supported formats is Typst. Tables can have footnotes, these are implemented as a single cell at the end, spanning all columns, which contains each footnote separated by a linebreak. My problem is that users may specify long footnotes, but if the table is not very wide itself, the final layout will look bad:
using SummaryTables
Table(
[Cell("$j$i") for i in 1:3, j in 'A':'E'],
footnotes = [
"This is a long footnote. It consists of multiple sentences. Therefore, the table will become very wide."
]
)
This creates the following typst code:
#table(
rows: 3,
columns: 5,
column-gutter: 0.25em,
align: (center, center, center, center, center),
stroke: none,
table.hline(y: 0, stroke: 1pt),
[A1],
[B1],
[C1],
[D1],
[E1],
[A2],
[B2],
[C2],
[D2],
[E2],
[A3],
[B3],
[C3],
[D3],
[E3],
table.hline(y: 3, stroke: 1pt),
table.cell(align: left, colspan: 5)[#text(size: 0.8em)[
This is a long footnote. It consists of multiple sentences. Therefore, the table will become very wide.
]],
)
And the visual result:
Is there some way I can nudge Typst so that it eagerly linebreaks that one cell with the footnotes? Because this is all programmatically generated, it’s not feasible to force the table to some width (how would I know in advance which width is suitable?).
Maybe a solution could be to move the text outside of the table, but it should always be aligned with it, so an actual table cell seemed the simplest option to ensure that.
Thanks for your help!
Julius