title: How to compile a pdf in RStudio Markdown?
body: <p>I've just installed RStudio and I want to knit a pdf document and I get this error message red:</p>
  <blockquote>
  <p>Error: LaTeX failed to compile
  diapositivas-PRYE-bugfac8d2bfe22dfde4bdebadc8cd65b2798b315d7788f1f7bef1c4c579a8d5f325.tex.
  See <a href="https://yihui.org/tinytex/r/#debugging" rel="nofollow noreferrer">https://yihui.org/tinytex/r/#debugging</a> for debugging tips. Además:
  Warning messages: 1: In system2(..., stdout = if (use_file_stdout())
  f1 else FALSE, stderr = f2) :   '&quot;pdflatex&quot;' not found 2: In
  system2(...) : '&quot;pdflatex&quot;' not found Ejecución interrumpida</p>
  <p>No LaTeX installation detected (LaTeX is required to create PDF
  output). You should install a LaTeX distribution for your platform:
  <a href="https://www.latex-project.org/get/" rel="nofollow noreferrer">https://www.latex-project.org/get/</a></p>
  <p>If you are not sure, you may install TinyTeX in R:
  tinytex::install_tinytex()</p>
  <p>Otherwise consider MiKTeX on Windows - <a href="http://miktex.org" rel="nofollow noreferrer">http://miktex.org</a></p>
  <p>MacTeX on macOS - <a href="https://tug.org/mactex/" rel="nofollow noreferrer">https://tug.org/mactex/</a>   (NOTE: Download with
  Safari rather than Chrome <em>strongly</em> recommended)</p>
  <p>Linux: Use system package manager</p>
  </blockquote>
  <p>I've tried installing the &quot;knitr&quot; package, and run this:</p>
  <pre><code>install.packages(&quot;knitr&quot;)
  library(knitr)
  tinytex::install_tinytex()
  </code></pre>
  <p>but still getting the same error.</p>
  <p>Thanks in advance for any help,</p>
  <p>Ivan.</p>