Indent without adding a bullet point or number in RMarkdown

前端 未结 2 475
[愿得一人]
[愿得一人] 2021-01-13 00:37

I want to make an indented list, but I don\'t want it to have bullet points or numbers. I am using Rmarkdown in RStudio, and knitting to html.

#### bla bla         


        
相关标签:
2条回答
  • 2021-01-13 01:18

    If you want to change how a list looks and you're outputting to HTML, use css:

    ---
    title: "ListTest"
    output: html_document
    ---
    
    <style>
    .nobullet li {
      list-style-type: none;
    }
    </style>
    
    <div class="nobullet">
    * This list
    * Doesn't have bullets
    </div>
    
    * This list 
    * Is normal
    

    This won't work for other output formats.

    0 讨论(0)
  • 2021-01-13 01:26

    This can be achieved using Line Blocks which are built-in to the R Markdown syntax. If you want the indentation to be respected, you can start a line with |.

    This approach works across multiple output formats and doesn't require any additional CSS styling:

    ---
    output:
      html_document: default
      pdf_document: default
    ---
    
    Here is some text with no indentation
    
    |    A list
    |         A sublist
    |         Sublist Item 2
    |         Sublist Item 3
    
    0 讨论(0)
提交回复
热议问题