Align underline in LaTeX

These days, I had trouble in aligning two fractions, one of which has an underlined numerator while the other
doesn’t.Just like this.
$$\frac{\partial \underline{\phi }}{\partial y}\frac{\partial f}{\partial y}$$
Finally I found a solution to it, using \vphantom
$$\frac{\partial \underline{\phi }}{\partial x}\frac{\partial f\vphantom{\underline{\phi }}}{\partial x}$$

The description of \vphantom is

The box created by \vphantom has the height and depth of its argument,
but its width is zero (so it doesn’t contribute to any horizontal spacing issues).
In other words, \hphantom creates vertical space equal to that produced by its argument,
but doesn’t create any horizontal space.

  • Post author: Gong Siqiu
  • Post link: /4041067566/
  • Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.