4

enter image description here

I want to write the above equation I tried

\begin{align}
 d(0,0) &= e(0,0) \\
 d(0,j) &= e(0,j) + d(0,j-1)        \text{$j = 1,2,..., N_\tau -1$}\\
 d(i,0) &= e(i,0)               \text{$i = 1,2,..., N_t -1$}\\
 d(1,j) &= e(1,j) +  \begin{cases}
                    d(0,j)      \\
                    d(0,j-1)    & \text{$j = 1,2,..., N_\tau -1$}\\
                    d(1,j-1)) 
                    \end{cases} \\

   d(i,1) &= e(i,1) + \begin{cases}
                        d(i,0)\\
                        d(i-1,0)  & \text{$i = 1,2,..., N_t -1$}\\
                        d(i-1,1))
                     \end{cases}        \\

   d(i,j) &= e(i,j) + \begin{cases}
                        d(i-1,j-1)\\
                d(i-1,j-2) + e(i,j-1)   &  \text{$ i > 1$ and $j > 1$}\\
                        d(i-2, j-1) + e(i-1,j)

                \end{cases}
    \end{align} 

but I didn't work ... I want a multi line equation with labeling

THank you

  • Welcome. Apart from the fact that you are using blank lines, which are not allowed ... I don't understand the problem. – Johannes_B Jun 12 '16 at 14:42
3

See, if the following result ids what you looking for:

enter image description here

\documentclass{article}
\usepackage{mathtools}
\usepackage{geometry}

\begin{document}
    \begin{align}
d(0,0) & = e(0,0)                                           \\
d(0,j) & = e(0,j) + d(0,j-1);\quad  j = 1,2,\dots, N_\tau -1  \\
d(i,0) & = e(i,0)           ;\quad  i = 1,2,\dots, N_t -1     \\
%
d(1,j) & = e(1,j) + \begin{cases}
            d(0,j)      &                           \\
            d(0,j-1)    & j = 1,2,\dots, N_\tau -1    \\
            d(1,j-1))   &
                    \end{cases}                             \\
d(i,1) & = e(i,1) + \begin{cases}
            d(i,0)      &                       \\
            d(i-1,0)    & i = 1,2,\dots, N_t -1   \\
            d(i-1,1))   &
                    \end{cases}                             \\
d(i,j) & = e(i,j) + \begin{cases}
            d(i-1,j-1)              &                           \\
            d(i-1,j-2) + e(i,j-1)   & i > 1 \text{ and } j > 1  \\
            d(i-2, j-1) + e(i-1,j)  &
                \end{cases}
    \end{align}
\end{document}

Your MWE is unnecessary complicated, but in the same time there are missing ampersands and as say johannes-b in his comments, not allowed empty lines ...

  • Would you mind changing the dots to \dots? – Johannes_B Jun 12 '16 at 14:50
3

Usage of \nonumber before \\ produce the output what you are seeking:

\documentclass{article}
\usepackage{mathtools}
\usepackage{geometry}

\begin{document}
    \begin{align}
d(0,0) & = e(0,0)                                           \nonumber\\
d(0,j) & = e(0,j) + d(0,j-1);\quad  j = 1,2,\dots, N_\tau -1  \nonumber\\
d(i,0) & = e(i,0)           ;\quad  i = 1,2,\dots, N_t -1     \nonumber\\
%
d(1,j) & = e(1,j) + \begin{cases}
            d(0,j)      &                           \\
            d(0,j-1)    & j = 1,2,\dots, N_\tau -1    \\
            d(1,j-1))   &
                    \end{cases}                             \nonumber\\
d(i,1) & = e(i,1) + \begin{cases}
            d(i,0)      &                       \\
            d(i-1,0)    & i = 1,2,\dots, N_t -1   \\
            d(i-1,1))   &
                    \end{cases}                             \nonumber\\
d(i,j) & = e(i,j) + \begin{cases}
            d(i-1,j-1)              &                           \\
            d(i-1,j-2) + e(i,j-1)   & i > 1 \text{ and } j > 1  \\
            d(i-2, j-1) + e(i-1,j)  &
                \end{cases}
    \end{align}
\end{document}
2
\documentclass{article}
\usepackage{mathtools}

\begin{document}
\begin{align}
\begin{aligned} 
    d(0,0) & = e(0,0)                                           \\
    d(0,j) & = e(0,j) + d(0,j-1);\quad  j = 1,2,\dots, N_\tau -1\\
    d(i,0) & = e(i,0)           ;\quad  i = 1,2,\dots, N_t -1   \\
    %
    d(1,j) & = e(1,j) + \begin{cases}
    d(0,j)      &                           \\
    d(0,j-1)    & j = 1,2,\dots, N_\tau -1    \\
    d(1,j-1))   &
    \end{cases}                             \\
    d(i,1) & = e(i,1) + \begin{cases}
    d(i,0)      &                       \\
    d(i-1,0)    & i = 1,2,\dots, N_t -1   \\
    d(i-1,1))   &
    \end{cases}                             \\
    d(i,j) & = e(i,j) + \begin{cases}
    d(i-1,j-1)              &                           \\
    d(i-1,j-2) + e(i,j-1)   & i > 1 \text{ and } j > 1  \\
    d(i-2, j-1) + e(i-1,j)  &
    \end{cases}
\end{aligned}
\end{align}
\end{document}

enter image description here

1

For every line where you do not want a number add a \nonumber before the \\. It should remove the numbers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.