我的目标是通过Rscript
从.Rnw文件中调用SweavePDF
,设置如下:
(add-hook 'Rnw-mode-hook
(lambda ()
(add-to-list 'TeX-command-list
'("SweavePDF" "Rscript -e 'patchDVI::SweavePDF('%t', encoding='utf8')'"
TeX-run-command nil t :help "Run SweavePDF") t)
(setq TeX-command-default "SweavePDF")))
如何正确调用R脚本Rscript
?带引号的东西似乎没有按预期工作:?
Running `SweavePDF' on `ch03_copula' with ``Rscript -e 'patchDVI::SweavePDF('ch03_copula.Rnw', encoding='utf8')''
/bin/sh: 1: Syntax error: Unterminated quoted string
SweavePDF exited abnormally with code 2
答案 0 :(得分:0)
刚发现双引号可以使用反斜杠\"