# Math equation with cases and division signs

\begin{equation*}
\theta({P,\bar{Cl}}) =
\begin{cases}
S(P,\widehat{Cl}) + (S(P,\widehat{Cl}) \times  ((\bar{R}-\widehat{R})/\bar{R})) & \widehat{Cl} \textless \bar{Cl} \\
S(P,\widehat{Cl}) - (S(P,\widehat{Cl}) \times  ((\widehat{R}-\bar{R})/\bar{R})) & \widehat{Cl} \textgreater \bar{Cl}
\end{cases}
\label(eq: state}
\end{equation*}


How can I make it look more beautiful and legible? I would like to push the division sign below so that it is more legible

any ideas are welcome

• Use \frac{}{} instead of a division line. But this depends one what is more beautiful to you. – dustin Oct 7 '14 at 13:26
• I tried \frac what is the difference between frac and frax or is it a typo? – tandem Oct 7 '14 at 13:26
• I did that then. any other suggestions will be appreciated. – tandem Oct 7 '14 at 13:31
• What does beautiful mean to you? This question is very subjective which makes it hard to answer. Why don't you like \frac? If you use dcases, you will have display style if that is beautiful. I think you need to load mathtools instead of amsmath instead though for dcases. – dustin Oct 7 '14 at 13:33
• I will take a look at some examples on the wiki page in that case. – tandem Oct 7 '14 at 13:38

