[LON-CAPA-users] tex(maxima_expression)

Seema Ali sali at vsb.bc.ca
Thu Feb 16 18:30:57 EST 2012


Thanks guys.  


-----Original Message-----
From: lon-capa-users-bounces at mail.lon-capa.org on behalf of Gerd Kortemeyer
Sent: Thu 2/16/2012 11:03 AM
To: Discussion list for LON-CAPA users
Subject: Re: [LON-CAPA-users] tex(maxima_expression)
 
Hi,

You can also use the tex1()-command in MAXIMA,

$texformula=&cas('maxima',"tex1($formula)");

The output is in inline-format, and I don't like the way it renders fractions, so the coming lines fix that:

$texformula=~s/\\\\/\\/gs;
$texformula=~s/^\"//;
$texformula=~s/\"$//;
$texformula=~s/\{([^\{]+)\}\\over\{([^\}]+)\}/\\frac\{$1\}\{$2\}/gs;

and then

<m eval="on" display="mimetex">\[$texformula\]</m>

I might package that into a convenient function call later.

- Gerd.


On Feb 16, 2012, at 12:42 PM, Stefan Bisitz wrote:

> Hi,
> 
> The <algebra> tag takes cares of pretting up the output of formulas using the preferred formular display style (see personal preferences and course settings):
> ----------------
> <problem>
> 
> <script type="loncapa/perl">
> $c=1;
> $d=4;
> $f = &cas('maxima', "trigsimp(abs(f(x+$c)) + $d)");
> </script>
> 
> <startouttext />
> <algebra>$f</algebra>
> <endouttext />
> 
> </problem>
> ----------------
> 
> 
> Stefan Bisitz
> 
> Am 16.02.2012 18:31 schrieb Seema Ali:
>> I get Maxima to pretty up an expression:
>> $fx = &cas('maxima', "trigsimp(abs(f(x+$c)) + $d)");
>> 
>> Example: $fx = abs(f(x+1)) - 4
>> 
>> And I'd like to display it like: |f(x+1)| - 4 instead of abs(f(x+1)) -
>> 4. Is that possible? In one of the manuals it said that tex(a,b) was not
>> implemented in LON CAPA.
>> 
>> Thanks.
>> 
>> 
>> 
>> _______________________________________________
>> LON-CAPA-users mailing list
>> LON-CAPA-users at mail.lon-capa.org
>> http://mail.lon-capa.org/mailman/listinfo/lon-capa-users
> 
> _______________________________________________
> LON-CAPA-users mailing list
> LON-CAPA-users at mail.lon-capa.org
> http://mail.lon-capa.org/mailman/listinfo/lon-capa-users

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.lon-capa.org/pipermail/lon-capa-users/attachments/20120216/7dc5b0f4/attachment-0001.html>


More information about the LON-CAPA-users mailing list