HTML outputs are different between using knitr in Rstudio & knit2html in command line

旧城冷巷雨未停 提交于 2019-12-07 02:26:58

问题


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

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

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

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...

Basically, the major difference are :

1) code chunks and outputs have smoother edges

2) header is included.

3) Font sizes


回答1:


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.



来源:https://stackoverflow.com/questions/25576095/html-outputs-are-different-between-using-knitr-in-rstudio-knit2html-in-command

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!