阻止Rmarkdown中的列表

时间:2018-01-25 14:42:49

标签: r r-markdown

我在Rmarkdown工作并编织成PDF。我想用(a) 开始一个段落而不用 创建一个列表。添加\(a)有效,但它突出显示了我的Rmd文件的其余部分,使其难以阅读。是否有另一种方式表明我不想在Rmarkdown中创建列表?

enter image description here

enter image description here

---
title: "Untitled"
output:
  pdf_document: default
  html_document: default
---

This is the first paragraph.

```{r, include=FALSE}
1+1 # nice highlighting before problem
```

(a) This should be the second paragraph. (b) But it is interpreted as a list.

\(a) This slash works to keep the text as a paragraph, but it highlights all remaining text in my Rmd file, which makes it hard to read. (b) Is there another method to use (a) without creating a list?

Here is a good list, but still wrong color in Rmd:

(a) One
(b) Two

```{r, include=FALSE}
1+1 # bad highlighting after problem
```

1 个答案:

答案 0 :(得分:2)

尝试将(a)放在<span>

<span> (a) </span> This should be the second paragraph.

它有点hacky但它​​适用于html&amp; pdf并修复了突出显示问题。