typst-tablex icon indicating copy to clipboard operation
typst-tablex copied to clipboard

Reference to figure with tablex is not aware it is table

Open KronosTheLate opened this issue 2 years ago • 10 comments

When I make a tablex table inside a figure and reference it, it thinks it is a figure, and not a table: image

Whereas a normal table changes the counter and text separately for tables: image

From the docs the text problem has to do with the supplement field. I do not know about the internals of the counters.

I have a deadline in a month (June 1st). Do you think this could be worked out before that, so that I can keep using this awesome package, and get the fix in before the deadline?

KronosTheLate avatar May 01 '23 10:05 KronosTheLate

This is a Typst limitation, but you can use kind: table on your figure to force Typst to recognize it as a table (which should work).

In the future, I plan on making this easier by adding some option which places the table in a figure for you or something.

PgBiel avatar May 01 '23 12:05 PgBiel

Perhaps related: https://github.com/typst/typst/issues/1058

KronosTheLate avatar May 01 '23 13:05 KronosTheLate

This is a Typst limitation, but you can use kind: table on your figure to force Typst to recognize it as a table (which should work).

In the future, I plan on making this easier by adding some option which places the table in a figure for you or something.

Doing type: table worked as expected, thanks, as I now ran into this issue even when not using this package in the linked issue above.

KronosTheLate avatar May 01 '23 13:05 KronosTheLate

When wrapping it in #figure() my tablex seems to be forced onto a single page. All text is supposed to be black and not mostly grey and in the last row 8 rows are overlapping. image

boyen-cell avatar Jul 30 '23 07:07 boyen-cell

When wrapping it in #figure() my tablex seems to be forced onto a single page. All text is supposed to be black and not mostly grey and in the last row 8 rows are overlapping. image

Figures are not breakable by default, I'm afraid (see https://github.com/typst/typst/issues/977 and https://github.com/typst/typst/pull/1121). You will need to use #show figure: set block(breakable: true) before the figure to override the default behavior and allow it to span multiple pages.

Edit: also make sure you add kind: table as a parameter to your figure so that Typst displays it as Table <N> when referenced.

PgBiel avatar Jul 30 '23 07:07 PgBiel

Thanks, that had worked but I know just realized that the repeat-header: true, doesn't work anymore. Is that just something that doesn't work atm or am I missing something to make it work?

boyen-cell avatar Aug 09 '23 07:08 boyen-cell

It is supposed to work in most cases, but sometimes it can break for no apparent reason. This will probably improve for v0.1.0.

PgBiel avatar Aug 09 '23 12:08 PgBiel

is there something I can try to maybe make it work?

boyen-cell avatar Aug 09 '23 14:08 boyen-cell

is there something I can try to maybe make it work?

Not sure. It tends to work better with smaller tables, or with less tables in the document. I hope to be able to work on this update soon enough though.

Refer to #43 for the full issue.

PgBiel avatar Aug 09 '23 15:08 PgBiel

Blocked by https://github.com/typst/typst/issues/147

PgBiel avatar Nov 17 '23 02:11 PgBiel