I'm currently using Rstudio and R markdown to create a pdf. However, every time I attempt to knit these error messages show up:
! Sorry, but C:\Users\AP\AppData\Local\Programs\MiKTeX\miktex\bin\x64\pdflatex.exe did not succeed.
! The log file hopefully contains the information to get MiKTeX going again:
! C:\Users\AP\AppData\Local\MiKTeX\miktex\log\pdflatex.log
Error: LaTeX failed to compile new-report.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See c2089682-report.log for more info.
In addition: Warning message:
In has_crop_tools() :
Tool(s) not installed or not in PATH: ghostcript
-> As a result, figure cropping will be disabled.
Execution halted
I've attempted to uninstall/re-install MiKTex and restarting Rstudio but the problem persists. How can I solve this issue?
With a new installation of MiKTeX, many style files needed to knit an RMarkdown file to PDF are not installed. To allow MiKTeX to install them on the fly, open the MiKTeX console and go to the Settings tab.
There is an option that says You can choose whether missing packages are to be installed automatically (on-the-fly). Make sure that this is set to Always to allow the necessary style files to be installed.
For me I just went to MiKTeX console setting and choose ALWAYS missing packages to be installed automatically.
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 have a work laptop that has recently forced a migration to microsoft OneDrive and all kinds of things have been squirrely since then, so I'll preface that MAYBE that has something to do with it. I'm running R 3.6.3 in RStudio.
Suddenly today though when I try to install a package I get a very weird error message I've never encountered before
install.packages("tidyquant")
warning in install.packages :
unable to access index for repository http://cran.rstudio.com/src/contrib:
Found continuation line starting ' <!DOCTYPE html> ...' at begin of record.
Error in install.packages : unknown input format
I tried some troubleshooting steps found elsewhere including
uncheck the global option for require secure download
delete the .Rhistory file and run update.packages()
when I run update.packages() I get
Error in readRDS(dest) : unknown input format
Any advice on how to proceed would be most appreciated.
I am using R for windows on RStudio.
I recently changed the name of User directory for a reason, and it seems that the change is causing a problem in knitting Rmd file.
If I try to knit Rmd file, the following error massage appears:
Error: invalid
version specification 'find'
In addition: Warning message:
In system(paste(shQuote(path), "--version"), intern = TRUE) :
running command '"C:/PROGRA~3/CHOCOL~1/bin/pandoc.exe" --version' had status 65535
Execution halted
I entered '"C:/PROGRA~3/CHOCOL~1/bin/pandoc.exe" --version' in cmd, it says
Cannot find file at 'c:\users\MY OLD USER NAME\appdata\local\pandoc\pandoc.exe'
So, I guess that knitr or pandoc is trying to find the wrong path.
How can I fix the problem? How can I change the path?
Here is the list of what I have tried:
Uninstalled R and RStudio, and then installed them.
Then, I installed all the packages needed by install.packeges.
Thus, I am using the latest version of R, RStudio, and packages.
Searched 'pandoc' in registry editor, and tried to find the old path (but I couldn't)
It seems you installed Pandoc by yourself through Chocolatey, and the installation was broken after you changed the name of your User directory.
First, you do not have to install Pandoc separately if you are using RStudio, because RStudio has bundled Pandoc with it.
If you have to install Pandoc for some reason, you may need to reinstall it (perhaps you have to reinstall Chocolatey, too).
choco uninstall pandoc
choco install pandoc
I'm getting the below error when I try to knit any document into Beamer and I don't understand why. I have Miktex installed and updated.
! LaTeX Error: File `beamerbasemodes.sty' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)
Enter file name:
! Emergency stop.
<read *>
l.19
pandoc.exe: Error producing PDF
Error: pandoc document conversion failed with error 43
With latex, if a .sty file isn't found, its because it isn't installed or MikTex doesn't know that its been installed and the FNDB must be refreshed.
I would check MikTex to verify that beamer is installed, and set the setting to install packages on the fly..
This tex.stachexchange answer might also lead to a solution.
https://tex.stackexchange.com/questions/404218/is-there-a-problem-with-beamer-in-the-latest-miktex-update
I am checking my package and this is actually the last remaining problem. The pdf file cannot be compiled and the logfile tells me
2015-10-15 14:17:47,430+0200 INFO pdflatex - running 'initexmf --quiet --update-fndb' to refresh the file name database
2015-10-15 14:17:50,276+0200 FATAL pdflatex - GUI framework cannot be initialized.
2015-10-15 14:17:50,276+0200 FATAL pdflatex - Info:
2015-10-15 14:17:50,276+0200 FATAL pdflatex - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp
2015-10-15 14:17:50,276+0200 FATAL pdflatex - Line: 50
Any idea where the problem could be?
This is known problem wit MikTex 2.9 when pdflatex encounters error
GUI framework cannot be initialized.
(found on my Windows 7 system in the file ~\AppData\Local\MiKTeX\2.9\miktex\log)
So far, I can offer following sequence of actions to remedy this:
In Windows Command prompt go to MiKTeX bin folder (e.g. C:\Program Files (x86)\MiKTeX 2.9\miktex\bin) and run utility mo.exe;
In General tab change 'Install missing packages on-the-fly:' option to No (this will disable GUI and error above won't be happening again);
Run R CMD that calls latex converter again (in my case
R CMD Rd2pdf man/
again to see new errors;
This time miktex won't complaint about GUI - instead it will be missing packages with error like this
! LaTeX Error: File `inconsolata.sty' not found.
Start MiKTeX package manager (again from mo.exe Packages tab) and install missing package one at the time by repeating steps 3.-5.
This might be not most effective way of fixing this so I appreciate corrections or alternative solutions.
I had this same issue, but for the newest versions of Miktex, mo.exe does not exist, and is replaced by the Miktex console. If you open it, go into settings and change the package on-the-fly setting from "Ask Me" to "Always", then the packages will install. If you do "Never" instead, then you'll have to do the individual package installation described by #topchef.
I ran into this problem just... A very easy solution for me that allowed me not to renege on the install on the fly option is to install TexStudio, open your .tex file in there, and compile it: you will be able to install all your MikTex packages on the fly as desired and retain control over what gets installed.
I had the same problem compiling Knit to PDF of a R markdown file in R studio. Once I changed from "Ask me" to "Always" in the MikTex console setting (see the screenshot posted above [Cara Wogsland]) it compiled without errors.