\begin{equation} \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}}
\end{equation}
How can I bring the first denominator at the same height as the second denominator?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this community\begin{equation} \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}}
\end{equation}
How can I bring the first denominator at the same height as the second denominator?
(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}
\begin{equation} \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{equation}
\end{document}
FOLLOW UP
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 \vphantom
s.
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}
\begin{equation}
\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{equation}
\end{document}
\vphantom
approach.
– Steven B. Segletes
Jun 17 '16 at 23:28
;-)
– egreg Jun 16 '16 at 19:24