使用html_document时,可以在RMarkdown前端指定highlight.js样式吗?

例子:

与其使用pandocespresso高亮显示,不如说我想要highlight.jstommorrow Highlithing保留在here

---
title: "Untitled"
output:
  html_document:
    highlight: espresso
---

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.

When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

```{r}
summary(cars)
```

etc...

我该怎么办?

最佳答案

据我所知,没有内置方法可以执行此操作,但是您可以在Rmd文档的开头添加以下行以获取所需的内容:

<style type="text/css">
@import "https://highlightjs.org/static/demo/styles/tomorrow.css";
</style>

关于r - 在rmarkdown::html_document()中使用Highlight.js主题。,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/30145208/

10-12 18:08