I don't understand what I did wrong? - r

After compiling, I got the following messages:
Error message
Error: LaTeX failed to compile hw_ch_1_Hussein_Jafar.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips.
Warning message
In addition: Warning message:
In system2(..., stdout = if (use_file_stdout()) f1 else FALSE, stderr = f2) :
'"pdflatex"' 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

It seems that you don't have a Latex installation in your machine. I suppose you're running with a linux distribution, try from the terminal to install the complete texlive package to avoid potential issues related to Latex installation:
~$ sudo apt-get install texlive-full

Related

RMarkdown and tinytex: unable to print to PDF

I have installed tinytex into RStudio, and yet when I attempt tp knit to PDF, I get the following error message:
! Package pdftex.def Error: File `file:///C:/Users/benja/Documents/R/Images/Doc
1.png' not found: using draft setting.
Error: LaTeX failed to compile Speedy-Success.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See Speedy-Success.log for more info.
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
I have tried uninstalling tinytext and reinstalling it; no dice. I have made certain tinytext is loaded; nothing. Any suggestions are very welcome. Thank you.

How to compile a pdf in RStudio Markdown?

I've just installed RStudio and I want to knit a pdf document and I get this error message red:
Error: LaTeX failed to compile
diapositivas-PRYE-bugfac8d2bfe22dfde4bdebadc8cd65b2798b315d7788f1f7bef1c4c579a8d5f325.tex.
See https://yihui.org/tinytex/r/#debugging for debugging tips. Además:
Warning messages: 1: In system2(..., stdout = if (use_file_stdout())
f1 else FALSE, stderr = f2) : '"pdflatex"' not found 2: In
system2(...) : '"pdflatex"' not found Ejecución interrumpida
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
I've tried installing the "knitr" package, and run this:
install.packages("knitr")
library(knitr)
tinytex::install_tinytex()
but still getting the same error.
Thanks in advance for any help,
Ivan.
So you've tried this.
install.packages("knitr")
library(knitr)
tinytex::install_tinytex()
But try this instead. You need to have the tinytex package to use it's install function.
install.packages("knitr")
library(knitr)
install.packages("tinytex")
tinytex::install_tinytex()
I always run into that same problem. Try knitting it to .html, opening the .html file, and then exporting the .html file to pdf.

R markdown knit issue

I was trying to use Rmarkdown fro the first time to generate a pdf and got error messages.
I tried to download texlive from here http://www.tug.org/texlive/acquire-netinstall.html
" install-tl-unx.tar.gz (4mb) " but i don't quite get the instruction to install and not sure if it is the right solution for my issue.
Error I got:
! Package pdftex.def Error: File `http://www.compbio.dundee.ac.uk/user/pschofie
ld/Projects/teaching_pg//figures/openmarkdown.png' not found: using draft setti
ng.
Error: LaTeX failed to compile RNA-seq-Analysis-1---Introduction-to-R,-RStudio-and-Rmarkdown-.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See RNA-seq-Analysis-1---Introduction-to-R,-RStudio-and-Rmarkdown-.log for more info.
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

Knit to pdf error in R - Error: Failed to compile

Need help. I have installed tinytex, miktex
I get this error when I knit to pdf
output file: test_knit.knit.md
Error: Failed to compile test_knit.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips.
In addition: Warning message:
In system2(..., stdout = if (use_file_stdout()) f1 else FALSE, stderr = f2) :
'"pdflatex"' 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

Rstudio / pandoc issue - can't knit to HTML or PDF

I can't knit to HTML or PDF anymore, although it used to work just fine. Here's the error I keep getting:
pandoc: out of memory (requested 1048576 bytes)
Error in strsplit(version_info, "\n")[[1]] : subscript out of bounds
Calls: <Anonymous> ... pandoc_available -> find_pandoc -> lapply -> FUN -> get_pandoc_version
In addition: Warning message:
running command ''/usr/lib/rstudio/bin/pandoc/pandoc' --version' had status 1
Execution halted
I used to have Rstudio 0.999.903, which I uninstalled, I then installed 1.0.44 version, reinstalled the knitr package through Rstudio, but I'm getting this error again.
I installed pandoc 1.18-1 from the git repository using the debian package installer, same problem again.
I later updated Rstudio to version 1.0.136 and pandoc to version 1.19.2.1 and no change.
I tried uninstalling R and re-installing a more recent version, again with no success.
The command-line works:
library(rmarkdown)
rmarkdown::render("test.Rmd", "html_document")
--
I'm using Debian (LMDE2).
Finally I got it!
It seems this bug was described 2 years ago by Arch users here.
It seems this bug was introduced for me with Rstudio version 0.98+ in a Debian system (I use LMDE Betsy).
The pandoc version installed along with Rstudio doesn't work, and when I installed pandoc manually Rstudio would stick to using its own broken version. Anyway the workaround is to remove the executable pandoc from Rstudio distro, and symlink another version of pandoc instead:
apt-get install pandoc
rm /usr/lib/rstudio/bin/pandoc/pandoc
ln -s /usr/bin/pandoc /usr/lib/rstudio/bin/pandoc/pandoc
rm /usr/lib/rstudio/bin/pandoc/pandoc-citeproc
ln -s /usr/bin/pandoc-citeproc /usr/lib/rstudio/bin/pandoc/pandoc-citeproc
I found this workaround here.
The repository has pandoc version 1.12, but more recent versions also work. I am now using pandoc 1.19.2.1 and Rstudio 1.0.136.

Resources