I want to write three matrix equations on multiple lines so I'm using alignat
.
However, the widths of the matrices on each line are not equal. How can I make sure they will be? I've been looking into the tabstackengine
but it doesn't work so well inside alignat
. I'd like to avoid using \phantom
. Any suggestions?
\documentclass[11pt,twoside,a4paper]{article}
\usepackage{amsmath}
\begin{alignat}{3}
& \begin{bmatrix} X \\ Y \\ Z \end{bmatrix} &&= \textbf{T}_3 (\phi) \begin{bmatrix} X \\ Y \\ Z \end{bmatrix} &&= \begin{bmatrix}
\text{cos($\psi$)} & \text{sin($\psi$)} & 0\\
\text{-sin($\psi$)} & \text{cos($\psi$)} & 0 \\
0 & 0 & 1 \\
\end{bmatrix}
\begin{bmatrix}
X \\
Y \\
Z \\
\end{bmatrix} \\
& \begin{bmatrix} X' \\ Y' \\ Z' \end{bmatrix} &&= \textbf{T}_2 (\theta) \begin{bmatrix} X' \\ Y' \\ Z' \end{bmatrix} &&= \begin{bmatrix}
\text{cos($\theta$)} & 0 & \text{-sin($\theta$)}\\
0 & 1 & 0 \\
\text{sin($\theta$)} & 0 & \text{cos($\theta$)} \\
\end{bmatrix}
\begin{bmatrix}
X' \\
Y' \\
Z' \\
\end{bmatrix} \\
& \begin{bmatrix} X'' \\ Y'' \\ Z'' \end{bmatrix} &&= \textbf{T}_1 (\psi) \begin{bmatrix} X'' \\ Y'' \\ Z'' \end{bmatrix} &&= \begin{bmatrix}
1 & 0 & 0\\
0 & \text{cos($\phi$)} & \text{sin($\phi$)} \\
0 & \text{-sin($\phi$)} & \text{cos($\phi$)} \\
\end{bmatrix}
\begin{bmatrix}
X'' \\
Y'' \\
Z'' \\
\end{bmatrix}
\end{alignat}
Best Answer
Here,
\eqstencil
has to be tailor made for your equation.RE-REVISED ANSWER to make transformation matrix of uniform total width and fixed inter-column width (using TABstacks), as well as increased vertical interrow spacing.
REVISED ANSWER to make vectors of equal width
ORIGINAL ANSWER
Different alignments can be obtained by setting alignments on the
\makebox
es. For example, the redefinitiongives