Rmarkdown - 如何去除输出的灰色背景 [英] Rmarkdown - how to remove grey background on output
问题描述
我遇到了一个有点恼人的问题,即我无法从输出中删除灰色文本(请参见下图).
我已经搜索了解决方案,但由于我对正确术语缺乏了解而受到限制,因此我无法找到任何解决方案.
我知道这可以通过只使用一个`"以某种方式绕过,但我需要三个```"来运行我的代码解释行.
I am experiencing a slightly irritating problem, which is that I am not able to remove the grey text from output (please see picture below).
I've searched for a solution, but is restricted by my lack of knowledge about the proper terms, and therefore I am not able to find any solutions.
I know this can be somehow bypassed by using only one "`", yet I need the triple "```" in order to run my code interpreting rows.
---
title: "Untitled"
output: word_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r, echo=FALSE}
hej <- ("test")
print(hej)
```
You might simply want to override the grey highlighting in the YAML header as follows:
---
title: "Untitled"
output:
word_document:
highlight: NULL
---
```{r setup, include = FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
Now if you want to get rid of the "##" and the line-numbers, tell knitr to handle texts as-is, and use cat()
:
```{r textfoo, echo = FALSE, results = 'asis'}
hej <- ("test")
cat(hej)
```
Et voilà:
这篇关于Rmarkdown - 如何去除输出的灰色背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!