[Tex/LaTex] Formatting maple for latex

exportformattingmaple2e

I am doing some linear programming in maple, and sometimes the matrices are quite large. I know that maple have a /latex(expression) function, but when I have a vector, that has fractions in it, it outputs:

\left[ \begin {array}{ccccccc} -23&0&0&-1&-8/3&0&-1/3
\\ \noalign{\medskip}9/2&1&0&1&2/3&0&-1/6\\ \noalign{\medskip}7/2&0&1&
1&1/3&0&1/6\\ \noalign{\medskip}3&0&0&3&-1/3&1&1/3\end {array}
 \right]

There are many things wrong with this, first of all when you copy+paste this into latex, it does not work since there is no space after the & also it displays fractions as -1/6 instead of -frac{1}{6}. Is there other packages to export maple to latex, or a way to edit the format of the current one? Hope you guys have the answer 🙂

Best Answer

I think I can help you to solve the problem. You need to delete all strings "\noalign{\medskip}" in your code

It works perfectly:

\left[ 
\begin {array}{ccccccc} 
-23  & 0 & 0 & -1 & -8/3 & 0 & -1/3\\ 
 9/2 & 1 & 0 &  1 &  2/3 & 0 & -1/6\\ 
 7/2 & 0 & 1 &  1 &  1/3 & 0 &  1/6\\ 
 3   & 0 & 0 &  3 & -1/3 & 1 &  1/3
 \end{array}\right]

You can test at here: http://www.wiris.com/editor/demo/en/mathml-latex

Related Question