[LON-CAPA-users] math formatting

Todd Ruskell lon-capa-users@mail.lon-capa.org
Thu, 03 May 2007 15:58:23 -0600


Jay,

Try <m eval="on">\[1/ $a\]</m>.  The eval="on" tells the system to
escape the $a.  Depending on your situation, you may also want to
experiment with the &format command:

<m eval="on">\[1/ &format($a,'2e') \]</m>
<m eval="on">\[1/ &format($a,'3f') \]</m>

Todd

James Sullivan wrote:
> I'm having some trouble with formatting of math equations, specifically fractions. The following is a code snippet that demonstrates the issue. 
> 
> [code snippet follows]
> <!-- pt type="loncapa/perl">
> $a = &random(1,5,1);
> </scr -->
> <m>\[1/3\]</m>
> <m>\[1/$a\]</m>
> 
> The fraction 1/3 is displayed as I would expect. On the other hand the fraction with the variable denominator bombs out in latex with an error message like:
> 
> -------------------------------
> WARNING:
> **** Error: Fatal Abnormal eqdepth 2 on display equation exit, line 0
> occured while attempting to convert this TeX:
> \[1/$a\]
> -------------------------------
> 
> I assume I need to somehow escape the $a to pass the value of the perl variable. Can anyone provide some guidance on this.
> 
> Thanks a bunch,
> Jay
> 
> 
> 
> 
> 
> _______________________________________________
> LON-CAPA-users mailing list
> LON-CAPA-users@mail.lon-capa.org
> http://mail.lon-capa.org/mailman/listinfo/lon-capa-users

-- 
Dr. Todd Ruskell
Senior Lecturer, Department of Physics       Office:  Meyer Hall 326
Colorado School of Mines                     Phone: 303-384-2080
1523 Illinois Street                         Fax: 303-273-3919
Golden, CO 80401