R 标记:使用HTML代码呈现pdf输出?

R 标记:使用HTML代码呈现pdf输出?,r,r-markdown,R,R Markdown,有没有办法使用像div for R markdown这样的html代码呈现为pdf格式?这里有一个例子 --- pdf_document: fig_caption: yes toc: yes output: pdf_document always_allow_html: yes --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ## R Markdown &

有没有办法使用像div for R markdown这样的html代码呈现为pdf格式?这里有一个例子

---
pdf_document:
  fig_caption: yes
toc: yes
output: pdf_document
always_allow_html: yes
---

    ```{r setup, include=FALSE}
    knitr::opts_chunk$set(echo = TRUE)
    ```

    ## R Markdown
    <hr>
    <div style="background-color: orange;">
    Hi there!
    </div>
---
pdf\U文件:
图片说明:是的
toc:是的
输出:pdf\U文件
始终\u允许\u html:是
---
```{r设置,include=FALSE}
knitr::opts_chunk$set(echo=TRUE)
```
##降价

你好!
如果我把它渲染成html,它会给出一个带有“Hi here!”的橙色背景,但是如果我把它输出到pdf,橙色div就会消失。是否可以将其渲染为带有橙色div背景的pdf格式?谢谢