rstudio/gt

Cell text size fails to render with latex

andrie opened this issue · 0 comments

Description

Describe the bug clearly and concisely.

Reproducible example

This reprex fails to render, and throws an error:

ERROR: 
compilation failed- error
Undefined control sequence.
l.229 {\small0.1111} & {\smallapricot
                                     } & {\smallone} & {\small2015-01-15} & ... 

Note that the latex command \small doesn't get terminated. It needs either a space, or to be \small{}

---
title: Test font size
format: pdf
---

```{r}
library(gt)
head(exibble) |> 
    gt() |>
    tab_style(
        style = cell_text(size = "small"),
        locations = cells_body(columns = everything())
      ) |> 
    as_latex()
```

Session info

> sessioninfo::session_info()
─ Session info ───────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.4.0 (2024-04-24 ucrt)
 os       Windows 11 x64 (build 22631)
 system   x86_64, mingw32
 ui       Rgui
 language (EN)
 collate  English_United Kingdom.utf8
 ctype    English_United Kingdom.utf8
 tz       GMT
 date     2024-09-19
 pandoc   3.4 @ C:\\Users\\apdev\\scoop\\shims\\pandoc.exe

─ Packages ───────────────────────────────────────────────────────────────────
 package     * version     date (UTC) lib source
 cli           3.6.3       2024-06-21 [1] RSPM
 data.table    1.14.10     2023-12-08 [1] CRAN (R 4.4.0)
 digest        0.6.37      2024-08-19 [1] RSPM
 dplyr         1.1.4       2023-11-17 [1] CRAN (R 4.4.0)
 fansi         1.0.6       2023-12-08 [1] CRAN (R 4.4.0)
 fastmap       1.2.0       2024-05-15 [1] RSPM
 generics      0.1.3       2022-07-05 [1] CRAN (R 4.4.0)
 glue          1.7.0       2024-01-09 [1] CRAN (R 4.4.0)
 gt          * 0.11.0.9000 2024-09-19 [1] local
 htmltools     0.5.8.1     2024-04-04 [1] RSPM
 lifecycle     1.0.4       2023-11-07 [1] CRAN (R 4.4.0)
 magrittr      2.0.3       2022-03-30 [1] CRAN (R 4.4.0)
 pillar        1.9.0       2023-03-22 [1] CRAN (R 4.4.0)
 pkgconfig     2.0.3       2019-09-22 [1] CRAN (R 4.4.0)
 R6            2.5.1       2021-08-19 [1] CRAN (R 4.4.0)
 rlang         1.1.4       2024-06-04 [1] RSPM
 sessioninfo   1.2.2       2021-12-06 [1] CRAN (R 4.4.0)
 tibble        3.2.1       2023-03-20 [1] CRAN (R 4.4.0)
 tidyselect    1.2.0       2022-10-10 [1] CRAN (R 4.4.0)
 utf8          1.2.4       2023-10-22 [1] CRAN (R 4.4.0)
 vctrs         0.6.5       2023-12-01 [1] CRAN (R 4.4.0)
 xml2          1.3.6       2023-12-04 [1] CRAN (R 4.4.0)