1

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

Jens Buysse
  • 119
  • 10

1 Answers1

1

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.

Achim Zeileis
  • 15,710
  • 1
  • 39
  • 49
  • The remark on the .sty files is justly, but I want the .sty file to be in the same folder as the template: this way somebody else can clone my repo and generate exams without the need to install the .sty file in its latex dir. – Jens Buysse Apr 20 '20 at 17:23
  • vignette("exams", package = "exams") gives some general info, but not everything: e.g. how can I get all the points etc. Is there an API available or something? – Jens Buysse Apr 20 '20 at 17:24
  • Regarding the sty file: Please provide a reproducible example. Regarding the points: I'm not sure what you mean by "get all the points". Possibly this is a separate question? An "API" does not exist because the process isn't really an interface - it's just a couple of placeholders that are replaced in the template. – Achim Zeileis Apr 20 '20 at 17:51
  • Sorry for the late answer. With the points I mean, I want to show how much points a student can get answering a question, and also generate a total of all the points in de preamble of the exam. I know there is something like `numpoints` for the metadata, but this doesn't do anything – Jens Buysse May 04 '20 at 15:16
  • That should best be discussed in a separate question and not here. See this thread: https://stackoverflow.com/questions/61210271/how-to-display-points-per-exercise-when-printing-to-pdf-via-exams2pdf There a workardound is described - but I'm currently also working on a more flexible solution as well. – Achim Zeileis May 04 '20 at 15:58