Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

For the LaTeX code below,

 \begin{equation}
Fitness(\CS)=
\begin{cases}
    0.5 + 0.5 \cdot G(\CS)                        & if\ V(\CS)=0 \\
    0.5\cdot G(\CS)-\frac{V(\CS)}{V_{Tot}(\CS)}   & otherwise.
\end{cases}~\label{eq:fitness}
\end{equation}

I get the output

enter image description here

It looks like the fraction \frac{V(\CS)}{V_{Tot}(\CS)} is a bit squeezed here,I would prefer

enter image description here

which looks less squeezed. How could I do that?

share|improve this question
    
@Werner The dcases environment is defined by mathtools –  egreg Nov 21 '12 at 0:12
add comment

1 Answer

up vote 5 down vote accepted

mathtools defined dcases which puts the entries inside in display math mode. This causes fractions and other mode-varying elements to conform to their largest size:

enter image description here

\documentclass{article}
% mathtools also loads amsmath (http://ctan.org/pkg/amsmath)
\usepackage{mathtools}% http://ctan.org/pkg/mathtools
\newcommand{\CS}{CS}
\DeclareMathOperator{\Fitness}{Fitness}
\begin{document}

% Original cases
\begin{equation}
  Fitness(\CS)=
  \begin{cases}
    0.5 + 0.5 \cdot G(\CS)                        & if\ V(\CS)=0 \\
    0.5\cdot G(\CS)-\frac{V(\CS)}{V_{Tot}(\CS)}   & otherwise.
  \end{cases}\label{eq:fitness1}
\end{equation}

% Updated dcases, operator definition and text
\begin{equation}
  \Fitness(\CS)=
  \begin{dcases}
    0.5 + 0.5 \cdot G(\CS)                        & \text{if\ }V(\CS)=0 \\
    0.5\cdot G(\CS)-\frac{V(\CS)}{V_{\text{Tot}}(\CS)}   & \text{otherwise.}
  \end{dcases}\label{eq:fitness2}
\end{equation}

\end{document}

Textual elements are forced as text using \text, while an operator like Fitness should also be declared as such. See the amsmath documentation for more on these topics.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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