[LON-CAPA-users] Algebra Expression Rendering in LON-CAPA

Harding, Gene L glhardin at purdue.edu
Tue Jan 17 14:23:15 EST 2017


Thanks Damien! That is very helpful. Is there an easy way to display the large numbers with commas (e.g., 32000 -> 32,000)? I tried a couple of different format commands using ",0f", but neither worked. Also, is there a good reference out there to help novices like me with the syntax for these commands? I'm having a hard time keeping the xml, perl, tex, etc. straight. (And have wasted a LOT of time trying to figure it out.)

Best regards,

Gene L. Harding, PE
Associate Professor of ECET
574-520-4190
Purdue University-South Bend


-----Original Message-----
From: lon-capa-users-bounces at mail.lon-capa.org [mailto:lon-capa-users-bounces at mail.lon-capa.org] On Behalf Of Damien Guillaume
Sent: Tuesday, January 17, 2017 11:29 AM
To: Discussion list for LON-CAPA users <lon-capa-users at mail.lon-capa.org>
Subject: Re: [LON-CAPA-users] Algebra Expression Rendering in LON-CAPA

You have to use eval="true" for <m> if you have variables inside. And make sure the display is using MathJax.

Try this:

<m eval="on" display="mathjax">$$ \frac{$numer}{$denom} \left[ \pi + \sum_{n=1}^{\infty} \frac{$sum_numer}{$sum_denom_n_coeff n - $sum_denom_const} \cdot \sin($w nt) \right] $$</m>

If you put the whole expression into a variable, you will also have to escape the "\" with "\\".

Damien

> Hi Damien,
>
>
>
> Thanks for your reply. At least now I know that I was chasing the wind. I was able to get close by using Sigma in place of sum in the expression, but then only the "n" was subscripted, not the "=1" part, even though I used braces: _{n=1}...
>
>
>
> I had initially tried to render the equation in the xml portion of the problem, but when I did that I had a lot of trouble properly displaying some of the variables using the <m>$...$</m> command. It worked in some places but not others.
>
>
>
> This is as close as I have been able to get to a proper expression:
>
> [cid:image001.png at 01D26DF0.DF719FF0]
>
>
>
> In the xml portion I have been able to render it nicely:
>
> [cid:image002.png at 01D26DF6.82F21010]
>
> ...but only if I hard-code the constants in the two fractions and inside the sine. Is there a way to display variable values from the perl script in place of the constants? I have tried a few things, but all were unsuccessful.
>
>
>
> Thanks,
>
>
>
> Gene L. Harding, PE
>
> Associate Professor of ECET
>
> 574-520-4190
>
> Purdue University-South Bend
_______________________________________________
LON-CAPA-users mailing list
LON-CAPA-users at mail.lon-capa.org
http://mail.lon-capa.org/mailman/listinfo/lon-capa-users


More information about the LON-CAPA-users mailing list