我有以下用于 10x10 矩阵的 LaTex 代码(我从 Mathematica 导入),
"$$\begin{bmatrix*}[r]
-2 (\text{$\beta $111} +\text{$\beta $224} x^2 & 0
& 2 \text{$\alpha $111} & 2 \text{$\alpha $223} y^2 & 2 \text{$\alpha $224} x^2 &
0 & 0 & 0 & x y (\text{$\alpha $223}+\text{$\alpha $224}) & x y (\text{$\alpha
$223}+\text{$\alpha $224}) \\
+\text{$\beta $223} y^2)&&&&&&&&& \\
0 & -2 (\text{$\beta $222}+\text{$\beta $115} x^2
& 0 & 2 \text{$\alpha $115} x^2 & 2 \text{$\alpha $116} y^2 & 2 \text{$\alpha
$222} & 0 & 0 & -x y (\text{$\alpha $115}+\text{$\alpha $116}) & -x y
(\text{$\alpha $115}+\text{$\alpha $116}) \\
&+\text{$\beta $116} y^2)&&&&&&&& \\
2 \text{$\beta $111} & 0 & -2 (\text{$\alpha $111}+\text{$\beta $222}) & 0 & 0 & 0 &
2 \text{$\alpha $222} & 0 & 0 & 0 \\
2 \text{$\beta $223} y^2 & 2 \text{$\beta $115} x^2 & 0 & -2 (\text{$\alpha
$115} x^2+\text{$\beta $229} x^2 & 0 & 0 & 2 \text{$\alpha $117} y^2 & 2 \text{$\alpha $229} x^2 & -x y
(-\text{$\alpha $116}+\text{$\alpha $224}
& -x y (-\text{$\alpha $116}+\text{$\alpha $224} \\
&&&+\text{$\alpha $223} y^2+\text{$\beta $117}
y^2)&&&&&+\text{$\beta $118}-\text{$\beta $2210})&+\text{$\beta $118}-\text{$\beta
$2210})
\\
2 \text{$\beta $224} x^2 & 2 \text{$\beta $116} y^2 & 0 & 0 & -2 (\text{$\alpha
$224} x^2+\text{$\beta $118} x^2 & 0 & 2 \text{$\alpha $118} x^2 & 2 \text{$\alpha $2210} y^2 & -x y
(-\text{$\alpha $115}+\text{$\alpha $223} &
-x y (-\text{$\alpha $115}+\text{$\alpha $223} \\
&&&&+\text{$\alpha $116} y^2+\text{$\beta $2210}
y^2)&&&&+\text{$\beta $117}-\text{$\beta $229})&+\text{$\beta $117}-\text{$\beta
$229})
\\
0 & 2 \text{$\beta $222} & 0 & 0 & 0 & -2 (\text{$\alpha $222}+\text{$\beta $111}) &
0 & 2 \text{$\alpha $111} & 0 & 0 \\
0 & 0 & 2 \text{$\beta $222} & 2 \text{$\beta $117} y^2 & 2 \text{$\beta $118} x^2 &
0 & -2 (\text{$\alpha $222}+\text{$\alpha $117} x^2 & 0 & x y (\text{$\beta $117}+\text{$\beta $118}) & x y (\text{$\beta
$117}+\text{$\beta $118}) \\
&&&&&&+\text{$\alpha $118}
y^2)&&&\\
0 & 0 & 0 & 2 \text{$\beta $229} x^2 & 2 \text{$\beta $2210} y^2 & 2 \text{$\beta
$111} & 0 & -2 (\text{$\alpha $111}+\text{$\alpha $2210} x^2& -x y (\text{$\beta $2210}+\text{$\beta $229}) & -x y
(\text{$\beta $2210}+\text{$\beta $229})\\
&&&&&&&+\text{$\alpha
$229} y^2) && \\
x y (\text{$\beta $223}+\text{$\beta $224}) & -x y (\text{$\beta $115}+\text{$\beta
$116}) & 0 & x y (\text{$\alpha $118}-\text{$\alpha $2210} & x y (\text{$\alpha $117}-\text{$\alpha
$229} & 0 & x y (\text{$\alpha
$117}+\text{$\alpha $118}) & -x y (\text{$\alpha $2210}+\text{$\alpha $229}) & -i
(\text{l1}-\text{l2}) & 0 \\
&&&-\text{$\beta
$116}+\text{$\beta $224})&-\text{$\beta $115}+\text{$\beta $223})&&&&-\text{$\alpha $115} x^2-\text{$\alpha $224} x^2&
\\
&&&&&&&&-\text{$\beta
$118} x^2-\text{$\beta $229} x^2&
\\
&&&&&&&&-\text{$\alpha $116} y^2-\text{$\alpha $223}
y^2&
\\
&&&&&&&&-\text{$\beta $117} y^2-\text{$\beta $2210} y^2&
\\
x y (\text{$\beta $223}+\text{$\beta $224}) & -x y (\text{$\beta $115}+\text{$\beta
$116}) & 0 & x y (\text{$\alpha $118}-\text{$\alpha $2210} & x y (\text{$\alpha $117}-\text{$\alpha
$229} & 0 & x y (\text{$\alpha
$117}+\text{$\alpha $118}) & -x y (\text{$\alpha $2210}+\text{$\alpha $229}) & 0 &
-i (\text{l2}-\text{l1})
\\
&&&-\text{$\beta
$116}+\text{$\beta $224})&-\text{$\beta $115}+\text{$\beta $223})&&&&&-\text{$\alpha $115} x^2-\text{$\alpha $224}x^2
\\
&&&&&&&&&-\text{$\beta
$118} x^2-\text{$\beta $229} x^2
\\
&&&&&&&&&-\text{$\alpha $116} y^2-\text{$\alpha $223}
y^2
\\
&&&&&&&&&-\text{$\beta $117} y^2-\text{$\beta $2210} y^2 \\
\end{bmatrix*} $$
\end{document}
完整矩阵在 PDF 中适合以下乳胶格式,
\documentclass{standalone}
\usepackage{amsmath,mathtools,amsthm}
\usepackage{array}
还以这种格式附加了完整的矩阵。
但就格式而言,
\usepackage{setspace}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{siunitx}
\usepackage{geometry,mathtools}
\usepackage{comment}
\setcounter{MaxMatrixCols}{10}
\usepackage[a4paper,margin=1.5cm]{geometry}"
我正在处理以下文档类型的第六列,
那么,有没有什么办法可以适应这种格式的完整矩阵呢?
答案1
您的矩阵非常庞大,而且正如所写,无法放在一页上。可能的解决方案是将其分成两部分:
此解决方案基于以下假设:\alpha
和处的数字\beta
是它们的索引。如果是这种情况,请告知我们。
从代码中删除所有混乱的内容后,MWE 为:
\documentclass{article}
\usepackage[a4paper, margin=15mm]{geometry}
\usepackage{nccmath, mathtools}
\begin{document}
\begingroup
\setlength\arraycolsep{1pt}
\renewcommand\arraystretch{1.5}
\begin{multline}
\medmath{
\widehat{\widetilde{\mathcal{M}}} =
\left[\begin{array}{*{5}{c}}
\begin{multlined}[t]-2 \bigl(\beta_{111}+\\[-2.4ex]
\beta_{224} x^2+\beta_{223} y^2\bigr)\end{multlined}
& 0
& 2 \alpha_{111}
& 2 \alpha_{223} y^2
& 2 \alpha_{224} x^2 \\%%%%
0
& \begin{multlined}[t]-2 \bigl(\beta_{222}+\\[-2.4ex]
\beta_{115} x^2+\beta_{116} y^2\bigr)\end{multlined}
& 0
& 2 \alpha_{115} x^2
& 2 \alpha_{116} y^2 \\%%%%
\beta_{111}
& 0
& -2 \bigl(\alpha_{111}+\beta_{222}\bigr)
& 0
& 0 \\%%%%
2 \beta_{223} y^2
& 2 \beta_{115} x^2
& 0
& \begin{multlined}[t]-2 \bigl(\alpha_{115} x^2+ \beta_{229} x^2+ \\[-2.4ex]
\alpha_{223} y^2 + \beta_{117} y^2\bigr)\end{multlined}
& 0 \\%%%%
2 \beta_{224} x^2
& 2 \beta_{116} y^2
& 0
& 0
& \begin{multlined}[t]-2 \bigl(\alpha_{224} x^2+\beta_{118} x^2 +\\[-2.4ex]
\alpha_{116} y^2 +\beta_{2210}y^2\bigr)\end{multlined} \\%%%%
0
& 2 \beta_{222}
& 0
& 0
& 0 \\%%%%
0
& 0
& 2 \beta_{222}
& 2 \beta_{117} y^2
& 2 \beta_{118} x^2 \\%%%%
0
& 0
& 0
& 2 \beta_{229} x^2
& 2 \beta_{2210} y^2 \\%%%%
x y \bigl(\beta_{223}+\beta_{224}\bigr)
& -x y (\beta_{115}+\beta_{116}\bigr)
& 0
& \begin{multlined}[t]x y \bigl(\alpha_{118}-\alpha_{2210}-\\[-2.4ex]
\beta_{116}+\beta_{224}\bigr)\end{multlined}
& \begin{multlined}[t]x y \bigl(\alpha_{117}-\alpha_{229}-\\[-2.4ex]
\beta_{115}+\beta_{223}\bigr)\end{multlined} \\%%%%
x y \bigl(\beta_{223}+\beta_{224}\bigr)
& -x y \bigl(\beta_{115}+\beta_{116}\bigr)
& 0
& \begin{multlined}[t]v y \bigl(\alpha_{118}-\alpha_{2210}-\\[-2.4ex]
\beta_{116}+\beta_{224}\bigr)\end{multlined}
& \begin{multlined}[t]x y\bigl(\alpha_{117}-\alpha_{229}-\\[-1ex]
\beta_{115}+\beta_{223}\bigr)\end{multlined}
\end{array}\right.} \\
%%%%%%%%%%%%%% SECOND PART
\medmath{
\left.\begin{array}{*{5}{c}}
0
& 0
& 0
& x y \bigl(\alpha_{223}+\alpha_{224}\bigr)
& x y \bigl(\alpha_{223}+\alpha_{224}\bigr) \\
2 \alpha_{222}
& 0
& 0
& -x y \bigl(\alpha_{115}+\alpha_{116}\bigr)
& -x y \bigl(\alpha_{115}+\alpha_{116}\bigr) \\
0
& 2 \alpha_{222}
& 0
& 0
& 0 \\
0
& 2 \alpha_{117} y^2
& 2 \alpha_{229} x^2
& \begin{multlined}[t]
-x y \bigl(-\alpha_{116}+\alpha_{224}+\\[-2.4ex]
\beta_{118}-\beta_{2210}\bigr)\end{multlined}
& \begin{multlined}[t]-x\bigl(-\alpha_{116}+\alpha_{224}+\\[-2.4ex]
\beta_{118}-\beta_{2210}\bigr)\end{multlined} \\
0
& \begin{multlined}[t]
-2 \bigl(\alpha_{222}+\\[-2.4ex]
\alpha_{117} x^2+\alpha_{118} y^2\bigr)\end{multlined}
& 0
& x y (\beta_{117}+\beta_{118}\bigr)
& x y \bigl(\beta_{117}+\beta_{118}\bigr) \\
0
& 2 \alpha_{118} x^2
& 2 \alpha_{2210} y^2
& \begin{multlined}[t]
-x y\bigl(-\alpha_{115}+\alpha_{223}+\\[-2.4ex]
\beta_{117}-\beta_{229}\bigr)\end{multlined}
& \begin{multlined}[t]
-x y \bigl(-\alpha_{115}+\alpha_{223}+\\[-2.4ex] \beta_{117}-\beta_{229}\bigr)\end{multlined} \\
-2 \bigl(\alpha_{222}+\beta_{111}\bigr)
& 0
& 2 \alpha_{111}
& 0
& 0 \\
0
& \begin{multlined}[t]-2 \bigl(\alpha_{222}+\\[-2.4ex]
\alpha_{117} x^2+\alpha_{118} y^2\bigr)\end{multlined}
& 0
& x y (\beta_{117}+\beta_{118}\bigr)
& x y \bigl(\beta_{117}+\beta_{118}\bigr) \\
2 \beta_{111}
& 0
& \begin{multlined}[t]-2 \bigl(\alpha_{111}+\\[-2.4ex]
\alpha_{2210} x^2 +\alpha_{229} y^2\bigr)\end{multlined}
& -x y \bigl(\beta_{2210}+\beta_{229}\bigr)
& -x y\bigl(\beta_{2210}+\beta_{229}\bigr) \\
0
& x y \bigl(\alpha_{117}+\alpha_{118}\bigr)
& -x y \bigl(\alpha_{2210}+\alpha_{229}\bigr)
& \begin{multlined}[t]
-i (l1-l2)-\alpha_{115} x^2-\\[-2.4ex]
\alpha_{224} x^2-\beta_{118} x^2-\\
\beta_{229}x^2-\alpha_{116} y^2-\\
\alpha_{223}y^2-\beta_{117} y^2-\\
\beta_{2210} y^2\end{multlined}
& 0 \\
0
& x y \bigl(\alpha_{117}+\alpha_{118}\bigr)
& -x y \bigl(\alpha_{2210}+\alpha_{229}\bigr)
& 0
& \begin{multlined}[t]-i(l2-l1)-\alpha_{115}x^2-\\[-2.4ex]
\alpha_{224}x^2-\beta_{118} x^2-\\
\beta_{229} x^2-\alpha_{116}y^2-\\
\alpha_{223} y^2-\beta_{117} y^2-\\
\beta_{2210} y^2\end{multlined}
\end{array}\right]}
\end{multline}
\endgroup
\end{document}