# Aligning two equations without losing enumeration

I have following two equations which I want to align following two equations (equality signs have to match), without losing their enumeration:

\documentclass[a4paper,12pt]{report}
\usepackage{algorithm}
\usepackage{caption}
\usepackage{amsmath}

$$\hat{C}_{i,n-i+2} & = C_{i,n-i+1}\hat{f}_{n-i+2} \hspace{6mm} 2 \leq i \leq n$$

$$\hat{C}_{i,k} & = \hat{C}_{i,k-1}\hat{f}_k$$

\end{document}


I tried align* and split* but his does not seem to do the job. Any ideas?

• There is a missing \begin{document} statement ;-)
– user31729
Apr 7, 2015 at 7:49

align* is not 'enumerated' (i.e. numbered), but align uses equation numbers.

The horizontal alignment can be achieved using additional & characters.

\documentclass[a4paper,12pt]{report}
\usepackage{algorithm}
\usepackage{caption}
\usepackage{amsmath}

\begin{document}
\begin{align}
\hat{C}_{i,n-i+2} & = C_{i,n-i+1}\hat{f}_{n-i+2} & 2 \leq i \leq n  \\
\hat{C}_{i,k} & = \hat{C}_{i,k-1}\hat{f}_k
\end{align}

\end{document}


For n groups of equations, you need 2n –1 ampersands: one for each alignment point, and one for introducing the next group, except the first:

\documentclass[a4paper,12pt]{report}
\usepackage{algorithm}
\usepackage{caption}
\usepackage{amsmath}

\begin{document}

\begin{align*}
\hat{C}_{i,n-i+2} & = C_{i,n-i+1}\hat{f}_{n-i+2} \hspace{6mm} 2 \leq i \leq n &
\hat{C}_{i,k} & = \hat{C}_{i,k-1}\hat{f}_k\\
\hat{C}_{i,n-i+2} & = C_{i,n-i+1}\hat{f}_{n-i+2} \hspace{6mm} 2 \leq i \leq n & \hat{C}_{i,k} & = \hat{C}_{i,k-1}\hat{f}_k
\end{align*}

\end{document}