rstudio/bookdown-demo

Build Book returns Error in vapply...

rccline opened this issue · 1 comments

I cloned bookdown-demo. I opened index.Rmd and I ran Build Book which returned the following errors:

Tweaking _book/index.html
Tweaking _book/intro.html
Tweaking _book/literature.html
Tweaking _book/methods.html
Error in vapply(footnotes, FUN.VALUE = character(1), function(x) { :
values must be length 1,
but FUN(X[[2]]) result is length 2
Calls: local ... bs4_chapters_tweak -> bs4_chapter_tweak -> tweak_footnotes -> vapply
Execution halted
Error: bookdown::render_book() failed to render the output format 'bookdown::bs4_book'.
Execution halted

Exited with status 1.

cderv commented

Hi,

Sorry for this misleading situation. You need the dev version of bookdown to work with current bookdown-demo template for bs4_book().

This is because we are preparing next release which contains some fixes and we already updated the bookdown-demo with example for this.

Can you install the dev version of bookdown ?

remotes::install_github("rstudio/bookdown")

Otherwise, you just need to remove the part with long footnotes examples:

We will approximate standard error to 0.027[^longnote]
[^longnote]: $p$ is unknown but expected to be around 1/3. Standard error will be approximated
$$
SE = \sqrt(\frac{p(1-p)}{n}) \approx \sqrt{\frac{1/3 (1 - 1/3)} {300}} = 0.027
$$

Sorry for the trouble with this.