r语言 - 将书本移植到蒸馏::d istill_article不支持定理环境



试图将定理环境实现到R distill::article。按照 Rmarkdown 和 Bookdown 以及 R Markdown Cookbook 中的说明进行操作

我发现定理环境处理得很好

bookdown::html_document2:
base_format: rmarkdown::html_document

bookdown::html_document2:
base_format: pagedown::html_paged

但是,它不适用于distill_article。有人知道为什么它不起作用吗?

下面是一个最小的可重现示例。

---
title: "Port the bookdown features to Rmarkdown"
author: "Bookdown Rmarkdown"
output:
bookdown::html_document2:
base_format: distill::distill_article
---
# Theorems
```{theorem, name="Pythagorean theorem"}
For a right triangle, if $c$ denotes the length of the hypotenuse
and $a$ and $b$ denote the lengths of the other two sides, we have
$$a^2 + b^2 = c^2.$$
```

在distll_article中检查代码后。R,我想出了为什么定理没有显示。默认情况下,在 distll_article 中,knitr_options$opts_chunk$echo被分配了值FALSE,我认为它隐藏了定理环境,因为它在 bookdown 中被定义为代码块。若要切换值,请在 yaml 标头之后添加以下代码块将完成工作。

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

最新更新