【问题标题】:exporting of .Rmd file in Emacs polymode does not work在 Emacs 多模式中导出 .Rmd 文件不起作用
【发布时间】:2019-01-16 16:01:33
【问题描述】:

我正在尝试使用 Emacs 中的 polymode 将文件 template.Rmd(可用 here)导出为 pdf。我选择 Rmarkdown-ESS 导出器。按 M-n e 并选择 pdf 作为输出格式后,编织似乎一切正常,但 Pandoc 调用抛出以下错误消息:

! Package pdftex.def Error: File "/path/template{[}exported{]}_files/figure-latex/unnamed-chunk-2-1.pdf" not found.(用简单而不是双引号。)

确实,我在工作目录附近的任何地方都找不到这样的文件。

M-n e 执行的命令rmarkdown::render() 的参数之一是output_file = "/path/template[exported].pdf"(再次使用简单的引号)。当我将其修改为 output_file = "/path/template.pdf" 时,一切正常。

所以问题似乎是 polymode 对输出文件的默认命名。这怎么能改变?谢谢!

迈克尔

【问题讨论】:

    标签: emacs r-markdown knitr


    【解决方案1】:

    查看.el file,可以通过添加来更改:

    (defcustom polymode-exporter-output-file-format "%s"
      "Format of the exported files.
    %s is substituted with the current file name sans extension."
      :group 'polymode-export
      :type 'string)
    

    到初始化文件。

    默认情况下,%s 似乎被%s[exported] 替换,其中%s 是要导出的文件的名称。

    【讨论】:

    • 这太棒了。谢谢。 Polymode 的开发人员 Vitalie Spinu 写道,问题在于 Pandoc,它显然无法正确识别文件名中的[]。 Vitalie 将输出格式更改为"%s-exported",这对我来说很好。
    猜你喜欢
    • 2014-04-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-08-23
    • 2016-09-30
    • 2014-12-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多