Creating a PDF document using HTML elements

I have created a HTML version of a bookdown book (, which contains HTML elements (e.g., embedded tweets). This book renders normally as a HTML book, but I run into issues when knitting a PDF, in which I get the following error:

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

I have tried followed the instructions in section 2.10 of the bookdown book "HTML Widgets" (i.e., installing the 'webshot' package and PhantomJS), but this does not work.

Is there a way that I can automatically take a 'screenshot' of embedded tweets for PDF output?


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