# Is it possible to align different lines according to a "waterfall" scheme

Let's say I have multiple lines of math symbols from which I want to create a kind of "waterfall aligning, i.e. At any given line, the proceeding line will start at the (horizontal) position of end of the current line.

I have attempted to do it with the align environment (using & and &&) but it does not work

\begin{align}
F: \mathcal{A} \to & \mathcal{B} \\
& f: && C \to D\\
&& c \mapsto f(c):= \sum ...
\end{align}


Any ideas on how I can do this properly?

• Like the main diagonal of a matrix? Then matrix environment, or more generally the array env, is an option. Apr 30 at 10:10
• I don't think one can do that properly (in the sense that, I cannot see an example where this is a good solution). I might be wrong, though. Apr 30 at 12:11

You can use alignat:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{alignat}{2}
F\colon \mathcal{A} \to \mathcal{B} \\
& f\colon  C \to D \\
&& c \mapsto f(c) = \sum ...
\end{alignat}

\end{document}