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

前端 未结 3 1186
伪装坚强ぢ
伪装坚强ぢ 2020-11-29 03:37

I have a quite long title in a rmarkdown document and I would like to force a line break in a specific position.

Minimum example:

---
title: \"Quite          


        
相关标签:
3条回答
  • 2020-11-29 03:51

    Try using a pipe | in each line:

    ---
    title: |
      | Veryyyyyyy  
      | yyyyyyyyyyyyyy Looooo  
      | oooooooooooooooo
      | oooooooooooong 
    
    author: "Foo Bar"
    date: "6 March 2015"
    output: html_document
    ---
    

    enter image description here

    0 讨论(0)
  • 2020-11-29 03:55

    I know that this is an old post, but I wanted to chime in with:

    # A Title of some kind
    <br><br><br><br><br>  
    
    # Another title that has 5 blank lines above it
    

    Note that you need 2 spaces on line 3 or the title will not display properly in Rmarkdown::html_document. This solution is a little hard to find, hope it helps!

    0 讨论(0)
  • 2020-11-29 04:09

    For a centered, multi-line title:

    ---
    title: |
      <center> Veryyyyyyy </center>
      <center> yyyyyyyyyyyyyy Looooo </center>
      <center> oooooooooooooooo </center>
      <center> oooooooooooong </center>
    
    author: "Foo Bar"
    date: "6 March 2015"
    output: html_document
    ---
    

    0 讨论(0)
提交回复
热议问题