Is there an equivalent of html-table-processing: none
for Typst output?
#13529
-
DescriptionHello! I use I think this is expected, because from what I understand, Quarto converts the gt table to a Typst table under the hood, which requires translating all the style properties. That's why I'm looking for an equivalent to For now, the best solution I've found is to save the table and add it back as an image in markdown, but I think there's a simpler solution: ---
format: typst
---
```{r}
library(gt)
data <- data.frame(
Name = c(“Alice”, ‘Bob’, “Charlie”),
Score = c(90, 85, 88)
)
gt(data) |>
gtsave(“here.png”)
```
 Ideally, I could just do the following and get the same result as above: ---
format:
typst:
typst-table-processing: none
---
```{r}
library(gt)
data <- data.frame(
Name = c(“Alice”, ‘Bob’, “Charlie”),
Score = c(90, 85, 88)
)
gt(data)
``` If it would be helpful, I can try to write examples of more specific unexpected/expected results in the gt table (like this #10653). |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
Edit: if this feature does not exist, I think it would super valuable to have in Quarto in the future. I could not find any feature request about this, but I might have missed it. |
Beta Was this translation helpful? Give feedback.
-
That cannot work, because If there is a |
Beta Was this translation helpful? Give feedback.
-
As Mickael explained, gt produces HTML and in this is a Quarto feature (thanks to HTML table processing) that Quarto gives you a Typst table, trying its best to keep the HTML style.
We also have advanced documentation that give you more details about support and limitations of Typst CSS: https://quarto.org/docs/advanced/typst/typst-css.html So be sure to consider those in case this is the difference you see. And so, considering all this, it would be really helpful to know what the differences are that you see as not well supported.
This is definitely a good solution! If you want the exact same table as the one styled in HTML, using screenshots is the best thing to do. As you are an Ruser, there may be some Regarding Typst output, only R package I know that produce raw typst is tinytable (https://vincentarelbundock.github.io/tinytable/ ) but I don't know how good they are at keeping exact same styling between HTML and Typst table as they support both. Hope it helps |
Beta Was this translation helpful? Give feedback.
-
Okay, that makes perfect sense, thank you. I didn't know that Quarto converted HTML gt tables to typst. A screenshot + markdown (or I'll take some time to write some reprex examples of what isn't well supported here. I've also noticed some differences between using the gt table and the gt table output in an HTML report, but that seems strange based on what you just said. In typst, the current differences I see are
|
Beta Was this translation helpful? Give feedback.
That cannot work, because
gt
does not emit Typst. If there is no Quarto processing, then there is no HTML to Typst table translation.If there is a
typst-table-processing
it would be for you to write Typst table without Quarto modifying it.