# Fractions, Binomials, genfrac, continued fractions

## Binomial coefficients

To write binomial coefficients you use any of \binom, \tbinom or \dbinom (the latter two if you want to force text style or display style respectively). These commands are defined as fractions in ConTeXt, and can be set up with \setupmathfractions.

The default look of the binomial coefficients look good in several fonts, but for example not perfect in Latin Modern. You can play with \setupmathfractions, and in particular, you can try

\setupmathfractions[binomial][
fences=parenthesis,
%threshold=1.5,
]


Below we show some of the often used fonts, together with the default setting and the one just suggested. You can also play with the threshold key.

\setuphead[chapter][align=middle]

\setuplayout[
topspace=1in,
bottomspace=1in,
footer=0pt,
backspace=1in,
margin=0pt,
width=fit,
height=fit,
]

\startbuffer
\type{\binom{n}{k}}: $\binom{n}{k}$\par
\type{\tbinom{n}{k}}: $\tbinom{n}{k}$\par
\type{\dbinom{n}{k}}: $\dbinom{n}{k}$\par
\stopbuffer

\starttext

\title{Binomial coefficients}

\startcolumns[n=2]

\subject{Default settings}

\subsubject{Latin Modern}
\getbuffer

\switchtobodyfont[pagella]
\subsubject{Pagella}
\getbuffer

\switchtobodyfont[stixtwo]
\subsubject{STIX Two}
\getbuffer

\switchtobodyfont[lucidaot]
\subsubject{Lucida}
\getbuffer

\column[yes]

\setupmathfractions[binom][
fences=parenthesis,
]

\switchtobodyfont[modern]
\subject{With fences=parenthesis}
\subsubject{Latin Modern}
\getbuffer

\switchtobodyfont[pagella]
\subsubject{Pagella}
\getbuffer

\switchtobodyfont[stixtwo]
\subsubject{STIX Two}
\getbuffer

\switchtobodyfont[lucidaot]
\subsubject{Lucida}
\getbuffer

\stopcolumns
\stoptext


The result of the code above, with the standalone from 2017-09-05 is given below.