Rendering rmarkdown into multiple formats is prone to be difficult because mixed HTML, LaTeX and markdown, and issues with depth of headers in LaTeX can have mixed results. The functions here attempt to smooth over some of that.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.