Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom cell borders are ignored in latex output #1712

Open
kuriwaki opened this issue Jun 18, 2024 · 0 comments
Open

Custom cell borders are ignored in latex output #1712

kuriwaki opened this issue Jun 18, 2024 · 0 comments
Assignees

Comments

@kuriwaki
Copy link

Prework: Checked

Description

Cell borders are ignored in latex output (as_latex or gtsave("......tex"))

Reproducible example

library(gt)
library(tibble)
gt0 <- tibble(x = 1:2) |> 
  gt() |> 
  # Add border
  tab_style(style = cell_borders(sides = "top"), locations = cells_body())

# should be a hrule above the {2}
as_latex(gt0) |> 
  cat()
#> \begingroup
#> \fontsize{12.0pt}{14.4pt}\selectfont
#> \begin{longtable}{r}
#> \toprule
#> x \\ 
#> \midrule\addlinespace[2.5pt]
#> {1} \\ 
#> {2} \\ 
#> \bottomrule
#> \end{longtable}
#> \endgroup

Created on 2024-06-18 with reprex v2.1.0

Expected result

The latex output should have some kind of \hrule for the added border

Session info

Session info
sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value
#>  version  R version 4.4.0 (2024-04-24)
#>  os       macOS Sonoma 14.5
#>  system   aarch64, darwin20
#>  ui       X11
#>  language (EN)
#>  collate  en_US.UTF-8
#>  ctype    en_US.UTF-8
#>  tz       America/New_York
#>  date     2024-06-18
#>  pandoc   3.1.11 @ /Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/aarch64/ (via rmarkdown)
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package     * version     date (UTC) lib source
#>  cli           3.6.2       2023-12-11 [1] CRAN (R 4.4.0)
#>  digest        0.6.35      2024-03-11 [1] CRAN (R 4.4.0)
#>  dplyr         1.1.4       2023-11-17 [1] CRAN (R 4.4.0)
#>  evaluate      0.23        2023-11-01 [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] CRAN (R 4.4.0)
#>  fs            1.6.4       2024-04-25 [1] CRAN (R 4.4.0)
#>  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.10.1.9000 2024-06-07 [1] Github (rstudio/gt@4aad9ff)
#>  htmltools     0.5.8.1     2024-04-04 [1] CRAN (R 4.4.0)
#>  knitr         1.47        2024-05-29 [1] CRAN (R 4.4.0)
#>  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)
#>  purrr         1.0.2       2023-08-10 [1] CRAN (R 4.4.0)
#>  R.cache       0.16.0      2022-07-21 [1] CRAN (R 4.4.0)
#>  R.methodsS3   1.8.2       2022-06-13 [1] CRAN (R 4.4.0)
#>  R.oo          1.26.0      2024-01-24 [1] CRAN (R 4.4.0)
#>  R.utils       2.12.3      2023-11-18 [1] CRAN (R 4.4.0)
#>  R6            2.5.1       2021-08-19 [1] CRAN (R 4.4.0)
#>  reprex        2.1.0       2024-01-11 [1] CRAN (R 4.4.0)
#>  rlang         1.1.3       2024-01-10 [1] CRAN (R 4.4.0)
#>  rmarkdown     2.27        2024-05-17 [1] CRAN (R 4.4.0)
#>  rstudioapi    0.16.0      2024-03-24 [1] CRAN (R 4.4.0)
#>  sass          0.4.9       2024-03-15 [1] CRAN (R 4.4.0)
#>  sessioninfo   1.2.2       2021-12-06 [1] CRAN (R 4.4.0)
#>  styler        1.10.3      2024-04-07 [1] CRAN (R 4.4.0)
#>  tibble      * 3.2.1       2023-03-20 [1] CRAN (R 4.4.0)
#>  tidyselect    1.2.1       2024-03-11 [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)
#>  withr         3.0.0       2024-01-16 [1] CRAN (R 4.4.0)
#>  xfun          0.44        2024-05-15 [1] CRAN (R 4.4.0)
#>  xml2          1.3.6       2023-12-04 [1] CRAN (R 4.4.0)
#>  yaml          2.3.8       2023-12-11 [1] CRAN (R 4.4.0)
#> 
#>  [1] /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library
#> 
#> ──────────────────────────────────────────────────────────────────────────────
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants