Reputation: 290
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.
Upvotes: 0
Views: 425
Reputation: 81
The error is TeX's error.
So, line 141 mean line 141 of TeX file, not Rmd file.
Keep your intermediate TeX file and check line 141 of it.
YAML front matter is like this:
---
title: "Title"
output:
pdf_document:
keep_tex: true
---
http://rmarkdown.rstudio.com/pdf_document_format.html#keeping_intermediate_tex
Upvotes: 1