From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/98972 Path: news.gmane.org!.POSTED!not-for-mail From: Fabrice L Newsgroups: gmane.comp.tex.context Subject: Re: Border matrix Date: Mon, 28 Aug 2017 10:44:54 -0700 Message-ID: References: <3c381955-0226-9d95-09f0-4d06afb40cba@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8174150533825671209==" X-Trace: blaine.gmane.org 1503942323 25355 195.159.176.226 (28 Aug 2017 17:45:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 28 Aug 2017 17:45:23 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Aug 28 19:45:17 2017 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmO68-0006Hn-O7 for gctc-ntg-context-518@m.gmane.org; Mon, 28 Aug 2017 19:45:16 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 6C2CE88205; Mon, 28 Aug 2017 19:45:08 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8v1rgBF6LJEo; Mon, 28 Aug 2017 19:45:07 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 9332B88208; Mon, 28 Aug 2017 19:45:07 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id E477E88206 for ; Mon, 28 Aug 2017 19:45:06 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id O79jI5ePTV0Q for ; Mon, 28 Aug 2017 19:45:05 +0200 (CEST) Original-Received: from mail-wr0-f173.google.com (mail-wr0-f173.google.com [209.85.128.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id D4FAB88205 for ; Mon, 28 Aug 2017 19:44:55 +0200 (CEST) Original-Received: by mail-wr0-f173.google.com with SMTP id k94so3723645wrc.0 for ; Mon, 28 Aug 2017 10:44:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:in-reply-to:references:mime-version:date:message-id:subject:to; bh=vFGCZbjN4iwKvmDw5duXJQobONuW7G3n2uBLkiBWVY4=; b=IikIWb7teOI/W1BKXNkd+AGa3LumbH0wdAK472L09+lYVOOtR1FFoKQqdavGV7VV3z BsnSFetQIubCZSGa684jVIGi/j0QZBOoYs/UffjjT3iqwGKkUXL0q5tmyi80QEddj4S+ 6XBkMdIprCtFK2B/6JqxNyPGD2kPE3gF4IaNl7cQdyeEUSS/SVjytIejLWtvP+ISXYgC KCHFlQm9ltyYvNuBJ5jBr+yH2U1S8GUk8JKNN6nmKgmv11khXk6iAEEOej1M2afAoi22 zjAcDjW77A3ukO9Yk89g5DN7Wszj8OwLris7c/te7GcuJ/Eu8hcNOb3xDtrn/hWFKrIu H0hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to; bh=vFGCZbjN4iwKvmDw5duXJQobONuW7G3n2uBLkiBWVY4=; b=HFShr4JhdBRflBcThyjMe94RFjtKk3llukCx08HDABuWizjtm6lQWCXPxD5PIhGmuR nHat8KkwcJdooEu6xO4Yn4a3pLeMZNonUtrLuPXagcpWPfXHyjxez77dlDHuDfuC8How ITy1WGOdid2KCnRzlj0ucvI5S/dcCNJgpA4xJlBk7kZ+uYXFO/jJ/TGn8NJ7wZ+rRbL4 zv3ARtMqF1JI39m5/mLQhQLmj2GfxM00bokrfSwhGgoKRdMyM7aQWYG39+Bap/JoaMDi 09x0C4cs7MFAFUiwznn0YDdYb4zuexi0BJR+kpjIGPigyHx07+cfkTJKO8fsFUASh1lO 2V3g== X-Gm-Message-State: AHYfb5isnnxvRB1Am5VxLl8H1nmhdE9xIWE4O524Boa6i0tMIqCXxchj aziYMGEENg4E50SDnlM4DecZ9nHCHQ== X-Received: by 10.223.192.76 with SMTP id c12mr1094588wrf.304.1503942295219; Mon, 28 Aug 2017 10:44:55 -0700 (PDT) Original-Received: from 1058052472880 named unknown by gmailapi.google.com with HTTPREST; Mon, 28 Aug 2017 10:44:54 -0700 In-Reply-To: <3c381955-0226-9d95-09f0-4d06afb40cba@wxs.nl> X-Mailer: Airmail (442) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:98972 Archived-At: --===============8174150533825671209== Content-Type: multipart/alternative; boundary="089e08e59c2344f3eb0557d3da28" --089e08e59c2344f3eb0557d3da28 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks so much ! I=E2=80=99ll will add an entry to the wiki. Fabrice. Le 28 ao=C3=BBt 2017 =C3=A0 13:29:55, Hans Hagen (pragma@wxs.nl) a =C3=A9cr= it: On 8/28/2017 6:33 PM, Fabrice L wrote: > Hi, > > I=E2=80=99have a lot of courses notes in MKII. I=E2=80=99m trying to move= to MKIV. I > have a problem that I=E2=80=99m not able to resolve, to make a border mat= rix > with brackets. In MKII, I was using a macro, found somewhere, which > works great, but no longer works; here is the macro: > > % Border matrix: first line and column are label > \catcode`\@=3D11\relax > \newdimen\p@renwd > \font\tenex=3Dcmex10 \setbox0=3D\hbox{\tenex B} \p@renwd=3D\wd0 > \def\bbordermatrix#1{\begingroup \m@th > \setbox\z@\vbox{\def\cr{\crcr\noalign{\kern2\p@\global\let\cr\endline}}% > \ialign{$##$\hfil\kern2\p@\kern\p@renwd&\thinspace\hfil$##$\hfil > &&\quad\hfil$##$\hfil\crcr > \omit\strut\hfil\crcr\noalign{\kern-\baselineskip}% > #1\crcr\omit\strut\cr}}% > \setbox\tw@\vbox{\unvcopy\z@\global\setbox\@ne\lastbox}% > \setbox\tw@\hbox{\unhbox\@ne\unskip\global\setbox\@ne\lastbox}% > \setbox\tw@\hbox{$\kern\wd\@ne\kern-\p@renwd\left[\kern-\wd\@ne > \global\setbox\@ne\vbox{\box\@ne\kern2\p@}% > \vcenter{\kern-\ht\@ne\unvbox\z@\kern-\baselineskip}\,\right]$}% > \null\;\vbox{\kern\ht\@ne\box\tw@}\endgroup} > \catcode`\@=3D12\relax Such a plain macro needs to be made bodyfotn size aware and such. > but MKIV gives me the error: > > \bbordermatrix #1->\begingroup \m@th > > \setbox \z@ \vbox {\def \cr {\crcr > \noa... > > l.26 i & j & k & l \cr} > > > 16 \null\;\vbox{\kern\ht\@ne\box\tw@}\endgroup} > > 17 \catcode`\@=3D12\relax > > > I look for solutions on the list, but did not find anything.Here is a > minimal example: > > \starttext > A border matrix: > \startformula > \bbordermatrix{ > a & b & c & d \cr > e & f & G & h \cr > i & j & k & l \cr} > \stopformula > \stoptext > > As I have in my notes hundreds of such matrix, it is really difficult to > change the input format. > > Do you know, or can you point me, to a solution ? I=E2=80=99m in a dead e= nd.. > Thanks a lot. I'll add this: \unprotect \unexpanded\def\math_border_matrix#1#2#3% adapted plain {\begingroup % \pushmacro\cr % \setbox\scratchbox\hbox\bgroup \mr B% \egroup \scratchdimenone\wd\scratchbox % \scratchdimentwo.2\bodyfontsize % \mathsurround\zeropoint % \setbox\scratchboxone\vbox\bgroup \def\cr{% \crcr \noalign\bgroup \kern\scratchdimentwo \global\let\cr\endline \egroup }% \ialign{% \startimath\alignmark\alignmark\stopimath \hfil \kern\dimexpr\scratchdimentwo+\scratchdimenone\relax \aligntab \thinspace \hfil \startimath\alignmark\alignmark\stopimath \hfil \aligntab \aligntab \quad \hfil \startimath\alignmark\alignmark\stopimath \hfil \crcr \omit \strut \hfil \crcr \noalign{\kern-\baselineskip}% #3\crcr \omit \strut \cr }% \egroup \setbox\scratchboxtwo\vbox\bgroup \unvcopy\scratchboxone \global\setbox\globalscratchbox\lastbox \egroup \setbox\scratchboxtwo\hbox\bgroup \unhbox\globalscratchbox \unskip \global\setbox\globalscratchbox\lastbox \egroup \setbox\scratchboxtwo\hbox\bgroup \startimath \kern\dimexpr\wd\globalscratchbox-\scratchdimenone\relax \left#1\relax \kern-\wd\globalscratchbox \global\setbox\globalscratchbox\vbox\bgroup \box\globalscratchbox \kern\scratchdimentwo \egroup \vcenter\bgroup \kern-\ht\globalscratchbox \unvbox\scratchboxone \kern-\baselineskip \egroup \thinspace \right#2\relax \stopimath \egroup \null \thickspace \vbox\bgroup \kern\ht\globalscratchbox \box\scratchboxtwo \egroup % \popmacro\cr % \endgroup} \unexpanded\def\bordermatrix {\math_border_matrix()} \unexpanded\def\bbordermatrix{\math_border_matrix[]} \protect \starttext A plain border matrix: \startformula \bordermatrix{ a & b & c & d \cr e & f & G & h \cr i & j & k & l \cr} \stopformula \startformula \bbordermatrix{ a & b & c & d \cr e & f & G & h \cr i & j & k & l \cr} \stopformula \stoptext ----------------------------------------------------------------- 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 ___________________________________________________________________________= ________ --089e08e59c2344f3eb0557d3da28 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable =
Thanks so much !
I=E2=80=99ll will add an entry to the wiki.
Fabrice.
=

