[LON-CAPA-users] algebra tag for nice formula output

Stefan Bisitz lon-capa-users@mail.lon-capa.org
Fri, 04 Feb 2011 19:20:14 +0100


[sent: 04.02.2011, 19:20 CET]

Hi authors,

I'd like to randomize the variables in a formula which is created in the 
problem's script block. The formula is used in the answer block as well 
as in the text where a nice formula rendering output is wanted. This is 
done by using the <algebra> tag.

The <m> tag would be also possible and works fine, but the screen output 
isn't so nice for fractions. <algebra> behaves a bit strange. Bug or 
wrong usage or something else I'm missing?

Simplified problem source code:
---- Start ----
<problem>

<script type="loncapa/perl">
$x = "x";
$f = "f($x) = 1 / (g($x) + h($x))";
</script>

<startouttext />
<algebra>$f</algebra>
<br />
<m eval="on">$ $f $</m>
<endouttext />

</problem>
---- End ----

Output with tth rendering (similar with mimetex):
[(f x=1)/(g x+h x)]
f(x) = 1 / (g(x) + h(x))

Thanks for any hints,
Stefan Bisitz