|
The TEXT(beginproblem()); line displays a header for the problem, and the Context()->texStrings line sets how formulas are displayed in the text, and we reset this after the text section. Everything between the BEGIN_TEXT and END_TEXT lines (each of which must appear alone on a line) is shown to the student.
Mathematical equations are delimited by \( \) (for inline equations) or \[ \] (for displayed equations); in these contexts inserted text is assumed to be TeX code.
There are a number of variables that set formatting: $PAR is a paragraph break (like \par in TeX). This page gives a list of variables like this. Finally, \{ \} sets off code that will be executed in the problem text. Here, ans_rule(20) is a function that inserts an answer blank 20 characters wide. |