The amsmath package provides the \overset
and \underset
macros that can be used to place one symbol above or below another. If you want text above and below, you could use \DeclareMathOperator*
(also from amsmath
).
\documentclass{minimal}
\usepackage{amsmath}
\DeclareMathOperator*{\eq}{=}
\begin{document}
\begin{equation*}
\underset{b}{=} \quad \eq^a_b
\end{equation*}
\end{document}
There shouldn't be any problems using this in amsmath
environments such as align
.
\begin{align*}
A &\eq^b_a B \\
&\eq^b_a C
\end{align*}
However, if you use it in the middle column of an eqnarray
or eqnarray*
(which are generally considered to be obsolete), then you will need \displaystyle
before \eq
.
All of the above applies to egreg's suggestion of defining \eq
via
\newcommand{\eq}[2]{\mathrel{\operatorname*{=}_#1^#2}}
which seems to improve the spacing (and may be better in other ways as well).
For the first question, you can typeset limits using the \lim
command:
$\lim_{x\to\infty}\frac{1}{x}$
\[ \lim_{x\to\infty}\frac{1}{x} \]
For the second question, the \left
, \middle
and \right
commands can be used to achieve vertical extension of some delimiters:
\[ \left\lvert\frac{1}{2} \right\rvert \]
To obtain fine control on the size of extensible delimiters there are also the following command groups (which in some circumstances, must replace the \left
\middle
\right
construct):
\bigl - \bigm - \bigr
\Bigl - \Bigm - \Bigr
\biggl - \biggm - \biggr
\Biggl - \Biggm - \Biggr
These groups provide delimiters of increasing sizes; the first column gives four sizes of opening symbols; the second column gives four sizes of relation symbols, and the third column gives four sizes of closing symbols..
There are some cases in which the above commands should replace the \left
, \right
ones: when the latter produce delimiters which are too big, and when there are several delimiters together. Compare the result of
\[ \left\lvert\lvert x\rvert -\lvert y\rvert \right\rvert \]
and
\[ \bigl\lvert\lvert x\rvert -\lvert y\rvert \bigr\rvert \]
In the first case, the inner and outer delimiters have the same size and the result can be ambiguous; in the second case, the outer delimiters are bigger, improving readability.
Best Answer
You are looking for
\lim_{x \to 2} f(x) = 5
. This has to be used in math mode which can be either inline mode (where the limit is placed as a subscript so that the inter line spacing of the paragraph is not perturbed):or in display mode where the limits are placed underneath):
References:
For the two types of math modes, please see:
An excellent reference for math mode is Herbert Voss' comprehensive review of mathematics in (La)TeX
Code: