Latex x Tex function



So far as I know, all TeX commands related to equations work identically
in LaTex.  I don't understand the error message about the } ... I cut
and pasted the answer into emacs and found the {} to be balanced.

There is a possibility of improving the appearance by adding small
spaces;  the source code would certainly allow the replacements
of 1\over2 etc   by \frac{1}{2}, but this would break the code
for users of TeX.  A command latex  in addition to tex could
be set up, if the alternatives are important.
RJF



Daniel Martins wrote:
> 
> Just a suggestion. Possibly most people use Latex rather than Tex. I
> am not suggesting anything like that Latex is worst or better than
> pure Tex. Possibly pure Tex is really better than Latex but I started
> with latex ...
> 
> In this case the tex function could be improved or maybe created a
> latex version in a not so near future.
> 
> Firstly I must refrain that my migration from Mathematica is being
> incredibly smooth and also that the Tex output from Maxima is
> ABSOLUTELY better than the equivalent Mathematica function.
> 
> I will present a Maxima session as an example
> 
> C83) mat:MATRIX([X+3*COS(X)^2-SIN(X)^2,0],[X+3*COS(X)^3-SIN(X),1]);
>                                         [      2           2           ]
>                                         [ - SIN (X) + 3 COS (X) + X  0 ]
> (D83)                                   [                              ]
>                                         [                 3            ]
>                                         [ - SIN(X) + 3 COS (X) + X   1 ]
> (C84) trigreduce(%);
>                                   [ COS(2 X)      COS(2 X)   1        1     ]
>                                   [ -------- + 3 (-------- + -) + X - -   0 ]
>                                   [    2             2       2        2     ]
> (D84)                             [                                         ]
>                                   [    COS(3 X)   3 COS(X)                  ]
>                                   [ 3 (-------- + --------) - SIN(X) + X  1 ]
>                                   [       4          4                      ]
> 
> >>>> Here  I obtain the Tex output
> 
> (C85) tex(%);
> $$\pmatrix{{{\cos 2\>X}\over{2}}+3\>\left({{\cos 2\>X}\over{2}}+
>  \mathchoice {{1}\over{2}}{{1}\over{2}}{1//2}{1//2}\right)+X-
>  \mathchoice {{1}\over{2}}{{1}\over{2}}{1//2}{1//2}&0\cr 3\>\left({{
>  \cos 3\>X}\over{4}}+{{3\>\left(\cos X\right)}\over{4}}\right)-\sin X
>  +X&1\cr }$$
> (D85)                                                FALSE
> (C86)
> 
> >>>> Here  is the output of latex when I include the equation above
> 
> This is TeX, Version 3.14159 (Web2C 7.3.1)
> (teste.tex
> LaTeX2e <1999/12/01> patch level 1
>  (...)
> ! Missing } inserted.
> <inserted text>
>                 }
> l.38 ...ce {{1}\over{2}}{{1}\over{2}}{1//2}{1//2}&
>                                                   0\cr 3\>\left({{
> ?
> 
> >>>> Then a suggestion that really works on latex. pmatrix is
> >>>> substituted by an
> \left(
>   \begin{array}[c]{cc}
>   \end{array}
> \right)
> 
> >>>> The result is
> 
> $$
> \left(
>   \begin{array}[c]{cc}
> {{\cos 2\>X}\over{2}}+3\>\left({{\cos 2\>X}\over{2}}+
>  \mathchoice {{1}\over{2}}{{1}\over{2}}{1//2}{1//2}\right)+X-
>  \mathchoice {{1}\over{2}}{{1}\over{2}}{1//2}{1//2}&0\cr 3\>\left({{
>  \cos 3\>X}\over{4}}+{{3\>\left(\cos X\right)}\over{4}}\right)-\sin X
>  +X&1\cr
> $$
> 
> >>>> And this works fine on latex. Just complain a little bit about the
> >>>> use of {1}\over{2}  instead of \frac{1}{2} which the most used
> >>>> command in Latex. But this is really not a crucial problem
> 
> _______________________________________________
> Maxima mailing list
> Maxima@www.math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima