How do I control cell padding in typst documents? #9090
-
DescriptionI was writing this as a bug report, but let me first make sure that I'm not just being silly: I am able to set table inset for a table where I explicitly outline the contents (first example below), but I cannot seem to get this to pass to a table derived from a saved dataframe (second example). I included the fill call as a sanity check that I'm using Note that I am passing this through Is this a bug? And/or is there another way to control this? ---
title: "Untitled"
format: typst
execute:
echo: false
---
```{=typst}
#set table(
inset: 20pt,
fill: luma(225)
)
#table(
[Hello],
[World],
)
```
```{r reprex table}
#| label: tbl-reprex
#| tbl-cap: Example
#| tbl-cap-location: bottom
gt::gt(head(mtcars)[,1:2])
```
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
Note that To debug Typst, you can use PS: note that in the below snippet from your code you are defining the label twice. In Quarto, you have no reason to have anything in the code cell header, all options exist in YAML which is the recommended way of passing options. ```{r reprex table}
#| label: tbl-reprex
#| tbl-cap: Example
#| tbl-cap-location: bottom
gt::gt(head(mtcars)[,1:2])
``` To ```{r}
#| label: tbl-reprex
#| tbl-cap: Example
#| tbl-cap-location: bottom
gt::gt(head(mtcars)[,1:2])
``` I am not aware of any R packages currently supporting Typst directly. Because of Pandoc and R packages (or any third party actually) lack of Typst support, I ended up writing the table myself in an extension: https://github.com/mcanouil/quarto-invoice/blob/main/template.qmd |
Beta Was this translation helpful? Give feedback.
-
Thanks! I guess my question now is: why is my set inset being overridden with this 6pt inset? Where is that coming from? If this is something that comes from the
And as an aside, thanks for the note on labels. I had been using YAML label for table and figure cross-referencing, and the code block header to name my chunks. Today I learned that the YAML label does indeed also name the chunk, which inherently makes sense, but I ever thought about it, so thank you! |
Beta Was this translation helpful? Give feedback.
CSS is HTML, this has absolutely no effect (and never will) in Typst or LaTeX.
As I said and as far as I know, there is no R packages supporting Typst, so in the end they either emit markdown or HTML tables which are processed by Quarto to AST (Pandoc representation of a document) then transformed to the appropriate format.
You can use
keep-md: true
to see the intermediate markdown document that is used.Additionally, you can use
html-table-processing: none
(you might need 1.5 for this) in your YAML front matter to disable Quarto processing of HTML table to see if it is related to what you see.See https://github.com/quarto-dev/quarto-cli/blob/main/src/resources/formats/typst/pandoc/quart…