Typst doesn't render GT() table feature tab_stub_indent() properly to pdf #14118
Replies: 2 comments 6 replies
-
|
@ande4148 please change to Q&A and more importantly provide a fully reproducible example. You can share a self-contained "working" (reproducible) Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four If you have multiple files (and if it is absolutely required to have multiple files), please share as a Git repository.
Additionally and if not already given, please share the output of |
Beta Was this translation helpful? Give feedback.
-
|
I would suggest to check on edit: actually don't open one, but do read the thread as it shows alternative code. ---
format: html
execute:
echo: false
---
```{r}
library(gt)
constants |>
dplyr::select(name, value, uncert, units) |>
dplyr::filter(
grepl("^atomic mass constant", name) |
grepl("^Rydberg constant", name) |
grepl("^Bohr magneton", name)
) |>
dplyr::mutate(
indent = ifelse(grepl("constant |magneton ", name), 4, 0),
name = gsub(".*constant |.*magneton ", "...", name),
name = purrr::map2_chr(name, indent, function(x, y) paste0(c(rep.int(" ", y), x), collapse = ""))
) |>
gt(rowname_col = "name") |>
cols_align(align = "left", columns = name) |>
tab_stubhead(label = "Physical Constant") |>
fmt_markdown(columns = name)
``` |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Hello,
As devs continue to improve Typst pdf rendering of R's GT great tables, I wanted to point out a limitation that I encountered.
I have a GT table containing this code:
It contains a lot of additional styling. Everything else renders properly to both html and pdf Typst output. However, the row/stub indents only render properly in html. The table looks perfect in RStudio, but when creating the pdf, everything looks perfect except the indents are lost.
I imagine this is just an attribute that hasn't been implemented yet and wanted to bring it to your attention.
Thanks,
Adam
Beta Was this translation helpful? Give feedback.
All reactions