# Fraction at the same height

$$\label{eq:pressure3} \cfrac{P_2}{P_0} = \cfrac{C_2}{C_2 + S^*_2}\cdot\cfrac{C_1}{C_1+S^*_1+\cfrac{C_2 S^*_2}{C_2+S^*_2}}$$


How can I bring the first denominator at the same height as the second denominator?

• You don't want it, trust me. ;-) – egreg Jun 16 '16 at 19:24

(see FOLLOW UP below for a more general approach)

Here a \vphantom of the tall term, added to the first term, can help.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$$\label{eq:pressure3} \cfrac{P_2}{P_0} = \cfrac{C_2}{C_2 + S^*_2\vphantom{\cfrac{S^*_2}{S^*_2}}} \cdot\cfrac{C_1}{C_1+S^*_1+\cfrac{C_2 S^*_2}{C_2+S^*_2}}$$
\end{document}


In response to David's comment, rather than over-exercising the \vphantom approach above, I introduce \sfrac which uses the values of \topgap and \botgap as baselineskips to the numerator and denominator, regardless of the height of those quantities. It thus avoids the use of \vphantoms.

It would be intended to use on the first level of all terms of the fraction.

\documentclass{article}
\usepackage{amsmath,stackengine}
\def\topgap{7pt}
\def\botgap{\topgap}
\newcommand\sfrac[2]{\def\stacktype{L}\ensurestackMath{%
\stackunder[\botgap]{\stackon[\topgap]{\dfrac{\phantom{#1}}{\phantom{#2}}}{#1}}{#2}%
}}
\begin{document}
$$\def\botgap{15pt} \sfrac{P_2}{P_0} = \sfrac{C_2}{C_2 + S^*_2} \cdot\sfrac{C_1}{C_1+S^*_1+\cfrac{C_2 S^*_2}{C_2+S^*_2}}$$
\end{document}


• Now P₀ looks funny. This is going nowhere good.... ;) – Dɑvïd Jun 17 '16 at 19:21
• @David See my follow-up. It is less nowhere-good than the \vphantom approach. – Steven B. Segletes Jun 17 '16 at 23:28