使用R Markdown在PDF中的第一行段落缩进 [英] First-line paragraph indenting in PDFs using R Markdown

查看:501
本文介绍了使用R Markdown在PDF中的第一行段落缩进的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望这是一个简单答案的问题.我正在使用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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