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@01D26DF0.DF719FF0]



In the xml portion I have been able to render it nicely:

[cid:image002.png@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



-----Original Message-----
From: lon-capa-users-boun...@mail.lon-capa.org 
[mailto:lon-capa-users-boun...@mail.lon-capa.org] On Behalf Of Damien Guillaume
Sent: Friday, January 13, 2017 10:17 PM
To: Discussion list for LON-CAPA users <lon-capa-users@mail.lon-capa.org>
Subject: Re: [LON-CAPA-users] Algebra Expression Rendering in LON-CAPA





> This is the call from the xml to render it:

>

> <center> <algebra>$function</algebra></center>



The algebra element has its own syntax. I do not know if it is documented, but 
we can look at the code at

http://source.lon-capa.org/cgi-bin/cvsweb.cgi/loncom/xml/algebra/AlgParser.pm?rev=1.18



The regular expressions used to recognized functions are:

my $trigfname = '(?:(?:a(?:rc)?)?(?:sin|cos|tan|sec|csc|cot)h?)';

my $otherfunc =

'(?:exp|abs|logten|log|ln|sqrt|sgn|step|fact|int|lim|fun[a-zA-Z])';



There is no sum. To display a sum, you could use the TeX syntax as Gerd 
suggested, within <m>$ $</m>.



Damien

_______________________________________________

LON-CAPA-users mailing list

LON-CAPA-users@mail.lon-capa.org<mailto:LON-CAPA-users@mail.lon-capa.org>

http://mail.lon-capa.org/mailman/listinfo/lon-capa-users
_______________________________________________
LON-CAPA-users mailing list
LON-CAPA-users@mail.lon-capa.org
http://mail.lon-capa.org/mailman/listinfo/lon-capa-users

Reply via email to