@problem@
	@problemtype@
		embedded
	@;problemtype@
	@name@
		tutorial_10_latex
	@endname@
	@preamble@
		y = randint(1,21)*2+1
	@;preamble@
	@content@
		If an exam problem contains mathematical expressions, the typesetting system can be used to create both inline and displayed equations within the problem content.
		@pb;@
		There are two distinct ways of including LaTeX code in a problem: First, so-called inline equations (which are embedded directly into the surrounding text) are simply enclosed by dollar symbols. For example, the equation $x=42$ is set in LaTeX, which will result in a different rendering than the plain text alternative "x = 42". Of course, it is also possible to combine LaTeX code with evaluated Python expressions; for example, if $2y=x$, then $x=@y/2@$. Note that by default, any non-integer value will usually be transformed into a fully simplified LaTeX fraction.
		@pb;@
		A second way of invoking LaTeX code is the use of so-called displayed equations, which are set apart from the surrounding text with vertical space and slightly indented. For example, the equation expression
		\[
			4y=x \quad\implies\quad x = @y/4@ = @num(y/4,keepFloat=True)@
		\]
		is most appropriately set as a displayed equation.
		@pb;@
		In multiple choice questions, LaTeX code can be used within the answers as well, unless they are displayed as a dropdown menu.
		@lb;@
		For $t\in\mathbb{R}$, let $f(t)=\int_0^t e^s \,\mathrm{d}s$. Then
		@chooseans(100, ["$f(t)=e^t-1$.", "$f(t)=e^t$.", "$f(t)=\\cos(t)$."], 1, shuffle=True, display=VERTICAL)@
		@pb;@
		Note carefully that the expression "\cos" for the cosine function has been replaced by "\\cos". In general, within a string which is read within Python code (as is the case for the above arguments in the 'choseans' function), every backslash character needs to be escaped by repacing it with "\\".
		@pb;@
		Note also that in general, only LaTeX expressions within inline or displayed equations are interpreted as such, with the exception of the line and paragraph break commands, "itemize" and "enumerate" environments and the @em@"emphasize"@;em@ environment, all of which are directly converted into suitable html expressions.
	@;content@
@;problem@