Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shiny App ! LaTeX Error: File `unicode-math.sty' not found #205

Closed
3 tasks done
jvanzalk opened this issue Apr 28, 2020 · 10 comments
Closed
3 tasks done

Shiny App ! LaTeX Error: File `unicode-math.sty' not found #205

jvanzalk opened this issue Apr 28, 2020 · 10 comments

Comments

@jvanzalk
Copy link

Hi,

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]

You can find my code at github.com/jvanzalk/easy-engagement-reports

Here's the link to my post on stackoverflow: https://stackoverflow.com/questions/61374767/shiny-app-latex-error-file-unicode-math-sty-not-found

And, here is my session info:

R version 3.6.0 (2019-04-26)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.2 LTS, RStudio 1.2.1335

Locale:
  LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8        LC_COLLATE=C.UTF-8    
  LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8    LC_PAPER=C.UTF-8       LC_NAME=C             
  LC_ADDRESS=C           LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   

Package version:
  assertthat_0.2.1 cli_2.0.2        compiler_3.6.0   crayon_1.3.4     fansi_0.4.0      glue_1.4.0      
  graphics_3.6.0   grDevices_3.6.0  methods_3.6.0    rlang_0.4.5      rstudioapi_0.11  stats_3.6.0     
  tools_3.6.0      utils_3.6.0      xfun_0.13       

Thanks for your help and let me know if there's anything else that I can provide.


By filing an issue to this repo, I promise that

  • I have fully read the issue guide at https://yihui.org/issue/.
  • I have provided the necessary information about my issue.
    • If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
    • If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included xfun::session_info('tinytex'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: remotes::install_github('yihui/tinytex').
    • If I have posted the same issue elsewhere, I have also mentioned it in this issue.
  • I have learned the Github Markdown syntax, and formatted my issue correctly.

I understand that my issue may be closed if I don't fulfill my promises.

@zoushucai
Copy link

zoushucai commented May 10, 2020

I also encountered the same problem. The local Rstudio can run. The above error occurs when deploying the www.shinyapps.io
How can I solve it?

@yihui
Copy link
Member

yihui commented May 10, 2020

This is more of a ShinyApps.io issue. Please keep an eye on this thread on the support forum: https://community.rstudio.com/t/58425 Thanks!

@jvanzalk
Copy link
Author

@yihui thanks for reaching out to someone on the shiny apps team for us. @zoushucai, in the thread that yihui shared, the issue was resolved by creating a template. I just tried it and it worked for me too! Still interested in seeing what Josh's response is.

@jvanzalk
Copy link
Author

jvanzalk commented May 29, 2020 via email

@urwa
Copy link

urwa commented May 30, 2020

Thanks for the above. This is very helpful.

@vishalsharma3003
Copy link

Hello All,

I have provided the solution for this problem at stackoverflow link. Please follow: https://stackoverflow.com/questions/61374767/shiny-app-latex-error-file-unicode-math-sty-not-found/63301857#63301857

Regards,
Vishal

@reyar
Copy link

reyar commented Dec 21, 2020

rmarkdown 1.15 + latex_engine: xelatex + shinyapps.io does work

rmarkdown >1.15 + latex_engine: xelatex + shinyapps.io does not work (adding a template.tex or the .sty files currently does not work)

Please check also rstudio/shinyapps-package-dependencies#230

@yihui
Copy link
Member

yihui commented Jan 4, 2021

rstudio/shinyapps-package-dependencies#230 has been fixed. Hopefully texlive-math-extra will be installed on ShinyApps.io soon. Thanks!

@yihui yihui closed this as completed Jan 4, 2021
@nicocriscuolo
Copy link

nicocriscuolo commented Jun 18, 2021

Hello everyone. Even though, according to the latest posts, this issue seems to be solved on shinyapps.io, from my shiny app (deployed there) I am still not able to produce a PDF from an .Rmd file embed in the application if the version of the rmarkdown package is higher than 1.15 and the latex engine is xelatex.

When I have this version installed, everything works fine, even though I get the following warning when the application starts:

This version of bslib is designed to work with rmarkdown version 2.7 or higher

If, however, I try to install the latest version of rmarkdown my PDF report is not produced and I get the following LaTeX error:

! LaTeX Error: Missing \begin{document}.
Warning: Error in : LaTeX failed to compile /var/folders/f9/8lfgdj3d5s1dbzsbtscxg9w80000gp/T//RtmpWVpFWz/file10d19ca31140.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See file10d19ca31140.log for more info. [No stack trace available]

Any idea on how to solve this? Thank you for your help!

@cderv
Copy link
Contributor

cderv commented Jun 22, 2021

Hi @nicocriscuolo,

Thanks for reaching out. Please next time open a new issue when yours is not directly related. It is always better to open a new issue, and referenced another that commenting on a closed thread.

I moved your comment into an issue and we can follow up there. thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants