Bookdown error with PDF output, even with webshot and phantomJS installed

Hi all

I have a bookdown "book" that renders fine into HTML, but with PDF I get this message:

Error: Functions that produce HTML output found in document targeting latex output.
Please change the output type of this document to HTML.

I have read that installing webshot (and phantomJS) fixes this, by taking a screenshot of the offending output.

But they are installed. For instance, I can happily use webshot to take an image of any webpage. So webshot() works.

In addition, I see this:

> is_phantomjs_installed()
[1] TRUE

So what am I doing wrong? Any help greatly appreciated.

I note a recent, similar question has gone unanswered.

BSP.

sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Mojave 10.14.6

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] webshot_0.5.2 bookdown_0.20

loaded via a namespace (and not attached):
[1] ps_1.3.3 packrat_0.5.0 digest_0.6.25 R6_2.4.1 jsonlite_1.7.0 magrittr_1.5 evaluate_0.14
[8] rlang_0.4.7 stringi_1.4.6 curl_4.3 rstudioapi_0.11 callr_3.4.3 webex_0.9.1 rmarkdown_2.3
[15] tools_4.0.2 stringr_1.4.0 processx_3.4.3 xfun_0.15 yaml_2.2.1 rsconnect_0.8.16 compiler_4.0.2
[22] askpass_1.1 htmltools_0.5.0 openssl_1.4.2 knitr_1.29

You did already 'google' with your title and saw e.g. https://github.com/hadley/r4ds/issues/296 ?
I wondered what changes you made in the yaml trying to get from the html to the pdf version? Did you add the always_allow_html: yes clause or is this outdated yet?
Is the only indication that there is something wrong the message

Error: Functions that produce HTML output found in document targeting latex output.
Please change the output type of this document to HTML.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.