-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
xelatex
rendering issue on shinyapps.io
#317
Comments
Hi @nicocriscuolo, First, about the warning on bslib, are you trying to use bslib ? Or maybe you are using it while using last shiny, this warning is thrown because a very old rmarkdown is used. Regarding the LaTeX error, have you looked into the log file ?
This seems to indicate that there is an issue in the generated tex file. There should be a I really don't think this is a tinytex issue, but I will leave this issue here for now. For shinyapps.io supports, know that there are some options: https://shiny.rstudio.com/help/
Anyway, I don't have the answer. I'll asked around. If you can get some more information from log file in the meantime it would be great. It would be interesting to see the version of Pandoc there. And as always, if you can share a reproducible example, this would greatly help to look into this. Thanks ! |
Hello @cderv and thank you for creating this new issue for my problem. I've tried to isolate my error, and I found out that this happens in the YAML. Please find here a minimal reproducible example of my code (adapted to produce just a simple plot). I haven't inserted the code here since the chunks' symbols of R Markdown make it difficult to understand how the code is structured. When I try to produce the report (also with this simple code) through the shiny application with the 1.15 version of rmarkdown, everything works fine. However, when I have the 2.9 version of rmarkdown installed, I got the error described in my previous comment. Please find below the logs of my shinyapps.io session to check the pandoc version: 2021-07-08T13:59:53.013350+00:00 shinyapps[1099846]: Starting R with process ID: '43' Thank's a lot for your help! |
Thanks a lot for the example ! I'll have a look Sharing here the content of the Rmd file so that it is quicker to check this: ---
output:
pdf_document:
keep_tex: true
latex_engine: xelatex
header-includes:
- |
```{=latex}
\usepackage{microtype}
\usepackage{fontspec}
\usepackage{ragged2e}
\renewcommand{\footnotesize}{\scriptsize \justify}
\usepackage{setspace}
\usepackage{xcolor}
\definecolor{very-light-gray}{gray}{0.95}
\pagenumbering{gobble}
\makeatletter
\def\MT@is@composite#1#2\relax{%
\ifx\\#2\\\else
\expandafter\def\expandafter\MT@char\expandafter{\csname\expandafter
\string\csname\MT@encoding\endcsname
\MT@detokenize@n{#1}-\MT@detokenize@n{#2}\endcsname}%
% 3 lines added:
\ifx\UnicodeEncodingName\@undefined\else
\expandafter\expandafter\expandafter\MT@is@uni@comp\MT@char\iffontchar\else\fi\relax
\fi
\expandafter\expandafter\expandafter\MT@is@letter\MT@char\relax\relax
\ifnum\MT@char@ < \z@
\ifMT@xunicode
\edef\MT@char{\MT@exp@two@c\MT@strip@prefix\meaning\MT@char>\relax}%
\expandafter\MT@exp@two@c\expandafter\MT@is@charx\expandafter
\MT@char\MT@charxstring\relax\relax\relax\relax\relax
\fi
\fi
\fi
}
% new:
\def\MT@is@uni@comp#1\iffontchar#2\else#3\fi\relax{%
\ifx\\#2\\\else\edef\MT@char{\iffontchar#2\fi}\fi
}
\makeatother
```
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE,
warning = FALSE,
message = FALSE,
fig.pos = "h",
dev = "cairo_pdf")
```
```{r}
library(ggplot2)
plot(cty ~ hwy,
data = mpg)
```
Check the issue guide for this: https://yihui.org/issue/#please-format-your-issue-correctly
I think the Pandoc version used on shinyapps.io will depend on the rmarkdown version you are using. i'll take that into accound while looking deeper into this. Thanks for the reprex. |
@cderv, thank you very much for your prompt response and for adapting the code for a GitHub post! Sorry, but I noticed that for the purpose of this post you can remove the line:
This .otf file is on my local machine. Thanks a lot for your help. |
Hello everyone. Even though, according to the latest posts, this issue (#205) 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 isxelatex
.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!
Originally posted by @nicocriscuolo in #205 (comment)
The text was updated successfully, but these errors were encountered: