2

I have used MAC OS X Grapher to create this equation:

\begin{equation}
\mbox{C}skip\left( \; d\;  \right)\; =\; \left\{\begin{array}{cc} 1+\mbox{C}m\cdot \left( Lm-d-1 \right), & if\; Rm\; =\; 1 \\ \frac{1+\mbox{C}m-Rm-\mbox{C}m\cdot Rm^{Lm-d-1}}{1-Rm}, & Otherwise \end{array}\right
\end{equation}

I should be something like this: enter image description here

But when I've tried to add the code in my latex file it doesn't work, I got some errors.

Can you help me please ?

1 Answers1

4

\left and \right must be come in pairs, even if only one is needed. In this case the other delimiter is a period: \left\{ ... \right..

But code and result are so ugly, it is much easier to rewrite them from scratch. Package amsmath provides the environment cases, which is used here. The used symbols are based on some wild guesses (e.g., m as index, ...):

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
  C_{\textnormal{skip}}(d) =
  \begin{cases}
    1 + C_m (L_m - d - 1), & \text{if $R_m=1$} \\
    \frac{1 + C_m - R_m - C_m R_m^{L_m - d -1}}{1 - R_m},
    & \text{otherwise}
  \end{cases}
\end{equation}
\end{document}

Result

The size of the fraction can be increased by \dfrac instead of \frac:

Result \dfrac

The environment dcases of package mathtools, see comment of Andrew Swann, also improves the vertical spacing:

Result dcases

Heiko Oberdiek
  • 271,626