Math
In this section, we'll cover how to use GIFT for math-heavy subjects.
Using LaTeX
GIFT supports questions with LaTeX to allow the creation of complex formulas and equations. If you use LaTeX with Moodle, it should work the way you expect it to, with a couple of small differences:
- For inline equations use
\\(
and\\)
for the start and close of a block. - For equation blocks, use
$$
and$$
for the start and close of a block. - Make sure to escape all special characters
~ = # { } :
using a backslash\
(e.g.\{
,\}
). Take special care with curly brackets{
,}
since they are also used for GIFT's question syntax.
Escaping all special characters is very important for LaTeX to work in GIFT. The following block will illustrate the difference:
# Unescaped LaTeX
$$ x\ =\ \frac{\sqrt{144}}{2}\ \times\ (y\ +\ 12) $$
# Escaped LaTeX (notice all curly brackets {} and = are escaped)
$$ x\ \=\ \frac\{\sqrt\{144\}\}\{2\}\ \times\ (y\ +\ 12) $$
For additional information on LaTeX in Moodle, refer to the Moodle docs on Using TeX notation.
Example:
For the following equation, what is the value of \\(x\\) when the value of \\(y \= 2 \\)?
$$ x\ \=\ \frac\{\sqrt\{144\}\}\{2\}\ \times\ (y\ +\ 12) $$ {
=\\(84\\)
~\\(80\\)
~\\(96\\)
~\\(102\\)
}
Optional Title...Multiple Choice
For the following equation, what is the value of when the value of ?
Select one: