I want to write a limit with the "arrows' notation." This is, instead of \lim_{n \rightarrow \infty} x_{n} = x
I want to use x_{n} \rightarrow_{n \rightarrow \infty} x
. My problem is that with this last code, the n \rightarrow \infty
appears down to the right of the arrow, and I would like it to appear below the arrow. How can I do that?
-
BTW, you can us \to instead of \rightarrow (reads better).– John KormyloCommented Feb 13, 2015 at 4:28
-
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.– karlkoellerCommented Feb 13, 2015 at 9:04
Add a comment
|
2 Answers
You can use the extensible arrow \xrightarrow
provided by amsmath
, which has two arguments, an optional one for text below the arrow and a mandatory one for text above the arrow
\xrightarrow[text below]{text above}
In your case you have to use
\xrightarrow[n \to \infty]{}
MWE
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
x_{n} \xrightarrow[n \to \infty]{} x
\]
\end{document}
Note that in the limit it's better to use \to
rather than \rightarrow
Here's a way with the amsmath
package's \underset
macro.
\documentclass{article}
\usepackage{amsmath}
\def\xtend{-\!\!\!}
\begin{document}
\[ x_{n} \underset{\scriptscriptstyle n \rightarrow \infty}{\xtend\xtend\rightarrow} x\]
\end{document}
Here's a way with a stack. the option argument (here [2pt]
) controls the depth of the underset.
\documentclass{article}
\usepackage{stackengine}
\stackMath
\def\xtend{-\!\!\!}
\begin{document}
\[ x_{n} \mathrel{%
\stackunder[2pt]{\xtend\xtend\rightarrow}{\scriptscriptstyle n \rightarrow \infty}} x\]
\end{document}
-
\underset
sets the "limit" too far away from the main arrow. this would be a disaster in an in-line expression. Commented Feb 13, 2015 at 16:36 -
@barbarabeeton I agree. But being always joked with about doing everything via stacks, I thought I would show something using
amsmath
too. I guess I should stick with stacks8^b
Commented Feb 13, 2015 at 17:55 -
@barbarabeeton I would add that the other given answer (
\xrightarrow
) also ruins linespacing. Only the stacking approach (perhaps with a0pt
underset) looks nice inline. Commented Feb 13, 2015 at 17:59 -
well, the main arrow would look better if it were a little longer. at least the back-tip of the arrowhead shouldn't poke at the infinity. (actually, if i were copyediting something that contained that expression in text, i would encourage the author to find some other way.) Commented Feb 13, 2015 at 18:40