0

我的目标是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 
4

1 回答 1

0

刚刚发现双引号可以用反斜杠转义\"

于 2012-08-25T06:58:46.540 回答