
我想在 LaTeX 文件中插入一些相當長的矩陣,並且我想知道是否可以分割環境matrix
以允許矩陣顯示在多個頁面上,因為簡單地減少足夠的字體會使我的文字不可讀。這是一個最小的工作範例:
\documentclass[10pt,a4paper]{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
A=\begin{pmatrix}
0&0\\
0&0\\
0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0
\end{pmatrix}
\end{align*}
\end{document}
在這個例子中,我們看到,如果我們刪除最後一行零,矩陣將從第1 頁開始,而不是像這裡那樣從第2 頁開始,而如果我們繼續添加行,LaTeX 將繼續顯示這些附加元素並超出邊距。我應該明確指出,這不是我為論文設想的矩陣。
我應該精確地說,在我的具體情況下,矩陣有足夠的列來填充整頁。
答案1
一個可能的解決方案是將巨大的矩陣拆分為子矩陣:
\documentclass[10pt,a4paper]{article}
\usepackage{amsmath}
\begin{document}
\[
\mathbf{A}=\begin{pmatrix}
\mathbf{A}_1 \\
\mathbf{A}_2 \\
\mathbf{A}_3 \\
\mathbf{A}_4 \\
\end{pmatrix}
\]
where submatrices $\mathbf{A}_1$, $\mathbf{A}_2$, $\mathbf{A}_3$ and $\mathbf{A}_4$ are
\[
\mathbf{A}_1 = \begin{pmatrix}
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
\end{pmatrix}
\quad
\mathbf{A}_2 = \begin{pmatrix}
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
\end{pmatrix}
\quad
\mathbf{A}_3 = \begin{pmatrix}
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
\end{pmatrix}
\quad
\mathbf{A}_4 = \begin{pmatrix}
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
\end{pmatrix}
\]
\end{document}
答案2
您可以剪輯它,並有一點重疊以保持連續性。請注意,基線位於中心(或多或少),對應於視窗中的 0pt。 \strutbox
是一個包含 的預定義框\strut
,因此\ht\strutbox
的高度也是\strut
。
\documentclass[10pt,a4paper]{article}
\usepackage{amsmath}
\usepackage{adjustbox}
\newsavebox{\tempbox}
\begin{document}
\savebox{\tempbox}{\begin{minipage}{\textwidth}
\begin{align*}
A=\begin{pmatrix}
0&0\\
0&0\\
0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0\\
0&0\\0&0
\end{pmatrix}
\end{align*}
\end{minipage}}%
\adjustbox{clip=true,viewport=0pt {-\ht\strutbox} {\wd\tempbox} {\ht\tempbox}}{\usebox{\tempbox}}
\newpage
\adjustbox{clip=true,viewport=0pt {-\dp\tempbox} {\wd\tempbox} {\dp\strutbox}}{\usebox{\tempbox}}
\end{document}