I have written a package in R, in that there is a function to compile .Rmd files to .pdf. The functionality enter code here of the function is as follows.
getPdf <- function(text){
writeLines(text, con="input.Rmd");
render("input.Rmd", bookdown::pdf_document2(toc = FALSE, fig_width=6,fig_height=4, fig_crop=FALSE, template="template01.tex", number_sections = FALSE))
}
This function works fine when I run locally.
I have installed this package into opencpu based docker image as I want to call this function through an API.
I have hosted opencpu instance in an EC2 and when I do the API call it gives me an error as follows.
LaTeX failed to compile input.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See input.log for more info.
When I log in to the docker image and if I run getPdf function directly through the console with the same input it works.
Do you have any idea?