vincentarelbundock / tinytable

Simple and Customizable Tables in `R`
https://vincentarelbundock.github.io/tinytable
GNU General Public License v3.0
196 stars 16 forks source link

Typst bolding issue #348

Closed bsgallih12 closed 1 week ago

bsgallih12 commented 1 week ago

I'm putting together a simple table with a spanning header above the main column titles. I want both the column titles and spanning header to be bolded. When I set the style function (i=-1:0, bold=TRUE) I get the spanning header bolded and the first column header bolded (that isn't covered by the spanning header) to be bolded in addition to the spanning header. But the columns under the header aren't bolded.

vincentarelbundock commented 1 week ago

Are you using the development version from Github?

remotes::install_github("vincentarelbundock/tinytable")
library(tinytable)
packageVersion("tinytable")

If so, could you supply a reproducible example? Here are some tips to do that: https://marginaleffects.com/vignettes/help.html#getting-help

bsgallih12 commented 1 week ago

table %>% tt(caption = "Study 1 Moderation Descriptives") %>% group_tt(j = list("Rare" = 2:4, "Common" = 5:7)) %>% style_tt(i=0,j=1:7,align = "c") %>% style_tt(i=-1,j=1:7,bold = TRUE) %>% style_tt(i=0,j=1:7,bold = TRUE) %>% style_tt(i=0,j=2:7,italic = TRUE) %>% style_tt(i=1:6,j=2:7,align = "c")

bsgallih12 commented 1 week ago

image

vincentarelbundock commented 1 week ago

With the latest version of tinytable, it works fine for me.

Note that a reproducible example requires data.

Here's a Quarto example:

---
format: typst
---

```{r}
library(tinytable)
head(iris) |>
    tt() |>
    group_tt(j = list("Sepal" = 1:2, "Petal" = 3:4)) |>
    style_tt(i = -1:0, bold = TRUE)


![Screenshot from 2024-09-23 13-15-51](https://github.com/user-attachments/assets/0f6254fb-723f-4f84-9fe2-01f4a3c7bd00)
bsgallih12 commented 1 week ago

Thanks for this! I figured it out shortly after I posted. In the future I'll be sure to add a quick reproducible example that includes data. Thanks for all your work!