8

We may notice that the numerator and denominator in the following fraction are not aligned. And, to me it does not look good.

How to align the numerator and denominator?

\documentclass{article}

\usepackage{amsmath,mathrsfs,xcolor,mathtools}

\let\xoverline\overline % supply your definition

\begin{document}

\begin{equation}
\dfrac{1-k^{m+n+d}}{1-k}
\end{equation}
\end{document}

The above yields:

enter image description here

azetina
  • 28,884
Mia
  • 1,151

1 Answers1

8

Here's a comparison of the proposed solutions; the name next to the fraction doesn't necessarily denote the suggestion author's preference.

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}
\begin{document}
\makebox[2in][l]{1. Original}$\dfrac{1-k^{m+n+d}}{1-k}$

\bigskip

\makebox[2in][l]{2. egreg}$\dfrac{1-k^{m+n+d}}{1-k^{\hphantom{m+n+d}}}$

\bigskip

\makebox[2in][l]{3. projetmbc}$\dfrac{1-k^S}{1-k}, \text{ with $S=m+n+d$}$

\bigskip

\makebox[2in][l]{4. Peter Grill}$\dfrac{1-k^{\mathrlap{m+n+d}}}{1-k}$


\end{document}

Take your pick.

enter image description here

Everybody can add here their personal preference.

  • egreg: version 1 (with an eye to 3)
egreg
  • 1,121,712