First of all, I would use displaystyle fractions. Next I would replace the non-extensible \bar with \widebar, borrowed from the mathx(it's in the mathabx bundle, without loading the mathabx package since it changes many symbols.As I'm changing symbols, I also replaced \widehat with mathx's version, with I named varwidehat to not interfere with defaults. Finally I changed Cl into a math operator (Cl), as I suspect it is so. For the moment it looks like the product of the two variables C and l. If I'm wrong, all you have to do is replacing back \Cl with Cl.

To prevent having too large vertical spacing with respect to the surrounding text, due to the fractions, I kill the first line fraction height with a \smash[t]{…} command, and the second line fraction depth with \smash[b]{…}.

\documentclass[11pt,a4paper]{article}

\usepackage{mathtools}

\DeclareMathOperator\Cl{Cl}

\DeclareFontFamily{U}{mathx}{\hyphenchar\font45}
\DeclareFontShape{U}{mathx}{m}{n}{
<-6> mathx5 <6-7> mathx6 <7-8> mathx7
<8-9> mathx8 <9-10> mathx9
<10-12> mathx10 <12-> mathx12
}{}
\DeclareSymbolFont{mathx}{U}{mathx}{m}{n}
\DeclareFontSubstitution{U}{mathx}{m}{n}

\DeclareMathAccent{\varwidehat}{0}{mathx}{"70}
\DeclareMathAccent{\widebar}{0}{mathx}{"73}

\begin{document}

\begin{equation*}
\theta({P,\widebar{\Cl}}) =
\begin{cases}
S(P,\varwidehat{\Cl}) + S(P,\varwidehat{\Cl}) \times \smash[t]{ \dfrac{\widebar{R}-\varwidehat{R}}{\widebar{R}}} &\qquad \varwidehat{\Cl} < \widebar{\Cl} \\[1.5ex]
S(P,\varwidehat{\Cl}) - S(P,\varwidehat{\Cl}) \times \smash[b]{\dfrac{\varwidehat{R}-\widebar{R}}{\widebar{R}}} &\qquad \varwidehat{\Cl} > \widebar{\Cl}
\end{cases}
\label{(eq: state}
\end{equation*}

\end{document}


• Ingenious use of \smash[t]{...} in the first line and \smash[b]{...} in the second. You may want to explain in more detail what these macros do, just in case the OP isn't an experienced user of the amsmath package... – Mico Oct 7 '14 at 14:57
• You're right, I'll do it. – Bernard Oct 7 '14 at 14:59

Your code isn't compilable since it contains macros such as \textgreater and \textless that shouldn't occur in math mode. The argument of a \label command has to be enclosed in curly braces, by the way.

You didn't give any hints as to your criteria for beauty and legibility, so I'll have to use my own. :-) There's nothing terribly wrong with the look once the code's been fixed so that it compiles. (I'm talking purely about the aestetics, of course; I can't tell if the math is correct or not...) I did notice that the overall look is quite cramped. You could use a dcases* environment (provided by the mathtools package) instead of the basic cases environment to provide a bit more whitespace. Next, there's a minor issue with the uneven usage of accents: the "hats" are uniformly "wide", but the "bars" are not. I suggest using \overline for the Cl terms. Third, I'd get rid of two redundant pairs of parentheses on each line. Finally, since there's no point in providing a \label to an unnumbered equation, I'd either comment it out or get rid of it entirely.

\documentclass[12pt, a4paper]{book}
\usepackage{mathtools} % for 'dcases*' environment
\begin{document}
Before:
\begin{equation*}
\theta({P,\bar{Cl}}) =
\begin{cases}
S(P,\widehat{Cl}) + (S(P,\widehat{Cl}) \times  ((\bar{R}-\widehat{R})/\bar{R})) & \widehat{Cl} < \bar{Cl} \\
S(P,\widehat{Cl}) - (S(P,\widehat{Cl}) \times  ((\widehat{R}-\bar{R})/\bar{R})) & \widehat{Cl} > \bar{Cl}
\end{cases}
\label{eq: state}
\end{equation*}

After:
\begin{equation*}
\theta(P,\overline{Cl}\,) =
\begin{dcases*}
S(P,\widehat{Cl}) + S(P,\widehat{Cl}) \times  (\bar{R}-\widehat{R})/\bar{R}
& if $\widehat{Cl} < \overline{Cl}$ \\
S(P,\widehat{Cl}) - S(P,\widehat{Cl}) \times  (\widehat{R}-\bar{R})/\bar{R}
& if $\widehat{Cl} > \overline{Cl}$
\end{dcases*}
\end{equation*}
\end{document}


Here are two suggestions that might make the equation easier to read.

Code based on @Bernard s answer.

\documentclass[11pt,a4paper]{article}

\usepackage{mathtools}

\DeclareMathOperator\Cl{Cl}

\DeclareFontFamily{U}{mathx}{\hyphenchar\font45}
\DeclareFontShape{U}{mathx}{m}{n}{
<-6> mathx5 <6-7> mathx6 <7-8> mathx7
<8-9> mathx8 <9-10> mathx9
<10-12> mathx10 <12-> mathx12
}{}
\DeclareSymbolFont{mathx}{U}{mathx}{m}{n}
\DeclareFontSubstitution{U}{mathx}{m}{n}

\DeclareMathAccent{\varwidehat}{0}{mathx}{"70}
\DeclareMathAccent{\widebar}{0}{mathx}{"73}

\begin{document}

\begin{equation*}
\theta({P,\widebar{\Cl}}) =
\begin{cases}
S(P,\varwidehat{\Cl}) \times \left( 1 +
\varwidehat{\Cl} < \widebar{\Cl} \\[3.0ex]
S(P,\varwidehat{\Cl}) \times \left( 1 -
\varwidehat{\Cl} > \widebar{\Cl}
\end{cases}
\label{(eq: state}
\end{equation*}

or perhaps, if this difference has some separate semantic value

Let
%
\begin{equation*}
\Delta =     \dfrac{\widebar{R}-\varwidehat{R}}{\widebar{R}}.
\end{equation*}

Then
\begin{equation*}
\theta({P,\widebar{\Cl}}) =
\begin{cases}
S(P,\varwidehat{\Cl}) \times ( 1 + \Delta)

• I think the cases environment would look more appealing if the large parentheses had the same size on both lines. Currently, the parentheses seem to be too small on the first line and too large on the second. – Mico Oct 8 '14 at 21:00