bably too large,
> but I think that a little more space than you currently have would be
> better.
I haven’t adjusted the space directly. I just changed the \times and \cdot from
class binom to class ord. I’m not going to tweak the space. I don’t even use
this font. With proportional numbers i
On 7/9/2022 12:40 AM, Otared Kavian via ntg-context wrote:
I just found that \choose has been replaced with \binom (binomial coefficient):
\starttext
\meaning\choose
\meaning\binom
$\binom{n}{k}$
\stoptext
Sorry for complaining… :-)
no problem ... maybe we should have a wiki page for
I just found that \choose has been replaced with \binom (binomial coefficient):
\starttext
\meaning\choose
\meaning\binom
$\binom{n}{k}$
\stoptext
Sorry for complaining… :-)
> On 9 Jul 2022, at 00:34, Otared Kavian wrote:
>
>
>
>> On 6 Jul 2022, at 22:10, Hans Hag
On 3/16/2021 3:11 PM, Jacob Kauffmann wrote:
Dear list,
lmtx draws a fraction line in \binom{n}{k},
ConTeXt ver: 2021.02.23 17:47 LMTX fmt: 2021.2.26 int: english/english
The same happens with {n \choose k}.
The other version I tested draws it correctly (without the bar
Dear list,
lmtx draws a fraction line in \binom{n}{k},
ConTeXt ver: 2021.02.23 17:47 LMTX fmt: 2021.2.26 int: english/english
The same happens with {n \choose k}.
The other version I tested draws it correctly (without the bar):
ConTeXt ver: 2019.03.21 21:39 MKII fmt: 2019.11.14
\binom{n-1}{k-1}}
\stopxcell
\startxcell[width=fit]
\m{+}
\stopxcell
\startxcell
\m{\displaystyle\binom{n-1}{k}}
\stopxcell
\stopxrow
\startxrow
\startxcell
\stopxcell
}]}]
\starttabulate [|p|r|]
\NC\NC #2 \NC\NR
\NC #1 \NC\NC\NR
\stoptabulate
}
\starttext
\startluacode
function Binom(n,k)
if k > n then
return ""
elseif (n == 0 or k == 0) then
return 1
else
return
.
Best regards,
Dalyoung
> 2020. 7. 20. 오후 5:36, Hans Hagen 작성:
>
> On 7/20/2020 7:56 AM, Jeong Dal wrote:
>> Dear Fabrice,
>> You may split Binom(n,k) function into two functions as following:
> > see original mail
> >
>> Dalyoung
> Best stay in a
Dal wrote:
> > Dear Fabrice,
> >
> > You may split Binom(n,k) function into two functions as following:
> >
> > see original mail
> >
> > Dalyoung
> Best stay in a protected namespace ...
>
> \startluacode
>
> local function fact (n)
>
Dear Fabrice,
You may split Binom(n,k) function into two functions as following:
*
\startluacode
P={}
combi = P
function P.fact (n)
if n <= 0 then
return 1
else
return n * P.fact(n-1)
end
end
function P.ncr(n,r)
return P.fact(n)/(P.fact(r)*P.fact(n-r))
end
co
On 7/20/2020 7:56 AM, Jeong Dal wrote:
Dear Fabrice,
You may split Binom(n,k) function into two functions as following:
> see original mail
>
Dalyoung
Best stay in a protected namespace ...
\startluacode
local function fact (n)
if n <= 0 then
return 1
to use context(...) here?
>> How not to display the .0 ?
Or even better, you can return an integer in your Binom function:
return math.round((n*Binom(n-1,k-1))/k)
Best regards: Otared
___
If your quest
ggested, ou can also use
context(math.round(Binom(i,j)))
to have integers instead of real numbers.
Best regards: Otared
___
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : n
Fabrice Couvreur schrieb am 18.07.2020 um 22:25:
Hi Wolfgang,
It works but why did you ask this question since I finally use context ?
Are you sure you want to use context(...) here?
In your first version you used the context function in the loop to print
the output of the Binom but the
Small correction :
\starttext
\startluacode
function Binom(n,k)
if k > n then
return 0
elseif (n == 0 or k == 0) then
return 1
else
return (n*Binom(n-1,k-1))/k
end
end
context.startxtable({"align={mid
abrice Couvreur schrieb am 18.07.2020 um 22:09:
> > Hi,
> > I improved the code to be able to display the grid but I cannot display
> > the coefficients.
> > Thank you
> > Fabrice
> >
> > \starttext
> >
> > \startluacode
> >
Fabrice Couvreur schrieb am 18.07.2020 um 22:09:
Hi,
I improved the code to be able to display the grid but I cannot display
the coefficients.
Thank you
Fabrice
\starttext
\startluacode
function Binom(n,k)
if k > n then
return 0
elseif (n == 0 or k =
Hi,
I improved the code to be able to display the grid but I cannot display the
coefficients.
Thank you
Fabrice
\starttext
\startluacode
function Binom(n,k)
if k > n then
return 0
elseif (n == 0 or k == 0) then
return 1
else
ret
Fabrice Couvreur schrieb am 18.07.2020 um 20:05:
Hello,
I want to display the values of Pascal's triangle in a table.
Unfortunately my knowledge of Lua is not sufficient to run this code.
Thank you.
Fabrice
\starttext
\startluacode
function Binom(n,k)
if k >
Hello,
I want to display the values of Pascal's triangle in a table.
Unfortunately my knowledge of Lua is not sufficient to run this code.
Thank you.
Fabrice
\starttext
\startluacode
function Binom(n,k)
if k > n then
return 0
elseif (n == 0 or k ==
hed file for the result):
>>
>> %%% Test file
>> \setupbodyfont[10pt]
>> \starttext
>> \startTEXpage[offset=10pt]
>> \type{\tbinom{n}{k}}: $\tbinom{n}{k}$, (does not look good, the
>> vertical space between $n
$\tbinom{n}{k}$, (does not look good, the
vertical space between $n$ and $k$ is too big) \par
\type{\binom{n}{k}}: $\binom{n}{k}$ (looks fine to me)\par
\type{\dbinom{n}{k}}: $\dbinom{n}{k}$ (does not look good, too
big parenthesis, even for displayed formu
;> \startTEXpage[offset=10pt]
>> \type{\tbinom{n}{k}}: $\tbinom{n}{k}$, (does not look good, the vertical
>> space between $n$ and $k$ is too big) \par
>> \type{\binom{n}{k}}: $\binom{n}{k}$ (looks fine to me)\par
>> \type{\dbinom{n}{k}}: $\dbinom{n}{k}$ (does not look good, too big
big) \par
\type{\binom{n}{k}}: $\binom{n}{k}$ (looks fine to me)\par
\type{\dbinom{n}{k}}: $\dbinom{n}{k}$ (does not look good, too big
parenthesis, even for displayed formulas).\par
\stopTEXpage
\stoptext
%%% End of test file
I think something should be changed to get the binomial coefficients
Hi,
I stumbled upon this (see the attached file for the result):
%%% Test file
\setupbodyfont[10pt]
\starttext
\startTEXpage[offset=10pt]
\type{\tbinom{n}{k}}: $\tbinom{n}{k}$, (does not look good, the vertical
space between $n$ and $k$ is too big) \par
\type{\binom{n}{k}}: $\binom{n}{k}$ (looks
t or too short. I guess this
> > is because the parentheses are not scaled when inlined and that this is
> > also a TeX limitation and therefore expected?
>
>
> Instead if \choose you can use \binom which is the recommended way in context.
>
> The \dbinom command sets the
this is
> also a TeX limitation and therefore expected?
Instead if \choose you can use \binom which is the recommended way in context.
The \dbinom command sets the content in display style while \tbinom use
textstyle.
\starttext
Using \tex{binom} in text $\binom{n}{\frac{n}{2}}$.
Using \tex{dbin
Am 16.07.2011 um 15:00 schrieb Andreas Harder:
> Hi,
>
> here is another problem regarding \environments.
>
> % \setupbodyfont[palatino] % OK
> \starttext
> \setupbodyfont[palatino] % not OK
>
> \startformula
>\binom{n}{0}
> \stopformula
> \stopte
Hi,
here is another problem regarding \environments.
% \setupbodyfont[palatino] % OK
\starttext
\setupbodyfont[palatino] % not OK
\startformula
\binom{n}{0}
\stopformula
\stoptext
To avoid it, I'd have to use something like the following?
\environment font-setups
\startpr
simplefonts module with Type1 LM Math?
No but you can use my calluna typescripts:
\usetypescriptfile[type-calluna]
\definetypeface[mainface][rm][serif][calluna][default]
\definetypeface[mainface][mm][math] [modern] [computer-modern]
\setupbodyfont[mainface]
\starttext
Calluna and Latin Modern Math
>
> \setmainfont[Calluna]
>
> \startbuffer[example]
> \input ward\par
> \startformula
> c^2=a^2+b^2 \quad \binom{1}{2}
> \stopformula
> \stopbuffer
>
> \starttext
>
> \getbuffer[example]
>
> \setmathfont[palatino]\getbuffer[example]
>
> \setmathfont[eul
onTeXt
or LuaTeX because it does only appear with OpenType math fonts:
Input:
\usemodule[simplefonts]
\setmainfont[Calluna]
\startbuffer[example]
\input ward\par
\startformula
c^2=a^2+b^2 \quad \binom{1}{2}
\stopformula
\stopbuffer
\starttext
\getbuffer[example]
\setmathfont[palatino]\get
[mainface]
\starttext
\startformula
\binom{1}{2}
\stopformula
\stoptext
After perusing the log file, here are the font files that are loaded:
/DATA/context-minimals/tex/texmf/fonts/opentype/public/lm/lmmath.otf
/DATA/context-minimals/tex/texmf/fonts/opentype/public/lm/lmroman10
6).
It’s the fault of the OpenType version of the LM Math fonts which
are used when you use the simplefonts module:
\definetypeface[mainface][rm][serif][modern]
\definetypeface[mainface][mm][math] [modern]
\setupbodyfont[mainface]
\starttext
\startformula
\binom{1}{2}
\stopformula
\stopte
peface[mainface][rm][serif][modern]
> \definetypeface[mainface][mm][math] [modern]
>
> \setupbodyfont[mainface]
>
> \starttext
> \startformula
> \binom{1}{2}
> \stopformula
> \stoptext
>
> Wolfgang
>
>
the OpenType version of the LM Math fonts which
are used when you use the simplefonts module:
\definetypeface[mainface][rm][serif][modern]
\definetypeface[mainface][mm][math] [modern]
\setupbodyfont[mainface]
\starttext
\startformula
\binom{1}{2}
\s
me. Setting the math font doesn't help
either.
\usemodule[simplefonts]
\setmainfont[Calluna]% could be Latin Modern Roman
%\setmathfont[Latin Modern Math]% as in t-simplefonts.tex
\starttext
\startformula
\binom{1}{2}
\stopformula
\stoptext
Regards.
-- Cédric
simplefonts-error.
Hi Hans,
with the latest beta asana-math.lfg don't seem to have any influence of the
output.
\setupbodyfont[asana]
\startTEXpage[offset=1ex]
$\binom{n}{k}\quad \dbinom{n}{k}$
\stopTEXpage
It used to work with the experimental two or three days ago.
Greeting
An
a link -)
OK
> anyhow, I wonder if we really need to keep supporting this
>
> x \operator y
>
> kind of syntax (at least that's what crossed my mind when i saw that this
> atopwithdelims primitive was used in your example) .. maybe we should simply
> define a few ex
topformula
stoptext
In fact, it seems atopwithdelims() isn't working because the problem can be
fixed by adding
delimiterfactor=1001
defbinom#1#2{left(#1 atop #2right)}
starttext
startformula
binom{a}{b}
stopformula
stoptext
The second problem is much more bothering to me because I can'
I've been trying to make some notes on typesetting math in ConTeXt,
and using nath seems the way to go. An odd thing about using \binom
with nath: in displayed equations, it works fine, in inline
equations, \binom{1}{2} will typeset "1(2)" (with a raised "2").
IL PROTECTED] command \string\choose }
> {No more a valid command. Replace {A \choose B} with \binom A B.}%
> \lext\next\relax
> [EMAIL PROTECTED]
> which should be robust enough. Can you try it in the context
> where my previous solution busted?
I don't remember what bust
gt;> [EMAIL PROTECTED] command \string\atop }
>> >> {No more a valid command. Use array [EMAIL PROTECTED]
>> >> [EMAIL PROTECTED] command \string\choose }
>> >> {No more a valid command. Replace {A \choose B} with \binom A
>> >> [EMAIL PROTECT
EMAIL PROTECTED] command \string\choose }
> >> {No more a valid command. Replace {A \choose B} with \binom A
> >> [EMAIL PROTECTED]
>
> > Ah, of course...
> > nikolai
>
> It works like that? Excellent.
It seems I spoke too soon. It does in fact not work.
t; {No more a valid command. Replace {A \over B} with \frac A
>> [EMAIL PROTECTED]
>> [EMAIL PROTECTED] command \string\atop }
>> {No more a valid command. Use array [EMAIL PROTECTED]
>> [EMAIL PROTECTED] command \string\choose }
>> {No more a valid command. Replace {
and \string\over }
> {No more a valid command. Replace {A \over B} with \frac A
> [EMAIL PROTECTED]
> [EMAIL PROTECTED] command \string\atop }
> {No more a valid command. Use array [EMAIL PROTECTED]
> [EMAIL PROTECTED] command \string\choose }
> {No more a valid command
command. Replace {A \over B} with \frac A B.}}
> [EMAIL PROTECTED] command \string\atop }
> {No more a valid command. Use array instead.}}
> [EMAIL PROTECTED] command \string\choose }
> {No more a valid command. Replace {A \choose B} with \binom A B.}}
> also messes up stuff
more a valid command. Replace {A \choose B} with \binom A B.}}
also messes up stuff in core-ref.tex for example:
! Disabled command \over.
[EMAIL PROTECTED] ...rrhelp \expandafter {#2}\errmessage {#1}
\natherrormark
l.46 \indent\inchapter
Sunday, May 30, 2004 Sebastian Sturm wrote:
> OK, I'll try that. At the moment I'm having all kinds of issues with
> nath (even without any preamble at all), like \binom{\frac 12}{a} not
> working, \to, \ot and \otto arrows not adjusting to the lengths of
> their subscr
. At the moment I'm having all kinds of issues with
nath (even without any preamble at all), like \binom{\frac 12}{a} not
working, \to, \ot and \otto arrows not adjusting to the lengths of
their subscripts, etc... and I can hardly imagine that all of these are
nath bugs, so maybe something
50 matches
Mail list logo