Written and maintained by CASRAI Editorial Board
Last updated
Who this is for: researchers and analysts typesetting limits in a paper, thesis or report who want the condition (for example x → ∞) in the right place and the operator name in upright type. After reading you should be able to write a limit with \lim, choose whether the condition sits under or beside the operator, and fix the usual placement surprises.
Short answer: load amsmath and write \lim_{x\to\infty} f(x), the form Overleaf’s documentation gives. In display math the amsmath guide places the condition underneath operator names such as lim; in running text the same code is set differently, because Overleaf’s operator article notes that the limit operator “changes when used alongside text”. Force a placement with \limits or \nolimits, or switch inline math to display style with \displaystyle. The table further down shows which symbols follow which rule, so you can predict the placement for sums, integrals and operator names in the same equation.
What it is used for in research
Limit notation appears in definitions, convergence conditions and asymptotic statements, so typesetting it consistently is part of preparing a mathematical manuscript or thesis. \lim is one of the predefined operator names in amsmath, alongside \liminf and \limsup. Overleaf notes that operator commands print the function name in upright (Roman) text instead of italics, which is the convention for function names such as sin, log and lim. For other symbols in the same equations, see Greek symbols in LaTeX; for multi-line derivations that end in a limit, see align vs aligned in amsmath and LaTeX new line in equation.
Install or access (official source only)
The \lim operator on this page comes from the amsmath package. The CTAN package page lists amsmath as part of the LaTeX required distribution, version 2.17z dated 2025-07-09, contained in TeX Live and MiKTeX as amsmath, so a standard TeX installation already has it (see our guides to MiKTeX and, for a hosted editor, Overleaf). Load it in the preamble:
\usepackage{amsmath}
The package’s own documentation is the User’s Guide for the amsmath Package (version 2.1, American Mathematical Society and the LaTeX Project) on CTAN. Overleaf’s documentation pages offer an “Open this example in Overleaf” link for each example.
Step-by-step: typeset a limit with \lim
- Add
\usepackage{amsmath}to the preamble. Overleaf’s examples for limits all load it. - In math mode, write
\lim_{lower}followed by the expression. Overleaf’s example is\lim_{x\to\infty} f(x). - Choose inline math (
\( ... \)) for a limit inside a sentence or display math (\[ ... \]) for a standalone line. Overleaf shows both for the same limit:Limit \(\lim_{x\to\infty} f(x)\) inside text \[ \lim_{x\to\infty} f(x) \] - Compile, then check where the condition sits (see “Output and how to read it” below).
- If the condition is in the wrong place, apply one of the overrides in the next subsections.
A complete minimal document, taken from Overleaf’s article on operators, shows the display form and the inline form side by side:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Testing notation for limits
\[
\lim_{h \to 0 } \frac{f(x+h)-f(x)}{h}
.\]
This operator changes when used alongside
text \( \lim_{h \to 0} (x-h) \).
\end{document}
LaTeX limit under: put the condition below lim
Use display math. The amsmath guide describes the namelimits option, on by default, as applying to operator names such as det, inf, lim, max and min that “traditionally have subscripts placed underneath when they occur in a displayed equation”. Writing \[ \lim_{x\to\infty} f(x) \] is therefore enough; no extra command is needed.
Force the condition under or beside: \limits and \nolimits
The amsmath guide states that the commands \limits and \nolimits “can be used to override the normal behavior of a base symbol”. Put the command directly after the symbol, before the subscript:
\lim\limits_{x\to\infty} f(x)
\lim\nolimits_{x\to\infty} f(x)
When several of \limits, \nolimits and \displaylimits occur consecutively, the guide says the last one takes precedence.
Fix an inline limit with \displaystyle
Overleaf’s article on display style lists \displaystyle as applying “the style used for mathematics typeset on lines by themselves”, and shows inline math set that way, with the warning that it “does impact heavily on the line spacing”. Because \lim places its condition underneath in display style (amsmath guide, above), wrapping an inline limit this way is the other route to a condition under lim:
\(\displaystyle \lim_{x\to\infty} f(x)\)
Prefer \lim\limits when you only want to move the limit and keep the rest of the line compact.
Several conditions under lim: \substack
The amsmath guide describes \substack as the command that produces a multi-line subscript or superscript, and also provides a subarray environment when each line should be left-aligned instead of centred. Inside a limit it looks like this:
\lim_{\substack{x \to 0 \\ x \ne 0}} f(x)
lim, liminf and limsup
The amsmath guide lists these predefined operator names; use them instead of typing the words:
\lim,\liminfand\limsup\projlimand\injlim\varinjlimand\varprojlim
Define your own limit-style operator
To make a new function name, the guide gives \DeclareMathOperator{\xxx}{xxx}, which prints the name upright and adds the spacing. If the new operator’s subscripts should go above and below, as with lim, sup or max, use the starred form; the guide’s own example is:
\DeclareMathOperator*{\Lim}{Lim}
Overleaf says the same: use \DeclareMathOperator* when the defined operator uses subscripts as \lim does. For a one-off, the guide’s \operatorname{abc} is equivalent to a declared \abc, and \operatorname* gives the limits placement.
Where the limits go: one table for sums, integrals and lim
The amsmath guide (sections 2 and 7.3) sets different defaults for three classes of symbol, which is why a limit, a sum and an integral can look inconsistent in the same equation:
| Symbol class | Examples | Default in display math | Default inline | Package option that changes it |
|---|---|---|---|---|
| Sum-class | \sum, \prod |
Above and below | To the side | sumlimits (default) or nosumlimits |
| Integral-class | \int, \iint |
To the side, even in displays | To the side | intlimits; nointlimits is the default |
| Operator names | \lim, \max, \min, \inf, \det |
Underneath | Set differently in running text (Overleaf’s inline example); underneath is the display setting | namelimits (default) or nonamelimits |
The guide adds that operator names such as sin or lim may have either “displaylimits” or “limits” positioning depending on how they were defined, and that the standard names are defined according to normal mathematical usage. A document that loads amsmath with the nonamelimits option, or a class that preloads amsmath with it, changes the operator-name row.
Output and how to read it
The rendered result is the word lim in upright type, the condition as a subscript, and the expression it applies to. In \lim_{x\to\infty} f(x) the subscript x → ∞ states the condition, and f(x) is the expression the limit is taken of. In Overleaf’s operator example, \lim_{h \to 0 } \frac{f(x+h)-f(x)}{h} places the condition under lim on its own line, while the inline example \( \lim_{h \to 0} (x-h) \) is set differently, as the article points out. The predefined variants print as follows in the amsmath guide’s table:
| Command | Printed as (amsmath guide) |
|---|---|
\lim |
lim |
\liminf |
lim inf |
\limsup |
lim sup |
\projlim |
proj lim |
\injlim |
inj lim |
\varinjlim |
lim with a rightwards arrow |
\varprojlim |
lim with a leftwards arrow |
Troubleshooting
- The limit sits to the right of lim in a sentence. This is the inline setting. Move the formula to display math, add
\limitsafter\lim, or use\displaystyle(see the sections above). - The limit sits to the right even in a display. Check whether the document or class loads amsmath with
nonamelimits(the opposite of the defaultnamelimits), or whether\nolimitsfollows the operator. The last of\limits,\nolimitsand\displaylimitswins. - The word lim appears in italic, with letter spacing like a product of variables. Use
\lim, not the typed letters. Overleaf notes operator commands print the name upright, and the amsmath guide says function names should not be entered with\text; use\mathrmor\DeclareMathOperatorinstead. - Your own operator puts its condition beside the name, not under it. Declare it with
\DeclareMathOperator*(or use\operatorname*). - The condition needs two lines. Use
\substackinside the subscript. - Integral limits stay beside the integral sign in a display. That is the amsmath default for integral-class symbols; the
intlimitsoption changes it.
Open-source alternatives
If a limit is the only reason you are looking at another tool, the table compares how each route writes one. Typst, an alternative typesetting system, is covered in Typst: what it is and how it compares with LaTeX.
| Tool | How a limit is written | Licence listed by its project |
|---|---|---|
| LaTeX with amsmath | \lim_{x\to\infty} f(x); placement controlled with \limits, \nolimits and the package options above |
amsmath: LaTeX Project Public License 1.3c (CTAN listing) |
| Typst | lim is one of the predefined math operators, with liminf and limsup; its documentation describes op("custom", limits: #true) for a custom operator, where the limits parameter controls whether attachments appear as limits in display mode (default false) |
Typst compiler: Apache-2.0 (GitHub repository typst/typst) |
FAQ
What is the LaTeX symbol for lim?
The command is \lim. It is an operator name, so it prints lim in upright type, and it is used with a subscript for the condition: \lim_{x\to\infty} f(x).
What does lim mean in LaTeX?
\lim typesets the limit notation. In Overleaf’s example \lim_{x\to\infty} f(x) it is read as the limit of f(x) as x tends to infinity. LaTeX only formats the notation; it does not evaluate anything.
How do I put the limit under lim in LaTeX?
Write the limit in display math, \[ \lim_{x\to\infty} f(x) \], where amsmath places the subscript underneath. In inline math, add \limits after \lim or start the formula with \displaystyle.
What is the LaTeX formula for a limit?
\lim_{lower} expression, as in \lim_{h \to 0 } \frac{f(x+h)-f(x)}{h} from Overleaf’s operator article. For the lim inf and lim sup variants use \liminf and \limsup.
Sources (official docs)
- Overleaf, Integrals, sums and limits: overleaf.com/learn/latex/Integrals,_sums_and_limits (as of 2026-11-07).
- Overleaf, Operators: overleaf.com/learn/latex/Operators (as of 2026-11-07).
- Overleaf, Display style in math mode: overleaf.com/learn/latex/Display_style_in_math_mode (as of 2026-11-07).
- American Mathematical Society and the LaTeX Project, User’s Guide for the amsmath Package, version 2.1: mirrors.ctan.org/macros/latex/required/amsmath/amsldoc.pdf (as of 2026-11-07).
- CTAN, amsmath package page (version 2.17z, 2025-07-09): ctan.org/pkg/amsmath (as of 2026-11-07).
- Typst documentation, Text Operator: typst.app/docs/reference/math/op, and the Typst repository: github.com/typst/typst (as of 2026-11-07).







