Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trouble with using Latex with R markdown

Hey I'm trying to use some latex in an R markdown file but I'm getting this error:

Try other LaTeX engines instead (e.g., xelatex) if you are using pdflatex. For R Markdown users, see https://bookdown.org/yihui/rmarkdown/pdf-document.html

Error: Failed to compile M5_collab.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips. See M5_collab.log for more info. In addition: There were 33 warnings (use warnings() to see them) Execution halted

I've checked out the bookdown website and I've installed tinytex

install.packages("tinytex")

Can someone let me know what's going wrong? How can I solve this?

Thank you

like image 658
JKong Avatar asked Oct 07 '19 04:10

JKong


1 Answers

I had the same problem as you.

In my case I wanted to generate a pdf file and received this message you received.

I solved the problem of defining latex_engine as follows:

---
title: "Report"
output:
  pdf_document:
    latex_engine: xelatex
---
like image 177
M.Souza Avatar answered Oct 05 '22 06:10

M.Souza