amsthm LaTex package not found in R (3.2.6) - r

I'm trying to compile a .Rnw file to PDF in RStudio using the amsthm package but keep getting the error "LaTex Error: File 'amsthm.sty' not found. Is amsthm not available on the latest version of R?

I'm trying Miktex for Windows and I've had the same problem: file 'amsthm.sty' not found. You can add it from the console, but it's not listed with that name. It's included in the amscls package.
Packages can be searched here: https://www.ctan.org/

Related

RStudio error in windows: Running pdflatex.exe on file_name.tex.. (exit code -1073740791)

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.

pdfpages Latex package not found

I am trying to compile a pdfbook using R-markdown. After I knit I get the following error:
! LaTeX Error: File `pdfpages.sty' not found.
I loaded tiny text using library(tinytex) to help me install the package pdfpages but continue to have the same error. I resorted to running Rstudio in administrator mode and try the preceding step and running the following tinytex::parse_install(text="! LaTeX Error: File `pdfpages.sty' not found.") (as suggested in Yihui in bookdown). Both resulted in the same error.
Any other suggestion on what is wrong? The package is clearly installed, so I do not know what else can the error be.
Generally when you get an error like pdfpages.sty not found, you need to install the package. From the command line (assuming the Tex bin is in your path) use "tlmgr install pdfpages". Yihui Xie called it "TinyTex" because it was a minimal install compared to something like MacTeX or TexLive.

R Notebook with dlookr package

I try to create Data summary with dlookr package. In normal R it works but in R notebook it has a notification like this:
Error: pandoc document conversion failed with error 251
Anybody knows why?
Pandoc is a program that R Studio relies on to create html files. You may be required to download (https://github.com/jgm/pandoc/releases/tag/2.4) and install (instructions here: https://pandoc.org/installing.html) the pandoc program on your computer. I would also recommend downloading and install MiKTeX (mentioned on the pandoc install page mentioned above; see here: https://miktex.org/) which will allow you to create pdf files.

Cannot install framed.sty when I use knitr and RStudio to produce a pdf file on Windows

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

Error creating R 3.0.1 package "Vignette product ‘Sample.tex’ does not have a known filename extension (‘NA’)"

I'm trying to build my own custom R package under R 3.0.1. This package builds fine in previous versions of R. It works successfully except I'm getting an error creating the vignette.
I have a Sample.Rnw in my inst/doc directory that includes some other .tex files in that directory.
I'm getting the following error when I try to build the package. I can't find any reference to what this means or why there is even a Sample.tex file getting created.
Vignette product ‘Sample.tex’ does not have a known filename extension (‘NA’)
Any advice on how to figure out what this error means would be greatly appreciated.

Resources