我正在寻找在 PDF 文档中使用rmarkdown
,knitr
和pander
. 该表应与下面显示的表 1 几乎相同,但星号应为项目符号。仅使用上面列出的库是否有可能R
?
这是我生成 PDF 文档的代码(以及上表):
---
title: "xxx"
author: "xxx"
date: "xxx"
output:
word_document: default
pdf_document:
fig_height: 4
fig_width: 10
highlight: tango
geometry: margin=3cm
---
```{r global_options, include=FALSE, echo=FALSE}
require(knitr)
opts_chunk$set(fig.width=8, fig.height=4, fig.path='figs/', dpi=500,
echo=FALSE, warning=FALSE, message=FALSE, results='hide')
```
```{r pandoc_options, include=FALSE, echo=FALSE}
require(pander)
panderOptions('digits', 3)
panderOptions('round', 3)
panderOptions('keep.trailing.zeros', TRUE)
panderOptions('keep.line.breaks', TRUE)
```
```{r concepts, echo=FALSE}
mytable = data.frame(Concept = c("Decoded", "XXX"),
Description = c("
\\\n
\\\n * Founded in 2011
\\\n * * Offers workshops to take people from zero skills and knowledge in programming through to coding a multi-platform app using HTML, CSS and Javascript in a single day
\\\n * * Rave reviews", "XXX"),
Website = c("http://decoded.com/uk/","XXX"))
```
``` {r concepts_descriptions, results = 'asis'}
pandoc.table(mytable, style = "multiline", justify = "left", caption = "Concepts and Descriptions")
```
编辑@Roman 谢谢 - 但是,如果我只是替换,我会得到以下不太漂亮的表格(“句号”项目符号,格式不佳)......现在对我来说最重要的是列表附带的格式。谢谢!