I am trying to align this set of equations at two places. Essentially, I want all the equals/neq
signs to be aligned.
I am aware of the alignat
environment which allows you to align an equation at multiple points. However, this doesn't seem to work as I have \begin{cases}
within my equation (cases
requires a \\
which appears to be confusing alignat
?)
When I try use \begin{alignat}{2}
Code
\documentclass[12pt,a4paper]{report}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{bm}
\begin{document}
\begin{equation}
\bm{\tilde{A}}^{(n)\intercal} \mathbf{M} \bm{\tilde{A}}^{(m)}
=\begin{cases}
0, \quad n \neq m\\
1, \quad n = m
\end{cases}
\end{equation}
and
\begin{equation}
\bm{\tilde{A}}^{(n)\intercal} \mathbf{K} \bm{\tilde{A}}^{(m)}
=\begin{cases}
0, \quad n \neq m\\
\omega_n^2, \quad n = m.
\end{cases}
\end{equation}
\begin{alignat}{2}
\bm{\tilde{A}}^{(n)\intercal} \mathbf{M} \bm{\tilde{A}}^{(m)}
&=\begin{cases}
0, \quad n &&\neq m\\
1, \quad n &&= m
\end{cases}
\shortintertext{and}
\bm{\tilde{A}}^{(n)\intercal} \mathbf{K} \bm{\tilde{A}}^{(m)}
&=\begin{cases}
0, \quad n &&\neq m\\
\omega_n^2, \quad n &&= m.
\end{cases}
\end{alignat}
\end{document}
align
andmakebox
as shown here: How can I align multiple cases environment simultaneously?cases
wrong, it is normally a two column construction, each column separated by&
, so remove the\quad
and write0, & n \new m \\
instead