Skip to main content
v2026.11,986 entries · CC-BY 4.0

LaTeX \choose: Binomial Coefficients and \binom

Write n choose k in LaTeX with \choose or amsmath \binom, convert between them, and fix common warnings.

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.

  • \choose is 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).
  • \binom is the amsmath form. 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 \dbinom and \tbinom beside 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

  1. Add \usepackage{amsmath} to the preamble, after \documentclass{...} and before \begin{document}.
  2. In math mode, write \binom{n}{k}. The first argument is the upper number and the second is the lower number.
  3. 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)

  1. Write the two values on either side of the command and wrap the whole expression in braces: {n \choose k}.
  2. 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:

  • \binom adapts to its context. Inline it is set in text style and in a displayed equation in display style.
  • \dbinom and \tbinom are the display-style and text-style variants, listed alongside \binom in section 4.11.2. Use them when you need to force one size, exactly as \dfrac and \tfrac do for fractions.
  • If you need a different delimiter, such as square brackets or none, call \genfrac directly with your own delimiters and a thickness of 0pt.

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 k without enclosing braces, which lets the command act on more of the formula than intended.
  • Using \over or \atop for a binomial and receiving the Foreign command warning; use \binom or \genfrac instead.
  • Forgetting \usepackage{amsmath} when switching from \choose to \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

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.

LaTeX binomial and fraction-style commands: origin, MathJax package and amsmath status
CommandOriginMathJax packageamsmath guide treatment
\choosePlain TeXbaseDefined as \atopwithdelims(); not named in amsmath guide's deprecated list
\atopTeX primitivebaseWarns under amsmath (Foreign command)
\overTeX primitivebaseWarns under amsmath (Foreign command)
\binomamsmathamsDefined as \genfrac{(}{)}{0pt}{}{#1}{#2}
\dbinomamsmathamsListed with \binom in section 4.11.2
\tbinomamsmathamsListed with \binom in section 4.11.2
\genfracamsmathamsSix-argument general fraction command; \frac is \genfrac{}{}{}{}

Sources

Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about LaTeX \choose: Binomial Coefficients and \binom

2 free questions a day, no account.

An AI assistant for research: funder rules, compliance, methods and publishing. It links the sources behind its answers and labels answers that come from a web search.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays open to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →