TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like the following to look nicer:

$\frac{1 - \left(\frac{r-3}{r-1}  \right)^{k-(p+q)+1}}{1 - \left(\frac{r-3}{r-1}  \right)}$

As of now, the horizontal line is way too long.

share|improve this question
Welcome to TeX.SX. A tip: If you indent lines by 4 spaces, then they're marked as a code sample. You can also highlight the code and click the "code" button ({}) or hit Ctrl+K. – Claudio Fiandrino Mar 6 '14 at 12:16
There is the \dfrac command, but I can't remember in which package it can be found. – Christian Hupfer Mar 6 '14 at 12:26
@ChristianH. amsmath. – Gonzalo Medina Mar 6 '14 at 12:30
If the horizontal line does not include the exponent, then I'd be unsure whether the exponent applies to the whole fraction. – MvG Mar 6 '14 at 17:53

You can use the command \mathrlap from the mathtools package.





Displaystyle version

\[\dfrac{1 - \left(\dfrac{r-3}{r-1}  \right)^{\mathrlap{k-(p+q)+1}}}{1 - \left(\dfrac{r-3}{r-1}  \right)}\]


Here is the inline version $\frac{1 - \left(\frac{r-3}{r-1}  \right)^{\mathrlap{k-(p+q)+1}}}{1 - \left(\frac{r-3}{r-1}  \right)}$


enter image description here

share|improve this answer

You could certainly use a trick like this:

${\frac{1 - \left(\frac{r-3}{r-1} \right)}{1 - \left(\frac{r-3}{r-1} \right)}}^{\mbox{\tiny $k-(p+q)+1$}}$

share|improve this answer
+1, but you can tweak it even better by adding \!\! at the beginning of the tiny mbox, as ^{\mbox{\tiny $\!\!k-(p+q)+1$}} – Steven B. Segletes Mar 6 '14 at 13:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.