5

I'm currently facing a problem with the align environment. I'd like to write six matrices in two rows, aligned on each equal sign per column. The problem is that I can't figure out how to do this with the align environment for some reason. I've read the related posts here and here, where [1] seems to be a bit of an overkill for my problem and [2] doesn't work for some reason...

An MWE to the problem:

\documentclass{article}
\usepackage[margin=2.5cm]{geometry}
\usepackage{amssymb, amsthm, mathtools}
\begin{document}
\begin{align*}
I _ { 1 } &= 
\begin{pmatrix} 
{ 0 } & { 0 } & { 0 } & { 0 } \\ 
{ 0 } & { 0 } & { 0 } & { 0 } \\ 
{ 0 } & { 0 } & { 0 } & { 1 } \\ 
{ 0 } & { 0 } & { - 1 } & { 0 } 
\end{pmatrix}, 
I _ { 2 } &&=  
\begin{pmatrix} 
{ 0 } & { 0 } & { 0 } & { 0 } \\ 
{ 0 } & { 0 } & { 0 } & { 1 } \\ 
{ 0 } & { 0 } & { 0 } & { 0 } \\ 
{ 0 } & { -1} & { 0 } & { 0 } 
\end{pmatrix}, 
I _ { 3 } &&= 
\begin{pmatrix} 
{ 0 } & { 0 } & { 0 } & { 0 } \\ 
{ 0 } & { 0 } & { 1 } & { 0 } \\ 
{ 0 } & { -1 } & { 0 } & { 0 } \\ 
{ 0 } & { 0 } & { 0 } & { 0 } 
\end{pmatrix}, \\
J _ { 1 } &= 
\begin{pmatrix} 
{ 0 } & { -1} & { 0 } & { 0 } \\ 
{ -1} & { 0 } & { 0 } & { 0 } \\ 
{ 0 } & { 0 } & { 0 } & { 0 } \\ 
{ 0 } & { 0 } & { 0 } & { 0 } 
\end{pmatrix},
J _ { 2 } &&= 
\begin{pmatrix} 
{ 0 } & { 0 } & { -1} & { 0 } \\ 
{ 0 } & { 0 } & { 0 } & { 0 } \\ 
{ -1} & { 0 } & { 0 } & { 0 } \\ 
{ 0 } & { 0 } & { 0 } & { 0 } 
\end{pmatrix},
J _ { 3 } &&= 
\begin{pmatrix} 
{ 0 } & { 0 } & { 0 } & { - 1 } \\ 
{ 0 } & { 0 } & { 0 } & { 0 } \\ 
{ 0 } & { 0 } & { 0 } & { 0 } \\ 
{ - 1 } & { 0 } & { 0 } & { 0 } 
\end{pmatrix}.
\end{align*}
\end{document}

Note: I'm aware that most of the {} are useless here but the matrices were generated by Mathpix....

Bernard
  • 271,350

2 Answers2

7

I just moved the &

enter image description here

