Bookdown test

library(dplyr)
library(huxtable)

if( ! ((x <- guess_knitr_output_format()) %in% c('html', 'latex'))) {
  stop("guessed output is ", x)
}
if (! huxtable:::use_bookdown_style_captions()) {
  stop("huxtable:::use_bookdown_style_captions() returned FALSE")
} 

My table is \@ref(tab:foo1). The other table is \@ref(tab:foo2). The third is \@ref(tab:foo3).

hux(a = 1:5, b = 1:5) %>% 
  set_caption("My labelled table") %>% 
  set_label("tab:foo1")


hux(a = 1:5, b = 1:5) %>% 
  set_caption("My labelled table, prefix should be autoadded!") %>% 
  set_label("foo2")

hux(a = "A table with no caption, but a label") %>% 
  set_label("tab:foo3")

hux(a = 1:5, b = 1:5) %>% 
  set_caption("My unlabelled table")

hux(a = "A table with no caption or label")


Try the huxtable package in your browser

Any scripts or data that you put into this service are public.

huxtable documentation built on Dec. 28, 2022, 1:09 a.m.