如何强制在降价标题中换行?

时间:2015-03-06 08:46:06

标签: r r-markdown

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

最小例子:

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

我试过:\ n,\ newline,\\和手动换行符。他们似乎都没有工作。

我认为它必须非常直截了当,但我无法找到解决方案。

3 个答案:

答案 0 :(得分:48)

尝试在每一行中使用管道|

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

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

enter image description here

答案 1 :(得分:3)

对于中心的多行标题:

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

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

enter image description here

答案 2 :(得分:0)

我知道这是一篇旧文章,但我想了解一下:

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

# Another title that has 5 blank lines above it

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

相关问题