Le 28 ao=C3=BBt 2017 =C3=A0 13:29:55, Hans Ha= gen (pragma@wxs.nl) a =C3=A9crit:

=
On = 8/28/2017 6:33 PM, Fabrice L wrote:
> Hi,
>
> I=E2=80=99= have a lot of courses notes in MKII. I=E2=80=99m trying to move to MKIV. I =
> have a problem that I=E2=80=99m not able to resolve, to make a bor= der matrix
> with brackets. In MKII, I was using a macro, found some= where, which
> works great, but no longer works; here is the macro:<= br>>
> % Border matrix: first line and column are label
> \= catcode`\@=3D11\relax
> \newdimen\p@renwd
> \font\tenex=3Dcmex1= 0 \setbox0=3D\hbox{\tenex B} \p@renwd=3D\wd0
> \def\bbordermatrix#1{\= begingroup \m@th
> \setbox\z@\vbox{\def\cr{\crcr\noalign{\kern2\p@\gl= obal\let\cr\endline}}%
> =C2=A0 =C2=A0 \ialign{$##$\hfil\kern2\p@\ke= rn\p@renwd&\thinspace\hfil$##$\hfil
> =C2=A0 =C2=A0 =C2=A0 &= &\quad\hfil$##$\hfil\crcr
> =C2=A0 =C2=A0 =C2=A0 \omit\strut\hfi= l\crcr\noalign{\kern-\baselineskip}%
> =C2=A0 =C2=A0 =C2=A0 #1\crcr\= omit\strut\cr}}%
> =C2=A0 \setbox\tw@\vbox{\unvcopy\z@\global\setbox= \@ne\lastbox}%
> =C2=A0 \setbox\tw@\hbox{\unhbox\@ne\unskip\global\s= etbox\@ne\lastbox}%
> =C2=A0 \setbox\tw@\hbox{$\kern\wd\@ne\kern-\p@= renwd\left[\kern-\wd\@ne
> =C2=A0 =C2=A0 \global\setbox\@ne\vbox{\bo= x\@ne\kern2\p@}%
> =C2=A0 =C2=A0 \vcenter{\kern-\ht\@ne\unvbox\z@\ke= rn-\baselineskip}\,\right]$}%
> =C2=A0 \null\;\vbox{\kern\ht\@ne\box= \tw@}\endgroup}
> \catcode`\@=3D12\relax

