First-line paragraph indenting in PDFs using R Markdown

后端 未结 3 1157
深忆病人
深忆病人 2021-01-02 08:49

I\'m hoping this is a question with a simple answer. I am using Rmarkdown/knitr to author a PDF document (in RStudio). Many LaTeX classes (like article) automatically indent

相关标签:
3条回答
  • 2021-01-02 08:58

    I believe the following in your YAML header will work the same and has the advantage of still compiling should you decide to knit your document to an HTML file (though, I haven't tested this).

    ----
    title: "Title"
    author: "Me"
    header-includes:
       - \setlength\parindent{24pt}
    output:
        pdf_document
    ----
    
    0 讨论(0)
  • 2021-01-02 09:14

    If what you're after happens to be the default settings in other regards as well, you might also be interested in setting the \parskip option to its default setting, since it is otherwise set to {6pt plus 2pt minus 1pt}

    header-includes:
       - \setlength\parindent{24pt}\setlength{\parskip}{0.0pt plus 1.0pt}
    
    0 讨论(0)
  • 2021-01-02 09:20

    The default Pandoc template includes an indent argument. If set to true, paragraphs start with an indentation.

    ----
    title: "Title"
    author: "Me"
    output: pdf_document
    indent: true
    ----
    
    0 讨论(0)
提交回复
热议问题