【发布时间】:2020-01-06 17:35:47
【问题描述】:
我使用 tineytex 包,当我单击 rStudio 中的 knit 按钮时,编织 pdf 没有问题。但是,当我使用相同的 .Rmd 文件作为输入调用 rmarkdown::render() 时,目标文件夹中只生成了一个中间的 .tex 文件。
下面是我的代码。
rmarkdown::render(input = "C:/Users/sqhuang/Pdf.Rmd",
output_format = "pdf_document",
output_file = "test.pdf",
output_dir = ot_path)
以下是我收到的错误消息。
处理文件:Pdf.Rmd
|......... | 14%
ordinary text without R code
|................... | 29%
label: setup (with options)
List of 1
$ echo: logi FALSE
|............................ | 43%
ordinary text without R code
|..................................... | 57%
label: cars
|.............................................. | 71%
ordinary text without R code
|........................................................ | 86%
label: pressure (with options)
List of 1
$ echo: logi FALSE
|.................................................................| 100%
ordinary text without R code
输出文件:Pdf.knit.md
"C:/PROGRA~1/Pandoc/pandoc" +RTS -K512m -RTS Pdf.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output pandoc15f027594a1c.tex --template "C:\PROGRA~1\R\R-36~1.1\library\RMARKD~1\rmd\latex\DEFAUL~3.TEX" --highlight-style tango --pdf-engine pdflatex --variable graphics=yes --variable "geometry:margin=1in" --variable "compact-title:yes" 这是 pdfTeX,版本 3.14159265-2.6-1.40.20 (TeX Live 2019/W32TeX) (预加载格式=pdflatex)限制\write18 启用。警告: kpathsea: //enterprise2/Users4$/Sqhuang_a/My Documents: Unrecognized 变量构造
$/'. warning: kpathsea: //enterprise2/Users4$/Sqhuang_a/My Documents: Unrecognized variable construct$/'。警告:kpathsea://enterprise2/Users4$/Sqhuang_a/My 文档:无法识别的变量构造$/'. warning: kpathsea: //enterprise2/Users4$/Sqhuang_a/My Documents/.TinyTeX/texmf-config/web2c/pdftex: Unrecognized variable construct$/'。警告:kpathsea://enterprise2/Users4$/Sqhuang_a/My Documents/.TinyTeX/texmf-var/web2c/pdftex:无法识别的变量 构造$/'. warning: kpathsea: //enterprise2/Users4$/Sqhuang_a/My Documents/.TinyTeX/texmf-home/web2c/pdftex: Unrecognized variable construct$/'。警告:kpathsea://enterprise2/Users4$/Sqhuang_a/My Documents/.TinyTeX/texmf-config/web2c:无法识别的变量构造$/'. warning: kpathsea: //enterprise2/Users4$/Sqhuang_a/My Documents/.TinyTeX/texmf-var/web2c: Unrecognized variable construct$/'。警告:kpathsea://enterprise2/Users4$/Sqhuang_a/My Documents/.TinyTeX/texmf-home/web2c:无法识别的变量构造 `$/'。进入扩展模式错误:编译失败 \endeavor/apps_doc$/Applications/0_Support/GCS/Brett - 其他 职责/BAR/Steph/AL/Jul/test_report.tex。看 https://yihui.name/tinytex/r/#debugging 获取调试提示。
【问题讨论】:
-
我在我的 .Rmd 文件代码主干中添加了以下内容:options(tinytex.verbose = TRUE)。但是,没有给出关于错误的太多细节。我也在互联网上搜索,发现有人在 Rstudio 论坛上发布了相同的问题,但问题没有解决。有没有人遇到这个问题并解决了这个问题?非常感谢任何获得有关该问题的更多信息的指针。
-
在呈现同一报表的 HTML 版本时,render() 也失败了。但是,这次我获得了有关该错误的更多信息。 render() 函数有问题的是合作共享驱动器:它无法正确解释包含
$的共享驱动器路径。一旦我将输出目录更改为 C 驱动器,报告的 pdf 和 html 版本都会被渲染。 -
(仅作记录)在这里提出了类似的问题:github.com/yihui/tinytex/issues/150 但我没有解决方案。
标签: r-markdown render tinytex