gfmg1992
gfmg1992

Reputation: 99

! Missing $ inserted R markdown

I had running scripts in R Markdown to produce .pdf documents that included figures in the outputs. I have run them for a while with no issues.

After updating to RStudio 1.4, I am getting the following error when trying to create the .pdf output using Rmarkdown:

! Missing $ inserted.
<inserted text> 
                $
l.225 ...files/figure-latex/unnamed-chunk-6-1.pdf}

As suggested in https://yihui.org/tinytex/r/#debugging, I have followed the steps updating my R packages and tinytex, but the issue persist.

Any ideas what is generating this issue and if it is related to the update to RStudio 1.4?

Thanks

Upvotes: 1

Views: 4456

Answers (1)

Vons
Vons

Reputation: 3325

You have latex that isn't properly closed. This generates the same error. A donut will cost you $5 \int with tax.

If your intention was to make latex, you gotta close the expression with another $. Or if it wasn't, you gotta escape the backslash with another backslash. \\int.

Upvotes: 2

Related Questions