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0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & -t_{J_2AB} & -t_{J_2AB} & 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 & -t_{J_1AB} & -t_{J_1AB} & 0 & 0 & -t_{UAA} & 0 & -t_{UAA} & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & -t_{J_1BA} & -t_{J_1BA} & 0 & 0 & -t_{UBB} & 0 & -t_{UBB} & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & t_{J_1AB} & t_{J_1AB} & 0 & 0 & t_{UAA} & 0 & t_{UAA} & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & t_{J_1BA} & t_{J_1BA} & 0 & 0 & t_{UBB} & 0 & t_{UBB} & 0 \\
-t & t & 0 & 0 & -t & t & 0 & 0 & U & 0 & 0 & 0 \\
0 & 0 & -t & t & 0 & 0 & -t & t & 0 & U & 0 & 0 \\
-t & t & 0 & 0 & -t & t & 0 & 0 & 0 & 0 & U & 0 \\
0 & 0 & -t & t & 0 & 0 & -t & t & 0 & 0 & 0 & U
\end{pmatrix}
$$

Can someone maybe help me to center this matrix in LaTeX? I tried \centering, \centerline or to move it, but nothing worked. Have anyone an idea why or what is else possible to do? Appreciate every kind of help ;)

Stefan Pinnow
  • 29,535
Anton
  • 31
  • 1
  • Incidentally, your matrix is of a somewhat peculiar structure: Its final four rows contain only 12 columns, whereas the first 16 rows feature 28 columns. Did maybe something become garbled during the upload to this webpage? – Mico Jun 22 '16 at 10:21
  • 3
    Off-topic: Don't use $$ to initiate and terminate displaymath mode in a LaTeX document. For more information on this subject, please see Why is \[ … \] preferable to $$ … $$? – Mico Jun 22 '16 at 11:09

2 Answers2

5

The Z part in Mico's answer can be rewritten in a different way. Still big but at least there is a pattern and also code-friendly since kronecker product is associative.

\documentclass{article}
\usepackage{mathtools,multirow}
\begin{document}

\[
\left[ 
\begin{array}{c|c|c}
\begin{psmallmatrix}-1\\-1\end{psmallmatrix}\otimes
I_{2} \otimes 
\begin{psmallmatrix}1&1\end{psmallmatrix} \otimes 
\begin{pmatrix}t_{J_2AB}\\t_{J_2BA}\end{pmatrix} & 0 & 0 \\ \hline
0 &
\begin{psmallmatrix}-1&0\\1&0\end{psmallmatrix} \otimes 
\begin{psmallmatrix}1&1\end{psmallmatrix} \otimes 
\begin{pmatrix}t_{J_1AB}\\t_{J_1BA}\end{pmatrix} & 
\begin{psmallmatrix}-1&-1\\1&1\end{psmallmatrix} \otimes 
\begin{psmallmatrix}1&0\end{psmallmatrix} \otimes 
\begin{pmatrix}t_{UAA}\\t_{UBB}\end{pmatrix}
\end{array}\right]
\]
\end{document} 

enter image description here

percusse
  • 157,807
4

The full matrix simply has too many non-trivial elements to fit in portrait mode on a normal-sized page, even with \arraycolsep set to (nearly) 0pt. That's why the matrix is protruding into the right-hand margin instead of being centered within the text block.

I think you have two main options: You could either use landscape mode to display the full matrix, or you could display just the non-trivial parts. For one, I am inclined to doubt that any readers will appreciate the significance of being shown all 192 zeroes in the upper-left block of the matrix, a 12 by 16 submatrix of zeroes.

The following code implements the second option mentioned above. I've left off the final four rows of the matrix you posted, as they feature only 12 columns instead of 28. (I trust you will be able to come up with, if need be, more imaginative names than X, Y, and Z for the three matrices.)

enter image description here

\documentclass{article}
\usepackage[a4paper,margin=2.5cm]{geometry} % set page block parameters suitably
\usepackage{mathtools} % for 'pmatrix*' environment
\setcounter{MaxMatrixCols}{12}
\begin{document}

The matrix $X_{12\times28} = 
\begin{pmatrix} Y_{12\times16} & Z_{12\times12} \end{pmatrix}$
has the following structure: $Y$ is a matrix of zeroes and
\[ 
\setlength\arraycolsep{3pt} % default value: 5pt
Z=
\begin{pmatrix*}[r]  % right-align entries in a column
-t_{J_2AB} & -t_{J_2AB} & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
-t_{J_2BA} & -t_{J_2BA} & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & -t_{J_2AB} & -t_{J_2AB} & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & -t_{J_2BA} & -t_{J_2BA} & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
-t_{J_2AB} & -t_{J_2AB} & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
-t_{J_2BA} & -t_{J_2BA} & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & -t_{J_2AB} & -t_{J_2AB} & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & -t_{J_2AB} & -t_{J_2AB} & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & -t_{J_1AB} & -t_{J_1AB} & 0 & 0 & -t_{UAA} & 0 & -t_{UAA} & 0 \\
0 & 0 & 0 & 0 & -t_{J_1BA} & -t_{J_1BA} & 0 & 0 & -t_{UBB} & 0 & -t_{UBB} & 0 \\
0 & 0 & 0 & 0 & t_{J_1AB} & t_{J_1AB} & 0 & 0 & t_{UAA} & 0 & t_{UAA} & 0 \\
0 & 0 & 0 & 0 & t_{J_1BA} & t_{J_1BA} & 0 & 0 & t_{UBB} & 0 & t_{UBB} & 0 \\
\end{pmatrix*}\,.
\]
\end{document} 
Mico
  • 506,678