gpt4 book ai didi

ms-word - 将空行添加到 Word 输出 RMarkdown

转载 作者:行者123 更新时间:2023-12-04 01:36:09 24 4
gpt4 key购买 nike

再会。

我正在尝试使用导出到 Word 文档的 rmarkdown 文件创建 session 摘要提交。我正在尝试找到一种在输出的 word 文档中插入空行的方法。我发现可以通过在 markdown 文件末尾添加两个空格来插入换行符,但是,当您只想要一个空行时,这个技巧不起作用。下面是示例代码

  ---
title: "HERE IS THE TITLE OF MY ABSTRACT"
output:
word_document:
reference_docx: draft-styles.docx
---

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

```{r, include=FALSE, cache=FALSE, echo=FALSE}
library(rmarkdown)
```


Authors: John H. Curry^1^, Kathy S. James^1^, Patrick S. Curry^1^
Affiliations: ^1^University of Somewhere

*Presenting author information*
Name: John H. Curry
Email: curry@umed.edu
Affiliation details: Kinesiology, University of Somewhere, Ottawa, Canada


*Coauthor #2*
Name: Kathy S. James
Email: james@umed.edu
Affiliation details: Kinesiology, University of Somewhere, Ottawa, Canada

*Coauthor #3*
Name: Patrick S. Curry
Email: curry2@umed.edu
Affiliation details: Kinesiology, University of Somewhere, Ottawa, Canada


## Introduction
Here is where I write my introduction....

## Methods
Here is where I write my methods

## Results
Here is where I write my results...

## Discussion
Here is where I write my discussion

当我编织文件时,遗憾的是它有点聚集。下面我添加了一张带有当前输出(左)和我希望它看起来像(右)的图片。
img

我已经阅读了论坛,但在使用 Word 文档时我还没有看到解决方案。我将不胜感激任何建议。

谢谢

最佳答案

您可以使用 \newline在 Rmd 文件中如下:

---
title: "HERE IS THE TITLE OF MY ABSTRACT"
output:
word_document
---

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

```{r, include=FALSE, cache=FALSE, echo=FALSE}
library(rmarkdown)
```


Authors: John H. Curry^1^, Kathy S. James^1^, Patrick S. Curry^1^
Affiliations: ^1^University of Somewhere

\newline

*Presenting author information*
Name: John H. Curry
Email: curry@umed.edu
Affiliation details: Kinesiology, University of Somewhere, Ottawa, Canada

\newline

*Coauthor #2*
Name: Kathy S. James
Email: james@umed.edu
Affiliation details: Kinesiology, University of Somewhere, Ottawa, Canada

\newline

*Coauthor #3*
Name: Patrick S. Curry
Email: curry2@umed.edu
Affiliation details: Kinesiology, University of Somewhere, Ottawa, Canada

\newline

## Introduction
Here is where I write my introduction....

\newline

## Methods
Here is where I write my methods

\newline

## Results
Here is where I write my results...

\newline

## Discussion
Here is where I write my discussion

如果您接下来要问,newpage 稍微难一些。您需要在 Word 中为标题 5(例如)创建一个新样式,该样式会自动在新页面上开始,并且在您的 Rmd 文件中,您将使用标题 5 作为新行。网上有很多关于这个的资源。

关于ms-word - 将空行添加到 Word 输出 RMarkdown,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43239868/

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