Skip to content
Discussion options

You must be logged in to vote

This is expected error by knitr and rmarkdown because HTML code is produced in output while the output format is seen to be PDF.

So this will be detected at computation rendering time (during knitting) and an error is thown. In some cases when webshot or webshot2 is detected, a screenshot of the HTML rendered is taken (for leaflet for example).

So basically this happens because

  • Quarto conditional content happens after computation. Everything in the document will be computed.
  • knitr and rmarkdown does throw an error when HTML code is produced in a non-HTML output like pdf.
  • It doesn't know about the code chunk being wrapped in conditional quarto div

This will be improved when we'll adapt c…

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
1 reply
@cderv
Comment options

Answer selected by snhansen
Comment options

You must be logged in to vote
6 replies
@cderv
Comment options

@mcanouil
Comment options

@cderv
Comment options

@cderv
Comment options

@snhansen
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
3 participants