问题描述
很抱歉,如果我在这里缺少一些信息。 我正在尝试从R Shiny和R Markdown渲染PDF,但始终收到此错误。整个过程确实是在HTML中运行的,但是我的想法是我可以导出PDF。
我尝试重新安装tinytex,安装MikTex,在Shiny中使用非临时设置,并在代码中使用options(tinytex.verbose = TRUE)
,但并没有提供问题出在哪里的任何提示。
"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS Consultants_normal.utf8.md --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output pandoc7ea82ffe49d2.tex --lua-filter "C:\Users\xxx\Documents\R\win-library\4.0\rmarkdown\rmarkdown\lua\pagebreak.lua" --lua-filter "C:\Users\xxx\Documents\R\win-library\4.0\rmarkdown\rmarkdown\lua\latex-div.lua" --self-contained --highlight-style tango --pdf-engine pdflatex --variable graphics --variable "geometry:margin=1in"
This is pdfTeX,Version 3.14159265-2.6-1.40.21 (TeX Live 2020/W32TeX) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
Warning: Error in : LaTeX Failed to compile C:\Users\xxx\AppData\Local\Temp\RtmpqUZDpX\file7ea82b6d767c.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips.
[No stack trace available]
这是我的Markdown文档的R Shiny输出:
output$ConsultantsReport <- downloadHandler(
# For PDF output,change this to "report.pdf"
filename = "report.pdf",content = function(file) {
# copy the report file to a temporary directory before processing it,in
# case we don't have write permissions to the current working dir (which
# can happen when deployed).
tempReport <- file.path(tempdir(),"Consultants_normal.Rmd")
file.copy("Consultants_normal.Rmd",tempReport,overwrite = TRUE)
# Set up parameters to pass to Rmd document
params <- list(Daterange1 = input$daterange[1],Daterange2 = input$daterange[2],ConsultantName = input$SelectedConsultantName,Data = MergedPaymentInfo())
# Knit the document,passing in the `params` list,and eval it in a
# child of the global environment (this isolates the code in the document
# from the code in this app).
rmarkdown::render(tempReport,output_file = file,params = params,envir = new.env(parent = globalenv())
)
}
)
这是R Markdown中的JML:
---
title: "Consultants Statement normal"
author: "xxx"
params:
Daterange1: NA,Daterange2: NA,ConsultantName: NA,Data: NA
output: pdf_document
---
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)