在Rstudio&中使用knitr的HTML输出有所不同.命令行中的knit2html [英] HTML outputs are different between using knitr in Rstudio & knit2html in command line

查看:156
本文介绍了在Rstudio&中使用knitr的HTML输出有所不同.命令行中的knit2html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用knitr从R markdown文件生成html文档.

I am trying to generate html documents from R markdown files using knitr.

当我在R studio中使用knit html按钮时,它可以正常工作,并且可以得到所需的输出.

When I use the knit html button in R studio it works fine and it gets me the desired output.

但是,当我在命令行中使用knit2html()时,输出html的格式与从rstudio获得的格式不同(更漂亮).

However when I use knit2html() in the commandline, the formatting of the output html is different (less prettier) than that obtained from rstudio.

您能告诉我当按下编织的html按钮时使用的确切选项和功能是什么吗?

Can you tell me what are the exact options and functions that are being used when I press the knit html button?

我想添加图片,但是显然我的声誉"太低了...

I wanted to include images, but apparently my "reputation" is too low...

基本上,主要区别是:

1)代码块和输出的边缘更平滑

1) code chunks and outputs have smoother edges

2)标头包括在内.

3)字体大小

推荐答案

现在,RStudio默认使用 R Markdown v2 仍使用 R Markdown v1 . V2使用Pandoc和Twitter Bootstrap主题,这比v1中的样式漂亮.

Now RStudio uses R Markdown v2 by default, and knitr::knit2html() still uses R Markdown v1. V2 uses Pandoc and Twitter Bootstrap themes, which are prettier than the style in v1.

这篇关于在Rstudio&中使用knitr的HTML输出有所不同.命令行中的knit2html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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