From: Eduardo O. <edu...@gm...> - 2022-08-24 00:45:53
|
Hi list, I am trying to learn how to define new operators that have "nice" representations in LaTeX and in display2d. Here is the example on which I am working. I want Eq5(aa, bb, cc, dd, ee) to be displayed as: aa = bb = cc = dd = ee To configure its LaTeX output I simply adapted the example in the section about "texput" here, (info "(maxima)Functions and Variables for TeX Output") and I wrote this: texEq5(ex) := block([a,b,c,d,e], [a,b,c,d,e] : args (ex), concat("\\begin{array}{rcl}", tex1(a), "&=&", tex1(b), "\\\\", "&=&", tex1(c), "\\\\", "&=&", tex1(d), "\\\\", "&=&", tex1(e), "\\\\", "\\end{array}")); texput(Eq5, texEq5); tex(Eq5(aa, bb, cc, dd, ee)); Here's the output of the last line above, indented by hand: $$\begin{array}{rcl} {\it aa} &=& {\it bb} \\ &=& {\it cc} \\ &=& {\it dd} \\ &=& {\it ee} \\ \end{array} $$ This was easy to do, and works great. But I couldn't find much documentation on how to configure how display2d displays "Eq5" objects. I was only able to write this prototype for the first step: MatrixEq5(ex) := block([a,b,c,d,e], [a,b,c,d,e] : args (ex), matrix([a,"=",b],["","=",c],["","=",d],["","=",e]))$ If I run this MatrixEq5(Eq5(aa, bb, cc, dd, ee)); the output is: [ aa = bb ] [ ] [ = cc ] [ ] [ = dd ] [ ] [ = ee ] So, questions: 1) How can I get rid of the outer "[]"s? 2) How can I get rid of the blank lines? 3) How can I make Eq5 objects be displayed with MatrixEq5? 4) Where can I find docs and examples about this? Thanks in advance! =) Eduardo Ochs http://angg.twu.net/eev-maxima.html |