When creating exercises, you may need to use mathematical symbols in the content block or in a question. To make this possible, you have the option to use an Equation editor ∑ or LaTeX.
Equation editor \(\Sigma\)
The Equation editor ∑ enables you to type symbols and create equations both through LaTeX syntax, typing symbol names and use the Ans-equation keyboard. To make use of the Equation editor, follow the steps below.
- Navigate to your assignment.
- Click New exercise, fill in a name and click Save.
- Click New content block and select Text block or click on New question.
- In the text content field or the question content field, click on the Equation symbol ∑.
- Type the name of the symbol you want to use or LaTeX syntax. The symbol should automatically render in the correct format.
- Click on the keyboard-icon to explore other possible symbols to use
- Click Save.
Type LaTeX directly into a text field
If you are familiar with LaTeX, it may be more time-efficient or easier to copy the LaTeX code of an equation or to type it yourself. You can find a few basic LaTeX codes written below. It may also be useful to use an external LaTeX editor, such as Visual Math Editor to help familiarise yourself with LaTeX equations. These editors offer more possibilities than the equation editor implemented in the Ans platform. To make use of LaTex, follow the steps below.
- Navigate to your assignment.
- Click New exercise, fill in a name and click Save.
- Click New content block and select Text block or click New question.
- If you want the equation to be within the text, enter two dollar signs ($ $) in the text content field or the question content field. If the equation needs to be on a separate line, use three dollar signs ($ $ $).
- After adding the dollar signs, enter or copy the LaTeX code.
- To add a line break in the equation, you must use shift-enter to go to the new line so that the content is in the same <div> html tag. The equation will not be formatted correctly otherwise.
- End the equation with the same amount of dollar signs as you started with. Instead of the dollar signs, you can also use \( to start the equation. Typing \ ) will make the equation end.
- Click Save and check your equation displays correctly.
error_outline LaTeX written directly in text fields can not be rendered correctly in some smaller interface elements of the Exercise editor and Grading interface due to the limitations of HTML. The student preview / Written exam preview allows you to check if this renders correctly for participants while taking an assignment.
A few basic operations are explained in the table below. For more of these operations, click on this link which lists functions supported by LaTeX in the math mode (math mode is in between the dollar signs), or use the Visual Math Editor as mentioned previously. Please note that the LaTeX functionality "\ begin { equation } ... \ end { equation } ", which is used to write an equation in LaTeX does not work in the Ans platform.
| LaTeX code | Preview |
| Plus or minus: z = x + y - 1 | \(z=x+y-1\) |
| Multiplying: x*y, x \cdot y | \(x*y,x\cdot y \) |
| Superscript: x^{2} | \( x^{2}\) |
| Subscript: x_{2} | \(x_{2} \) |
| Fraction: \frac{1}{x} | \(\frac{1}{x} \) |
| Root: \sqrt{x} | \( \sqrt{x}\) |
| Trigonometric functions: \sin{x}, \cos{x},\tan{x} | \(\sin{x}, \cos{x}, \tan{x} \) |
| Greek letters: \pi, \alpha, \beta, \delta etc. | \(\pi, \alpha, \beta, \delta \) |
Comments
0 comments
Please sign in to leave a comment.