I often write definitions like
\begin{align*}
f &: \mathbb{R} \to \mathbb{R}
\\ f(0) &: 0
\\ f(x) &= \frac{\sin x}{x}
\end{align*}
(Yeah, I know this could also be written with a cases environment, but I'm not asking about that.)
Needless to say, the alignment is a bit of a mess here. I do want the = signs to be aligned, but it doesn't really make sense for the colon. In principle, that should just be centered by itself, and the equations below centered as well as a block, like would happen with two separate environments
but that has its own disadvantages, including the undesired vertical space.
It's no good to just omit the alignment character
\begin{align*}
f &: \mathbb{R} \to \mathbb{R}
\\ f(0) &: 0
\\ f(x) &= \frac{\sin x}{x}
\end{align*}
as that just smashes the first line entirely in the left alignment column
Nesting environments doesn't do the trick either
\begin{align*}
f : \mathbb{R} \to \mathbb{R}
\\
\begin{aligned}
f(0) &= 0
\\ f(x) &= \frac{\sin x}{x}
\end{aligned}
\end{align*}
– this seems to result in the same as the first version, for some reason.
What's the proper way?
Related questions:
- Alignment like in align environment asks also about a different-aligned first line, but not centered. The solution involves a manual alignment point. That's really awkward and should not be necessary if the first line should just be individually centered.
- How to align only some equations in an align environment? is more about adding additional padding to align specific lines within an already aligned environment




f(0) = 1, but only noticed the discontinuity at zero in the finished question. Not that it matters for what I'm asking. – leftaroundabout Jun 08 '23 at 10:25