Forum: support


RE: keeping tex source [ Reply ] By: Achim Zeileis on 2025-01-02 01:17 | [forum:50043] |
This is one option but you likely can set up a custom interface that is easier to use. If you use the xexams() workhorse function directly you can do something like this: ## get one random version of a single-choice exercise set.seed(0) x <- xexams("deriv2.Rnw") ## use the first (and only) random version of the first (and only) exercise x <- x[[1]][[1]] ## extract the question and questionlist x$question ## [1] "What is the derivative of $f(x) = x^{7} e^{2.3x}$, evaluated at $x = 0.66$?" ## [2] "" x$questionlist ## [1] "$2.89$" "$4.72$" "$3.21$" "$5.27$" "$2.64$" Similarly, you can extract the $solution and $solutionlist. If your exercises are not in .Rnw but in .Rmd format, then you additionally need to convert all text from Markdown to LaTeX. You can do so via: textrafo <- make_exercise_transform_pandoc(to = "latex", base64 = FALSE) set.seed(0) x <- xexams("deriv2.Rmd", driver = list(sweave = NULL, read = NULL, transform = textrafo, write = NULL)) Some more details on how to work with xexams() are provided in the answer to this SO question: https://stackoverflow.com/questions/62315622/ |
RE: keeping tex source [ Reply ] By: Ilya Musabirov on 2025-01-01 20:18 | [forum:50042] |
It seems like `exams2pandoc(..., type="latex")` does the trick |
keeping tex source [ Reply ] By: Ilya Musabirov on 2025-01-01 18:01 | [forum:50041] |
Hi, I need to include some examples of exam questions in a larger latex document in the form exams would render them. Is there a way to keep the latex source with exams2pdf or any alternative? Thanks and Happy New year! |