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

Table references work when rendering to bookdown::html_document2, but not blogdown::html_page #225

Closed
joshuaborn opened this issue May 2, 2022 · 2 comments

Comments

@joshuaborn
Copy link

Describe the bug
Table references work when a huxtable is in an R Markdown document rendered to output bookdown::html_document2, but not when a huxtable is in a document rendered to output blogdown::html_page.

Minimal Reproducible Example
See https://github.com/joshuaborn/minimal-example. Table numbering and references work for the huxtables when bookdown-article.Rmd is rendered, but not when blogdown-article.Rmd is rendered. Table numbering and references work for the kable versions of tables in both documents. Manually calling set_label has no effect.

Expected behavior
huxtables should be labeled, and references to them should work. The documentation for blogdown::html_page states that it "is a simple wrapper of bookdown::html_document2() with different default arguments," so if table references work with bookdown::html_document2, they should work with with blogdown::html_page.

System details
I am using the latest versions of R and relevant packages.

> xfun::session_info('huxtable')
R version 4.2.0 (2022-04-22 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22000), RStudio 2022.2.1.461

Locale:
  LC_COLLATE=English_United States.utf8  LC_CTYPE=English_United States.utf8   
  LC_MONETARY=English_United States.utf8 LC_NUMERIC=C                          
  LC_TIME=English_United States.utf8    

Package version:
  assertthat_0.2.1 cachem_1.0.6     cli_3.3.0        commonmark_1.8.0 ellipsis_0.3.2  
  fastmap_1.1.0    generics_0.1.2   glue_1.6.2       graphics_4.2.0   grDevices_4.2.0 
  huxtable_5.4.0   magrittr_2.0.3   memoise_2.0.1    methods_4.2.0    purrr_0.3.4     
  R6_2.5.1         rlang_1.0.2      stats_4.2.0      stringi_1.7.6    stringr_1.4.0   
  tidyselect_1.1.2 tools_4.2.0      utils_4.2.0      vctrs_0.4.1      xml2_1.3.3
> packageVersion('bookdown')
[1] ‘0.26’
> packageVersion('blogdown')
[1] ‘1.9’
> packageVersion('knitr')
[1] ‘1.39’
> packageVersion('RMarkdown')
[1] ‘2.14’

Stack Overflow issue
Note: This began as a question on Stack Overflow: https://stackoverflow.com/questions/72045792/why-is-table-numbering-not-working-with-blogdownhtml-page-but-working-with-bo

@hughjonesd
Copy link
Owner

Thanks for this. Could you check if setting options(huxtable.bookdown = TRUE) works? I'm also about to push a fix to master, please test it using remotes::install_github("hughjonesd/huxtable")

@joshuaborn
Copy link
Author

I verified just now that the table references in a blogdown page work with options(huxtable.bookdown = TRUE) with v5.4.0 of huxtable, and independently without options(huxtable.bookdown = TRUE) using the HEAD of this repo.

Thanks for your prompt attention, and more importantly, thanks for all your work on huxtable!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants