ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Otared Kavian <otared@gmail.com>
To: Hans Hagen <j.hagen@xs4all.nl>
Cc: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: mathmatrix and internal lines
Date: Fri, 27 Nov 2020 10:07:13 +0100	[thread overview]
Message-ID: <10535BA5-478F-4C4D-A1D6-1B8359C38232@gmail.com> (raw)
In-Reply-To: <2e62e93d-6736-2e6f-6e8b-05c112cadf74@xs4all.nl>

Hi Hans,

Thanks for your insight!
Indeed I'll wikify what you explained, once I have tested it with the next upload. Would  \HL and \VL be also available in mkiv ?

Best regards: Otared

> On 26 Nov 2020, at 23:23, Hans Hagen <j.hagen@xs4all.nl> wrote:
> 
> On 11/26/2020 8:43 PM, Otared Kavian wrote:
>> Hi Jean-Philippe,
>> A few weeks ago I saw briefly the discussion about Hans' message regarding \noalign and the the new definitions of \HR and \VR that you are sending. Indeed your solution works great !
>> Just for the case other people may have the same question about writing block matrix, I copy below the whole example which can be found later in the mail archive.
>> (For mkiv, I don't know how to do the same thing…).
> 
> The \noaligned permits a \protected definition. Otherwise one has to do something
> 
> \def\VR{\noalign\bgroup
>  <command that picks up [#1]
> 
> that command then does the rule and ends the noalign. Also, that one cannot be \protected (a pitty in case one uses \expanded or so)
> 
> So ... a multistep approach. Plenty of that in mkiv.
> 
>> %%% begin block-matrix.tex
>> % in LMTX defining \HR and \VR to create block matrices:
>> \pushoverloadmode
>> \noaligned\tolerant\protected\def\HR[#1]{\noalign{\hrule #1}}
>> \popoverloadmode
>> \def\VR{\dosingleempty\doVR}
>> \def\doVR[#1]{\NC \hskip-0.5em \vrule #1 \hskip-0.5em \NC}
> 
> given the \HR definition that should be
> 
> \tolerant\protected\def\VR[#1]{\NC ...\NC}
> 
>> \definemathmatrix[mymatrix]
>> 	[left={\left(\,},
>> 	right={\, \right)}]
>> \starttext	
>> \startformula
>> 	\startmymatrix
>> 		\NC A \VR  B \NR
>> 		\HR
>> 		\NC C \VR  D \NR
>> 	\stopmymatrix
>> \stopformula
>> \stoptext
> 
> Anyway, a feature like this should be in sync with other table mechanisms, so
> 
> \definemathmatrix
>  [mymatrix]
>  [left={\left\lparent\thinspace},
>   right={\thinspace\right\rparent}]
> 
> \starttext
> 
> \startformula
> 	\startmymatrix
> 		\NC A \VL  B \NR
> 		\HL
> 		\NC C \VL  D \NR
> 	\stopmymatrix
> \stopformula
> 
> \startformula
> 	\startmymatrix
> 		\NC A \VL[3,green]  B \NR
> 		\HL[10,red]
> 		\NC C \VL  D \NR
> 	\stopmymatrix
> \stopformula
> 
> \stoptext
> 
> A bit more code needed but the next upload will have it. Of course you have to wikify it.
> 
> Hans
> 
> -----------------------------------------------------------------
>                                          Hans Hagen | PRAGMA ADE
>              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>       tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2020-11-27  9:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-26  9:19 Jean-Philippe Rey
2020-11-26  9:58 ` Otared Kavian
2020-11-26 12:40 ` Otared Kavian
2020-11-26 18:46   ` Jean-Philippe Rey
2020-11-26 19:43     ` Otared Kavian
2020-11-26 22:23       ` Hans Hagen
2020-11-27  9:07         ` Otared Kavian [this message]
2020-11-27  9:19           ` Hans Hagen
2020-11-29  7:48         ` Otared Kavian
2020-11-29 18:59           ` Jean-Philippe Rey
2020-11-29 20:01             ` Otared Kavian
2020-11-30  8:14           ` Taco Hoekwater

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=10535BA5-478F-4C4D-A1D6-1B8359C38232@gmail.com \
    --to=otared@gmail.com \
    --cc=j.hagen@xs4all.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).