在RMarkdown输出到PDF的过程中,如何进行缩进但不加入项目符号或编号?

7
1个回答

11

更新::

行块可用于强制R Markdown遵循缩进。 这对多输出格式有效。

---
output: 
    pdf_document
---

This is normal text.

|        Item 1
|        Item 2
|        Item 3

More Text

Translated Answer:

如果我们要将内容写入PDF文件,可以在.Rmd文件中使用LaTeX代码来扩展Markdown的功能。Pandoc会在将文件转换为LaTeX文件时同时遵循LaTeX和RMarkdown格式。

以下是一些不需要安装额外LaTeX包的例子:

---
title: "Untitled"
output: 
    pdf_document
---

This is normal text. If we want to indent a paragraph we could change the size of the left margin:

\setlength{\leftskip}{2cm}

Items 1

Item 2

Item 3

\setlength{\leftskip}{0pt}

Or we can make a list and suppress the items. 

\begin{itemize}
  \item[] First.
  \item[] Second.
\end{itemize}

enter image description here


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接