Such a plain macro ne= eds to be made bodyfotn size aware and such.

> but MKIV gives me = the error:
>
> \bbordermatrix #1->\begingroup \m@th
>=
> =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 \setb= ox \z@ \vbox {\def \cr {\crcr
> \noa...
>
> l.26=C2=A0 = =C2=A0 i & j & k & l \cr}
>
>
> 16 =C2=A0 = =C2=A0 =C2=A0 \null\;\vbox{\kern\ht\@ne\box\tw@}\endgroup}
>
>= 17 =C2=A0 =C2=A0 \catcode`\@=3D12\relax
>
>
> I look f= or solutions on the list, but did not find anything.Here is a
> mini= mal example:
>
> \starttext
> A border matrix:
> \= startformula
> \bbordermatrix{
> =C2=A0 =C2=A0a & b & = c & d \cr
> =C2=A0 =C2=A0e & f & G & h \cr
> = =C2=A0 =C2=A0i & j & k & l \cr}
> \stopformula
> \s= toptext
>
> As I have in my notes hundreds of such matrix, it = is really difficult to
> change the input format.
>
> D= o you know, or can you point me, to a solution ? I=E2=80=99m in a dead end.= .
> Thanks a lot.
I'll add this:

\unprotect

\u= nexpanded\def\math_border_matrix#1#2#3% adapted plain
{\begingroup %
\pushmacro\cr
%
\setbox\scratchbox\hbox\bgroup<= br> \mr B%
\egroup
\scratchdimenone\wd\scratchbox
= %
\scratchdimentwo.2\bodyfontsize
%
\mathsurround\zer= opoint
%
\setbox\scratchboxone\vbox\bgroup
\def\cr{%=
\crcr
\noalign\bgroup
\kern\scratchdime= ntwo
\global\let\cr\endline
\egroup
}%
= \ialign{%
\startimath\alignmark\alignmark\stopimath
= \hfil
\kern\dimexpr\scratchdimentwo+\scratchdimenone\relax<= br> \aligntab
\thinspace
\hfil
\sta= rtimath\alignmark\alignmark\stopimath
\hfil
\aligntab=
\aligntab
\quad
\hfil
\startim= ath\alignmark\alignmark\stopimath
\hfil
\crcr
= \omit
\strut
\hfil
\crcr
\n= oalign{\kern-\baselineskip}%
#3\crcr
\omit
= \strut
\cr
}%
\egroup
\setbox\scratchbox= two\vbox\bgroup
\unvcopy\scratchboxone
\global\setbox\glo= balscratchbox\lastbox
\egroup
\setbox\scratchboxtwo\hbox\bgro= up
\unhbox\globalscratchbox
\unskip
\global\setb= ox\globalscratchbox\lastbox
\egroup
\setbox\scratchboxtwo\hbo= x\bgroup
\startimath
\kern\dimexpr\wd\globalscratchbox-\s= cratchdimenone\relax
\left#1\relax
\kern-\wd\globalscratc= hbox
\global\setbox\globalscratchbox\vbox\bgroup
\box\g= lobalscratchbox
\kern\scratchdimentwo
\egroup
= \vcenter\bgroup
\kern-\ht\globalscratchbox
\unvbox\sc= ratchboxone
\kern-\baselineskip
\egroup
\thins= pace
\right#2\relax
\stopimath
\egroup
\nul= l
\thickspace
\vbox\bgroup
\kern\ht\globalscratchbox=
\box\scratchboxtwo
\egroup
%
\popmacro\cr %
\endgroup}

\unexpanded\def\bordermatrix {\math_border_= matrix()}
\unexpanded\def\bbordermatrix{\math_border_matrix[]}

\p= rotect

\starttext

A plain border matrix:

\startformula=
\bordermatrix{
a & b & c & d \cr
e & f &a= mp; G & h \cr
i & j & k & l \cr}
\stopformula
=
\startformula
\bbordermatrix{
a & b & c & d \cr e & f & G & h \cr
i & j & k & l \cr}\stopformula

\stoptext


--------------------------------= ---------------------------------
= Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Ha= sselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
----------------------------------------------= -------------------
____________________________________________________= _______________________________
If your question is of interest to other= s as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-co= ntext
webpage : http://www.pra= gma-ade.nl / http://context.aanhe= t.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki = : http://contextgarden.net
__= ___________________________________________________________________________= ______
--089e08e59c2344f3eb0557d3da28-- --===============8174150533825671209== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f --===============8174150533825671209==--