<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Plain Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.PlainTextChar
        {mso-style-name:"Plain Text Char";
        mso-style-priority:99;
        mso-style-link:"Plain Text";
        font-family:"Calibri",sans-serif;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoPlainText"><a name="_MailEndCompose">Hi Damien,<o:p></o:p></a></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">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}...<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">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.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">This is as close as I have been able to get to a proper expression:<o:p></o:p></p>
<p class="MsoPlainText"><img width="281" height="44" id="Picture_x0020_1" src="cid:image001.png@01D26DF0.DF719FF0"><o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">In the xml portion I have been able to render it nicely: <o:p>
</o:p></p>
<p class="MsoPlainText"><img width="269" height="79" id="Picture_x0020_2" src="cid:image002.png@01D26DF6.82F21010"><o:p></o:p></p>
<p class="MsoPlainText">…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.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Thanks,<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Gene L. Harding, PE<o:p></o:p></p>
<p class="MsoPlainText">Associate Professor of ECET<o:p></o:p></p>
<p class="MsoPlainText">574-520-4190<o:p></o:p></p>
<p class="MsoPlainText">Purdue University-South Bend<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">-----Original Message-----<br>
From: lon-capa-users-bounces@mail.lon-capa.org [mailto:lon-capa-users-bounces@mail.lon-capa.org] On Behalf Of Damien Guillaume<br>
Sent: Friday, January 13, 2017 10:17 PM<br>
To: Discussion list for LON-CAPA users <lon-capa-users@mail.lon-capa.org><br>
Subject: Re: [LON-CAPA-users] Algebra Expression Rendering in LON-CAPA</p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">> This is the call from the xml to render it:<o:p></o:p></p>
<p class="MsoPlainText">><o:p> </o:p></p>
<p class="MsoPlainText">> <center> <algebra>$function</algebra></center><o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">The algebra element has its own syntax. I do not know if it is documented, but we can look at the code at<o:p></o:p></p>
<p class="MsoPlainText"><a href="http://source.lon-capa.org/cgi-bin/cvsweb.cgi/loncom/xml/algebra/AlgParser.pm?rev=1.18"><span style="color:windowtext;text-decoration:none">http://source.lon-capa.org/cgi-bin/cvsweb.cgi/loncom/xml/algebra/AlgParser.pm?rev=1.18</span></a><o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">The regular expressions used to recognized functions are:<o:p></o:p></p>
<p class="MsoPlainText">my $trigfname = '(?:(?:a(?:rc)?)?(?:sin|cos|tan|sec|csc|cot)h?)';<o:p></o:p></p>
<p class="MsoPlainText">my $otherfunc =<o:p></o:p></p>
<p class="MsoPlainText">'(?:exp|abs|logten|log|ln|sqrt|sgn|step|fact|int|lim|fun[a-zA-Z])';<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">There is no sum. To display a sum, you could use the TeX syntax as Gerd suggested, within <m>$ $</m>.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Damien<o:p></o:p></p>
<p class="MsoPlainText">_______________________________________________<o:p></o:p></p>
<p class="MsoPlainText">LON-CAPA-users mailing list<o:p></o:p></p>
<p class="MsoPlainText"><a href="mailto:LON-CAPA-users@mail.lon-capa.org"><span style="color:windowtext;text-decoration:none">LON-CAPA-users@mail.lon-capa.org</span></a><o:p></o:p></p>
<p class="MsoPlainText"><a href="http://mail.lon-capa.org/mailman/listinfo/lon-capa-users"><span style="color:windowtext;text-decoration:none">http://mail.lon-capa.org/mailman/listinfo/lon-capa-users</span></a><o:p></o:p></p>
</div>
</body>
</html>