We are using the following setup to include a customized intro to our printed exams:
rmarkdown::render(input = "Intro.Rmd",output_file ="Intro.pdf")
quests <- unlist(Grupos[c(1:3,sample(c(4:7)))])
exams2nops(file=quests, n=1, nsamp = 1, intro = "\\includepdf[pages=-]{D:/ExameAEI_R/Intro.pdf}", ...)
We start by generating a intro.pdf file, and then use the intro
argument to add it to the exams2nops
.
We would like to do the same thing with exams2pdf
:
exams2pdf(file=quests, n=1, nsamp = 1, intro = "\\includepdf[pages=-]{D:/ExameAEI_R/Intro.pdf}", language = "pt-PT", ...)
There's no error returned, but the intro.pdf does not get appended to the exams2pdf
file produced. Is there a way to add an intro file within exams2pdf
?
There is no intro
argument in exams2pdf()
. The difference between exams2nops()
and exams2pdf()
is:
exams2pdf()
assumes that the user writes the LaTeX templates. The templates included in the package are intended as illustrations or as starting points for new templates. But they should not be considered as templates for "production use".
exams2nops()
creates its own template in a rather rigid format. You have quite a few options for smaller customizations but, by and large, the template is defined by the function.
Currently, there is nothing in between these two approaches: Either you have to write your own template and do all the work yourself. Or you have to live with the limitations of the NOPS format.
For more guidance on how to write a LaTeX template that has extra parameters or can be extended, see: How to have parameters in the LaTeX template?