【发布时间】:2013-07-27 11:39:50
【问题描述】:
我正在尝试在 reports R 包中重现 tex2docx 函数的示例并收到以下错误。
DOC <- system.file("extdata/doc_library/apa6.qual_tex/doc.tex",
package = "reports")
BIB <- system.file("extdata/docs/example.bib", package = "reports")
tex2docx(DOC, file.path(getwd(), "test.docx"), path = NULL, bib.loc = BIB)
错误信息
pandoc.exe: Error reading bibliography `C:/Users/Muhammad'
citeproc: the format of the bibliographic database could not be recognized
using the file extension.
docx file generated!
Warning message:
running command 'C:\Users\MUHAMM~1\AppData\Local\Pandoc\pandoc.exe -s C:/Users/Muhammad Yaseen/R/win-library/3.0/reports/extdata/doc_library/apa6.qual_tex/doc.tex -o C:/Users/Muhammad Yaseen/Documents/test.docx --bibliography=C:/Users/Muhammad Yaseen/R/win-library/3.0/reports/extdata/docs/example.bib' had status 23
我想知道如何让reports R 包中的tex2docx 函数正常工作。
【问题讨论】:
-
我强烈怀疑您的文件路径中有空格问题。不过,除了在没有空格的文件路径中进行测试之外,不知道如何修复它。
-
你说得对@BenBolker,我的文件路径有空格。任何解决方法。
-
你也许可以破解包,让它在命令参数的相关组件周围加上引号。
-
您可以 ping @tyler-rinker 以在 github.com/trinker/reports/blob/master/R/tex2docx.R 中添加
shQuote -
我实际上不确定如何执行
shQuote,但如果这能解决问题,我将非常感谢有人提出请求。即使您更正了它,我也可以完成该文件中的其余功能。