带有变音符号的Knitr和R Markdown文档 [英] Knitr and R markdown doc with diacritics

查看:80
本文介绍了带有变音符号的Knitr和R Markdown文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人对R包Knitrmarkdown以及变音符号的使用有经验吗?是否可以用另一种语言编写,而输出仍为pdf?

Has someone experience with R packages Knitr and markdown and working with diacritics? Is it possible to write in another language and still have the output in pdf?

knitr Html转换器knit2html不允许我转换R markdown文档,并因此使用pandoc将其转换为pdf.

The knitr Html converter knit2html won't let me to convert the R markdown document and consequently convert it into pdf with pandoc.

推荐答案

以下文件没有问题:

Test rmd with diacritical marks
=============

Hello: Dvořak, müsli, éèô


```{r}
exp(pi)
```

从命令行:

Rscript -e "library('knitr'); knit('tmp.rmd')"
pandoc -o tmp.pdf tmp.md

关键点可能是您需要编织(将rmd转换为md),然后运行pandoc:请勿尝试转换为HTML,然后转换为PDF ...

The key point may be that you need to knit (to convert rmd to md), then run pandoc: don't try to convert to HTML and thence to PDF ...

这篇关于带有变音符号的Knitr和R Markdown文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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