Question

I'm using Latex to create equations and it is rendered on a website using Mathjax.

When multiple 'lim' comes in the same line, the second 'lim' is not displayed properly as shown in the image.

Following is the latex code for the equation. How can the issue be fixed?

\begin{align}
  \sf\:We\: have \:
  \lim_{x \rightarrow a} \frac {x^{n} - a^{n}} {x - a}
    & = na^{n-1} \\
  \therefore 
  \lim_{x \rightarrow 2} \frac {x^{100} - 2^{100}} {x^{77} - 2^{77}}
    & = \lim_{x \rightarrow 2} \frac {x^{100} - 2^{100}} {x - 2} 
        \times \frac {1} {\lim_{x\rightarrow 2} \frac {x^{77} - 2^{77}} {x - 2}} \\ 
    & = \frac {100 \times 2^{99}} {77 \times 2^{76}} \\ 
    & = \frac {100} {77} \times 2^{23}
\end{align}

Screenshot of the equation written using latex and rendered using mathjax

Was it helpful?

Solution

The placement of the limits on an operator like \lim or \sum is controlled by the "style" that TeX is using. In "displaystyle", the limits are placed above and below the operator, while in "textstyle" (and the script styles) they are placed to the right (as in your boxed example). In-line equations are in textstyle, while displayed equations begin in displaystyle. But the style isn't constant within an equation. In displaystyle, the numerator and denominator of a fraction will be typeset in textstyle, not displaystyle, which is why you are seeing the limits to the right of the operator. That is the correct behavior.

To get the limits below the operator when you are not in displaystyle, use \limits after the operator name. E.g.,

\frac{1}{\lim\limits_{x\rightarrow 2}\frac{x^{77}-2^{77}}{x-2}}

should produce the result you want.

OTHER TIPS

That looks like a perfectly acceptable way of typesetting the equation to me. I suppose you could try to force LaTeX to typeset the x->2 under the lim by using \stackrel or something like that.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top