Search code examples
rr-exams

Where is the documentation for the layout of the template .tex file for r/exams


I'm trying to generate a set of exams using R/exams (software of which I'm very impressed by the way). For our University College, we need to apply a certain template for our exams. We have a .sty file for it, but I'm unable to include it in the LaTex template. I have tried all the options per documentation

Using the inputs variable:

exams2pdf(myexam, n = 1, name = c("pdf-examen", "pdf-oplossing"),
          encoding = "UTF-8",
          showpoints = "TRUE",
          dir = "output",
          edir = "oefeningen",
          inputs = "/Users/eothein/education/examentest/templates/hogent-examen.sty",
          template = c("templates/opgave.tex", "templates/oplossing.tex"),
         )

I have tried relative paths, absolute paths but the LaTeX compiler complains it cannot find the .sty file.

On top of that, it is very difficult to find documentation on how to use the metainfo/regular info from R into the LateX file. I'm starting from the template file generated from exams_skeleton but it is unclear how to work with it (without a lot of trial and error). Is there documentation for this? E.g. I guess %% \exinput{questionnaire} generates the questions, but how can I tweak this?

Kind regards

Jens Buysse


Solution

  • In general I would recommend to include such .sty files in your personal texmf tree, e.g., in texmf/tex/latex/hogent-examen.sty or texmf/tex/latex/hogent/hogent-examen.sty. This way they are found from every location on your machine.

    Your solution via the inputs= argument should have worked as well, tough. It's hard to tell what exactly went wrong without a fully reproducible example.

    As for your general question about the documentation for the exams2pdf() templates, see vignette("exams", package = "exams"), specifically Section 3.

    Historical note: This is actually quite an old document (including various updates, though), originally written more than a decade ago and long before R/exams had the capabilities it has today. I should turn the most important details from that paper into a blog post for R-exams.org (which is less than 3 years old). However, I didn't get round to doing this, though.