ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* How to draw a red frame of a row in a matrix?
@ 2012-07-25  9:20 dalyoung
  2012-07-25  9:43 ` Hans Hagen
  2012-07-25 12:22 ` Otared Kavian
  0 siblings, 2 replies; 8+ messages in thread
From: dalyoung @ 2012-07-25  9:20 UTC (permalink / raw)
  To: ntg-context

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to draw a red frame of a row in a matrix?
  2012-07-25  9:20 How to draw a red frame of a row in a matrix? dalyoung
@ 2012-07-25  9:43 ` Hans Hagen
  2012-07-25 11:27   ` dalyoung
  2012-07-25 14:34   ` Wolfgang Schuster
  2012-07-25 12:22 ` Otared Kavian
  1 sibling, 2 replies; 8+ messages in thread
From: Hans Hagen @ 2012-07-25  9:43 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: 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
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to draw a red frame of a row in a matrix?
  2012-07-25  9:43 ` Hans Hagen
@ 2012-07-25 11:27   ` dalyoung
  2012-07-25 11:35     ` Henning Hraban Ramm
  2012-07-25 14:34   ` Wolfgang Schuster
  1 sibling, 1 reply; 8+ messages in thread
From: dalyoung @ 2012-07-25 11:27 UTC (permalink / raw)
  To: Hans Hagen; +Cc: ntg-context

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
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to draw a red frame of a row in a matrix?
  2012-07-25 11:27   ` dalyoung
@ 2012-07-25 11:35     ` Henning Hraban Ramm
  0 siblings, 0 replies; 8+ messages in thread
From: Henning Hraban Ramm @ 2012-07-25 11:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users

I don’t know matrix, but otherwise you’d be better off with TABLEs,
see http://wiki.contextgarden.net/TABLE


Greetlings,
Hraban
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to draw a red frame of a row in a matrix?
  2012-07-25  9:20 How to draw a red frame of a row in a matrix? dalyoung
  2012-07-25  9:43 ` Hans Hagen
@ 2012-07-25 12:22 ` Otared Kavian
  1 sibling, 0 replies; 8+ messages in thread
From: Otared Kavian @ 2012-07-25 12:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
> ___________________________________________________________________________________

___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to draw a red frame of a row in a matrix?
  2012-07-25  9:43 ` Hans Hagen
  2012-07-25 11:27   ` dalyoung
@ 2012-07-25 14:34   ` Wolfgang Schuster
  2012-07-25 15:28     ` dalyoung
  1 sibling, 1 reply; 8+ messages in thread
From: Wolfgang Schuster @ 2012-07-25 14:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: dalyoung


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
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to draw a red frame of a row in a matrix?
  2012-07-25 14:34   ` Wolfgang Schuster
@ 2012-07-25 15:28     ` dalyoung
  0 siblings, 0 replies; 8+ messages in thread
From: dalyoung @ 2012-07-25 15:28 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: ntg-context

Dear Wolfgang,

Your both methods work nicely.

And, the table method can be used to frame a column, too.

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to draw a red frame of a row in a matrix?
@ 2012-07-25 14:10 dalyoung
  0 siblings, 0 replies; 8+ messages in thread
From: dalyoung @ 2012-07-25 14:10 UTC (permalink / raw)
  To: ntg-context

Dear Otared, Henning Hraban,

Thank you for the reply.
 \RedMath works!

To use TABLE may be another solution. I will try soon.

Thank you again.

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-07-25 15:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-25  9:20 How to draw a red frame of a row in a matrix? dalyoung
2012-07-25  9:43 ` Hans Hagen
2012-07-25 11:27   ` dalyoung
2012-07-25 11:35     ` Henning Hraban Ramm
2012-07-25 14:34   ` Wolfgang Schuster
2012-07-25 15:28     ` dalyoung
2012-07-25 12:22 ` Otared Kavian
2012-07-25 14:10 dalyoung

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).