I am new to R and am trying to knit my R Markdown files into PDF format.
I continually get the error message:
pandoc: pdflatex not found. pdflatex is needed for pdf output.
Error: pandoc document conversion failed with error 41
Execution halted
No TeX installation detected (TeX is required to create PDF output). You should install a recommended TeX distribution for your platform:
Windows: MiKTeX (Complete) - http://miktex.org/2.9/setup
(NOTE: Be sure to download the Complete rather than Basic installation)
Mac OS X: TexLive 2013 (Full) - http://tug.org/mactex/
(NOTE: Download with Safari rather than Chrome strongly recommended)
Linux: Use system package manager
I have downloaded pandoc, and I have also downloaded TexLive and have installed them both onto my computer. For the life of me I cannot figure out why R wont recognize that Ive installed them, and knit into a PDF.
Please help!
For Mac OS X, if you have installed TexLive (I installed so through homebrew caskroom) you should have pdftex available via command line.
type 'which pdftex' to make sure something shows up. from there, i created a symbolic link into my $PATH, specifically into my /usr/local/bin (which is where all my homebrew stuff is stored) with:
ln -s /usr/texbin/pdftex /usr/local/bin/pdflatex
from there, using knitr in RStudio and R in general seemed to work and rendering R Markdown is definitely a really beautiful option (check some of the templates too like the Tufte one!)
I had the same problem, after downloading mactex through FireFox and installing the package.
I quit and restarted RStudio, and it worked (no changes at the terminal command line level).
The .pdf output is, however, a bit blurry at least on my first attempt.
I had a similar issue as I wasn't able to knit pdf file & solved it by installing & running tinitex packages using those commands in the console -- not the terminal
install.packages("tinytex")
tinytex::install_tinytex()
Related
I am using Rstudio in windows 10. I am triying to create a pdf from a .tex file. However, when I compile the PDF, the following error appears:
Running pdflatex.exe on file_name.tex...failed Error running C:/Users/user_name/AppData/Local/Programs/MiKTeX/miktex/bin/x64/pdflatex.exe (exit code -1073740791)
I am using a native installation of R, Rstudio and MikTeX. Not an envioronment with anaconda or similar.
If you are using RStudio, have you tried tinytex instead of MikTeX? In the Tools Menu>Global Options>Sweave, tick "use tinytex for compiling .tex files". Then install tinytex package. After installing tinytex package, write in console "tinytex::install_tinytex()". This will install the latex compiler tinytex. Try compiling your tex file using it.
I think that issue has to do with missing packages. In fact, MiKTeX doesnt preinstall most of them. I recommend to compile with TinyTeX, because it shows where the compilation stops (as I said, due to a missing package typically required in some sty file). This way you can track which are the missing packages and install them on the MiKTeX Console one by one.
I posted about this issue in an open discussion on Github. Drop the link here in case you need more details.
I recently installed the R package exams in order to generate some qti format quizzes for a course I am about to teach, but have been unable to import R markdown files.
I tried with the example file switzerland.Rmd available here:
http://www.r-exams.org/templates/switzerland/
Here's the error I am getting when I try to run exams2qti21:
> exams2qti21("../Downloads/switzerland.Rmd")
sh: 1: +RTS: not found
Error: pandoc document conversion failed with error 127
How can I fix this?
I am running R 3.4.4 on Ubuntu Xenial.
This error does not come from exams itself but from the rmarkdown package which is leveraged by exams to call the pandoc converter (for converting Markdown to HTML in this case). It appears that on your system pandoc is either not installed at all, not in the search path, or not installed correctly.
If pandoc is not installed at all, then you need to install it. On Ubuntu you can use the usual package managers to install it, e.g., sudo apt-get install pandoc or via synaptic etc. If you use RStudio then this also ships with a pandoc binary (at least on Windows) so that you don't need to install it yourself.
To check at which path pandoc is installed (if it is), you can use rmarkdown::pandoc().
I am trying to use RStudio and knitr to produce PDF files on Windows 10. There is no LaTex on my computer. When clicking "Compile PDF" button, I have this error message:
LaTex Error: File 'framed.sty' not found.
==>Fatal error occurred, no output PDF file produced.
I found a framed.sty file under H:\R\win-library\3.3\knitr\misc. It looks like RStudio cannot find the path. So, I try some methods. For example, install framed package. I downloaded framed package from https://www.ctan.org/pkg/framed?lang=en.
However, all the websites I found are talking about the solution on Mac or Linux, for example https://github.com/rstudio/rmarkdown/issues/39. How can I fix this problem on Windows 10?
Presumably you were using MiKTeX on Windows. You can use its package manager to install a missing package: https://docs.miktex.org/manual/pkgmgt.html
I'm trying to use pandoc on a markdown document I'm working on at the command line on a mac. My Mac is telling me that I don't have pandoc installed. In fact, I know that pandoc is installed because I regularly use it from within Rstudio to knit rmarkdown or sweave files. I dealt with this problem on my desktop Ubuntu before and created a link from Rstudio's copy of pandoc to my bin so I could use it at the command line. However, I can't seem to find pandoc on my Mac. Does anyone know how I can create a link on a mac to make the Rstudio copy of pandoc accessible at the terminal line?
I have been using Sweave for quite sometime on my system using RStudio.
However, I recently upgraded my Mac OS from Lion to Mavericks.
This caused several issues:
First, RStudio was not able to locate the R library, and it just wont start. I reinstalled RStudio, but still got the same issue. So I reinstalled both R and RStudio, and then RStudio started to work.
And now, RStudio is still not able to locate TeX installation, and gives me the following warning:
"No TeX installation detected. Please install TeX before compiling."
This will probably get fixed by a reinstall, but I would prefer to avoid a fresh download of TeX (~2.3G).
Any ideas on how to resolve this?
RStudio expects pdflatex to be on the system path (i.e. entering Sys.which("pdflatex") at the R console should return the path to pdflatex).
You can fix the problem by getting pdflatex back on the system path:
Find the path where pdflatex is installed on your system--likely /usr/texbin, but use find /usr -name pdflatex if you need help.
Create a file called TeX in /etc/paths.d that contains this path.
For example:
$ sudo -s "echo /usr/texbin > /etc/paths.d/TeX"
You'll need to restart to apply the changes.