且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将空白行添加到Word输出RMarkdown

更新时间:2023-12-06 17:07:22

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

you can use \newline in the Rmd file as follows:

---
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

如果您要问下一个问题,则新页面会稍微难一些.您将需要在标题5中创建一个新样式(例如),该样式会自动在新页面上启动,在Rmd文件中,您将标题5用作新行.网上有很多与此相关的资源.

In case you are going to ask next, newpage is slightly harder. You will need to create a new style in word for Heading 5 (for e.g.) which auto starts on a new page and in your Rmd file you will use heading 5 as your new line. there are quite a number of resources online regarding this though.