【问题标题】:use highlight.js theme in rmarkdown::html_document() .Rmd在 rmarkdown::html_document() .Rmd 中使用 highlight.js 主题
【发布时间】:2015-07-20 15:09:29
【问题描述】:

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

示例:

而不是使用pandoc 的espresso 突出显示我想要highlight.js 的tommorrow 高亮生活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...

我该怎么做?

【问题讨论】:

    标签: r rstudio r-markdown pandoc


    【解决方案1】:

    据我所知,没有内置方法可以做到这一点,但您可以在 Rmd 文档的开头添加以下行以获得您想要的:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-07-09
      • 2019-02-11
      • 1970-01-01
      • 2021-07-24
      • 1970-01-01
      • 2020-08-06
      • 2014-07-02
      相关资源
      最近更新 更多