闪亮的应用程序! LaTeX错误:找不到文件unicode-math.sty [英] Shiny App ! LaTeX Error: File `unicode-math.sty' not found
问题描述
我创建了一个闪亮的应用程序,以使用knitr和rmarkdown生成可下载的pdf报告.
I created a shiny app to generate a downloadable pdf report with knitr and rmarkdown.
我能够在Rstudio中生成报告,但是当我尝试从应用程序生成报告时,出现此错误:
I am able to generate the report in Rstudio, but when I attempt to do so from the app, I get this error:
2020-04-22T19:40:03.590795+00:00 shinyapps[2124372]: cannot setup TLPDB in /home/shiny/texmf at /usr/bin/tlmgr line 5604.
2020-04-22T19:40:03.593636+00:00 shinyapps[2124372]: Warning in system2("tlmgr", args, ...) :
2020-04-22T19:40:03.593638+00:00 shinyapps[2124372]: running command ''tlmgr' search --file --global '/unicode-math.sty'' had status 2
2020-04-22T19:40:03.594869+00:00 shinyapps[2124372]: ! LaTeX Error: File `unicode-math.sty' not found.
2020-04-22T19:40:03.594871+00:00 shinyapps[2124372]:
2020-04-22T19:40:03.594872+00:00 shinyapps[2124372]: ! Emergency stop.
2020-04-22T19:40:03.594873+00:00 shinyapps[2124372]: <read *>
2020-04-22T19:40:03.594873+00:00 shinyapps[2124372]:
2020-04-22T19:40:03.597624+00:00 shinyapps[2124372]: Warning: Error in : LaTeX failed to compile /tmp/RtmpDEOSFT/fileca7f657fa3.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See fileca7f657fa3.log for more info.
2020-04-22T19:40:03.602043+00:00 shinyapps[2124372]: [No stack trace available]
调试提示建议重新安装tinytex,所以我尝试了这一点.我还分别将unicode-math.sty下载到我闪亮的应用程序文件夹中并进行了重新部署,但均无济于事.有什么建议吗?
The debugging tips suggested reinstalling tinytex so I tried that. I also downloaded unicode-math.sty individually to my shiny app folder and redeploying, but neither helped. Any suggestions?
推荐答案
我也遇到了同样的问题,但是找不到解决方案.请使用以下解决方案解决此问题.
I also faced the same issue and couldn't found the solution. Please use the below solution to resolve this problem.
转到您的tex软件包的安装文件夹,该文件夹很可能位于C:\ Users \ vksharma \ AppData \ Roaming \ TinyTeX \ texmf-dist \ tex \ latex \ unicode-math中.复制所有四个文件,即
Go to the folder where your tex packages are installed that would most probably be in C:\Users\vksharma\AppData\Roaming\TinyTeX\texmf-dist\tex\latex\unicode-math. Copy all the four files i.e.,
进入您的工作目录.然后编写以下代码,其中已绘制了markdown pdf:
into your working directory. Then write the following code wherein you have rendered the markdown pdf:
tempsty <- file.path(tempdir(), "unicode-math.sty")
file.copy("unicode-math.sty", tempsty, overwrite = TRUE)
tempxesty <- file.path(tempdir(), "unicode-math-xetex.sty")
file.copy("unicode-math-xetex.sty", tempxesty, overwrite = TRUE)
tempxesty1 <- file.path(tempdir(), "unicode-math-table.tex")
file.copy("unicode-math-table.tex", tempxesty, overwrite = TRUE)
tempxesty2 <- file.path(tempdir(), "unicode-math-luatex.sty")
file.copy("unicode-math-luatex.sty", tempxesty, overwrite = TRUE)
基本上,它的工作是将这些文件从您的工作目录复制到Shinyapps服务器的临时目录中,然后在渲染Markdown时搜索这些软件包并安装它们.
What it does basically is copy these files from your working directory to the temporary directory of the shinyapps server and then while rendering the markdown, it searched for these packages and install them.
快乐编码!
这篇关于闪亮的应用程序! LaTeX错误:找不到文件unicode-math.sty的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!