hughjonesd / huxtable

An R package to create styled tables in multiple output formats, with a friendly, modern interface.
http://hughjonesd.github.io/huxtable
Other
321 stars 28 forks source link

Huxtable Formatting Overridden by Quarto Bootstrapping after Quarto Update to 1.3 #248

Closed mvanaman closed 1 year ago

mvanaman commented 1 year ago

Not sure if this is more of a Quarto or huxtable question.

Sadly, the new Quarto (>= 1.3) undoes some of huxtable formatting in favor of Quarto's bootstrapping table theming. I have tried for html format but not PDF. Here's an example:

library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
library(huxtable)
#> 
#> Attaching package: 'huxtable'
#> The following object is masked from 'package:dplyr':
#> 
#>     add_rownames
iris %>% 
    head() %>% 
    huxtable() %>% 
    theme_article()
#> Warning in knit_print.huxtable(x, ...): Unrecognized output format "gfm-yaml". Using `to_screen` to print huxtables.
#> Set options("huxtable.knitr_output_format") manually to "latex", "html", "rtf", "docx", "pptx", "md" or "screen".
 ─────────────────────────────────────────────────────────────────────
   Sepal.Length   Sepal.Width   Petal.Length   Petal.Width   Species  
 ─────────────────────────────────────────────────────────────────────
            5.1           3.5            1.4           0.2   setosa   
            4.9           3              1.4           0.2   setosa   
            4.7           3.2            1.3           0.2   setosa   
            4.6           3.1            1.5           0.2   setosa   
            5             3.6            1.4           0.2   setosa   
            5.4           3.9            1.7           0.4   setosa   
 ─────────────────────────────────────────────────────────────────────

Column names: Sepal.Length, Sepal.Width, Petal.Length, Petal.Width, Species

Created on 2023-10-09 with reprex v2.0.2

In the resulting html file, striping and probably other stuff I'm not noticing are changed, but so far I just notice striping. The expected output is for the table to resemble the theme_article() styling as shown here i.e., bold headers, no stripes.

This issue was noted in this stackoverflow question, but I found the solution unsatisfactory as it seems to break Quarto's tbl-cap: setting, at least for me.

System details huxtable Version ‘5.5.2’ R Version 4.3.1 (2023-06-16) Quarto Version 1.3 RStudio Version 2023.06.1+524 (2023.06.1+524)

EDIT: tbl-caption to tbl-cap

hughjonesd commented 1 year ago

I would definitely report to quarto also and reference this bug. Not sure who can fix it best.

cderv commented 1 year ago

Hi !

I have answered at https://github.com/quarto-dev/quarto-cli/issues/7187#issuecomment-1755793457

This is not a bug per-se but probably some compatibility adjustment with how Quarto works.

Hope it helps understand.

hughjonesd commented 1 year ago

This is now controlled by a new option huxtable.quarto_process, which defaults to FALSE. By default it simply adds the relevant attribute into HTML table tags.