如何在 rmarkdown 的标题中强制换行?

How can I force a line break in rmarkdown's title?

我在 rmarkdown 文档中有一个很长的标题,我想在特定位置强制换行。

最小示例:

---
title: "Quite long title want the * line break at the asterisk"
output: html_document
---

我尝试过:\n、\newline、\\ 和手动换行符。 None 其中似乎有效。

我相信它必须非常简单,但我一直无法找到解决方案。

尝试在每行中使用管道 |

---
title: |
  | Veryyyyyyy  
  | yyyyyyyyyyyyyy Looooo  
  | oooooooooooooooo
  | oooooooooooong 

author: "Foo Bar"
date: "6 March 2015"
output: html_document
---

对于居中的 multi-line 标题:

---
title: |
  <center> Veryyyyyyy </center>
  <center> yyyyyyyyyyyyyy Looooo </center>
  <center> oooooooooooooooo </center>
  <center> oooooooooooong </center>

author: "Foo Bar"
date: "6 March 2015"
output: html_document
---

我知道这是一个旧的 post,但我想插话:

# A Title of some kind
<br><br><br><br><br>  

# Another title that has 5 blank lines above it

请注意,第 3 行需要 2 个空格,否则标题将无法在 Rmarkdown::html_document 中正确显示。这个解决方案有点难找,希望对你有帮助!