[LON-CAPA-users] Math Display Problem

Harding, Gene L glhardin at purdue.edu
Mon Mar 30 08:05:30 EDT 2020

Ah, I see. That worked, so I added it to my ever-growing notes file. :)
Thanks Mark!

Gene L. Harding, PE
Associate Professor of ECET
Purdue University

-----Original Message-----
From: LON-CAPA-users <lon-capa-users-bounces at mail.lon-capa.org> On Behalf Of Lucas, Mark
Sent: Sunday, March 29, 2020 10:50 PM
To: Discussion list for LON-CAPA users <lon-capa-users at mail.lon-capa.org>
Subject: Re: [LON-CAPA-users] Math Display Problem

The \ in $PwrIntegral need to be escaped.

$PwrIntegral = "p(x) = \\frac{1}{T} \\int_0^T v(x) i(x) dx”;

\\ escapes the left slash and puts a single left slash in.

\ is used to include special characters in a perl string: \n - newline, \r - carriage return.
It thought \f and \i were special characters.
\\ says make this a real \

Hope this helps!

> On Mar 29, 2020, at 10:25 PM, Harding, Gene L <glhardin at purdue.edu> wrote:
> Hi,
> I am having trouble getting equations to render properly. I have done this before, and have even tried directly copying code I have used before, but cannot get it to display properly.
> This is one of the equation definitions:
>   $PwrIntegral = "p(x) = \frac{1}{T} \int_0^T v(x) i(x) dx";
> This is the radiobuttonresponse code using it:
>     <radiobuttonresponse max="10" randomize="yes">
>         <foilgroup>
>             <foil location="random" value="true" name="foil1">
>                 <startouttext />
>                     <m eval="on" display="mathjax">$ $PwrIntegral $</m>
>                 <endouttext />
>             </foil>
>             <foil location="random" value="false" name="foil2">
>                 <startouttext /><m eval="on" display="mathjax">$ $RMSIntegral $</m><endouttext />
>             </foil>
>             <foil location="random" value="false" name="foil3">
>                 <startouttext /><m eval="on" display="mathjax">$ $AvgIntegral $</m><endouttext />
>             </foil>
>             <foil location="random" value="false" name="foil4">
>                 <startouttext />bla<endouttext />
>             </foil>
>             <foil location="random" value="false" name="foil5">
>                 <startouttext />This is foil Five, and it is currently set to "false."<endouttext />
>             </foil>
>         </foilgroup>
>     </radiobuttonresponse>
> I can’t send a snip of the display to the listserv, but it looks something like this:
> p(x) = rac1Tint0Tv(x)i(x)dx
> It responds to the _subscript and ^superscript, but completely ignores the \frac and \int commands. I know I must be doing something dumb, but don’t know what, and don’t understand why a different expression I pulled from a correctly working problem does not work in this one.
> If anyone can see what I’m doing wrong, please help. The exam is scheduled for first thing Tuesday morning…
> Best regards,
> Gene L. Harding, PE
> Associate Professor of ECET
> Purdue University
> 574-520-4190
> https://polytechnic.purdue.edu/south-bend/
> _______________________________________________
> LON-CAPA-users mailing list
> LON-CAPA-users at mail.lon-capa.org
> https://nam03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmail.lon-capa.org%2Fmailman%2Flistinfo%2Flon-capa-users&data=02%7C01%7Clucasm%40ohio.edu%7C417966d64bd94a6d4fe908d7d451c17e%7Cf3308007477c4a70888934611817c55a%7C0%7C0%7C637211319917211585&sdata=InAHZZPUryHES9bhFX8toubXNQ3XjwDE7GsejURH7Tw%3D&reserved=0

Mark Lucas 								email: lucasm at ohio.edu
252D Clippinger Lab						phone: (740)597-2984
Department of Physics and Astronomy			fax: (740)593-0433
Ohio University
Athens, OH 45701

LON-CAPA-users mailing list
LON-CAPA-users at mail.lon-capa.org

More information about the LON-CAPA-users mailing list