首页 > 解决方案 > 我们如何编程 statet 以同时使用 knitr 和 pdflatex

问题描述

在 statet4.0 的新版本中,我想找到一种方法来配置 sweave 以同时使用 knitr 和 pdflatex 运行。

在 external tool configuration > sweave Document processing 中有一个使用示例,tools::texi2dvi(file= "${resource_loc}", pdf= TRUE)我应该如何配置使用 pdflatex ?

在此处输入图像描述

标签: rknitrstatet

解决方案


乳胶文件

我已经将 R Weave 配置设置为生成tex.tex不仅仅是 tex) R编织配置 然后我使用了

system2(command='pdflatex', args=c('-interaction=nonstopmode','-synctex=1','${resource_loc}')). 

在这里,我尝试设置一个stdinandstout参数但没有成功,但在 Windows 下可能存在问题,正如那里指出的那样: https ://github.com/rstudio/rstudio/issues/2446 。最后将文件的路径${resource.loc}作为最后一个参数效果很好。

在此处输入图像描述


推荐阅读