PgBiel / typst-tablex

More powerful and customizable tables in Typst
MIT License
370 stars 12 forks source link

Fractional columns within `#block` #44

Closed maxcrees closed 1 year ago

maxcrees commented 1 year ago

The upgrade to Typst 0.7.0 has revealed one regression and one longstanding issue.

Consider the following:

#table(columns: 1fr, [1A. table])
#tablex(columns: 1fr, [1B. tablex])

#block(table(columns: 1fr, [2A. table plain block]))
#block(tablex(columns: 1fr, [2B. tablex plain block]))

#block(breakable: true, table(columns: 1fr, [3A. table breakable: true]))
#block(breakable: true, tablex(columns: 1fr, [3B. tablex breakable: true]))

#block(breakable: false, table(columns: 1fr, [4A. table breakable: false]))
#block(breakable: false, tablex(columns: 1fr, [4B. tablex breakable: false]))

The behavior of these examples was unchanged from at least Typst 0.0.3 to 0.0.6 and tablex 0.0.2 to 0.0.4:

image

Note how 2B and 3B are not drawn correctly.


Then, in Typst 0.0.7 and tablex 0.0.4, example 4B changed (to become incorrect like 2B and 3B). Note that only 4B changed; all other examples appear identical to the above:

image
PgBiel commented 1 year ago

Thanks for the detailed bug report. (This is likely related to #39)

I will investigate a solution as soon as I can.

PgBiel commented 1 year ago

Hi, I've pushed a fix to main with https://github.com/PgBiel/typst-tablex/commit/f00b91c7d9383ebd194fb9e36ee5999339c38891. Can you please test and see if everything is working properly now? Thanks!

maxcrees commented 1 year ago

Thanks for the quick response on this. The linked commit appears to fix 2B, 3B, and 4B.

image
maxcrees commented 1 year ago

This also fixes the problem in my original document. Well done!

PgBiel commented 1 year ago

Hooray! Thanks for the feedback! :smile: