我有一个很长的阵列
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{fourier}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage{array,longtable}\begin{document}
\[
\left(
\begin{array}{cc} \{18,24,30\} & \left(
\begin{array}{ccc}
-16 & 8 & 16 \\
-6 & 12 & -12 \\
0 & 0 & 0 \\
\end{array}
\right) \\
\{18,24,30\} & \left(
\begin{array}{ccc}
-16 & 8 & 16 \\
-4 & 20 & 22 \\
0 & 0 & 0 \\
\end{array}
\right) \\
\{18,24,30\} & \left(
\begin{array}{ccc}
-16 & 8 & 16 \\
0 & 0 & 0 \\
6 & -12 & 12 \\
\end{array}
\right) \\
\{18,24,30\} & \left(
\begin{array}{ccc}
-16 & 16 & -8 \\
-12 & -6 & 12 \\
0 & 0 & 0 \\
\end{array}
\right) \\
\{18,24,30\} & \left(
\begin{array}{ccc}
-12 & -6 & 12 \\
-4 & 10 & 28 \\
0 & 0 & 0 \\
\end{array}
\right) \\
\{18,24,30\} & \left(
\begin{array}{ccc}
-12 & -6 & 12 \\
0 & 0 & 0 \\
4 & -22 & 20 \\
\end{array}
\right) \\
\{18,24,30\} & \left(
\begin{array}{ccc}
-12 & -6 & 12 \\
0 & 0 & 0 \\
16 & -16 & 8 \\
\end{array}
\right) \\
\end{array}
\right)
\]
\end{document}
现在我想转换成形式(我在这里看到如何对齐长数组?)
\begin{longtable}{| *{4}{>{$}c<{$}} | }
\endfirsthead % blank header on first page
\multicolumn{4}{@{}l}{(\emph{array continued from previous page})}
\endhead
\multicolumn{4}{r@{}}{(\emph{array continued on next page})}
\endfoot
\endlastfoot
\{18,24,30\} & (-16, 8, 16) & (-6, 12, -12) & (0,0,0)\\
\{18,24,30\} & (-16, 8, 16) & (-4, 20,22) & (0,0,0)\\
\{18,24,30\} & (-16, 8, 16) & (0,0,0) & (6,-12,12)\\
\end{longtable}
在longtable
:
数组的左列是longtable的第一列(从左到右);
在右列中,第一行是 longtable 的第二列(从左到右);第二行是 longtable 的第三列,第三行是 longtable 的第四列。
我该如何转换它?
答案1
我还使用 pmatrix 简化了子数组。为了好玩,我使用 TikZ 在左侧和右侧添加了顶部和底部。
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{fourier}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage{array,longtable}
\usepackage{tikz}
\begin{document}
\begin{longtable}{| *{2}{>{$}c<{$}} | }
\endfirsthead % blank header on first page
\multicolumn{2}{@{}l}{(\emph{array continued from previous page})}
\endhead
\multicolumn{2}{r@{}}{(\emph{array continued on next page})}
\endfoot
\endlastfoot
% start of table
\multicolumn{2}{@{\tikz[overlay,xshift=.2pt,yshift=-4.3pt]{\draw (0,0) to[in=180,out=90] (5pt,5pt);}}c%
@{\tikz[overlay,xshift=-.2pt,yshift=-4.3pt]{\draw (-5pt,5pt) to[in=90,out=0] (0,0);}}}{ }\\
\{18,24,30\} & \begin{pmatrix}
-16 & 8 & 16 \\
-6 & 12 & -12 \\
0 & 0 & 0
\end{pmatrix}\\
\{18,24,30\} & \begin{pmatrix}
-16 & 8 & 16 \\
-4 & 20 & 22 \\
0 & 0 & 0
\end{pmatrix}\\
\multicolumn{2}{@{\tikz[overlay,xshift=.2pt]{\draw (0,10pt) to[in=180,out=270] (5pt,5pt);}}c%
@{\tikz[overlay,xshift=-.2pt]{\draw (-5pt,5pt) to[in=-90,out=0] (0,10pt);}}}{ }\\
\end{longtable}
\end{document}