# How to align long array?

I use Mathematica and the command TeXForm to convert Equation. The array is too long. I try to find a way but I can't align this equation. How can I do?

\documentclass[12pt,a4paper]{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{fourier}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\begin{document}
$\left( \begin{array}{ccc} \{-7,-2,2\} & \{-5,8,0\} &\{-3,-6,4\} \\ \{-7,-2,2\} & \{-3,-6,4\} &\{7,-4,6\} \\ \{-7,-2,2\} & \{-3,6,10\} &\{4,8,9\} \\ \{-7,-2,4\} & \{-5,8,6\} & \{-3,-6,2\} \\ \{-7,-2,4\} & \{-3,-6,2\} &\{7,-4,0\} \\ \{-7,3,-1\} & \{-3,-5,7\} &\{4,-4,9\} \\ \{-7,3,7\} & \{-3,-5,-1\} &\{-2,8,9\} \\ \{-7,6,2\} & \{-5,-4,0\} &\{-3,10,4\} \\ \{-7,6,2\} & \{-3,-2,10\} &\{4,-4,9\} \\ \{-7,6,4\} & \{-3,10,2\} &\{7,8,0\} \\ \{-6,-2,-1\} & \{2,6,-5\} &\{7,8,0\} \\ \{-6,-2,7\} & \{-5,-4,0\} &\{2,6,11\} \\ \{-6,6,-1\} & \{2,-2,-5\} &\{7,-4,0\} \\ \{-6,6,7\} & \{-5,8,0\} &\{2,-2,11\} \\ \{-5,-4,0\} & \{5,-6,2\} &\{9,-2,4\} \\ \{-5,-4,6\} & \{-3,1,11\} &\{5,9,7\} \\ \{-5,-4,6\} & \{5,-6,4\} & \{9,-2,2\} \\ \{-5,-1,9\} & \{-3,-6,4\} &\{5,-2,-4\} \\ \{-5,5,-3\} & \{0,10,-1\} &\{8,6,7\} \\ \{-5,5,9\} & \{0,10,7\} &\{8,6,-1\} \\ \{-5,8,0\} & \{-3,9,7\} &\{5,1,11\} \\ \{-5,8,0\} & \{5,10,2\} & \{9,6,4\} \\ \{-3,-2,-4\} & \{5,-6,4\} &\{7,-1,9\} \\ \{-3,1,-5\} & \{5,9,-1\} &\{7,8,6\} \\ \{-3,9,-1\} & \{5,1,-5\} &\{7,-4,0\} \\ \{-2,-4,-3\} & \{0,6,-5\} &\{2,10,-1\} \\ \{-2,-4,-3\} & \{5,-5,-1\} &\{9,3,7\} \\ \{-2,-4,9\} & \{0,6,11\} &\{2,10,7\} \\ \{-2,8,-3\} & \{0,10,7\} &\{2,6,11\} \\ \{-2,8,9\} & \{0,10,-1\} &\{2,6,-5\} \\ \{0,-6,-1\} & \{2,-2,-5\} & \{4,8,-3\} \\ \{0,-6,7\} & \{2,-2,11\} &\{4,8,9\} \\ \{0,-2,-5\} & \{2,-6,-1\} &\{4,-4,9\} \\ \{0,-2,11\} & \{2,-6,7\} &\{4,-4,-3\} \\ \{0,6,-5\} & \{2,10,-1\} & \{4,8,9\} \\ \{0,6,11\} & \{2,10,7\} & \{4,8,-3\} \\ \{0,10,-1\} & \{2,6,-5\} & \{4,-4,-3\} \\ \{0,10,7\} & \{2,6,11\} & \{4,-4,9\} \\ \{4,-4,-3\} & \{5,6,10\} & \{9,-2,2\} \\ \{4,8,-3\} & \{5,-5,7\} &\{9,3,-1\} \\ \{4,8,-3\} & \{5,-2,10\} & \{9,6,2\} \\ \{5,-6,2\} & \{7,8,6\} &\{9,-2,4\} \\ \{5,-6,4\} & \{7,8,0\} &\{9,-2,2\} \\ \{5,10,4\} & \{7,-4,0\} &\{9,6,2\} \\ \{0,10,7\} & \{2,6,11\} & \{4,-4,9\} \\ \{4,-4,-3\} & \{5,6,10\} & \{9,-2,2\} \\ \{4,8,-3\} & \{5,-5,7\} & \{9,3,-1\} \\ \{4,8,-3\} & \{5,-2,10\} &\{9,6,2\} \\ \{5,-6,2\} & \{7,8,6\} & \{9,-2,4\} \\ \{5,-6,4\} & \{7,8,0\} &\{9,-2,2\} \\ \{5,10,4\} & \{7,-4,0\} &\{9,6,2\} \end{array} \right)$
\end{document}

• Do you want the single values (e.g. 7, 5, ...) to be aligned, or you want simply the triples to be aligned left or right? Dec 22, 2014 at 8:39

\documentclass[12pt,a4paper]{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{fourier}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\begin{document}
\small$\left(\begin{array}{*{3}{r@{,}r@{,}r}} \{-7&-2&2\} & \{-5&8&0\} &\{-3&-6&4\} \\ \{-7&-2&2\} & \{-3&-6&4\} &\{7&-4&6\} \\ \{-7&-2&2\} & \{-3&6&10\} &\{4&8&9\} \\ \{-7&-2&4\} & \{-5&8&6\} & \{-3&-6&2\} \\ \{-7&-2&4\} & \{-3&-6&2\} &\{7&-4&0\} \\ \{-7&3&-1\} & \{-3&-5&7\} &\{4&-4&9\} \\ \{-7&3&7\} & \{-3&-5&-1\} &\{-2&8&9\} \\ \{-7&6&2\} & \{-5&-4&0\} &\{-3&10&4\} \\ \{-7&6&2\} & \{-3&-2&10\} &\{4&-4&9\} \\ \{-7&6&4\} & \{-3&10&2\} &\{7&8&0\} \\ \{-6&-2&-1\} & \{2&6&-5\} &\{7&8&0\} \\ \{-6&-2&7\} & \{-5&-4&0\} &\{2&6&11\} \\ \{-6&6&-1\} & \{2&-2&-5\} &\{7&-4&0\} \\ \{-6&6&7\} & \{-5&8&0\} &\{2&-2&11\} \\ \{-5&-4&0\} & \{5&-6&2\} &\{9&-2&4\} \\ \{-5&-4&6\} & \{-3&1&11\} &\{5&9&7\} \\ \{-5&-4&6\} & \{5&-6&4\} & \{9&-2&2\} \\ \{-5&-1&9\} & \{-3&-6&4\} &\{5&-2&-4\} \\ \{-5&5&-3\} & \{0&10&-1\} &\{8&6&7\} \\ \{-5&5&9\} & \{0&10&7\} &\{8&6&-1\} \\ \{-5&8&0\} & \{-3&9&7\} &\{5&1&11\} \\ \{-5&8&0\} & \{5&10&2\} & \{9&6&4\} \\ \{-3&-2&-4\} & \{5&-6&4\} &\{7&-1&9\} \\ \{-3&1&-5\} & \{5&9&-1\} &\{7&8&6\} \\ \{-3&9&-1\} & \{5&1&-5\} &\{7&-4&0\} \\ \{-2&-4&-3\} & \{0&6&-5\} &\{2&10&-1\} \\ \{-2&-4&-3\} & \{5&-5&-1\} &\{9&3&7\} \\ \{-2&-4&9\} & \{0&6&11\} &\{2&10&7\} \\ \{-2&8&-3\} & \{0&10&7\} &\{2&6&11\} \\ \{-2&8&9\} & \{0&10&-1\} &\{2&6&-5\} \\ \{0&-6&-1\} & \{2&-2&-5\} & \{4&8&-3\} \\ \{0&-6&7\} & \{2&-2&11\} &\{4&8&9\} \\ \{0&-2&-5\} & \{2&-6&-1\} &\{4&-4&9\} \\ \{0&-2&11\} & \{2&-6&7\} &\{4&-4&-3\} \\ \{0&6&-5\} & \{2&10&-1\} & \{4&8&9\} \\ \{0&6&11\} & \{2&10&7\} & \{4&8&-3\} \\ \{0&10&-1\} & \{2&6&-5\} & \{4&-4&-3\} \\ \{0&10&7\} & \{2&6&11\} & \{4&-4&9\} \\ \{4&-4&-3\} & \{5&6&10\} & \{9&-2&2\} \\ \{4&8&-3\} & \{5&-5&7\} &\{9&3&-1\} \\ \{4&8&-3\} & \{5&-2&10\} & \{9&6&2\} \\ \{5&-6&2\} & \{7&8&6\} &\{9&-2&4\} \\ \{5&-6&4\} & \{7&8&0\} &\{9&-2&2\} \\ \{5&10&4\} & \{7&-4&0\} &\{9&6&2\} \\ \{0&10&7\} & \{2&6&11\} & \{4&-4&9\} \\ \{4&-4&-3\} & \{5&6&10\} & \{9&-2&2\} \\ \{4&8&-3\} & \{5&-5&7\} & \{9&3&-1\} \\ \{4&8&-3\} & \{5&-2&10\} &\{9&6&2\} \\ \{5&-6&2\} & \{7&8&6\} & \{9&-2&4\} \\ \{5&-6&4\} & \{7&8&0\} &\{9&-2&2\} \\ \{5&10&4\} & \{7&-4&0\} &\{9&6&2\} \end{array}\right)$
\end{document}

• wouldn't it be possible to define a delimited macro, say \3{#1,#2,#3} that would expand to format the triple? if the way the columns are shown in the question is the way they come out of mathematica, it would mean a lot less hand editing. (although a global replacement of all commas with &s would shorten that considerably.) Dec 22, 2014 at 13:52
• @barbarabeeton as you know anything's possible:-) although actually I think adding \3 is a more involved edit than simply globally replacing , by & which is all I did here Dec 22, 2014 at 14:02

Here are two approaches depending on your needs. Each needs hand editing of the output. Results and full code are shown at the bottom.

# Approach 1

As the whole expression is enclosed in parentheses there is not standard way to do this. I suggest you describe the matrix as

X = ( X_1 )
( X_2 )


where X_1 and X_2 are smaller submatrices that will fit in the space available. Now insert X_1 = before the \left(\begin{array} and insert

\end{array}\right)\]
and
X_2 = \left( \begin{array}{ccc}  at a place appropriate for the page break. (An alternative, would be to place the definitions of X_1 and X_2 in floating environments such as table and reference those tables. Then you would just have to make sure each X_i is smaller than one page.) # Approach 2 If the parentheses are not important, then you can either use the longtable package, or mdframed. Neither will need choosing the page break by hand. Here is an mdframed approach. Replace the \[\left(\array{ccc}' and\end{array}\right)] by \begin{mdframed}[hidealllines=true] \allowdisplaybreaks \begin{align*}  and \end{align*} \end{mdframed}  and replace each & by &&. # Result of approach 1 # Result of approach 2 # Code for approach 1 \documentclass[12pt,a4paper]{article} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{fourier} \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry} \usepackage{lipsum}% for dummy text \begin{document} \lipsum[1-2] \begin{equation*} X = \begin{pmatrix} X_1 \\ X_2 \end{pmatrix} , \end{equation*} where \[ X_1 = \left( \begin{array}{ccc} \{-7,-2,2\} & \{-5,8,0\} &\{-3,-6,4\} \\ \{-7,-2,2\} & \{-3,-6,4\} &\{7,-4,6\} \\ \{-7,-2,2\} & \{-3,6,10\} &\{4,8,9\} \\ \{-7,-2,4\} & \{-5,8,6\} & \{-3,-6,2\} \\ \{-7,-2,4\} & \{-3,-6,2\} &\{7,-4,0\} \\ \{-7,3,-1\} & \{-3,-5,7\} &\{4,-4,9\} \\ \{-7,3,7\} & \{-3,-5,-1\} &\{-2,8,9\} \\ \{-7,6,2\} & \{-5,-4,0\} &\{-3,10,4\} \\ \{-7,6,2\} & \{-3,-2,10\} &\{4,-4,9\} \\ \{-7,6,4\} & \{-3,10,2\} &\{7,8,0\} \\ \{-6,-2,-1\} & \{2,6,-5\} &\{7,8,0\} \\ \{-6,-2,7\} & \{-5,-4,0\} &\{2,6,11\} \\ \{-6,6,-1\} & \{2,-2,-5\} &\{7,-4,0\} \\ \{-6,6,7\} & \{-5,8,0\} &\{2,-2,11\} \\ \{-5,-4,0\} & \{5,-6,2\} &\{9,-2,4\} \\ \{-5,-4,6\} & \{-3,1,11\} &\{5,9,7\} \\ \{-5,-4,6\} & \{5,-6,4\} & \{9,-2,2\} \\ \{-5,-1,9\} & \{-3,-6,4\} &\{5,-2,-4\} \\ \{-5,5,-3\} & \{0,10,-1\} &\{8,6,7\} \\ \{-5,5,9\} & \{0,10,7\} &\{8,6,-1\} \\ \{-5,8,0\} & \{-3,9,7\} &\{5,1,11\} \\ \{-5,8,0\} & \{5,10,2\} & \{9,6,4\} \\ \{-3,-2,-4\} & \{5,-6,4\} &\{7,-1,9\} \\ \{-3,1,-5\} & \{5,9,-1\} &\{7,8,6\} \\ \{-3,9,-1\} & \{5,1,-5\} &\{7,-4,0\} \\ \{-2,-4,-3\} & \{0,6,-5\} &\{2,10,-1\}\\ \{-2,-4,-3\} & \{5,-5,-1\} &\{9,3,7\} \\ \{-2,-4,9\} & \{0,6,11\} &\{2,10,7\} \\ \{-2,8,-3\} & \{0,10,7\} &\{2,6,11\} \\ \{-2,8,9\} & \{0,10,-1\} &\{2,6,-5\} \\ \{0,-6,-1\} & \{2,-2,-5\} & \{4,8,-3\} \\ \end{array}\right)
and
$X_2 = \left( \begin{array}{ccc} \{0,-6,7\} & \{2,-2,11\} &\{4,8,9\} \\ \{0,-2,-5\} & \{2,-6,-1\} &\{4,-4,9\} \\ \{0,-2,11\} & \{2,-6,7\} &\{4,-4,-3\} \\ \{0,6,-5\} & \{2,10,-1\} & \{4,8,9\} \\ \{0,6,11\} & \{2,10,7\} & \{4,8,-3\} \\ \{0,10,-1\} & \{2,6,-5\} & \{4,-4,-3\} \\ \{0,10,7\} & \{2,6,11\} & \{4,-4,9\} \\ \{4,-4,-3\} & \{5,6,10\} & \{9,-2,2\} \\ \{4,8,-3\} & \{5,-5,7\} &\{9,3,-1\} \\ \{4,8,-3\} & \{5,-2,10\} & \{9,6,2\} \\ \{5,-6,2\} & \{7,8,6\} &\{9,-2,4\} \\ \{5,-6,4\} & \{7,8,0\} &\{9,-2,2\} \\ \{5,10,4\} & \{7,-4,0\} &\{9,6,2\} \\ \{0,10,7\} & \{2,6,11\} & \{4,-4,9\} \\ \{4,-4,-3\} & \{5,6,10\} & \{9,-2,2\} \\ \{4,8,-3\} & \{5,-5,7\} & \{9,3,-1\} \\ \{4,8,-3\} & \{5,-2,10\} &\{9,6,2\} \\ \{5,-6,2\} & \{7,8,6\} & \{9,-2,4\} \\ \{5,-6,4\} & \{7,8,0\} &\{9,-2,2\} \\ \{5,10,4\} & \{7,-4,0\} &\{9,6,2\} \end{array} \right)$
\end{document}


# Code for approach 2

\documentclass[12pt,a4paper]{article}

\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{fourier}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}

\usepackage[tikz]{mdframed}

\usepackage{lipsum}% for dummy text

\begin{document}

\lipsum[1-2]

\begin{mdframed}[hidealllines=true]
\allowdisplaybreaks
\begin{align*}
\{-7,-2,2\} && \{-5,8,0\} &&\{-3,-6,4\} \\
\{-7,-2,2\} && \{-3,-6,4\} &&\{7,-4,6\} \\
\{-7,-2,2\} && \{-3,6,10\} &&\{4,8,9\} \\
\{-7,-2,4\} && \{-5,8,6\} && \{-3,-6,2\} \\
\{-7,-2,4\} && \{-3,-6,2\} &&\{7,-4,0\} \\
\{-7,3,-1\} && \{-3,-5,7\} &&\{4,-4,9\} \\
\{-7,3,7\} && \{-3,-5,-1\} &&\{-2,8,9\} \\
\{-7,6,2\} && \{-5,-4,0\} &&\{-3,10,4\} \\
\{-7,6,2\} && \{-3,-2,10\} &&\{4,-4,9\} \\
\{-7,6,4\} && \{-3,10,2\} &&\{7,8,0\} \\
\{-6,-2,-1\} && \{2,6,-5\} &&\{7,8,0\} \\
\{-6,-2,7\} && \{-5,-4,0\} &&\{2,6,11\} \\
\{-6,6,-1\} && \{2,-2,-5\} &&\{7,-4,0\} \\
\{-6,6,7\} && \{-5,8,0\} &&\{2,-2,11\} \\
\{-5,-4,0\} && \{5,-6,2\} &&\{9,-2,4\} \\
\{-5,-4,6\} && \{-3,1,11\} &&\{5,9,7\} \\
\{-5,-4,6\} && \{5,-6,4\} && \{9,-2,2\} \\
\{-5,-1,9\} && \{-3,-6,4\} &&\{5,-2,-4\} \\
\{-5,5,-3\} && \{0,10,-1\} &&\{8,6,7\} \\
\{-5,5,9\} && \{0,10,7\} &&\{8,6,-1\} \\
\{-5,8,0\} && \{-3,9,7\} &&\{5,1,11\} \\
\{-5,8,0\} && \{5,10,2\} && \{9,6,4\} \\
\{-3,-2,-4\} && \{5,-6,4\} &&\{7,-1,9\} \\
\{-3,1,-5\} && \{5,9,-1\} &&\{7,8,6\} \\
\{-3,9,-1\} && \{5,1,-5\} &&\{7,-4,0\} \\
\{-2,-4,-3\} && \{0,6,-5\} &&\{2,10,-1\}\\
\{-2,-4,-3\} && \{5,-5,-1\} &&\{9,3,7\} \\
\{-2,-4,9\} && \{0,6,11\} &&\{2,10,7\} \\
\{-2,8,-3\} && \{0,10,7\} &&\{2,6,11\} \\
\{-2,8,9\} && \{0,10,-1\} &&\{2,6,-5\} \\
\{0,-6,-1\} && \{2,-2,-5\} && \{4,8,-3\} \\
\{0,-6,7\} && \{2,-2,11\} &&\{4,8,9\} \\
\{0,-2,-5\} && \{2,-6,-1\} &&\{4,-4,9\} \\
\{0,-2,11\} && \{2,-6,7\} &&\{4,-4,-3\} \\
\{0,6,-5\} && \{2,10,-1\} && \{4,8,9\} \\
\{0,6,11\} && \{2,10,7\} && \{4,8,-3\} \\
\{0,10,-1\} && \{2,6,-5\} && \{4,-4,-3\} \\
\{0,10,7\} && \{2,6,11\} && \{4,-4,9\} \\
\{4,-4,-3\} && \{5,6,10\} && \{9,-2,2\} \\
\{4,8,-3\} && \{5,-5,7\} &&\{9,3,-1\} \\
\{4,8,-3\} && \{5,-2,10\} && \{9,6,2\} \\
\{5,-6,2\} && \{7,8,6\} &&\{9,-2,4\} \\
\{5,-6,4\} && \{7,8,0\} &&\{9,-2,2\} \\
\{5,10,4\} && \{7,-4,0\} &&\{9,6,2\} \\
\{0,10,7\} && \{2,6,11\} && \{4,-4,9\} \\
\{4,-4,-3\} && \{5,6,10\} && \{9,-2,2\} \\
\{4,8,-3\} && \{5,-5,7\} && \{9,3,-1\} \\
\{4,8,-3\} && \{5,-2,10\} &&\{9,6,2\} \\
\{5,-6,2\} && \{7,8,6\} && \{9,-2,4\} \\
\{5,-6,4\} && \{7,8,0\} &&\{9,-2,2\} \\
\{5,10,4\} && \{7,-4,0\} &&\{9,6,2\}\\
\end{align*}
\end{mdframed}

\end{document}


You could use a longtable environment with nine columns. Each column is processed automatically processed in math mode, and curly braces and commas are inserted automatically. Because a longtable can break across pages, you don't have to worry about allowing (or disallowing...) page breaks just to make the array fit on a page.

The first half dozen rows of the resulting array look like this:

\documentclass[12pt,a4paper]{article}
\usepackage[margin=2cm]{geometry}
\usepackage{fourier,longtable,array}
\begin{document}
\begin{longtable}{| *{3}{>{$\{}r<{$} @{,\,} >{$}r<{$} @{,\,} >{$}r<{\}$} } |}
\multicolumn{9}{l}{(\emph{array continued from previous page})}
\multicolumn{9}{r}{(\emph{array continued on next page})}
\endfoot
\endlastfoot  % blank footer on final page
-7 & -2 & 2 & -5 & 8 & 0 &-3 & -6 & 4 \\
-7 & -2 & 2 & -3 & -6 & 4 &7 & -4 & 6 \\
-7 & -2 & 2 & -3 & 6 & 10 &4 & 8 & 9 \\
-7 & -2 & 4 & -5 & 8 & 6 & -3 & -6 & 2 \\
-7 & -2 & 4 & -3 & -6 & 2 &7 & -4 & 0 \\
-7 & 3 & -1 & -3 & -5 & 7 &4 & -4 & 9 \\
-7 & 3 & 7 & -3 & -5 & -1 &-2 & 8 & 9 \\
-7 & 6 & 2 & -5 & -4 & 0 &-3 & 10 & 4 \\
-7 & 6 & 2 & -3 & -2 & 10 &4 & -4 & 9 \\
-7 & 6 & 4 & -3 & 10 & 2 &7 & 8 & 0 \\
-6 & -2 & -1 & 2 & 6 & -5 &7 & 8 & 0 \\
-6 & -2 & 7 & -5 & -4 & 0 &2 & 6 & 11 \\
-6 & 6 & -1 & 2 & -2 & -5 &7 & -4 & 0 \\
-6 & 6 & 7 & -5 & 8 & 0 &2 & -2 & 11 \\
-5 & -4 & 0 & 5 & -6 & 2 &9 & -2 & 4 \\
-5 & -4 & 6 & -3 & 1 & 11 &5 & 9 & 7 \\
-5 & -4 & 6 & 5 & -6 & 4 & 9 & -2 & 2 \\
-5 & -1 & 9 & -3 & -6 & 4 &5 & -2 & -4 \\
-5 & 5 & -3 & 0 & 10 & -1 &8 & 6 & 7 \\
-5 & 5 & 9 & 0 & 10 & 7 &8 & 6 & -1 \\
-5 & 8 & 0 & -3 & 9 & 7 &5 & 1 & 11 \\
-5 & 8 & 0 & 5 & 10 & 2 & 9 & 6 & 4 \\
-3 & -2 & -4 & 5 & -6 & 4 &7 & -1 & 9 \\
-3 & 1 & -5 & 5 & 9 & -1 &7 & 8 & 6 \\
-3 & 9 & -1 & 5 & 1 & -5 &7 & -4 & 0 \\
-2 & -4 & -3 & 0 & 6 & -5 &2 & 10 & -1 \\
-2 & -4 & -3 & 5 & -5 & -1 &9 & 3 & 7 \\
-2 & -4 & 9 & 0 & 6 & 11 &2 & 10 & 7 \\
-2 & 8 & -3 & 0 & 10 & 7 &2 & 6 & 11 \\
-2 & 8 & 9 & 0 & 10 & -1 &2 & 6 & -5 \\
0 & -6 & -1 & 2 & -2 & -5 & 4 & 8 & -3 \\
0 & -6 & 7 & 2 & -2 & 11 &4 & 8 & 9 \\
0 & -2 & -5 & 2 & -6 & -1 &4 & -4 & 9 \\
0 & -2 & 11 & 2 & -6 & 7 &4 & -4 & -3 \\
0 & 6 & -5 & 2 & 10 & -1 & 4 & 8 & 9 \\
0 & 6 & 11 & 2 & 10 & 7 & 4 & 8 & -3 \\
0 & 10 & -1 & 2 & 6 & -5 & 4 & -4 & -3 \\
0 & 10 & 7 & 2 & 6 & 11 & 4 & -4 & 9 \\
4 & -4 & -3 & 5 & 6 & 10 & 9 & -2 & 2 \\
4 & 8 & -3 & 5 & -5 & 7 &9 & 3 & -1 \\
4 & 8 & -3 & 5 & -2 & 10 & 9 & 6 & 2 \\
5 & -6 & 2 & 7 & 8 & 6 &9 & -2 & 4 \\
5 & -6 & 4 & 7 & 8 & 0 &9 & -2 & 2 \\
5 & 10 & 4 & 7 & -4 & 0 &9 & 6 & 2 \\
0 & 10 & 7 & 2 & 6 & 11 & 4 & -4 & 9 \\
4 & -4 & -3 & 5 & 6 & 10 & 9 & -2 & 2 \\
4 & 8 & -3 & 5 & -5 & 7 & 9 & 3 & -1 \\
4 & 8 & -3 & 5 & -2 & 10 &9 & 6 & 2 \\
5 & -6 & 2 & 7 & 8 & 6 & 9 & -2 & 4 \\
5 & -6 & 4 & 7 & 8 & 0 &9 & -2 & 2 \\
5 & 10 & 4 & 7 & -4 & 0 &9 & 6 & 2 \\
\end{longtable}
\end{document}


Addendum: If you choose to keep the code of the body of the array the way it's provided by Mathematica, you can still use a longtable environment instead of an array environment to typeset the material. Just replace the current instruction

\[ \left( \begin{array}{ccc}


with

\begin{longtable}{| *{3}{>{$}c<{$}} | }


If a page break occurs somewhere in the array, you could provide the following code to guide the reader's eye:

\endfirsthead  % blank header on first page
\multicolumn{3}{@{}l}{(\emph{array continued from previous page})}
\multicolumn{3}{r@{}}{(\emph{array continued on next page})}
\endfoot
\endlastfoot  % blank footer on final page


The material on the second page would look like this:

\documentclass{article}
\usepackage{array,longtable,fourier}
\begin{document}
\begin{longtable}{| *{3}{>{$}c<{$}} | }
\multicolumn{3}{@{}l}{(\emph{array continued from previous page})}
\multicolumn{3}{r@{}}{(\emph{array continued on next page})}
\endfoot
\endlastfoot  % blank footer on final page
\{-7,-2,2\} & \{-5,8,0\} &\{-3,-6,4\} \\
\{-7,-2,2\} & \{-3,-6,4\} &\{7,-4,6\} \\
\{-7,-2,2\} & \{-3,6,10\} &\{4,8,9\} \\
\{-7,-2,4\} & \{-5,8,6\} & \{-3,-6,2\} \\
\{-7,-2,4\} & \{-3,-6,2\} &\{7,-4,0\} \\
\{-7,3,-1\} & \{-3,-5,7\} &\{4,-4,9\} \\
\{-7,3,7\} & \{-3,-5,-1\} &\{-2,8,9\} \\
\{-7,6,2\} & \{-5,-4,0\} &\{-3,10,4\} \\
\{-7,6,2\} & \{-3,-2,10\} &\{4,-4,9\} \\
\{-7,6,4\} & \{-3,10,2\} &\{7,8,0\} \\
\{-6,-2,-1\} & \{2,6,-5\} &\{7,8,0\} \\
\{-6,-2,7\} & \{-5,-4,0\} &\{2,6,11\} \\
\{-6,6,-1\} & \{2,-2,-5\} &\{7,-4,0\} \\
\{-6,6,7\} & \{-5,8,0\} &\{2,-2,11\} \\
\{-5,-4,0\} & \{5,-6,2\} &\{9,-2,4\} \\
\{-5,-4,6\} & \{-3,1,11\} &\{5,9,7\} \\
\{-5,-4,6\} & \{5,-6,4\} & \{9,-2,2\} \\
\{-5,-1,9\} & \{-3,-6,4\} &\{5,-2,-4\} \\
\{-5,5,-3\} & \{0,10,-1\} &\{8,6,7\} \\
\{-5,5,9\} & \{0,10,7\} &\{8,6,-1\} \\
\{-5,8,0\} & \{-3,9,7\} &\{5,1,11\} \\
\{-5,8,0\} & \{5,10,2\} & \{9,6,4\} \\
\{-3,-2,-4\} & \{5,-6,4\} &\{7,-1,9\} \\
\{-3,1,-5\} & \{5,9,-1\} &\{7,8,6\} \\
\{-3,9,-1\} & \{5,1,-5\} &\{7,-4,0\} \\
\{-2,-4,-3\} & \{0,6,-5\} &\{2,10,-1\} \\
\{-2,-4,-3\} & \{5,-5,-1\} &\{9,3,7\} \\
\{-2,-4,9\} & \{0,6,11\} &\{2,10,7\} \\
\{-2,8,-3\} & \{0,10,7\} &\{2,6,11\} \\
\{-2,8,9\} & \{0,10,-1\} &\{2,6,-5\} \\
\{0,-6,-1\} & \{2,-2,-5\} & \{4,8,-3\} \\
\{0,-6,7\} & \{2,-2,11\} &\{4,8,9\} \\
\{0,-2,-5\} & \{2,-6,-1\} &\{4,-4,9\} \\
\{0,-2,11\} & \{2,-6,7\} &\{4,-4,-3\} \\
\{0,6,-5\} & \{2,10,-1\} & \{4,8,9\} \\
\{0,6,11\} & \{2,10,7\} & \{4,8,-3\} \\
\{0,10,-1\} & \{2,6,-5\} & \{4,-4,-3\} \\
\{0,10,7\} & \{2,6,11\} & \{4,-4,9\} \\
\{4,-4,-3\} & \{5,6,10\} & \{9,-2,2\} \\
\{4,8,-3\} & \{5,-5,7\} &\{9,3,-1\} \\
\{4,8,-3\} & \{5,-2,10\} & \{9,6,2\} \\
\{5,-6,2\} & \{7,8,6\} &\{9,-2,4\} \\
\{5,-6,4\} & \{7,8,0\} &\{9,-2,2\} \\
\{5,10,4\} & \{7,-4,0\} &\{9,6,2\} \\
\{0,10,7\} & \{2,6,11\} & \{4,-4,9\} \\
\{4,-4,-3\} & \{5,6,10\} & \{9,-2,2\} \\
\{4,8,-3\} & \{5,-5,7\} & \{9,3,-1\} \\
\{4,8,-3\} & \{5,-2,10\} &\{9,6,2\} \\
\{5,-6,2\} & \{7,8,6\} & \{9,-2,4\} \\
\{5,-6,4\} & \{7,8,0\} &\{9,-2,2\} \\
\{5,10,4\} & \{7,-4,0\} &\{9,6,2\}
\end{longtable}
\end{document}

• @ Mico. Thank you for your answer. But, I must repair code from Mathematica (add & many times). Dec 22, 2014 at 12:20
• @minthao_2011 - I've provided an addendum to show how to use a longtable environment while keeping the bulk of the array code provided by Mathematica.
– Mico
Dec 22, 2014 at 19:56
• If I have 4 columns, how can I change the code of the line \begin{longtable}{| *{3}{>{$}c<{$}} | }? Dec 23, 2014 at 3:28
• @minthao_2011 - If all four columns contain math material that should be centered, just replace *{3} with *{4}`.
– Mico
Dec 23, 2014 at 3:57
• When my document has two types three columns and four columns, I fell, there is array does not align center. In this Comment, I can not up my pictures. Dec 24, 2014 at 11:49