2

When I try to generate the exams' solution with the exams2nops(...template="solution"...) I get the following error message:

Error in exams2pdf(file, n = n, nsamp = nsamp, dir = dir, name = name,  : 
  formal argument "template" matched by multiple actual arguments

How can I produce an exams' solution with the exams2nops?

Sinval
  • 1,315
  • 1
  • 16
  • 25

2 Answers2

1

You cannot do that in one go, you need two runs after setting the same seed, e.g.,

set.seed(1)
exams2nops(my_exam)
set.seed(1)
exams2pdf(my_exam, template = "my_solution.tex")      

You can use the solution.tex provided within the package as a starting point for my_solution.tex. But you may want to translate it to your natural language, use the name of your university, possibly insert a logo, add your actual exam name, possibly some into text etc. In exams2pdf() you need to add these things in the template LaTeX file directly.

Sinval
  • 1,315
  • 1
  • 16
  • 25
Achim Zeileis
  • 15,710
  • 1
  • 39
  • 49
  • The exam was created some day ago... Do I have to create a "my_solution.tex"? – Sinval Jan 19 '21 at 14:56
  • Have you kept the seed? I would always recommend to do that. // As for "my_solution.tex": I would assume that you want to have it in pt (rather than en) with your actual university and exam name etc. // When I wrote exams2pdf() I assumed that everybody would want to tweak their own LaTeX master template anyway - as opposed to inserting certain pieces of information into a flexible template. That's why exam.tex and solution.tex are really just demo files and not for use in production. – Achim Zeileis Jan 19 '21 at 15:05
  • I did not keep the seed. But the right answer stills the same, the order will be different (due to exshuffle) but that's not a big issue. I understand, I will use the template `exams/tex` folder and edit it. – Sinval Jan 19 '21 at 15:16
0

won't the template="solution" not work in the exams2pdf? Also, can we do something like:

usepackage = "pdfpages", intro = intro2,... ?

JPMD
  • 644
  • 1
  • 7
  • 19