title: can't knit Rmd file to a pdf
body: <p>I'm trying to knit Rmd file to pdf. I get the following error:</p>
  <pre><code>Error: LaTeX failed to compile test.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips.
  In addition: Warning message:
  In system2(..., stdout = if (use_file_stdout()) f1 else FALSE, stderr = f2) :
    '&quot;pdflatex&quot;' not found
  Execution halted
  
  No LaTeX installation detected (LaTeX is required to create PDF output). You should install a LaTeX distribution for your platform: https://www.latex-project.org/get/
  
    If you are not sure, you may install TinyTeX in R: tinytex::install_tinytex()
  
    Otherwise consider MiKTeX on Windows - http://miktex.org
  
    MacTeX on macOS - https://tug.org/mactex/
    (NOTE: Download with Safari rather than Chrome _strongly_ recommended)
  
    Linux: Use system package manager
  
  </code></pre>
  <p>When I try <code>tinytex::install_tinytex()</code>, I get:</p>
  <pre><code>trying URL 'https://yihui.org/tinytex/TinyTeX-1.zip'
  Content type 'text/html' length 4305 bytes
  downloaded 4305 bytes
  
  Error in system2(&quot;tlmgr&quot;, args, ...) : '&quot;tlmgr&quot;' not found
  In addition: Warning message:
  In extract(pkg, exdir = path.expand(target)) :
    error 1 in extracting from zip file
  </code></pre>
  <p>Trying <code>tinytex::reinstall_tinytex()</code>, gets me:</p>
  <pre><code>Error in system2(&quot;tlmgr&quot;, args, ...) : '&quot;tlmgr&quot;' not found
  </code></pre>
  <p>Trying <code>tinytex::uninstall_tinytex()</code> gets me:</p>
  <pre><code>Error in tinytex::uninstall_tinytex() : 
    TinyTeX does not seem to be installed.
  </code></pre>
  <p>Please help because I need to compile my Rmd to pdf.</p>
  <p>UPDATE: Added this section (see comment thread for more info)</p>
  <p><code>xfun::session_info()</code></p>
  <p>Returns:</p>
  <pre><code>R version 4.1.2 (2021-11-01)
  Platform: x86_64-w64-mingw32/x64 (64-bit)
  Running under: Windows 10 x64 (build 18363), RStudio 2021.9.0.351
  
  Locale:
    LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
    LC_NUMERIC=C                           LC_TIME=English_United States.1252    
  
  Package version:
    base64enc_0.1.3 compiler_4.1.2  digest_0.6.28   evaluate_0.14   fastmap_1.1.0   glue_1.4.2      graphics_4.1.2  grDevices_4.1.2 highr_0.9      
    htmltools_0.5.2 jquerylib_0.1.4 jsonlite_1.7.2  knitr_1.36      magrittr_2.0.1  methods_4.1.2   rlang_0.4.12    rmarkdown_2.11  stats_4.1.2    
    stringi_1.7.5   stringr_1.4.0   tinytex_0.35    tools_4.1.2     utils_4.1.2     xfun_0.27       yaml_2.2.1   
  </code></pre>
  <p>Thank you!</p>