Hi all
(Previously posted in stack exchange 4 days ago, with no replies.)
I am trying to create an epub version of a book that successfully compiles into PDF and HTML.
It seems that using kable_styling
is causing the issue.
Consider the code from here exactly as it stands:
options(kableExtra.html.bsTable = T) iris[1:10, ] %>%
mutate_if(is.numeric, function(x) {
cell_spec(x, bold = T,
color = spec_color(x, end = 0.9),
font_size = spec_font_size(x)) }) %>%
mutate(Species = cell_spec(
Species, color = "white", bold = T,
background = spec_color(1:10, end = 0.9,
option = "A", direction = -1) )) %>%
kable(escape = F, align = "c", booktabs = T) %>%
kable_styling(c("striped", "condensed"),
latex_options = "striped",
full_width = F)
Running this code generates the error message:
Error: Functions that produce HTML output found in document targeting epub3 output.
Please change the output type of this document to HTML. Alternatively, you can allow
HTML output in non-HTML formats by adding this option to the YAML front-matter of
your rmarkdown file:
always_allow_html: true
Note however that the HTML output will not be visible in non-HTML formats.
If I remove the kable_styling
command, all works well: no error at all.
Fiddling and trouble-shooting my own code suggests the same: the problem is with kable_styling
.
Am I doing something wrong, or is there a problem (and, hopefully, a fix)?
Thanks.
P.