Without an image of exactly how you want this typeset it is difficult to know for sure, but perhaps one of these is what you are looking for:
or perhaps:
\documentclass{book}
\usepackage{amsmath}
\newcommand{\fib}{\mathrm{fib}}
\begin{document}
\begin{align*}
&\text{if } x < 2 & \fib X &= 1 \\
&\text{otherwise } & \fib X &= (\fib (X - 1)) + (\fib (X - 2))
\end{align*}
Another option is:
\begin{align*}
\fib X = \begin{cases}
\text{if } x < 2 & = 1 \\
\text{otherwise } & = (\fib (X - 1)) + (\fib (X - 2))
\end{cases}
\end{align*}
\end{document}
Here is how you can modify the given MWE to obtain better spacing:
Notes:
Code:
\documentclass{article}
\usepackage{amsmath}
\newcommand{\prodtime}{\operatorname{prodtime}}
\begin{document}
\[
\begin{array}{l l @{}l}
\prodtime V & X = Y &{}= 0 \\
\prodtime V & X = f(\ldots) &{}= 0 \\
\prodtime V & p(X_1,\,\ldots,\,X_n) &{}= \prodtime V\,(\operatorname{body} p) \\
\prodtime V & V = \,f(X_1,\,\ldots,\,X_n) &{}= \prodtime V\,(\operatorname{body} f) \\
\prodtime V & X_0(X_1,\,\ldots,\,X_n) &{}= \mathit{time\_of\_call} \\
\prodtime V & m(X_1,\,\ldots,\,X_n) &{}= \mathit{time\_of\_call} \\
\prodtime V & \mathit{foreign}(\ldots) &{}= 0 \\
\prodtime V & G_\mathrm{head},\,G_\mathrm{tail}
\end{array}
\]
\end{document}
Only use one ampersand, &
.
See page 68 in lshort: https://tobi.oetiker.ch/lshort/lshort.pdf
Example:
\begin{equation*}
|x| = \begin{cases}
-x & \text{if } x < 0,\\
0 & \text{if } x = 0,\\
x & \text{if } x > 0.
\end{cases}
\end{equation*}
Produces:
Best Answer
You can make use of
mathtools
and itscases*
environment.The environments
cases*
anddcases*
handles the second column as text, so you wont have to manually "escape" mathmode to typeset the text correctly. Thedcases*
variant use displaystyle math in the first column, which will make no difference in your situation. See section 3.4.3 in the package documentation for more details.If you want to remove the equation number (1), you can use
\begin{equation*} ... \end{equation*}
instead of\begin{equation} ... \end{equation}
.