0

I'm trying to put an equation in IEEE latex format(two column). Following is my equation.

\begin{equation}
 LD(a_{x},b_{y})
   \begin{cases}
      max(x,y) \;\;\;\;\;\;\;\;\;\;\;if\; min(x,y)=0 \\
      min
      \begin{cases}
      L(a,b)(x-1,y)+1 \\
      L(a,b)(x,y-1,j)+1 & Otherwise\\
      L(a,b)(x-1,y-1)+1(a_{x}\neq b_{y})
      \end{cases}
    \end{cases}
\end{equation}

But it displays like following. How to put Otherwise in the first column. enter image description here

1
  • 1
    not an answer to the question, but please use \max, \min, and \text{...} for the conditions. Commented Dec 15, 2014 at 13:58

1 Answer 1

2

Try, if this you can accommodate in two column format of IEEE (since you didn't provide MWE, i don't know the paper size, etc).

\documentclass[12pt]{article}
    \usepackage{empheq}

\usepackage[active,displaymath,tightpage]{preview}
\setlength\PreviewBorder{1em}

    \begin{document}
\begin{equation}
 LD(a_{x},b_{y})
   \begin{cases}
      \max(x,y)         \hfill   \text{if } \min(x,y)=0 \\
      \min
      \begin{cases}
      L(a,b)(x-1,y)+1   &                       \\
      L(a,b)(x,y-1,j)+1 &   \text{Otherwise}    \\
      L(a,b)(x-1,y-1)+1 &   (a_{x}\neq b_{y})
      \end{cases}
    \end{cases}
\end{equation}
    \end{document}

I rearrange the equation a bit (as I think to be more correct form) and considered the comment of Barbara Beeton. If this can not be feet into one column, consider to write it over two columns. How to do this, see manual for used documentclass. enter image description here

Edit: Since IEEE discourage to wrote equations over two column probably is better idea to split your equation into two sub equations like

\documentclass[12pt]{article}
    \usepackage{empheq}

\usepackage[active,displaymath,tightpage]{preview}
\setlength\PreviewBorder{1em}

    \begin{document}
If $\min(x,y)=0$ then
    \begin{subequations}\label{myequation}
    \begin{align}
 LD(a_{x},b_{y}) & = \max(x,y)    \label{myequation-a}
    \shortintertext{otherwise}
 LD(a_{x},b_{y}) & = \begin{cases}
      L(a,b)(x-1,y)+1   &   condition\ 1     \\
      L(a,b)(x,y-1,j)+1 &   condition\ 2     \\
      L(a,b)(x-1,y-1)+1 &   (a_{x}\neq b_{y})
      \end{cases}               \label{myequation-b}
      \end{align}
      \end{subequations}
    \end{document}

enter image description here

Unfortunately the picture doesn't show the first line of given MWE.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .