Answer behavior in the PDF

In the PDF, the default behavior is showing all answers and solutions.

Using \documentclass[handout]{ximera} suppresses the answers.

In the PDF version, $\answer{x^2 + 3x + 1}$ is by default rendered as , and in handout mode normally as . With $\answer[given]{x^2 + 3x + 1}$ you get by default , but in handout mode .

Note: in order to make sense of this, you’ll have to consult the PDF version of this manual!

This behavior can be changed by setting \defaultAnswerFormat, \handoutAnswerFormat and \givenAnswerFormat.

Provide your own formats

Further formats can be implemented as follows:

(Auto)Scale Box to (Correct) Answer Size:

The answer box scales with the size of the (correct) answer. To do this, include the command

    \renewcommand{\handoutAnswerFormat}[1]{
         \fbox{\scalebox{2}{\phantom{$#1$}}}}
                 
     
in the preamble.

Now $\answer{x^2 + 3x + 1}$ will display as and $\answer{2x}$ will display as .

(Auto)Scaling Horizontal Line:

A horizontal line that scales with the size of the answer. To do this, include the command

    \renewcommand{\handoutAnswerFormat}[1]{\protect
         \rule{\widthof{$#1$}*2}{0.4pt}}
                 
     
in the preamble. The *2 stretched the length by two to accomodate handwriting.

Now $\answer{x^2 + 3x + 1}$ will display as ______________________________ and $\answer{2x}$ will display as ______.

2024-06-24 13:21:59