\documentclass{article}
\usepackage[margin=2.5cm]{geometry}
\usepackage{amssymb, amsthm, mathtools}
\begin{document}
\begin{align*}
I _ { 1 } &= 
\begin{pmatrix} 
{ 0 } & { 0 } & { 0 } & { 0 } \\ 
{ 0 } & { 0 } & { 0 } & { 0 } \\ 
{ 0 } & { 0 } & { 0 } & { 1 } \\ 
{ 0 } & { 0 } & { - 1 } & { 0 } 
\end{pmatrix}, 
&I _ { 2 } &=  
\begin{pmatrix} 
{ 0 } & { 0 } & { 0 } & { 0 } \\ 
{ 0 } & { 0 } & { 0 } & { 1 } \\ 
{ 0 } & { 0 } & { 0 } & { 0 } \\ 
{ 0 } & { -1} & { 0 } & { 0 } 
\end{pmatrix}, 
&I _ { 3 } &= 
\begin{pmatrix} 
{ 0 } & { 0 } & { 0 } & { 0 } \\ 
{ 0 } & { 0 } & { 1 } & { 0 } \\ 
{ 0 } & { -1 } & { 0 } & { 0 } \\ 
{ 0 } & { 0 } & { 0 } & { 0 } 
\end{pmatrix}, \\
J _ { 1 } &= 
\begin{pmatrix} 
{ 0 } & { -1} & { 0 } & { 0 } \\ 
{ -1} & { 0 } & { 0 } & { 0 } \\ 
{ 0 } & { 0 } & { 0 } & { 0 } \\ 
{ 0 } & { 0 } & { 0 } & { 0 } 
\end{pmatrix},
&J _ { 2 } &= 
\begin{pmatrix} 
{ 0 } & { 0 } & { -1} & { 0 } \\ 
{ 0 } & { 0 } & { 0 } & { 0 } \\ 
{ -1} & { 0 } & { 0 } & { 0 } \\ 
{ 0 } & { 0 } & { 0 } & { 0 } 
\end{pmatrix},
&J _ { 3 } &= 
\begin{pmatrix} 
{ 0 } & { 0 } & { 0 } & { - 1 } \\ 
{ 0 } & { 0 } & { 0 } & { 0 } \\ 
{ 0 } & { 0 } & { 0 } & { 0 } \\ 
{ - 1 } & { 0 } & { 0 } & { 0 } 
\end{pmatrix}.
\end{align*}
\end{document}
David Carlisle
  • 757,742
  • David and his movement made me feel good. – manooooh Mar 20 '19 at 18:33
  • 1
    @marmot I didn't look at them (as I say I just moved the & ) but what about them? – David Carlisle Mar 20 '19 at 19:26
  • @marmot not a sign change between a test file and a supplied example, you are assuming that is the meaning of these matrices:-) – David Carlisle Mar 20 '19 at 20:10
  • @marmot TeX takes no position on mathematical accuracy, so long as it looks nice. – David Carlisle Mar 20 '19 at 20:15
  • @marmot in that case, which convention do you prefer?^^ – Marius Jaeger Mar 20 '19 at 20:43
  • @marmot more seriously it's not my area of mathematics and I didn't recognise these as any particular set of matrices so I took the supplied equation at face value and had no answer to your initial comment of "was I sure about the signs" If you wish to edit the question and answer to match then feel free. – David Carlisle Mar 20 '19 at 20:45
  • @MariusJaeger Anything in which the structure constants for the SO(3) subgroup are given by the Levi-Civita symbol. –  Mar 20 '19 at 20:49
  • @DavidCarlisle Yes. My comment was not meant to be destructive and I had a feeling that special relativity is not your field of maths. It was only a remark that I made when I upvoted your nice answer, knowing it will be read by hundreds of users. –  Mar 20 '19 at 20:59
6

Uniform alignment everywhere...

\documentclass{article}
\usepackage[margin=2.5cm]{geometry}
\usepackage{amssymb, amsthm, mathtools}
\usepackage{tabstackengine}
\setstacktabbedgap{1ex}
\begin{document}
\fixTABwidth{T}
\begin{align*}
I _ { 1 } =& 
\parenMatrixstack[r]{
0 & 0 & 0 & 0 \\ 
0 & 0 & 0 & 0 \\ 
0 & 0 & 0 & { 1 } \\ 
0 & 0 & { - 1 } & 0 
},&
I _ { 2 } =&  
\parenMatrixstack[r]{
0 & 0 & 0 & 0 \\ 
0 & 0 & 0 & 1 \\ 
0 & 0 & 0 & 0 \\ 
0 & -1 & 0 & 0 
}, &
I _ { 3 } =& 
\parenMatrixstack[r]{
0 & 0 & 0 & 0 \\ 
0 & 0 &  1  & 0 \\ 
0 & -1 & 0 & 0 \\ 
0 & 0 & 0 & 0 
}, \\
J _ { 1 } =& 
\parenMatrixstack[r]{
0 & -1 & 0 & 0 \\ 
-1 & 0 & 0 & 0 \\ 
0 & 0 & 0 & 0 \\ 
0 & 0 & 0 & 0 
},&
J _ { 2 } =& 
\parenMatrixstack[r]{
0 & 0 & -1 & 0 \\ 
0 & 0 & 0 & 0 \\ 
-1 & 0 & 0 & 0 \\ 
0 & 0 & 0 & 0 
},&
J _ { 3 } =& 
\parenMatrixstack[r]{
0 & 0 & 0 & { - 1 } \\ 
0 & 0 & 0 & 0 \\ 
0 & 0 & 0 & 0 \\ 
 - 1  & 0 & 0 & 0 
}.
\end{align*}
\end{document}

enter image description here

  • 2
    These matrices align nicely because I and J happen to be about the same width. But if they had instead been I and M, the alignment would have been different. Better to put the "second" & before the = sign in each instance. – barbara beeton Mar 20 '19 at 23:40
  • @barbarabeeton Thanks for the great suggestion. Only clarification is that in TABstackengine, the & should, by default, follow the = rather than precede it. – Steven B. Segletes Mar 21 '19 at 01:32
  • @steven : This solution doesn't compile with overleaf.com, error at line 51. – pzorba75 Mar 21 '19 at 04:31
  • @pzorba75 Sorry I cannot assist...I am not an overleaf user. – Steven B. Segletes Mar 21 '19 at 04:36