Search code examples
rsweaver-examsinstallr

Problems with exams2pdf after updating R version


Recently, I have updated R using installr so that I have now two versions (3.6.1 e 4.0.3) installed in my computer running Windows 10, but I only use the 4.0.3 version. For some reasons I do not know, the 'exams' package has not been transferred to the new version so I had to reinstall it, but now 'exams2pdf' does not work anymore and I get the following error message:

LaTeX Error: File `Sweave.sty' not found.

Any help would be very much appreciated.


Solution

  • I would guess that you have the R package tinytex installed which does not always find the Sweave.sty file that is shipped in base R's texmf folder. Installing the file in a texmf folder where it is easier to find (as you did in your answer) is one possibility to solve the problem. Uninstalling the R package tinytex probably would have also solved the problem. Or you could use a template that avoids using Sweave.sty.

    For further details on using LaTeX with R/exams, see http://www.R-exams.org/tutorials/latex/. This question and answer is also related: How to configure R/Exams to use system LaTeX?