Science:MER/Final answers

From UBC Wiki
Jump to: navigation, search

A script automatically extracts the final answer from the solution. For this to work well, please follow this guide when writing your solution:

Main Assumption: The final answer can be found in the last paragraph and is is either

  1. part of a sentence
  2. the last term in an align-environment or
  3. a picture.

1. Final answer in a sentence

If the last paragraph is not an align-environment and not a picture, then we assume that final answer is in the last sentence. However, some questions end with <<which is what we wanted to show.>>, which is not the final answer we want to extract. Therefore, if there is no <math>, the script takes the sentence before the last sentence and so on. This means: Please write the final answer in a <math> environment so that the script recognizes it.

  • Do not split the math environment like
DON'T DO THIS!  f = 2 <math> \frac{\pi}{2}</math>sin(x) DON'T DO THIS!

Instead, wrap everything in a single math environment.

<math>f = 2 \frac{\pi}{2}sin(x)</math>
  • Do not use \emph (<i>, <b>, ''text'') for math-environments.
  • If the final answer is in text-form, e.g. (B), then use the \emph-environment for this, i.e. The final answer is \emph{(B)}.
  • If you want to write a note in the last sentence, then don't use math-expressions and no \emph-environments in the note. The script would interpret this as the final answer.

2. Final answer in an align-environment

IF the last paragraph is an align-environment the last item on the left hand side will be matched with the last item of the right hand side, as so

<math> \begin{align} f(x) &= ab \\
& = cd \\
g(x) & = ef = gh \\
& = ij = kl = mn

Then the final answer would be g(x) = mn.

If the final answer is a picture, then place the figure as last paragraph.

If you want to write a note for the figure, write the note below the figure and do not use math-expressions and no \emph-environment in the note. A figure which is not an answer-figure must be placed before the last paragraph and after the figure there is the final answer either as math-expression in math-environment or in an emph-environment.

== General note ==The last paragraph of the solution should be self-contained. The last paragraph is separated from the rest by two new-lines:

Script won't look for final answer here: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Integer vestibulum erat sit amet tempus semper.
Phasellus sit amet nisi quis mauris bibendum sagittis nec vel sapien.

Place final answer in this paragraph instead: Vestibulum interdum non elit sed ultricies.
Mauris at sollicitudin erat. Mauris lobortis est at congue venenatis.
Maecenas ac augue at orci tempor viverra nec sit amet augue. Integer vitae justo dui.

In particular, do not write matrices like this:

1 & 2 \\
3 & 4 \end{matrix}</math>

The blank line is really bad! Then the last paragraph is 3 & 4 \end{matrix}</math> which not only gives the wrong answer but introduces lots of latex errors. Similarly with itemize, cases, enumerate.... environments, and curly brackets.