I am trying to apply the answer to this question to the overloaded exam-randomizechoices oneparchoices environment; I want oneparchoices to spread out evenly with respect to the available horizontal space. However, when I attempt this, the formatting behaves unexpectedly. I believe this part of the exam-randomizechoices documentation might be essential to figuring this out. I'm not experienced working with latex on a technical level. Also, are there any other ways to achieve the same effect?

enter image description here


\xpatchcmd{\oneparchoices}{\penalty -50\hskip 1em plus 1em\relax}{\hfill}{}{}% must be altered before loading exam-randomizechoices

% other potential options?
% https://muug.ca/mirror/ctan/macros/latex/contrib/exam-randomizechoices/exam-randomizechoices-doc.pdf#page=18

    \noindent All questions should have evenly spaced multiple choice answers that take up all horizontal spacing.
        vanilla oneparchoices (works fine):\par
            \CorrectChoice First
            \choice Second
            \choice Third
            \choice Fourth
        exam-randomizechoices oneparchoices (unexpected behavior):\par
            \CorrectChoice First
            \choice Second
            \choice Third
            \choice Fourth
  • @JohnKormylo I've tried moving the \xpatchcmd after loading the exam-randomizechoices package and nothing happens. There is likely another way to do it, but I cannot figure it out at my experience level.
    – Jon
    Sep 30, 2022 at 13:46
  • Sometimes it works, sometimes it doesn't. Unfortuneately, exam-randomizechoices patchces the heck out of exam class, so there is no telling what the final code looks like. Oct 1, 2022 at 2:55


You must log in to answer this question.

Browse other questions tagged .