[Aimmath-commit] AIM/WEB-INF/maple/aim LaTeX.mpl,1.6,1.7
Brought to you by:
gustav_delius,
npstrick
|
From: <mo...@us...> - 2003-09-10 15:26:14
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim
In directory sc8-pr-cvs1:/tmp/cvs-serv20004
Modified Files:
LaTeX.mpl
Log Message:
the last bug fix only worked with Maple 9. Hopefully this one will work with Maple 7,8,9 though I can't test it with Maple 8 or Maple 7
Index: LaTeX.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/LaTeX.mpl,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** LaTeX.mpl 10 Sep 2003 02:38:02 -0000 1.6
--- LaTeX.mpl 10 Sep 2003 15:26:09 -0000 1.7
***************
*** 177,268 ****
"",
proc(e)
! local subexp, den, ee, ff, subee, i, k, num, texlist, `\\,`,
! `\\frac `, `\\sqrt `, `{`, `}`, ccnt, keepcnt, ll, nlist;
! global _LatexSmallFractionConstant;
! option `Copyright (c) 1992 by the University of Waterloo. All rights reserved.`;
! if type(op(1, e), 'numeric') and op(1, e) < 0 then
! LaTeX:-CountCharacters(1);
! return `latex/latex/copy`('`-`'), `latex/print`(-e)
! end if;
! if type(op(1, e), 'numeric') then
! # i := _LatexSmallFractionConstant;
! # _LatexSmallFractionConstant := 50;
! texlist := `latex/print`(op(1, e)), `\\,`,
! `latex/print`(subsop(1 = 1, e));
! # _LatexSmallFractionConstant := i;
! return texlist
! end if;
! texlist := NULL;
! num := 1;
! den := 1;
! ee := e;
! for subee in [op(ee)] do
! if type(subee, 'fraction') then
! num := num*op(1, subee); den := den*op(2, subee)
! elif
! type(subee, '`^`') and type(op(2, subee), 'rational')
! and op(2, subee) < 0 then den := den/subee
! else num := num*subee
! end if
! end do;
! if den <> 1 then
! if type(num, '`latex/istall`') or
! type(den, '`latex/istall`') then
! if num <> 1 then
! texlist := `latex/print`(num);
! if type(num, '`+`') then texlist :=
! ` \\left( `, texlist, ` \\right) `
! end if
! else texlist := NULL
! end if;
! if type(den, '`*`') then den := [op(den)]
! else den := [den]
! end if;
! for subexp in den do
! nlist := `latex/print`(1/subexp);
! ll := LaTeX:-CheckLineBreak();
! texlist := texlist, nlist, ll
! end do;
! texlist
! else texlist := texlist, `{`, '`\\frac `', '`{`',
! `latex/print`(num), '`}`', '`{`',
! `latex/print`(den), '`}`', `}`
! end if
! else
! i := 1;
! ff := [op(ee)];
! for k to nops(ff) do
! keepcnt := LaTeX:-ResetCount();
! if type(ff[k], {'series', '`+`'}) then
! nlist := `latex/latex/prinpar`(ff[k])
! elif type(ff[k], 'complex'('numeric')) and
! nops(ff[k]) = 2 then
! nlist := `latex/latex/prinpar`(ff[k])
! elif i < nops(ee) and type(ff[k], 'function')
! and member(op(0, ff[k]), {diff, Diff}) then
! nlist := `latex/latex/prinpar`(ff[k])
! elif type(ff[k], 'function') and
! member(op(0, ff[k]), {`@`, `@@`}) then
! nlist := `latex/latex/prinpar`(ff[k])
! elif type(ff[k], procedure) then
! nlist := `latex/latex/prinpar`(ff[k])
! else nlist := `latex/print`(ff[k])
! end if;
! if i < nops(ee) and (
! i = 1 and type(op(1, ee), 'integer') or
! type(ff[k], '`!`') or
! type(ff[k], {'string', 'symbol'}) and
! 1 < length(ff[k]) or
! has([`latex/print`(ff[k])], '`\\sqrt `')) then
! nlist := nlist, `\\,`
! end if;
! ccnt := LaTeX:-SetCount(keepcnt);
! ll := LaTeX:-CheckLineBreak(ccnt);
! texlist := texlist, nlist, ll;
! i := i + 1
! end do
! end if;
! texlist
! end
):
--- 177,257 ----
"",
proc(e)
! local subexp, den, ee, ff, subee, i, k, num, texlist, `\\,`, `\\frac `,
! `\\sqrt `, `{`, `}`;
! global _LatexSmallFractionConstant;
! option
! `Copyright (c) 1992 by the University of Waterloo. All rights reserved.`;
! if type(op(1, e), 'numeric') and op(1, e) < 0 then
! return `latex/latex/copy`('`-`'), `latex/print`(-e)
! end if;
! if type(op(1, e), 'numeric') then
! # i := _LatexSmallFractionConstant;
! # _LatexSmallFractionConstant := 50;
! texlist := `latex/print`(op(1, e)), `\\,`,
! `latex/print`(subsop(1 = 1, e));
! # _LatexSmallFractionConstant := i;
! return texlist
! end if;
! texlist := NULL;
! num := 1;
! den := 1;
! ee := e;
! for subee in [op(ee)] do
! if type(subee, 'fraction') then
! num := num*op(1, subee); den := den*op(2, subee)
! elif type(subee, '`^`') and type(op(2, subee), 'rational') and
! op(2, subee) < 0 then den := den/subee
! else num := num*subee
! end if
! end do;
! if den <> 1 then
! if type(num, '`latex/istall`') or type(den, '`latex/istall`') then
! if num <> 1 then
! texlist := `latex/print`(num);
! if type(num, '`+`') then
! texlist := ` \\left( `, texlist, ` \\right) `
! end if
! else texlist := NULL
! end if;
! if type(den, '`*`') then den := [op(den)]
! else den := [den]
! end if;
! for subexp in den do
! texlist := texlist, `latex/print`(1/subexp)
! end do;
! texlist
! else texlist := texlist, `{`, '`\\frac `', '`{`',
! `latex/print`(num), '`}`', '`{`', `latex/print`(den), '`}`',
! `}`
! end if
! else
! i := 1;
! ff := [op(ee)];
! for k to nops(ff) do
! if type(ff[k], {'`+`', 'series'}) then
! texlist := texlist, `latex/latex/prinpar`(ff[k])
! elif type(ff[k], 'complex'('numeric')) and nops(ff[k]) = 2
! then texlist := texlist, `latex/latex/prinpar`(ff[k])
! elif i < nops(ee) and type(ff[k], 'function') and
! member(op(0, ff[k]), {diff, Diff}) then
! texlist := texlist, `latex/latex/prinpar`(ff[k])
! elif
! type(ff[k], 'function') and member(op(0, ff[k]), {`@`, `@@`})
! then texlist := texlist, `latex/latex/prinpar`(ff[k])
! elif type(ff[k], procedure) then
! texlist := texlist, `latex/latex/prinpar`(ff[k])
! else texlist := texlist, `latex/print`(ff[k])
! end if;
! if i < nops(ee) and (
! i = 1 and type(op(1, ee), 'integer') or type(ff[k], '`!`') or
! type(ff[k], {'symbol', 'string'}) and 1 < length(ff[k]) or
! has([`latex/print`(ff[k])], '`\\sqrt `')) then
! texlist := texlist, `\\,`
! end if;
! i := i + 1
! end do
! end if;
! texlist
! end
):
|