How to draw a red frame of a row in a matrix?
Dear all, I made a matrix as follows and I'd like to draw a red frame over the i-th row in a matrix. \startformula \startmatrix[left={\left (\,},right={\,\right)}] \NC a_{11} \NC a_{12} \NC \dots \NC a_{1n} \NR \NC \vdots \NC \vdots \NC \vdots \NC \vdots \NR \NC a_{i1} \NC a_{i2} \NC \cdots \NC a_{in} \NR \NC \vdots \NC \vdots \NC \ddots \NC \vdots \NR \NC a_{m1} \NC a_{m2} \NC \cdots \NC a_{mn} \NR \stopmatrix \stopformula But \frame or \inframe is not working inside matrix. Is there a way to do that? Thank you. Best regards, Dalyoung
On 25-7-2012 11:20, dalyoung wrote:
Dear all,
I made a matrix as follows and I'd like to draw a red frame over the i-th row in a matrix.
\startformula \startmatrix[left={\left (\,},right={\,\right)}] \NC a_{11} \NC a_{12} \NC \dots \NC a_{1n} \NR \NC \vdots \NC \vdots \NC \vdots \NC \vdots \NR \NC a_{i1} \NC a_{i2} \NC \cdots \NC a_{in} \NR \NC \vdots \NC \vdots \NC \ddots \NC \vdots \NR \NC a_{m1} \NC a_{m2} \NC \cdots \NC a_{mn} \NR \stopmatrix \stopformula
But \frame or \inframe is not working inside matrix. Is there a way to do that?
maybe \mframed ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Dear Hans, Thank you for quick answer and for reminding me \mframed. \mframed is working if I enclose one term like ... \NC{\mframed[]{x+y}}\NC ...\NC\NR. But I'd like to enclose the whole row in one frame. I apply \mframed to every term and get close result except there are gaps between frames. I tried \mframed in a few different ways, but not succeed. \HL in \startalign...\stopalign is not working either. I think that \framed and \startformula\startalign have strong characters for each, it is not easy to combine them smoothly. It is just my guess. So far, using \mframed for each term is the best result. Thank you again. Best regards, Dalyoung
I don’t know matrix, but otherwise you’d be better off with TABLEs, see http://wiki.contextgarden.net/TABLE Greetlings, Hraban
Am 25.07.2012 um 11:43 schrieb Hans Hagen:
On 25-7-2012 11:20, dalyoung wrote:
Dear all,
I made a matrix as follows and I'd like to draw a red frame over the i-th row in a matrix.
\startformula \startmatrix[left={\left (\,},right={\,\right)}] \NC a_{11} \NC a_{12} \NC \dots \NC a_{1n} \NR \NC \vdots \NC \vdots \NC \vdots \NC \vdots \NR \NC a_{i1} \NC a_{i2} \NC \cdots \NC a_{in} \NR \NC \vdots \NC \vdots \NC \ddots \NC \vdots \NR \NC a_{m1} \NC a_{m2} \NC \cdots \NC a_{mn} \NR \stopmatrix \stopformula
But \frame or \inframe is not working inside matrix. Is there a way to do that?
maybe \mframed
He’s looking for \HL and \VL commands like the table below has to frame a complete row in the matrix. \starttext \startformula \startmatrix[left={\left(\,},right={\,\right)}] \NC a_{11} \NC a_{12} \NC \cdots \NC a_{1n} \NR \NC \vdots \NC \vdots \NC \vdots \NC \vdots \NR \noalign{\hrule} \NC a_{i1} \NC a_{i2} \NC \cdots \NC a_{in} \NR \noalign{\hrule} \NC \vdots \NC \vdots \NC \ddots \NC \vdots \NR \NC a_{m1} \NC a_{m2} \NC \cdots \NC a_{mn} \NR \stopmatrix \stopformula \starttable[|*{4}{b{\strut}Mc|}] \NC a_{11} \NC a_{12} \NC \cdots \NC a_{1n} \NC\NR \NC \vdots \NC \vdots \NC \vdots \NC \vdots \NC\NR \HL \VL a_{i1} \NC a_{i2} \NC \cdots \NC a_{in} \VL\NR \HL \NC \vdots \NC \vdots \NC \ddots \NC \vdots \NC\NR \NC a_{m1} \NC a_{m2} \NC \cdots \NC a_{mn} \NC\NR \stoptable \stoptext Wolfgang
Dear Wolfgang, Your both methods work nicely. And, the table method can be used to frame a column, too. Thank you. Best regards, Dalyoung
Hi Dalyoung, Is this what you want: \setupcolors[state=start] \def\RedMath{\mframed[frame=on, framecolor=red, offset=2pt, % background=color, % backgroundcolor=lightred, % backgroundoffset=2pt ]} \starttext \startformula \startmatrix[left={\left (\,},right={\,\right)}] \NC\startmatrix[left=,right=,] \NC a_{11} \NC a_{12} \NC \dots \NC a_{1n} \NR \NC \vdots \NC \vdots \NC \vdots \NC \vdots \NR \stopmatrix\NR \NC\RedMath{\startmatrix[left=,right=,] \NC a_{i1} \NC a_{i2} \NC \cdots \NC a_{in} \NR \stopmatrix}\NR \NC\startmatrix[left=,right=,] \NC \vdots \NC \vdots \NC \ddots \NC \vdots \NR \NC a_{m1} \NC a_{m2} \NC \cdots \NC a_{mn} \NR \stopmatrix\NR \stopmatrix \stopformula \stoptext Best regards: OK On 25 juil. 2012, at 11:20, dalyoung wrote:
Dear all,
I made a matrix as follows and I'd like to draw a red frame over the i-th row in a matrix.
\startformula \startmatrix[left={\left (\,},right={\,\right)}] \NC a_{11} \NC a_{12} \NC \dots \NC a_{1n} \NR \NC \vdots \NC \vdots \NC \vdots \NC \vdots \NR \NC a_{i1} \NC a_{i2} \NC \cdots \NC a_{in} \NR \NC \vdots \NC \vdots \NC \ddots \NC \vdots \NR \NC a_{m1} \NC a_{m2} \NC \cdots \NC a_{mn} \NR \stopmatrix \stopformula
But \frame or \inframe is not working inside matrix. Is there a way to do that?
Thank you.
Best regards,
Dalyoung ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
participants (5)
-
dalyoung
-
Hans Hagen
-
Henning Hraban Ramm
-
Otared Kavian
-
Wolfgang Schuster