使用 R Markdown 在 PDF 中缩进第一行段落 [英] First-line paragraph indenting in PDFs using R Markdown
问题描述
我希望这是一个简单回答的问题.我正在使用 Rmarkdown/knitr 来创作 PDF 文档(在 RStudio 中).许多 LaTeX 类(如文章)会自动缩进一段文本的第一行,但 Rmarkdown 不会,我也找不到这样做的方法.
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 the first line of a paragraph of text, but Rmarkdown does not, nor can I figure out a way to do so.
这是一个简单的例子:
---
title: "minimal"
author: "prison rodeo"
output: pdf_document
---
This is an R Markdown document.
I would like this paragraph to be first-line indented, but it is not.
使用 > 缩进整个段落,这不是我想要的.我在每个段落的开头尝试了空格/制表符,并使用 indent;两者似乎都不起作用.有什么想法吗?
Using > indents the entire paragraph, which is not what I'm looking for. I've tried spaces/tabs at the beginning of each paragraph, and using indent; neither seems to work. Any ideas?
推荐答案
默认 Pandoc 模板包含一个 indent
参数.如果设置为 true
,段落以缩进开始.
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
----
这篇关于使用 R Markdown 在 PDF 中缩进第一行段落的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!