gpt4 book ai didi

r - 代码块漂浮到带有 tufte markdown r 的边缘区域

转载 作者:行者123 更新时间:2023-12-02 01:26:51 28 4
gpt4 key购买 nike

我对 tufte Markdown 样式有疑问...

我的一些代码块的格式不正确。无法识别换行符并且文本 float (这是正确的词吗?)到评论和图像所在的侧面区域。

例子:

---
title: "test"
author: "user"
date: "Now"
output:
tufte::tufte_handout:
number_sections: yes
toc: yes
toc_depth: 1
---

Some test lines

```{r, eval=FALSE}
re_quantify_setting <-
parameters[,'Value'][parameters[,'Parameter'] == 'Re-quantify']
if(re_quantify_setting != 'False') {
stop('Re-quantify was set to \'True\'! ',
'Please reanalyse data with correct MaxQuant settings.')
}
```

```{marginfigure}
Also a common problem is that people often just mark all lines of code and then
just executing (Run) it. Here it might happen that an error occured at the beginning
of the script but was not seen by the user because code is executing so fast.
This can be prevent by using the **Source**-button. The script will stop in case
of an error message!
```

结果如下:

pdf output

有谁知道为什么会发生这种情况以及如何获得正确的换行符?

最佳答案

您可以禁用整理:

```{r, echo=FALSE}
knitr::opts_chunk$set(tidy=FALSE)
```

关于r - 代码块漂浮到带有 tufte markdown r 的边缘区域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36622727/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com