* Ugly matrix spacing
[not found] <mailman.1335.1171778384.17432.ntg-context@ntg.nl>
@ 2007-02-19 22:24 ` Vyatcheslav Yatskovsky
2007-02-19 22:30 ` David Arnold
2007-02-20 1:09 ` Aditya Mahajan
0 siblings, 2 replies; 3+ messages in thread
From: Vyatcheslav Yatskovsky @ 2007-02-19 22:24 UTC (permalink / raw)
To: ntg-context-request@ntg.nl
Hi,
I'm ConTeXting a text that follows:
%%%%%%%%%%%%%%%%%
\setupwhitespace[big]
\setupinterlinespace[line=2.5ex]
\starttext
The Leslie Matrix is a matrix $L[1:X, 1:X]$ of the form
$$\left( {\matrix{
{a_1 } & {a_2 } & {a_3 } & \ldots & {a_X } \cr
{b_1 } & 0 & 0 & 0 & 0 \cr
0 & {b_2 } & 0 & 0 & 0 \cr
0 & 0 & \ddots & 0 & 0 \cr
0 & 0 & 0 & {b_{X - 1} } & 0 \cr
} } \right), $$
to build which we need to know $a_x$, {\em ability to reproduce}, an average number of offsprings within a time step from an individual of age class $x$, and $b_x$, {\em probability of surviving}, a fraction of individuals that survives from age class $x$ to age class $x+1$.
\stoptext
%%%%%%%%%%%%
and a matrix has big spacing BEFORE and normal spacing AFTER.
Interesting, but without two first setup lines, matrix glues to the subsequent text.
Best,
Vaytcheslav
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Ugly matrix spacing
2007-02-19 22:24 ` Ugly matrix spacing Vyatcheslav Yatskovsky
@ 2007-02-19 22:30 ` David Arnold
2007-02-20 1:09 ` Aditya Mahajan
1 sibling, 0 replies; 3+ messages in thread
From: David Arnold @ 2007-02-19 22:30 UTC (permalink / raw)
To: Yatskovsky, mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 569 bytes --]
Try:
\placeformula[-]
\startformula
\left( {\matrix{
{a_1 } & {a_2 } & {a_3 } & \ldots & {a_X } \cr
{b_1 } & 0 & 0 & 0 & 0 \cr
0 & {b_2 } & 0 & 0 & 0 \cr
0 & 0 & \ddots & 0 & 0 \cr
0 & 0 & 0 & {b_{X - 1} } & 0 \cr
} } \right),
\stopformula
On Feb 19, 2007, at 2:24 PM, Vyatcheslav Yatskovsky wrote:
> $$\left( {\matrix{
> {a_1 } & {a_2 } & {a_3 } & \ldots & {a_X } \cr
> {b_1 } & 0 & 0 & 0 & 0 \cr
> 0 & {b_2 } & 0 & 0 & 0 \cr
> 0 & 0 & \ddots & 0 & 0 \cr
> 0 & 0 & 0 & {b_{X - 1} } & 0 \cr
> } } \right), $$
[-- Attachment #1.2: Type: text/html, Size: 3491 bytes --]
[-- Attachment #2: Type: text/plain, Size: 139 bytes --]
_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Ugly matrix spacing
2007-02-19 22:24 ` Ugly matrix spacing Vyatcheslav Yatskovsky
2007-02-19 22:30 ` David Arnold
@ 2007-02-20 1:09 ` Aditya Mahajan
1 sibling, 0 replies; 3+ messages in thread
From: Aditya Mahajan @ 2007-02-20 1:09 UTC (permalink / raw)
To: Yatskovsky, mailing list for ConTeXt users
On Tue, 20 Feb 2007, Vyatcheslav Yatskovsky wrote:
> Hi,
> I'm ConTeXting a text that follows:
>
> %%%%%%%%%%%%%%%%%
> \setupwhitespace[big]
> \setupinterlinespace[line=2.5ex]
> \starttext
>
> The Leslie Matrix is a matrix $L[1:X, 1:X]$ of the form
>
> $$\left( {\matrix{
> {a_1 } & {a_2 } & {a_3 } & \ldots & {a_X } \cr
> {b_1 } & 0 & 0 & 0 & 0 \cr
> 0 & {b_2 } & 0 & 0 & 0 \cr
> 0 & 0 & \ddots & 0 & 0 \cr
> 0 & 0 & 0 & {b_{X - 1} } & 0 \cr
> } } \right), $$
>
> to build which we need to know $a_x$, {\em ability to reproduce}, an average number of offsprings within a time step from an individual of age class $x$, and $b_x$, {\em probability of surviving}, a fraction of individuals that survives from age class $x$ to age class $x+1$.
>
> \stoptext
> %%%%%%%%%%%%
>
> and a matrix has big spacing BEFORE and normal spacing AFTER.
Change $$ ... $$ to \startformula \stopformula
> Interesting, but without two first setup lines, matrix glues to the subsequent text.
The use of $$ ... $$ for display math will not give you correct
spacing. Always use \startformula ... \stopformula
BTW, there is also \startmathmatrix in ConTeXt which allows you to
\definemathmatrix[pmatrix]
[left={\left(\,},
right={\,\right)}]
\startformula \startpmatrix
\NC {a_1 } \NC {a_2 } \NC {a_3 } \NC \ldots \NC {a_X } \NR
\NC {b_1 } \NC 0 \NC 0 \NC 0 \NC 0 \NR
\NC 0 \NC {b_2 } \NC 0 \NC 0 \NC 0 \NR
\NC 0 \NC 0 \NC \ddots \NC 0 \NC 0 \NR
\NC 0 \NC 0 \NC 0 \NC {b_{X - 1} } \NC 0 \NR
\stoppmatrix \stopformula
and some other fun stuff also. See My Way on math-align
http://dl.contextgarden.net/myway/mathalign.pdf
Aditya
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-02-20 1:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <mailman.1335.1171778384.17432.ntg-context@ntg.nl>
2007-02-19 22:24 ` Ugly matrix spacing Vyatcheslav Yatskovsky
2007-02-19 22:30 ` David Arnold
2007-02-20 1:09 ` Aditya Mahajan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).