title: How to PDF render Quarto books with dynamic content?
body: <p>I am writing my thesis using a Quarto book in HTML, which has some dynamic content (leaflet maps, plotly dynamic graphs). However, eventually, I will need to export the book in PDF/LaTeX, or at least Word (and then I can copy and paste into LaTeX).</p>
  <p>When I try to export to PDF I of course run into this error:</p>
  <blockquote>
  <p>Functions that produce HTML output found in document targeting pdf
  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:</p>
  <p>always_allow_html: true</p>
  <p>Note however that the HTML output will not be visible in non-HTML
  formats.</p>
  </blockquote>
  <p>I did try to add the <code>always_allow_html: true</code> in my YAML file, but I get the same exact error. I also tried the <a href="https://quarto.org/docs/authoring/conditional.html" rel="nofollow noreferrer">conditional rendering</a> with <code>{.content-hidden unless-format=&quot;pdf&quot;}</code>, but I can't seem to get it working.</p>
  <p>Has anyone experienced the same issue?</p>