LaTeX can be used in Ans for different purposes. The different options are described in this article.

# Write equations in Ans using LaTeX

When you are familiar with LaTeX, it may be more time-efficient or easier to copy the LaTeX code of an equation or type it yourself. Below, a few basic LaTeX codes are written. Also, it may come in useful to use an external LaTeX editor, such as

*Visual Math Editor**in which you can get familiarised with LaTeX equations (even more). These editors have more possibilities than the equation editor implemented in the Ans platform.*- Go to a question, content or criteria box and start with two dollar signs if you want the equation to be in the text ($$), see the example two images above here. If the equation should be on a separate line, use three dollar signs ($$$). End your LaTeX code again with the two ($$) or three ($$$) dollar signs.
- Do not use the LaTeX functionality
*\begin{equation} ... \end{equation}*, which is used to write an equation in LaTeX. This does not work in the Ans platform. - Type or copy the LaTeX code. A few basic operations will be explained below. For more of these operations, go to this link which lists all functions supported by KaTeX in the math mode (math mode is in between the dollar signs), or use the
*Visual Math Editor*

**Plus** or **minus**: z = x + y - 1

**Multiplying**: x*y, x \cdot y

**Superscript**: x^{2}

**Subscript**: x_{2}

**Fraction**: \frac{1}{x}

**Root**: \sqrt{x}

**Trigonometric functions**: \sin{x}, \cos{x}, \tan{x}

**Greek letters**: \pi, \alpha, \beta, \delta *etc.*

- If the equation is finished, end with the same amount of dollar signs as you started with, so $$ or $$$.
- Click save and look at the render if the equation you wish is visible.

# Create tables in Ans using LaTeX

**only for handwritten assignments**

It is also possible in Ans to use some other LaTeX operations that are not basically used for math. For example tables can be written in LaTeX and then be copied only into a question or a content box. For these operations, the result will only be loaded into the PDF on the right side of the page, but not in the exercise, criteria or content bar itself. Also, it can only be used when a PDF viewer is on the right side of the page, so

An example is given below. Advised is to only do this if you are familiar with LaTeX, the PDF viewer will give errors if the code does not work.

**only for a handwritten assignment this can be used**.An example is given below. Advised is to only do this if you are familiar with LaTeX, the PDF viewer will give errors if the code does not work.

Code:

Result:

# Use custom LaTeX packages in Ans

**only for handwritten assignments**

For some LaTeX operations packages are needed that have to be imported into LaTeX, because LaTeX does not support all commands by default. These packages can be imported into Ans by adding the packages in the Layout options menu. See the following example for the

*lipsum*-package. Again this is only possible for handwritten assignments, and the PDF generator will give errors if a command is unknown.- Click
**Layout**in the Exercises menu of a handwritten assignment. - In the window that pops up, write \usepackage{lipsum} in the textbox. Click
**SAVE**. - Now the package is imported into LaTeX and its commands can be used by just typing it in a content or question box. In the example below, the result can be found. Here the LaTeX code is typed in a content box, and the result can be seen in the PDF example in the right part of the screen.

*Note: Using custom packages in Ans can lead to errors in the answer form.*

## Comments

0 comments

Please sign in to leave a comment.