In the general case, I agree with Hendrik Vogt: fractions look better centered. And yes, when I'm writing fractions, I typically write the top, draw a line, and then try to center the bottom. I usually screw this up, but that's what computers are for :-)
However, in this case, I can see why you might prefer to align things, even if I wouldn't do so myself. To do so, you should use \hphantom
. There are three \phantom
commands: \phantom
, \hphantom
, and \vphantom
. They each create an empty box; the first command creates one the exact size of its argument, the second creates a solely horizontal box, and the third one creates a solely vertical box. You then want to overlap the actual text with the box. For this, you can use \rlap
, which sets its contents in a zero-width box and overlaps it to the right. However, this gets math mode a little wrong; to get this really right, we can use the \crampedrlap
command from the mathtools
package. Putting this together gives
\newcommand{\geomsum}[2]{\frac{1-#1^{#2+1}}%
{1-\crampedrlap{#1}\hphantom{#1^{#2+1}}}}
I don't know of any package which does this for you, since as I said, it's more typical to leave things centered. The \cfrac
command from amsmath
is designed for typesetting continued fractions, but specifying \cfrac[l]{\text{short numerator}}{\text{very long denominator}}
will left-align the numerator. It doesn't provide a way to deal with the denominator, and it's for continued fractions so something about its spacing (I'm not sure exactly what, but something) is different; however, it might provide a good starting point.