Hoping to combine the best of the exam class with the kaobook class, I took the Overleaf example document for Kaobook and added exam.cls with an \import{exam} command in the preamble. This worked perfectly aside from one problem: Margin notes are all translated right, half-way off the page.

enter image description here

enter image description here

I would like to provide a minimal working example, but both the basic kaobook example and the exam.cls file are too large to paste here. As an alternative, I hope it would be acceptable to share a link to the Overleaf project in this situation:


Does anyone have any suggestions how to could prevent exam.cls from translating marginnotes off the page? Thank you in advance!

  • 1
    Exam class does odd things with the margins, so I'm not surprised if there are conflicts. See "Changing the page margins" on page 100 of the manual. You might look at the exercise package instead. Jun 23, 2021 at 12:58
  • Thank you for your comment! I wish I could find the part of exam.cls that screws up the margins. As for switching, I have spent a very long time developing questions and solutions and diagrams with answer plots within the exam class, so I am apprehensive to switch away from it. Jun 23, 2021 at 13:07
  • Fixing this would require a complete re-write of exam class. More precisely, to make it compatible with marginnotes one would have to totally change how exam class handles margins. Jun 23, 2021 at 13:15
  • Could one comment the part of the exam.cls that handles margins, and keep everything else? I would like to keep grade tables for cover pages of exams, \printanswers commands (like \answerplot that hides/shows nodes in a tikzpicture, \solutiontable that hides/shows answers in the tabular environment, etc.), \solutionorlines and \answerline[] and \fillin[] commands for fill in the blanks, \choice and \correctchoice for multiple choice questions, etc.? All of these features are important to me but I would be happy to delete the margin stuff from the exam class. Thanks again. Jun 23, 2021 at 16:27
  • 1
    First, why don't you look at the manuals for the exercise (2014) and exercises (2017) packages (mirrors.ctan.org/macros/latex/contrib/exercise/exercise.pdf and mirrors.ctan.org/macros/latex/contrib/exercises/exercises.pdf). Trying to treat a document class as a package is a very bad idea to begin with, and exam class is one of the worst (see tex.stackexchange.com/questions/402863/… for example). Jun 23, 2021 at 19:41


You must log in to answer this question.

Browse other questions tagged .