[Tex/LaTex] Exam Class: Make math expressions in \correctchoice bold

boldexam

I'm using the exam package to create a mathematics question paper. When printing answers, the \correctchoice command makes the choice letter as well as the text in the choice bold. However, it does not make any mathematic expressions bold.

Is there a way to add this to the document? I think the commands \boldmath and \unboldmath when put around the text will make both normal text and mathematic expressions bold, but I do not know how to "merge" it with the \correctchoice command.

Best Answer

The best solution would be to use \correctchoice as a hook and tack \boldmath and \unboldmath onto it that way using a formula of \edef and \expandafters that I've yet to grasp/memorize. See How to add a hook to a macro.

In absence of hooking, I would say

\renewcommand{\choiceshook}{%
  \ifprintanswers
    \let\oldchoice\choice
    \let\oldcorrectchoice\correctchoice
    \def\choice{\unboldmath\oldchoice}
    \def\correctchoice{\oldcorrectchoice\boldmath}
  \fi}

\noprintanswers:
enter image description here

\printanswers:
enter image description here

Related Question