(Answer) (Category) LON-CAPA User Help : (Category) Authoring : (Category) Authoring Problems :
When to use <display> tag
Functions that must be inside of a <display> when outputting text:
&prettyprint
&tex
&web
&xmlparse
Functions that shouldn't be used but if used need it
&dollarformat (use pretty print instead with '$2f')
&var_in_tex

More gory details:

When coverting the HTML of a problem to LaTeX, Lon-CAPA assumes that the contents of the entire problem, and the contents of all variables that it expands is HTML,.

LaTeX has some charactes that are special, as they tell it to do special things.

In order to not have the characters that HTML generates confuse LaTeX we need to protect them.

The problem with the &xmlparse(), &prettyprint() etc functions is that when printing, these functions rather than genearte HTML, they generate LaTeX code.

So the assumption that everything is in HTML is wrong, and can cause things to break.

Thus enters the <display> tag.

The <display> tag says, that this variable's value or function's result is safe to pass directly to the LaTeX engine.


[Append to This Answer]
Previous: (Answer) Equation Entry Example
Next: (Answer) Adaptive Hints
This document is: http://help.loncapa.org/cgi-bin/fom?file=225
[Search] [Appearance] [Show This Answer As Text]
This is a Faq-O-Matic 2.719.
This FAQ administered by the LON-CAPA team at MSU. Submit a help request ticket to contact us.