A description of how the answer box behaves in the compiled pdf
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.
The format of the output of \answer can be adapted. Following code
\begin{tabular}{ll}gives by default :
long: & $\answer{1234567890}$, and [given]: $\answer[given]{1234567890}$. \\
short:& $\answer{15}$, and [given]: $\answer[given]{12}$.
\end{tabular}
Handout:
long: | and [given]: . |
short: | and [given]: . |
Default:
long: | and [given]: . |
short: | and [given]: . |
But could e.g. be changed to (handout: flexible box, default: boxed, and given: plain) with
\let\handoutAnswerFormat\answerFormatFlexibleBox
\let\defaultAnswerFormat\answerFormatBoxed
\let\givenAnswerFormat\answerFormatPlain
Handout:
long: | and [given]: . |
short: | and [given]: . |
Default:
long: | and [given]: . |
short: | and [given]: . |
or also to (handout: fixed length line, default: blue, and given: blue) with
\renewcommand{\answerFormatLength}{3cm}
\let\handoutAnswerFormat\answerFormatLine
\let\defaultAnswerFormat\answerFormatBlue
\let\givenAnswerFormat\answerFormatBlue
Handout:
long: | and [given]: . |
short: | and [given]: . |
Default:
long: | and [given]: . |
short: | and [given]: . |
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]{
in the preamble.
\fbox{\scalebox{2}{\phantom{$#1$}}}}
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
in the preamble. The *2 stretched the length by two to accomodate handwriting.
\rule{\widthof{$#1$}*2}{0.4pt}}
Now $\answer{x^2 + 3x + 1}$ will display as ______________________________ and $\answer{2x}$ will display as ______.