我的目标是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")))
如何Rscript
正确调用 R 脚本?带引号的东西似乎没有按预期工作:?
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