<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7654.12">
<TITLE>RE: [LON-CAPA-users] tex(maxima_expression)</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>Thanks guys. <BR>
<BR>
<BR>
-----Original Message-----<BR>
From: lon-capa-users-bounces@mail.lon-capa.org on behalf of Gerd Kortemeyer<BR>
Sent: Thu 2/16/2012 11:03 AM<BR>
To: Discussion list for LON-CAPA users<BR>
Subject: Re: [LON-CAPA-users] tex(maxima_expression)<BR>
<BR>
Hi,<BR>
<BR>
You can also use the tex1()-command in MAXIMA,<BR>
<BR>
$texformula=&cas('maxima',"tex1($formula)");<BR>
<BR>
The output is in inline-format, and I don't like the way it renders fractions, so the coming lines fix that:<BR>
<BR>
$texformula=~s/\\\\/\\/gs;<BR>
$texformula=~s/^\"//;<BR>
$texformula=~s/\"$//;<BR>
$texformula=~s/\{([^\{]+)\}\\over\{([^\}]+)\}/\\frac\{$1\}\{$2\}/gs;<BR>
<BR>
and then<BR>
<BR>
<m eval="on" display="mimetex">\[$texformula\]</m><BR>
<BR>
I might package that into a convenient function call later.<BR>
<BR>
- Gerd.<BR>
<BR>
<BR>
On Feb 16, 2012, at 12:42 PM, Stefan Bisitz wrote:<BR>
<BR>
> Hi,<BR>
><BR>
> The <algebra> tag takes cares of pretting up the output of formulas using the preferred formular display style (see personal preferences and course settings):<BR>
> ----------------<BR>
> <problem><BR>
><BR>
> <script type="loncapa/perl"><BR>
> $c=1;<BR>
> $d=4;<BR>
> $f = &cas('maxima', "trigsimp(abs(f(x+$c)) + $d)");<BR>
> </script><BR>
><BR>
> <startouttext /><BR>
> <algebra>$f</algebra><BR>
> <endouttext /><BR>
><BR>
> </problem><BR>
> ----------------<BR>
><BR>
><BR>
> Stefan Bisitz<BR>
><BR>
> Am 16.02.2012 18:31 schrieb Seema Ali:<BR>
>> I get Maxima to pretty up an expression:<BR>
>> $fx = &cas('maxima', "trigsimp(abs(f(x+$c)) + $d)");<BR>
>><BR>
>> Example: $fx = abs(f(x+1)) - 4<BR>
>><BR>
>> And I'd like to display it like: |f(x+1)| - 4 instead of abs(f(x+1)) -<BR>
>> 4. Is that possible? In one of the manuals it said that tex(a,b) was not<BR>
>> implemented in LON CAPA.<BR>
>><BR>
>> Thanks.<BR>
>><BR>
>><BR>
>><BR>
>> _______________________________________________<BR>
>> LON-CAPA-users mailing list<BR>
>> LON-CAPA-users@mail.lon-capa.org<BR>
>> <A HREF="http://mail.lon-capa.org/mailman/listinfo/lon-capa-users">http://mail.lon-capa.org/mailman/listinfo/lon-capa-users</A><BR>
><BR>
> _______________________________________________<BR>
> LON-CAPA-users mailing list<BR>
> LON-CAPA-users@mail.lon-capa.org<BR>
> <A HREF="http://mail.lon-capa.org/mailman/listinfo/lon-capa-users">http://mail.lon-capa.org/mailman/listinfo/lon-capa-users</A><BR>
<BR>
_______________________________________________<BR>
LON-CAPA-users mailing list<BR>
LON-CAPA-users@mail.lon-capa.org<BR>
<A HREF="http://mail.lon-capa.org/mailman/listinfo/lon-capa-users">http://mail.lon-capa.org/mailman/listinfo/lon-capa-users</A><BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>