How to configure R/Exams to use system LaTeX?

大城市里の小女人 提交于 2021-01-28 06:02:55

问题


I'm completely new to R and R/Exams. I have installed R and R/Exams, and tested the dist example to generate HTML outputs. When I tried to generate PDF outputs, R/Exams always used tinytex and failed because Sweave.sty was not found. I already have TeXLive installed on my system and use LaTeX regularly in my work. I have resolved the problem with Sweave.sty being not found by adding the R's texmf to my TeXLive. However, I still want to use my TeXLive installation instead of tinytex. Is there a way to configure R/Exams to use the system TeXLive instead of tinytex? I'm on MacOS.


回答1:


The default in exams2pdf() and exams2nops() is to use tinytex when requireNamespace("tinytex") is TRUE, i.e., when tinytex is installed. If you generally don't want to use tinytex, simply uninstall it.

If tinytex is installed but you still want to use pdflatex() from the tools package instead, please set options(exams_tex = "tools"). You can also put it into your .Rprofile if you generally want to set it.

Finally, you can also set up your own LaTeX template for exams2pdf(..., template = ...) and omit the packages you don't need - or replace Sweave.sty



来源:https://stackoverflow.com/questions/62719970/how-to-configure-r-exams-to-use-system-latex

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!