如果您查看knit2html帮助页面,您将看到:
This is a convenience function to knit the input markdown source and
call ‘markdownToHTML()’ in the ‘markdown’ package to convert the
result to HTML.
然后你看看markdownToHTML帮助页面,并阅读有以下参数:
options: options that are passed to the renderer. see
‘markdownHTMLOptions’.
所以你看看markdownHTMLOptions(还没丢失?),看看下面的选项:
‘'base64_images'’ Any local images linked with the ‘''’ tag
to the output HTML will automatically be converted to base64
and included along with output.
使用以下命令,您应该会看到系统上的默认选项:
R> markdownHTMLOptions(default=TRUE)
[1] "use_xhtml" "smartypants" "base64_images" "mathjax"
[5] "highlight_code"
所以可能你可以尝试编织你的markdown文件:
knit2html("knit.Rmd",options=c("use_xhtml","smartypants","mathjax","highlight_code"))
没有测试,虽然…