Written and maintained by CASRAI Editorial Board
Published · Last updated
On this page
In LaTeX, \choose typesets a binomial coefficient, “n choose k”, as a stacked pair of numbers inside parentheses. It is written {n \choose k} and comes from plain TeX, where it is defined as \atopwithdelims(). In a current LaTeX document the recommended form is \binom{n}{k} from the amsmath package, which gives the same stacked layout with a clearer argument syntax. This guide covers both commands, how to convert between them, what the warnings mean, and how each renders on web pages.
What \choose is used for in research
A binomial coefficient counts the ways to pick k items from n, and it appears wherever a paper discusses combinations: sampling designs, probability distributions, permutation tests, combinatorial proofs and the binomial theorem. In print it is shown as n over k with no fraction bar, enclosed in parentheses. Two commands produce that shape in LaTeX source.
\chooseis the older plain TeX form. It is an infix command: it sits between the two values and the whole expression is grouped in braces, as in{n \choose k}. The plain TeX definition is\choose = \atopwithdelims()(Wikibooks, TeX/atopwithdelims, read 2026-11-12).\binomis theamsmathform. It takes two arguments,\binom{n}{k}. The amsmath User’s Guide introduces it as the command for “binomial expressions such as (n over k)” and lists\dbinomand\tbinombeside it (section 4.11.2, read 2026-11-12).
Both are searched under several phrasings: “choose in latex” and “latex choose”. Both lead to the same two commands described here. If you are looking for how to select a LaTeX editor or distribution, this is not that page; see LaTeX and Overleaf collaborative writing instead.
How to install or access it
\choose needs no package because it is part of plain TeX and is available in a standard LaTeX document. \binom requires amsmath, which is distributed through CTAN under the LaTeX Project Public License and ships with standard LaTeX distributions (CTAN package page, ctan.org/pkg/amsmath, checked 2026-11-08). The package documentation is the amsmath User’s Guide, version 2.1, revised 2020-02-18, hosted on CTAN. Load the package in the preamble:
\usepackage{amsmath}
Overleaf’s documentation page on fractions and binomials states the same requirement: the examples there load amsmath before using \binom (Overleaf, Fractions and Binomials, read 2026-11-12).
Step-by-step: typeset n choose k
With \binom (recommended)
- Add
\usepackage{amsmath}to the preamble, after\documentclass{...}and before\begin{document}. - In math mode, write
\binom{n}{k}. The first argument is the upper number and the second is the lower number. - Compile as usual. The result is n stacked over k inside parentheses.
A full definition, as shown in the Overleaf example, is:
\[ \binom{n}{k} = \frac{n!}{k!(n-k)!} \]
The amsmath guide’s own example shows the command inside a longer expression: 2^k-\binom{k}{1}2^{k-1}+\binom{k}{2}2^{k-2}. For the \frac part and the display-versus-inline sizing that goes with it, see LaTeX \dfrac, \tfrac and \frac.
With \choose (existing documents)
- Write the two values on either side of the command and wrap the whole expression in braces:
{n \choose k}. - Keep the braces. The command is infix, so the braces mark which material belongs to the numerator and denominator positions.
Converting \choose to \binom
To modernise a document, move the first value into the first argument and the second value into the second argument, dropping the infix command and its enclosing group: {n \choose k} becomes \binom{n}{k}. Search the source for the string \choose and convert each occurrence individually, since a long left-hand expression such as {n+1 \choose k-1} needs its whole content moved into the first argument: \binom{n+1}{k-1}.
Output and how to read it
All of these commands produce the same visual pattern: an upper value over a lower value, wrapped in parentheses, with no fraction rule between them. The amsmath guide shows why. It defines \binom in terms of the general fraction command:
\newcommand{\binom}[2]{\genfrac{(}{)}{0pt}{}{#1}{#2}}
Reading the arguments of \genfrac{left-delim}{right-delim}{thickness}{mathstyle}{numerator}{denominator}: the delimiters are parentheses, the rule thickness is 0pt (so no bar is drawn), the mathstyle is empty (so it follows the surrounding context), and the two remaining arguments are the numbers. The same guide notes that \frac is \genfrac{}{}{}{} with an empty thickness meaning a normal rule, and that \tfrac uses mathstyle 1. Mathstyle values 0 to 3 stand for \displaystyle, \textstyle, \scriptstyle and \scriptscriptstyle respectively (amsmath User’s Guide, section 4.11.3).
That definition gives three practical consequences:
\binomadapts to its context. Inline it is set in text style and in a displayed equation in display style.\dbinomand\tbinomare the display-style and text-style variants, listed alongside\binomin section 4.11.2. Use them when you need to force one size, exactly as\dfracand\tfracdo for fractions.- If you need a different delimiter, such as square brackets or none, call
\genfracdirectly with your own delimiters and a thickness of0pt.
The data table below summarises the commands, their origin, and where each is supplied in MathJax, which is relevant for web and Markdown output.
Troubleshooting
“Package amsmath Warning: Foreign command \over”
The amsmath guide states that the primitive generalized-fraction commands \over, \overwithdelims, \atop, \atopwithdelims, \above and \abovewithdelims “produce warning messages if used with the amsmath package”. The warning reads “Package amsmath Warning: Foreign command \over; \frac or \genfrac should be used instead”, and the guide explains that these commands are deprecated under amsmath because their syntax is foreign to LaTeX. \choose is not named in that list in the guide, so this guide does not claim it produces the warning. Because \choose is defined through \atopwithdelims, though, replacing it with \binom removes any dependence on the deprecated family and is the safer long-term choice.
“Undefined control sequence” on \binom
This points to a missing \usepackage{amsmath} in the preamble, since \binom is supplied by that package rather than by the base format. Add the line and recompile.
The binomial looks wrong when copied between documents
Check that every \choose expression is wrapped in braces. Without a group, the command treats everything in the surrounding formula as its numerator and denominator, which is why the braces form is the documented pattern. Using \binom avoids the problem because the arguments are explicit.
Web and Markdown output
MathJax documentation lists \choose, \atop and \over in its base package, and \binom, \dbinom, \tbinom and \genfrac in the ams package (MathJax, Supported TeX/LaTeX commands, v4.0, read 2026-11-12). A configuration that loads only the base package will therefore lack \binom but still provide \choose.
Free alternatives
Every command here is free to use, so the question is which one to write rather than which to buy. The table compares each in terms of what the sources state.
| Command | Syntax | Package needed | Use it when |
|---|---|---|---|
\choose |
{n \choose k} |
None (plain TeX; \atopwithdelims()) |
You are maintaining an older document or a base-only MathJax setup |
\binom |
\binom{n}{k} |
amsmath (MathJax: ams) |
Writing new LaTeX; context-sized binomial |
\dbinom / \tbinom |
\dbinom{n}{k} |
amsmath (MathJax: ams) |
You must force display or text size |
\genfrac |
\genfrac{(}{)}{0pt}{}{n}{k} |
amsmath (MathJax: ams) |
You need other delimiters or a custom rule thickness |
Common mistakes
- Writing
n \choose kwithout enclosing braces, which lets the command act on more of the formula than intended. - Using
\overor\atopfor a binomial and receiving the Foreign command warning; use\binomor\genfracinstead. - Forgetting
\usepackage{amsmath}when switching from\chooseto\binom. - Mixing both styles in one paper; pick
\binomfor consistency.
FAQ
What does choose do in LaTeX?
It typesets a binomial coefficient, n over k in parentheses, written {n \choose k}. It is a plain TeX command defined as \atopwithdelims().
How do I write n choose k in LaTeX?
Load amsmath and write \binom{n}{k}. The older {n \choose k} still exists but is not the form the amsmath guide documents.
Is \choose deprecated?
The amsmath guide does not list \choose among the deprecated primitives; it lists \over, \atop and related commands. It does present \binom as the amsmath command for binomial expressions.
Does \choose need a package?
No. \choose is available without loading anything, while \binom needs amsmath.
How do I make the binomial larger or smaller?
Use \dbinom for display size or \tbinom for text size, or call \genfrac with a mathstyle value between 0 and 3.
Does \binom work in MathJax?
Yes, from the ams package; \choose comes from the base package.
Sources
- amsmath User’s Guide, version 2.1, revised 2020-02-18, sections 4.11.2 and 4.11.3: mirrors.ctan.org/macros/latex/required/amsmath/amsldoc.pdf (read 2026-11-12).
- CTAN, amsmath package page: ctan.org/pkg/amsmath (checked 2026-11-08).
- Overleaf documentation, Fractions and Binomials: overleaf.com/learn/latex/Fractions_and_Binomials (read 2026-11-12).
- Wikibooks, TeX/atopwithdelims: en.wikibooks.org/wiki/TeX/atopwithdelims (read 2026-11-12).
- MathJax documentation, Supported TeX/LaTeX commands (v4.0): docs.mathjax.org/en/v4.0/input/tex/macros/ (read 2026-11-12).
Related CASRAI guides: LaTeX \dfrac, Big O in LaTeX, argmax in LaTeX, cases in LaTeX math.
Data: LaTeX binomial and fraction-style commands: origin, MathJax package and amsmath status
Compares the LaTeX commands used for binomial coefficients and stacked fractions by origin, the MathJax package that supplies them, and how the amsmath User's Guide treats each. Compiled from the amsmath guide, MathJax docs and Wikibooks.
| Command | Origin | MathJax package | amsmath guide treatment |
|---|---|---|---|
| \choose | Plain TeX | base | Defined as \atopwithdelims(); not named in amsmath guide's deprecated list |
| \atop | TeX primitive | base | Warns under amsmath (Foreign command) |
| \over | TeX primitive | base | Warns under amsmath (Foreign command) |
| \binom | amsmath | ams | Defined as \genfrac{(}{)}{0pt}{}{#1}{#2} |
| \dbinom | amsmath | ams | Listed with \binom in section 4.11.2 |
| \tbinom | amsmath | ams | Listed with \binom in section 4.11.2 |
| \genfrac | amsmath | ams | Six-argument general fraction command; \frac is \genfrac{}{}{}{} |
Sources
- amsmath User's Guide v2.1 (accessed 2026-11-12)
- MathJax Supported TeX/LaTeX commands v4.0 (accessed 2026-11-12)
- Wikibooks TeX/atopwithdelims (accessed 2026-11-12)
Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.







