矩阵从 Maple 转换为 LaTeX 的紧凑形式

矩阵从 Maple 转换为 LaTeX 的紧凑形式

我有一段从 maple 中提取到 TeX 文件中的代码,我希望在从该 TeX 文件编译出来的 PDF 文件中,能够显示矩阵 $m$ 和 $M$ 的所有条目,而不会因为它们太长而剪切它们(我尝试将 vspace 从 12pt 降低到 8pt,但似乎不起作用):

\documentclass{article}
\usepackage{maplestd2e}
\def\emptyline{\vspace{12pt}}
\begin{document}

\pagestyle{empty}
\DefineParaStyle{Maple Heading 1}
\DefineParaStyle{Maple Text Output}
\DefineParaStyle{Maple Dash Item}
\DefineParaStyle{Maple Bullet Item}
\DefineParaStyle{Maple Normal}
\DefineParaStyle{Maple Heading 4}
\DefineParaStyle{Maple Heading 3}
\DefineParaStyle{Maple Heading 2}
\DefineParaStyle{Maple Warning}
\DefineParaStyle{Maple Title}
\DefineParaStyle{Maple Error}
\DefineCharStyle{Maple Hyperlink}
\DefineCharStyle{Maple 2D Math}
\DefineCharStyle{Maple Maple Input}
\DefineCharStyle{Maple 2D Output}
\DefineCharStyle{Maple 2D Input}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{2d}{with(LinearAlgebra); -1}{\[\]}
\end{mapleinput}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{2d}{X := Matrix([[X11, X12, X13, X14, 0], [X21, X22, X23, 0, -X14], [X31, X32, 0, -X23, -X13], [X41, 0, -X32, -X22, -X12], [0, -X41, -X31, -X21, -X11]]); 1}{\[\]}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{X := Matrix(%id = 18446744073906084910)}{\[\displaystyle X\, := \, \left[ \begin {array}{ccccc} {\it X11}&{\it X12}&{\it X13}&{\it X14}&0\\ \noalign{\medskip}{\it X21}&{\it X22}&{\it X23}&0&-{\it X14}\\ \noalign{\medskip}{\it X31}&{\it X32}&0&-{\it X23}&-{\it X13}\\ \noalign{\medskip}{\it X41}&0&-{\it X32}&-{\it X22}&-{\it X12}\\ \noalign{\medskip}0&-{\it X41}&-{\it X31}&-{\it X21}&-{\it X11}\end {array} \right] \]}
\end{maplelatex}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{2d}{Y := Matrix([[Y11, Y12, Y13, Y14, 0], [Y21, Y22, Y23, 0, -Y14], [Y31, Y32, 0, -Y23, -Y13], [Y41, 0, -Y32, -Y22, -Y12], [0, -Y41, -Y31, -Y21, -Y11]]); 1}{\[\]}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{Y := Matrix(%id = 18446744073906078774)}{\[\displaystyle Y\, := \, \left[ \begin {array}{ccccc} {\it Y11}&{\it Y12}&{\it Y13}&{\it Y14}&0\\ \noalign{\medskip}{\it Y21}&{\it Y22}&{\it Y23}&0&-{\it Y14}\\ \noalign{\medskip}{\it Y31}&{\it Y32}&0&-{\it Y23}&-{\it Y13}\\ \noalign{\medskip}{\it Y41}&0&-{\it Y32}&-{\it Y22}&-{\it Y12}\\ \noalign{\medskip}0&-{\it Y41}&-{\it Y31}&-{\it Y21}&-{\it Y11}\end {array} \right] \]}
\end{maplelatex}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{2d}{M := Matrix([LinearAlgebra:-MatrixMatrixMultiply(X, Y)-LinearAlgebra:-MatrixMatrixMultiply(Y, X)]); 1}{\[\]}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{M := Matrix(%id = 18446744073906065646)}{\[\displaystyle M\, := \, \left[ \begin {array}{ccccc} {\it X12}\,{\it Y21}+{\it X13}\,{\it Y31}+{\it X14}\,{\it Y41}-{\it X21}\,{\it Y12}-{\it X31}\,{\it Y13}-{\it X41}\,{\it Y14}&{\it X11}\,{\it Y12}-{\it X12}\,{\it Y11}+{\it X12}\,{\it Y22}+{\it X13}\,{\it Y32}-{\it X22}\,{\it Y12}-{\it X32}\,{\it Y13}&{\it X11}\,{\it Y13}+{\it X12}\,{\it Y23}-{\it X13}\,{\it Y11}-{\it X14}\,{\it Y32}-{\it X23}\,{\it Y12}+{\it X32}\,{\it Y14}&{\it X11}\,{\it Y14}-{\it X13}\,{\it Y23}-{\it X14}\,{\it Y11}-{\it X14}\,{\it Y22}+{\it X22}\,{\it Y14}+{\it X23}\,{\it Y13}&0\\ \noalign{\medskip}-{\it X11}\,{\it Y21}+{\it X21}\,{\it Y11}-{\it X21}\,{\it Y22}+{\it X22}\,{\it Y21}+{\it X23}\,{\it Y31}-{\it X31}\,{\it Y23}&-{\it X12}\,{\it Y21}+{\it X14}\,{\it Y41}+{\it X21}\,{\it Y12}+{\it X23}\,{\it Y32}-{\it X32}\,{\it Y23}-{\it X41}\,{\it Y14}&-{\it X13}\,{\it Y21}+{\it X14}\,{\it Y31}+{\it X21}\,{\it Y13}+{\it X22}\,{\it Y23}-{\it X23}\,{\it Y22}-{\it X31}\,{\it Y14}&0&-{\it X11}\,{\it Y14}+{\it X13}\,{\it Y23}+{\it X14}\,{\it Y11}+{\it X14}\,{\it Y22}-{\it X22}\,{\it Y14}-{\it X23}\,{\it Y13}\\ \noalign{\medskip}-{\it X11}\,{\it Y31}-{\it X21}\,{\it Y32}-{\it X23}\,{\it Y41}+{\it X31}\,{\it Y11}+{\it X32}\,{\it Y21}+{\it X41}\,{\it Y23}&-{\it X12}\,{\it Y31}+{\it X13}\,{\it Y41}-{\it X22}\,{\it Y32}+{\it X31}\,{\it Y12}+{\it X32}\,{\it Y22}-{\it X41}\,{\it Y13}&0&{\it X13}\,{\it Y21}-{\it X14}\,{\it Y31}-{\it X21}\,{\it Y13}-{\it X22}\,{\it Y23}+{\it X23}\,{\it Y22}+{\it X31}\,{\it Y14}&-{\it X11}\,{\it Y13}-{\it X12}\,{\it Y23}+{\it X13}\,{\it Y11}+{\it X14}\,{\it Y32}+{\it X23}\,{\it Y12}-{\it X32}\,{\it Y14}\\ \noalign{\medskip}-{\it X11}\,{\it Y41}-{\it X22}\,{\it Y41}+{\it X31}\,{\it Y32}-{\it X32}\,{\it Y31}+{\it X41}\,{\it Y11}+{\it X41}\,{\it Y22}&0&{\it X12}\,{\it Y31}-{\it X13}\,{\it Y41}+{\it X22}\,{\it Y32}-{\it X31}\,{\it Y12}-{\it X32}\,{\it Y22}+{\it X41}\,{\it Y13}&{\it X12}\,{\it Y21}-{\it X14}\,{\it Y41}-{\it X21}\,{\it Y12}-{\it X23}\,{\it Y32}+{\it X32}\,{\it Y23}+{\it X41}\,{\it Y14}&-{\it X11}\,{\it Y12}+{\it X12}\,{\it Y11}-{\it X12}\,{\it Y22}-{\it X13}\,{\it Y32}+{\it X22}\,{\it Y12}+{\it X32}\,{\it Y13}\\ \noalign{\medskip}0&{\it X11}\,{\it Y41}+{\it X22}\,{\it Y41}-{\it X31}\,{\it Y32}+{\it X32}\,{\it Y31}-{\it X41}\,{\it Y11}-{\it X41}\,{\it Y22}&{\it X11}\,{\it Y31}+{\it X21}\,{\it Y32}+{\it X23}\,{\it Y41}-{\it X31}\,{\it Y11}-{\it X32}\,{\it Y21}-{\it X41}\,{\it Y23}&{\it X11}\,{\it Y21}-{\it X21}\,{\it Y11}+{\it X21}\,{\it Y22}-{\it X22}\,{\it Y21}-{\it X23}\,{\it Y31}+{\it X31}\,{\it Y23}&-{\it X12}\,{\it Y21}-{\it X13}\,{\it Y31}-{\it X14}\,{\it Y41}+{\it X21}\,{\it Y12}+{\it X31}\,{\it Y13}+{\it X41}\,{\it Y14}\end {array} \right] \]}
\end{maplelatex}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{2d}{x := Matrix([[x11, x12, x13, x14], [x21, x22, x23, x13], [x31, x32, -x22, -x12], [x41, x31, -x21, -x11]]); 1; y := Matrix([[y11, y12, y13, y14], [y21, y22, y23, y13], [y31, y32, -y22, -y12], [y41, y31, -y21, -y11]]); 1; m := LinearAlgebra:-MatrixMatrixMultiply(x, y)-LinearAlgebra:-MatrixMatrixMultiply(y, x)}{\[\]}
\end{mapleinput}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{x := Matrix(%id = 18446744073906068646)}{\[\displaystyle x\, := \, \left[ \begin {array}{cccc} {\it x11}&{\it x12}&{\it x13}&{\it x14}\\ \noalign{\medskip}{\it x21}&{\it x22}&{\it x23}&{\it x13}\\ \noalign{\medskip}{\it x31}&{\it x32}&-{\it x22}&-{\it x12}\\ \noalign{\medskip}{\it x41}&{\it x31}&-{\it x21}&-{\it x11}\end {array} \right] \]}
\end{maplelatex}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{y := Matrix(%id = 18446744073906062150)}{\[\displaystyle y\, := \, \left[ \begin {array}{cccc} {\it y11}&{\it y12}&{\it y13}&{\it y14}\\ \noalign{\medskip}{\it y21}&{\it y22}&{\it y23}&{\it y13}\\ \noalign{\medskip}{\it y31}&{\it y32}&-{\it y22}&-{\it y12}\\ \noalign{\medskip}{\it y41}&{\it y31}&-{\it y21}&-{\it y11}\end {array} \right] \]}
\end{maplelatex}
\mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{m := Matrix(%id = 18446744073906053358)}{\[\displaystyle m\, := \, \left[ \begin {array}{cccc} {\it x12}\,{\it y21}+{\it x13}\,{\it y31}+{\it x14}\,{\it y41}-{\it x21}\,{\it y12}-{\it x31}\,{\it y13}-{\it x41}\,{\it y14}&{\it x11}\,{\it y12}-{\it x12}\,{\it y11}+{\it x12}\,{\it y22}+{\it x13}\,{\it y32}+{\it x14}\,{\it y31}-{\it x22}\,{\it y12}-{\it x31}\,{\it y14}-{\it x32}\,{\it y13}&{\it x11}\,{\it y13}+{\it x12}\,{\it y23}-{\it x13}\,{\it y11}-{\it x13}\,{\it y22}-{\it x14}\,{\it y21}+{\it x21}\,{\it y14}+{\it x22}\,{\it y13}-{\it x23}\,{\it y12}&2\,{\it x11}\,{\it y14}+2\,{\it x12}\,{\it y13}-2\,{\it x13}\,{\it y12}-2\,{\it x14}\,{\it y11}\\ \noalign{\medskip}-{\it x11}\,{\it y21}+{\it x13}\,{\it y41}+{\it x21}\,{\it y11}-{\it x21}\,{\it y22}+{\it x22}\,{\it y21}+{\it x23}\,{\it y31}-{\it x31}\,{\it y23}-{\it x41}\,{\it y13}&-{\it x12}\,{\it y21}+{\it x13}\,{\it y31}+{\it x21}\,{\it y12}+{\it x23}\,{\it y32}-{\it x31}\,{\it y13}-{\it x32}\,{\it y23}&-2\,{\it x13}\,{\it y21}+2\,{\it x21}\,{\it y13}+2\,{\it x22}\,{\it y23}-2\,{\it x23}\,{\it y22}&{\it x11}\,{\it y13}+{\it x12}\,{\it y23}-{\it x13}\,{\it y11}-{\it x13}\,{\it y22}-{\it x14}\,{\it y21}+{\it x21}\,{\it y14}+{\it x22}\,{\it y13}-{\it x23}\,{\it y12}\\ \noalign{\medskip}-{\it x11}\,{\it y31}-{\it x12}\,{\it y41}-{\it x21}\,{\it y32}-{\it x22}\,{\it y31}+{\it x31}\,{\it y11}+{\it x31}\,{\it y22}+{\it x32}\,{\it y21}+{\it x41}\,{\it y12}&-2\,{\it x12}\,{\it y31}-2\,{\it x22}\,{\it y32}+2\,{\it x31}\,{\it y12}+2\,{\it x32}\,{\it y22}&{\it x12}\,{\it y21}-{\it x13}\,{\it y31}-{\it x21}\,{\it y12}-{\it x23}\,{\it y32}+{\it x31}\,{\it y13}+{\it x32}\,{\it y23}&-{\it x11}\,{\it y12}+{\it x12}\,{\it y11}-{\it x12}\,{\it y22}-{\it x13}\,{\it y32}-{\it x14}\,{\it y31}+{\it x22}\,{\it y12}+{\it x31}\,{\it y14}+{\it x32}\,{\it y13}\\ \noalign{\medskip}-2\,{\it x11}\,{\it y41}-2\,{\it x21}\,{\it y31}+2\,{\it x31}\,{\it y21}+2\,{\it x41}\,{\it y11}&-{\it x11}\,{\it y31}-{\it x12}\,{\it y41}-{\it x21}\,{\it y32}-{\it x22}\,{\it y31}+{\it x31}\,{\it y11}+{\it x31}\,{\it y22}+{\it x32}\,{\it y21}+{\it x41}\,{\it y12}&{\it x11}\,{\it y21}-{\it x13}\,{\it y41}-{\it x21}\,{\it y11}+{\it x21}\,{\it y22}-{\it x22}\,{\it y21}-{\it x23}\,{\it y31}+{\it x31}\,{\it y23}+{\it x41}\,{\it y13}&-{\it x12}\,{\it y21}-{\it x13}\,{\it y31}-{\it x14}\,{\it y41}+{\it x21}\,{\it y12}+{\it x31}\,{\it y13}+{\it x41}\,{\it y14}\end {array} \right] \]}
\end{maplelatex}
\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{2d}{}{\[\]}
\end{mapleinput}
\end{maplegroup}
\end{document}

在此处输入图片描述

相关内容