I created a shiny app to generate a downloadable pdf report with knitr and rmarkdown.
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]
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.
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.,
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)
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.
Happy Coding!
Related
I have installed Zim on my MacBook. I already have Latex installed. When I try to add the "Insert Equation" plugin, the following errors are shown:
Dependencies
latex - Failed
dvipng - Failed
It is worth mentioning that when I type "latex" or "dvipng" in the terminal, I see that the corresponsing program is called. So, the installation of Latex seems fine.
How to solve this issue?
I am unable to knit thesis and articles since I have updated Rstudio and some of the packages under a project (git version). I keep getting the following error. I have tried solving the issue reinstalling the packages, R, Rtools and Rstudios. However, the error still persists.
Error in system.file(..., package = package, mustWork = mustWork) :
no file found
Calls: ... lua_filter -> -> pkg_file -> system.file
Execution halted
Any assistance with the issue would be great. Thanks
I am about to begin a project with Shiny (by RStudio). When I try to install the shiny package using the console install.packages("shiny"), I get the following error message:
trying URL 'http://cran.rstudio.com/bin/macosx/mavericks/contrib/3.1/shiny_0.10.1.tgz'
Warning in install.packages :
cannot open: HTTP status was '404 Not Found'
Error in download.file(url, destfile, method, mode = "wb", ...) :
cannot open URL'http://cran.rstudio.com/bin/macosx/mavericks/contrib/3.1/shiny_0.10.1.tgz'
Warning in install.packages :
download of package ‘shiny’ failed
I have tried to install it from the drop down menu in RStudio but have encountered the same problem. Any thoughts as to what is going on?
I am working on Mac, with the latest version of Mavericks (R version is 3.1.1).
Thanks,
Brian
Try a different CRAN mirror. The error indicates that the file was not found on the CRAN server
chooseCRANmirror()
shiny has just been updated 2014-10-01 so the changes may not have propagated down to all mirrors yet.
I am trying to create a RMarkdown document with RStudio using shiny server. It works fine if the ouptut is pdf but if I want it as html I get this following error at the end of the process (in the RMarkdown console I can see it reached 100%).
Error: unrecognized fields specified in html_dependency: attachment
I have no idea why this error is happening.
Can anyone help me with this?
Thank you
I had a similar problem and found that it was caused by RStudio attempting to use Knitr to build a Shiny page. You can fix this by running using rmarkdown::run() instead of rmarkdown::render(). In some older versions of RStudio, the "Knit html" button runs this:
rmarkdown::render('filename.Rmd', 'html_document')
whereas, you can get the the results you want by running this command instead:
rmarkdown::run('filename.Rmd')
You could use this command or just update to the latest version of RStudio.
There is more info about authoring Shiny document here: http://rmarkdown.rstudio.com/authoring_shiny.html.
This is caused by a recent update of the relevant rmarkdown package or related ones.
Update RStudio to the latest version and then the error should disappear. It worked in my case.
Updating RStudio didn't work for me. What did work was updating all R packages (Tools > Check for Package Updates...).
I recently downloaded the libcurl package in .zip format into my downloads directory.
On R I click 'Install packages from local zip file'
I find my zip file and get the following error:
utils:::menuInstallLocal()
Error in read.dcf(file.path(pkgname, "DESCRIPTION"), c("Package", "Type")) :
cannot open the connection
In addition: Warning message:
In read.dcf(file.path(pkgname, "DESCRIPTION"), c("Package", "Type")) :
cannot open compressed file 'libcurl/DESCRIPTION', probable reason 'No such file or directory'
libcurl is not an R package. You need to install it on your machine with whatever system resources are appropriate. (The R package, RCurl does require that libcurl be present.)
http://curl.haxx.se/libcurl/
You should probably edit the tags to include your OS and remove the zip, r and local tags, ... oh heck, I'll do the second part.