Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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 at 12:16
    
There is the \dfrac command, but I can't remember in which package it can be found. –  Christian Hupfer Mar 6 at 12:26
    
@ChristianH. amsmath. –  Gonzalo Medina Mar 6 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 at 17:53

2 Answers 2

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

MWE:

\documentclass{article}

\usepackage{mathtools}

\begin{document}

Displaystyle version

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

\bigskip

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)}$

\end{document} 

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 at 13:15

Your Answer

 
discard

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.