mystmd icon indicating copy to clipboard operation
mystmd copied to clipboard

Typst build : table raise Unhandled Typst conversion for node of "div"

Open mathisdrn opened this issue 1 year ago • 5 comments

Table cause Typst build to to raise ⛔️ Unhandled Typst conversion for node of "div"

1.1.56

Description

I was using 1.1.53 before and Table were rendered : Capture d’écran 2024-04-24 à 02 47 21 Since 1.1.56 Table raise a warning and most of them simply don't render.

All data for reproducibility here : https://github.com/mathisdrn/head_coach_dismissal

Additional note: Since switching to 1.1.56, I also have warning raised about ⛔️ Unhandled Typst conversion for node of "_lift" which I am unsure what this is about

mathisdrn avatar Apr 24 '24 00:04 mathisdrn

Thanks for the issue. For some reason the nodes are not getting lifted out of their parent, likely here. Very strange. Will take a look at the div rendering soon, very easy to add that back in -- and am looking forward to nicer looking default tables soon as well. Thanks again for your help in raising issues!

rowanc1 avatar Apr 24 '24 04:04 rowanc1

I am no longer seeing the _lift warning, the div rendering should be fixed in #1163. There also seems to be a challenge with the tablex rendering in typst. Will leave this issue open while we investigate that.

rowanc1 avatar Apr 25 '24 17:04 rowanc1

Thanks for the support. _lift warning is gone and it was inbetween commit so I am unable to reproduce.

mathisdrn avatar Apr 27 '24 06:04 mathisdrn

Hi @rowanc1, Since MyST 1.2.0 some table are rendered like this : Capture d’écran 2024-04-30 à 16 49 33

Debugging option doesn't seem to show anything meaningful. I have used myst clean --templates before running myst build.

mathisdrn avatar Apr 30 '24 14:04 mathisdrn

Thanks for the note. This is a problem with our figure handling that now sees a div instead of a table, and renders as content, rather than a typst function. We need to update our handling of that, should be straight forward!

The offending line is here: https://github.com/executablebooks/mystmd/blob/main/packages/myst-to-typst/src/table.ts#L27

rowanc1 avatar Apr 30 '24 15:04 rowanc1

Just installed 1.2.3 to update my PDF but now, not a single table is rendered and figure are no longer rendered : Here is side by side diff 1.2.0 / 1.2.3 No error when running build -d

(figures and table are reused from jupyter output)

Capture d’écran 2024-05-18 à 12 38 36

mathisdrn avatar May 18 '24 10:05 mathisdrn