I'm trying to knit an Rmd to pdf from a script so I can set an AWS service to generate reports, problem is, within Rstudio (knit button) it works fine but if I try to generate the document using rmarkdown::render('diagnostic.Rmd',output_format = pdf_document(latex_engine = "pdflatex"), output_file = "diagnostique.pdf")
I get this error:
! Missing $ inserted.
<inserted text>
$
l.141 \$\ge
pandoc: Error producing PDF
Error: pandoc document conversion failed with error 43
Note that I'm using engine = pdflatex
which produces the results I want, I've also tried xelatex
and lualatex
with success using lualatex
with a huge cost in quality (reports generated with lualatex do not compile as expected).
I have looked everywhere for this missing $
without finding the mistake.
Any advice on where to search or what to do would be much appreciated.