Changes

Jump to navigation Jump to search
1,436 bytes added ,  18:18, 5 September 2017
= 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 $ \binomstartcolumns[n=2] \subject{nDefault settings\subsubject{Latin Modern}\fracgetbuffer \switchtobodyfont[pagella]\subsubject{nPagella}\getbuffer \switchtobodyfont[stixtwo]\subsubject{2STIX Two}\getbuffer \switchtobodyfont[lucidaot]\subsubject{Lucida}$.\getbuffer \column[yes]
Using \tex{dbinom} in text $\dbinom{n}{\frac{n}{2}}$.setupmathfractions[binom][fences=parenthesis,]
Using \texswitchtobodyfont[modern]\subject{tbinomWith fences=parenthesis} in text $\tbinomsubsubject{nLatin Modern}{\frac{n}{2}}$.getbuffer
\startformulaswitchtobodyfont[pagella]\binomsubsubject{n}{\frac{n}{2}Pagella}\stopformulagetbuffer
\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]]
23

edits

Navigation menu