我想在使用\longtable
和横向环境中拆分一个很长的表格以自动在页面之间进行拆分。我的工作代码如下:
\documentclass{article}
\usepackage{longtable,rotating}
\begin{document}
\begin{sidewaystable}
\setlength{\arrayrulewidth}{0.1mm}
\setlength{\tabcolsep}{9pt}
\renewcommand{\arraystretch}{1.2}
\begin{longtable}{|c|c|c|}
\caption{Unipotent matrix of EEG signals of Patient $A$ at time $t=1$ to $t=15$ written as a summation of their respective semisimple and nilpotent parts}
\label{table:JCD-of-diagonal}\\
\hline
\textbf{Time ($t$)} & \textbf{Unipotent matrix of EEG signals} & \textbf{Semisimple $+$ Nilpotent} \\
\hline
\endfirsthead
\multicolumn{3}{c}%
{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
\hline
\textbf{Time ($t$)} & \textbf{Unipotent matrix of EEG signals} & \textbf{Semisimple $+$ Nilpotent} \\
\hline
\endhead
\hline \multicolumn{3}{r}{\textit{Continued on next page}} \\
\endfoot
\hline
\endlastfoot
1 & $\left(\begin{array}{cccc}
1 & -1.7693 & 2.3933 & 3.5579 \\
0 & 1 & -0.7405 & -1.4740 \\
0 & 0 & 1 & -1.8018 \\
0 & 0 & 0 & 1
\end{array}\right)$ & $\left(\begin{array}{cccc}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1
\end{array}\right)+\left(\begin{array}{cccc}
0 & -1.7693 & 2.3933 & 3.5579 \\
0 & 0 & -0.7405 & -1.4740 \\
0 & 0 & 0 & -1.8018 \\
0 & 0 & 0 & 0
\end{array}\right)$ \\ \hline
2 & $\left(\begin{array}{cccc}
1 & 0.5468 & -0.8309 & 8.8955 \\
0 & 1 & 2.4452 & 6.6199 \\
0 & 0 & 1 & 3.3119 \\
0 & 0 & 0 & 1
\end{array}\right)$ & $\left(\begin{array}{cccc}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1
\end{array}\right)+\left(\begin{array}{cccc}
0 & 0.5468 & -0.8309 & 8.8955 \\
0 & 0 & 2.4452 & 6.6199 \\
0 & 0 & 0 & 3.3119 \\
0 & 0 & 0 & 0
\end{array}\right)$ \\ \hline
3 & $\left(\begin{array}{cccc}
1 & 1.4185 & -0.2744 & -15.9462 \\
0 & 1 & -3.8254 & -11.4390 \\
0 & 0 & 1 & 1.1833 \\
0 & 0 & 0 & 1
\end{array}\right)$ & $\left(\begin{array}{cccc}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1
\end{array}\right)+\left(\begin{array}{cccc}
0 & 1.4185 & -0.2744 & -15.9462 \\
0 & 0 & -3.8254 & -11.4390 \\
0 & 0 & 0 & 1.1833 \\
0 & 0 & 0 & 0
\end{array}\right)$ \\ \hline
4 & $\left(\begin{array}{cccc}
1 & -0.4499 & 15.5040 & 1.2788 \\
0 & 1 & 13.9690 & -0.8115 \\
0 & 0 & 1 & 0.4189 \\
0 & 0 & 0 & 1
\end{array}\right)$ & $\left(\begin{array}{cccc}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1
\end{array}\right)+\left(\begin{array}{cccc}
0 & -0.4499 & 15.5040 & 1.2788 \\
0 & 0 & 13.9690 & -0.8115 \\
0 & 0 & 0 & 0.4189 \\
0 & 0 & 0 & 0
\end{array}\right)$ \\ \hline
5 & $\left(\begin{array}{cccc}
1 & -1.3695 & -22.3137 & 0.4863 \\
0 & 1 & -3.9190 & -0.1132 \\
0 & 0 & 1 & 0.3099 \\
0 & 0 & 0 & 1
\end{array}\right)$ & $\left(\begin{array}{cccc}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1
\end{array}\right)+\left(\begin{array}{cccc}
0 & -1.3695 & -22.3137 & 0.4863 \\
0 & 0 & -3.9190 & -0.1132 \\
0 & 0 & 0 & 0.3099 \\
0 & 0 & 0 & 0
\end{array}\right)$ \\ \hline
6 & $\left(\begin{array}{cccc}
1 & -0.8564 & -1.4359 & 1.4699 \\
0 & 1 & -0.1128 & -4404 \\
0 & 0 & 1 & 20.473 \\
0 & 0 & 0 & 1
\end{array}\right)$ & $\left(\begin{array}{cccc}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1
\end{array}\right)+\left(\begin{array}{cccc}
0 & -0.8564 & -1.4359 & 1.4699 \\
0 & 0 & -0.1128 & -4404 \\
0 & 0 & 0 & 20.473 \\
0 & 0 & 0 & 0
\end{array}\right)$ \\ \hline
7 & $\left(\begin{array}{cccc}
1 & -1.2084 & 20.7007 & -1.0977 \\
0 & 1 & 4.9237 & -0.2032 \\
0 & 0 & 1 & -0.0381 \\
0 & 0 & 0 & 1
\end{array}\right)$ & $\left(\begin{array}{cccc}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1
\end{array}\right)+\left(\begin{array}{cccc}
0 & -0.8564 & -1.4359 & 1.4699 \\
0 & 0 & -0.1128 & -0.2032 \\
0 & 0 & 0 & -0.0381 \\
0 & 0 & 0 & 0
\end{array}\right)$ \\ \hline
8 & $\left(\begin{array}{cccc}
1 & 0.3065 & -0.5738 & 0.7648 \\
0 & 1 & -0.6329 & -2.0170 \\
0 & 0 & 1 & -2.1552 \\
0 & 0 & 0 & 1
\end{array}\right)$ & $\left(\begin{array}{cccc}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1
\end{array}\right)+\left(\begin{array}{cccc}
0 & 0.3065 & -0.5738 & 0.7648 \\
0 & 0 & -0.6329 & -2.0170 \\
0 & 0 & 0 & -2.1552 \\
0 & 0 & 0 & 0
\end{array}\right)$ \\ \hline
8 & $\left(\begin{array}{cccc}
1 & 0.3065 & -0.5738 & 0.7648 \\
0 & 1 & -0.6329 & -2.0170 \\
0 & 0 & 1 & -2.1552 \\
0 & 0 & 0 & 1
\end{array}\right)$ & $\left(\begin{array}{cccc}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1
\end{array}\right)+\left(\begin{array}{cccc}
0 & 0.3065 & -0.5738 & 0.7648 \\
0 & 0 & -0.6329 & -2.0170 \\
0 & 0 & 0 & -2.1552 \\
0 & 0 & 0 & 0
\end{array}\right)$ \\ \hline
8 & $\left(\begin{array}{cccc}
1 & 0.3065 & -0.5738 & 0.7648 \\
0 & 1 & -0.6329 & -2.0170 \\
0 & 0 & 1 & -2.1552 \\
0 & 0 & 0 & 1
\end{array}\right)$ & $\left(\begin{array}{cccc}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1
\end{array}\right)+\left(\begin{array}{cccc}
0 & 0.3065 & -0.5738 & 0.7648 \\
0 & 0 & -0.6329 & -2.0170 \\
0 & 0 & 0 & -2.1552 \\
0 & 0 & 0 & 0
\end{array}\right)$ \\ \hline
\end{longtable}
\end{sidewaystable}
\end{document}
我怎样才能做到这一点?
答案1
正如之前的评论中提到的,您可以使用包中的环境longtable
内部来获取跨多页的旋转表。在下面的 MWE 中,我另外做了一些调整以改善对齐和间距。现在整个表格应该可以轻松放入两页中。landscape
pdflscape
以下是第一页的截图:
\documentclass{article}
\usepackage{longtable,pdflscape,array}
\usepackage[column=0]{cellspace}
\setlength{\cellspacetoplimit}{.5\tabcolsep}
\setlength{\cellspacebottomlimit}{\cellspacetoplimit}
\begin{document}
\begin{landscape}
\setlength{\LTcapwidth}{\linewidth}
\setlength{\arrayrulewidth}{0.1mm}
\setlength{\tabcolsep}{9pt}
% \renewcommand{\arraystretch}{1.2}
\begin{longtable}{|0c|0c|0c|}
\caption{Unipotent matrix of EEG signals of Patient $A$ at time $t=1$ to $t=15$ written as a summation of their respective semisimple and nilpotent parts}
\label{table:JCD-of-diagonal}\\
\hline
\textbf{Time ($t$)} & \textbf{Unipotent matrix of EEG signals} & \textbf{Semisimple $+$ Nilpotent} \\
\hline
\endfirsthead
\multicolumn{3}{c}%
{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
\hline
\textbf{Time ($t$)} & \textbf{Unipotent matrix of EEG signals} & \textbf{Semisimple $+$ Nilpotent} \\
\hline
\endhead
\hline \multicolumn{3}{r}{\textit{Continued on next page}} \\
\endfoot
\hline
\endlastfoot
1 & $\left(\begin{array}{c*{3}{wc{3em}}}
1 & -1.7693 & 2.3933 & 3.5579 \\
0 & 1 & -0.7405 & -1.4740 \\
0 & 0 & 1 & -1.8018 \\
0 & 0 & 0 & 1
\end{array}\right)$ & $\left(\begin{array}{cccc}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1
\end{array}\right)+\left(\begin{array}{c*{3}{wc{3em}}}
0 & -1.7693 & 2.3933 & 3.5579 \\
0 & 0 & -0.7405 & -1.4740 \\
0 & 0 & 0 & -1.8018 \\
0 & 0 & 0 & 0
\end{array}\right)$ \\ \hline
2 & $\left(\begin{array}{c*{3}{wc{3em}}}
1 & 0.5468 & -0.8309 & 8.8955 \\
0 & 1 & 2.4452 & 6.6199 \\
0 & 0 & 1 & 3.3119 \\
0 & 0 & 0 & 1
\end{array}\right)$ & $\left(\begin{array}{cccc}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1
\end{array}\right)+\left(\begin{array}{c*{3}{wc{3em}}}
0 & 0.5468 & -0.8309 & 8.8955 \\
0 & 0 & 2.4452 & 6.6199 \\
0 & 0 & 0 & 3.3119 \\
0 & 0 & 0 & 0
\end{array}\right)$ \\ \hline
3 & $\left(\begin{array}{c*{3}{wc{3em}}}
1 & 1.4185 & -0.2744 & -15.9462 \\
0 & 1 & -3.8254 & -11.4390 \\
0 & 0 & 1 & 1.1833 \\
0 & 0 & 0 & 1
\end{array}\right)$ & $\left(\begin{array}{cccc}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1
\end{array}\right)+\left(\begin{array}{c*{3}{wc{3em}}}
0 & 1.4185 & -0.2744 & -15.9462 \\
0 & 0 & -3.8254 & -11.4390 \\
0 & 0 & 0 & 1.1833 \\
0 & 0 & 0 & 0
\end{array}\right)$ \\ \hline
4 & $\left(\begin{array}{c*{3}{wc{3em}}}
1 & -0.4499 & 15.5040 & 1.2788 \\
0 & 1 & 13.9690 & -0.8115 \\
0 & 0 & 1 & 0.4189 \\
0 & 0 & 0 & 1
\end{array}\right)$ & $\left(\begin{array}{cccc}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1
\end{array}\right)+\left(\begin{array}{c*{3}{wc{3em}}}
0 & -0.4499 & 15.5040 & 1.2788 \\
0 & 0 & 13.9690 & -0.8115 \\
0 & 0 & 0 & 0.4189 \\
0 & 0 & 0 & 0
\end{array}\right)$ \\ \hline
5 & $\left(\begin{array}{c*{3}{wc{3em}}}
1 & -1.3695 & -22.3137 & 0.4863 \\
0 & 1 & -3.9190 & -0.1132 \\
0 & 0 & 1 & 0.3099 \\
0 & 0 & 0 & 1
\end{array}\right)$ & $\left(\begin{array}{cccc}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1
\end{array}\right)+\left(\begin{array}{c*{3}{wc{3em}}}
0 & -1.3695 & -22.3137 & 0.4863 \\
0 & 0 & -3.9190 & -0.1132 \\
0 & 0 & 0 & 0.3099 \\
0 & 0 & 0 & 0
\end{array}\right)$ \\ \hline
6 & $\left(\begin{array}{c*{3}{wc{3em}}}
1 & -0.8564 & -1.4359 & 1.4699 \\
0 & 1 & -0.1128 & -4404 \\
0 & 0 & 1 & 20.473 \\
0 & 0 & 0 & 1
\end{array}\right)$ & $\left(\begin{array}{cccc}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1
\end{array}\right)+\left(\begin{array}{c*{3}{wc{3em}}}
0 & -0.8564 & -1.4359 & 1.4699 \\
0 & 0 & -0.1128 & -4404 \\
0 & 0 & 0 & 20.473 \\
0 & 0 & 0 & 0
\end{array}\right)$ \\ \hline
7 & $\left(\begin{array}{c*{3}{wc{3em}}}
1 & -1.2084 & 20.7007 & -1.0977 \\
0 & 1 & 4.9237 & -0.2032 \\
0 & 0 & 1 & -0.0381 \\
0 & 0 & 0 & 1
\end{array}\right)$ & $\left(\begin{array}{cccc}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1
\end{array}\right)+\left(\begin{array}{c*{3}{wc{3em}}}
0 & -0.8564 & -1.4359 & 1.4699 \\
0 & 0 & -0.1128 & -0.2032 \\
0 & 0 & 0 & -0.0381 \\
0 & 0 & 0 & 0
\end{array}\right)$ \\ \hline
8 & $\left(\begin{array}{c*{3}{wc{3em}}}
1 & 0.3065 & -0.5738 & 0.7648 \\
0 & 1 & -0.6329 & -2.0170 \\
0 & 0 & 1 & -2.1552 \\
0 & 0 & 0 & 1
\end{array}\right)$ & $\left(\begin{array}{cccc}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1
\end{array}\right)+\left(\begin{array}{c*{3}{wc{3em}}}
0 & 0.3065 & -0.5738 & 0.7648 \\
0 & 0 & -0.6329 & -2.0170 \\
0 & 0 & 0 & -2.1552 \\
0 & 0 & 0 & 0
\end{array}\right)$ \\ \hline
8 & $\left(\begin{array}{c*{3}{wc{3em}}}
1 & 0.3065 & -0.5738 & 0.7648 \\
0 & 1 & -0.6329 & -2.0170 \\
0 & 0 & 1 & -2.1552 \\
0 & 0 & 0 & 1
\end{array}\right)$ & $\left(\begin{array}{cccc}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1
\end{array}\right)+\left(\begin{array}{c*{3}{wc{3em}}}
0 & 0.3065 & -0.5738 & 0.7648 \\
0 & 0 & -0.6329 & -2.0170 \\
0 & 0 & 0 & -2.1552 \\
0 & 0 & 0 & 0
\end{array}\right)$ \\ \hline
8 & $\left(\begin{array}{c*{3}{wc{3em}}}
1 & 0.3065 & -0.5738 & 0.7648 \\
0 & 1 & -0.6329 & -2.0170 \\
0 & 0 & 1 & -2.1552 \\
0 & 0 & 0 & 1
\end{array}\right)$ & $\left(\begin{array}{cccc}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1
\end{array}\right)+\left(\begin{array}{c*{3}{wc{3em}}}
0 & 0.3065 & -0.5738 & 0.7648 \\
0 & 0 & -0.6329 & -2.0170 \\
0 & 0 & 0 & -2.1552 \\
0 & 0 & 0 & 0
\end{array}\right)$ \\ \hline
\end{longtable}
\end{landscape}
\end{document}