Changes

Jump to navigation Jump to search
1,461 bytes added ,  17:25, 8 June 2020
m
no edit summary
= Fractions, Binomials, genfrac, continued fractions =
== Binomials Binomial coefficients ==
Binomials: Wolfgang explains (ntg-context list, 2011-12-04): Instead if \choose To write binomial coefficients you can use \any of {{cmd|binom which is }}, {{cmd|tbinom}} or {{cmd|dbinom}} (the recommended way latter two if you want to force text style or display style respectively). These commands are defined as fractions in contextConTeXt, and can be set up with{{cmd|setupmathfractions}}.  The \dbinom command sets default look of the content binomial coefficients look good in display style while several fonts, but for example not perfect in Latin Modern. You can play with {{cmd|setupmathfractions}}, and in particular, you can try <texcode>\tbinom use textstylesetupmathfractions[binomial][fences=parenthesis,%threshold=1.5,]</texcode> Below we show some of the often used fonts, together with the default setting and the one just suggested. You can also play with thethreshold key.
<texcode>
\setuphead[chapter][align=middle]
\setuphead[section][style=\bfa]
\setuphead[subsection][style=\it]
 
 
\setuplayout[
topspace=1in,
bottomspace=1in,
header=0pt,
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
Using \textitle{binomBinomial coefficients} in text $\binom{n}{\frac{n}{2}}$.
Using \tex{dbinom} in text $\dbinom{n}{\frac{startcolumns[n}{=2}}$.]
Using \texsubject{tbinomDefault settings} in text $\tbinom{n}{\frac{n}{2}}$.
\startformula\binomsubsubject{n}{\frac{n}{2}Latin Modern}\stopformulagetbuffer
\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
</texcode>
 
The result of the code above, with the standalone from 2017-09-05 is given below.
 
[[File:binomialcoefficients.png|700px]]
 
[[Category:Math]]

Navigation menu