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.
I would guess that you have the R package
tinytexinstalled which does not always find theSweave.styfile that is shipped in base R'stexmffolder. Installing the file in atexmffolder where it is easier to find (as you did in your answer) is one possibility to solve the problem. Uninstalling the R packagetinytexprobably would have also solved the problem. Or you could use a template that avoids usingSweave.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?