-
DescriptionI think I may have found a bug when using gtsummary tables with differences, which seems to be a lua filter issue. Consider the following file including two tables, the only difference being the use of add_difference. ---
title: "Untitled"
format: typst
editor: visual
---
```{r}
data(mtcars)
library(gtsummary)
mtcars |>
select(mpg, am) |>
tbl_summary(by = am)
```
```{r}
mtcars |>
select(mpg, am) |>
tbl_summary(by = am) |>
add_difference()
``` When rendering to html, both tables are included (considering that typst is still relatively new, i often try html as a reference when something doesn't work). But when rendering to typst, only the first table is included, with the following message from quarto:
Actually, the warning is produced when rendering to both HTML and typst, but the table is included anyway in the case of HTML... (the fact that the warning is produced under both formats suggests that there might also be an issue on the gtsummary or gt side I suppose, but I'm posting here as the table clearly works in HTML...)
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
This thread in gt will explain a little the support: gt does not yet support Typst output natively So it will produce HTML table, and then it is Quarto that does handle the transformation from HTML table to a Table AST node that can be written to Typst (https://quarto.org/docs/authoring/tables.html#html-tables) However, this assumes the HTML table produced can be correctly parsed using It seems that the second HTML table is not parseable by Quarto. So, it is skipped as raw HTML does not show in Typst output, and the table can't be converted. The next steps are:
Thanks for the report! |
Beta Was this translation helpful? Give feedback.
This is in fact known issue in gt: