From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/100666 Path: news.gmane.org!.POSTED!not-for-mail From: Fabrice L Newsgroups: gmane.comp.tex.context Subject: Re: Border matrix Date: Thu, 19 Apr 2018 13:05:52 -0700 Message-ID: References: <7c38cc04-4408-9799-7a27-fcd1c3a47f6b@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3046818349772766429==" X-Trace: blaine.gmane.org 1524168265 16192 195.159.176.226 (19 Apr 2018 20:04:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 19 Apr 2018 20:04:25 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Apr 19 22:04:20 2018 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 1f9Fn2-000486-Ml for gctc-ntg-context-518@m.gmane.org; Thu, 19 Apr 2018 22:04:20 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 16EE36262F6; Thu, 19 Apr 2018 22:06:07 +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 RC35kDo4vdRx; Thu, 19 Apr 2018 22:06:05 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id D029E6262E0; Thu, 19 Apr 2018 22:06:05 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id E84C46262E4 for ; Thu, 19 Apr 2018 22:06:04 +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 S1zRnmtWFul9 for ; Thu, 19 Apr 2018 22:06:03 +0200 (CEST) Original-Received: from mail-wr0-f179.google.com (mail-wr0-f179.google.com [209.85.128.179]) (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 629336262DE for ; Thu, 19 Apr 2018 22:05:53 +0200 (CEST) Original-Received: by mail-wr0-f179.google.com with SMTP id u11-v6so17167172wri.12 for ; Thu, 19 Apr 2018 13:05:53 -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=aZPIUEIB89BUZAHoeWgD9SsHeyrh95PF0OGJKjeGlc0=; b=sBvs+gEUJjeFcknIg/aHg0dYtmpwUJi0mCc8Off0g3rRKPlK2rW6Hve0vBvFSBzCve 9yNXHgw3jJQX6LLIb9/zVopB7gq4QFldycRSsl/3PphHCn5CNxoAK66+gxgNQwCOWrip WVPCFzqd9AMesmLO9B7NsYnj0XUBI0Tl3viRTVQLzaFc6Vup1uHIRQDh8nsEdcoYVKlx 6EXftyNf1onu37diGh8M5YxHOD/YToHFXAm8dhL1DPldrQDpHufCoV5/eHnPp8o4YF8/ UAwb5HpsUKIszeeGsrNQjnJs2CZ3tEL2hZCeTzj8rRJb456oF5YrBrQ2bZdu5YZXE8wN 1I/A== 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=aZPIUEIB89BUZAHoeWgD9SsHeyrh95PF0OGJKjeGlc0=; b=XCLGQAqDY586NM8iFsWRX1PPI/NTXPvjb0E0KXkjAWXDUYHaTAHE6diWb6Mf6/g2m/ luRYUmFKQD0XWSEg3kstFuorPwnYnOMYLG7p2XTW1ppcR7CHC1trVdsa/VDCMnIpv9ml IEt5batKD6XymF4fsEgZeO1yminXYBSEoYpjJzQ1V3MROSejcPVMwTSqFYcM2r4cSTlF hq/z/Izm6EQero8GkBF10ESdbyb8QBbpvw/J35qCknxlmPvY9+jGrfDigeT9QLGtdblx GXKbgtVWu28FXo0vsBJMy8cYM/nVmrWJm67ScAx4WFuWJiC/+MfOa5GT+xjdLHcRYQkU 4YwQ== X-Gm-Message-State: ALQs6tBEBIadnRoefzOF8y4Khj89seiVNpoyQ17n1Gu4LR+xjRvdW9Zb Kd5MoDHU+nGpLZzdLZTN9SuvtXhMQ2Z+PrOoV7w= X-Google-Smtp-Source: AIpwx49AGauuf0y/9sPnpGwaQv5CR/8FMWZ9K81X9N2Yl2a+5eZ67/F87Zhk2Uw8ImimbDQX6v8Np4k9Mw65OzNNh/s= X-Received: by 10.28.66.19 with SMTP id p19mr75515wma.155.1524168352685; Thu, 19 Apr 2018 13:05:52 -0700 (PDT) Original-Received: from 1058052472880 named unknown by gmailapi.google.com with HTTPREST; Thu, 19 Apr 2018 13:05:52 -0700 In-Reply-To: <7c38cc04-4408-9799-7a27-fcd1c3a47f6b@wxs.nl> X-Mailer: Airmail (481) 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:100666 Archived-At: --===============3046818349772766429== Content-Type: multipart/alternative; boundary="001a114e31e03d6254056a391961" --001a114e31e03d6254056a391961 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Dear list, Some months ago, Hans wrote to this list (see below) a macro to do matrix showing outside the brackets some informations (like we usually do for Markov chains), but adapted some plain tex code, which worked in MKII). I have used with success this code since then, but some weeks ago, the behavior of Context had changed (probably something on my part; I have updated the installation, but nothing changed). The problem (I think) is linked to \unprotect \protect. When this code is put before the \starttext to the the cont-new-mkiv, the border matrix behave well, but a simple \eqalign like this: \startformula \eqalign{ & \lambda=3D5, \mu =3D5 \cr & \mu=3D8 \cr } \stopformula do not works is I replace =C2=AB \lambda =C2=BB by =C2=AB \lambda_2 =C2=BB= for example. I have no idea what=E2=80=99s is going on. here is a minimal example where Hans=E2= =80=99s code is before the \starttext: % =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 \unprotect \def\math_border_NC_indeed {\gdef\math_border_NC{\aligntab}} \let\math_border_NC\math_border_NC_indeed \def\math_border_NR {\glet\math_border_NC\math_border_NC_indeed \cr} \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 % \def\NC{\math_border_NC}% \def\NR{\math_border_NR}% % \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[]} \unexpanded\def\startbordermatrix #1\stopbordermatrix {\math_border_matrix(){#1}} \unexpanded\def\startbbordermatrix#1\stopbbordermatrix{\math_border_matrix[= ]{#1}} \let\stopbordermatrix \relax \let\stopbbordermatrix\relax % =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 % Should there be a "\ptotect" ? %\protect % =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 \starttext A plain border matrix : \startformula \bbordermatrix{ a & b & c & d \cr e & f & G & h \cr i & j & k & l \cr} \stopformula \startformula \startbbordermatrix \NC a \NC b \NC c \NC d \NR \NC e \NC f \NC G \NC h \NR \NC i \NC j \NC k \NC l \NR \stopbbordermatrix \stopformula \startformula \eqalign{ & \lambda=3D5, \mu =3D5 \cr % =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 % Does not work if the next line is uncommented % & \lambda_1=3D5, \mu =3D4 \cr % =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 & \mu=3D8 \cr } \stopformula \stoptext % =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 Thanks for any help. By the way. Is there with MKIV a more direct way to do such matrix ? Fabrice. Le 28 ao=C3=BBt 2017 =C3=A0 13:47:59, Hans Hagen (pragma@wxs.nl) a =C3=A9cr= it: Hi, Put this in cont-new.mkiv (after \unprotect): \def\math_border_NC_indeed {\gdef\math_border_NC{\aligntab}} \let\math_border_NC\math_border_NC_indeed \def\math_border_NR {\glet\math_border_NC\math_border_NC_indeed \cr} \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 % \def\NC{\math_border_NC}% \def\NR{\math_border_NR}% % \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[]} \unexpanded\def\startbordermatrix #1\stopbordermatrix {\math_border_matrix(){#1}} \unexpanded\def\startbbordermatrix#1\stopbbordermatrix{\math_border_matrix[= ]{#1}} \let\stopbordermatrix \relax \let\stopbbordermatrix\relax Then you can do: \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 \startformula \startbordermatrix \NC a \NC b \NC c \NC d \NR \NC e \NC f \NC G \NC h \NR \NC i \NC j \NC k \NC l \NR \stopbordermatrix \stopformula \startformula \startbbordermatrix \NC a \NC b \NC c \NC d \NR \NC e \NC f \NC G \NC h \NR \NC i \NC j \NC k \NC l \NR \stopbbordermatrix \stopformula \stoptext Not the full matrix support of MKIV but good enough for plain simulations. ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl ----------------------------------------------------------------- --001a114e31e03d6254056a391961 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable = Dear list,
Some months ago, Hans wrote to= this list (see below) a macro to do matrix showing outside the brackets so= me informations (like we usually do for Markov chains), but adapted some pl= ain tex code, which worked in MKII). I have used with success this code sin= ce then, but some weeks ago, the behavior of Context had changed (probably = something on my part; I have updated the installation, but nothing changed)= .=C2=A0

<= /div>
The problem (= I think) is linked to \unprotect \protect. When this code is put before the= \starttext to the the cont-new-mkiv, the border matrix behave well, but a = simple \eqalign like this:

<= div id=3D"bloop_customfont" style=3D"margin:0px">\startformula =C2=A0
=
\eqalign{ & \lambda=3D5, \mu = =3D5 \cr
=C2=A0 =C2=A0 =C2=A0= =C2=A0& \mu=3D8 \cr=C2=A0}
\stopformula

do not wor= ks is I replace =C2=AB =C2=A0\lambda =C2=BB by =C2=AB \lambda_2 =C2=BB for = example. I have no idea what=E2=80=99s is going on. here is a minimal examp= le where Hans=E2=80=99s code is before the \starttext:


% =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94
=
\unprotect

\def\math_border_NC_indeed=C2=A0
{\gdef\math_border_NC{\aligntab}}=C2=A0

\let\math_border_NC\math_border_NC_indeed=C2=A0
<= div id=3D"bloop_customfont" style=3D"margin:0px">
\def\math_border_NR=C2=A0
{\glet\math_border_NC\math_border_N= C_indeed=C2=A0
\cr}= =C2=A0

\unexpanded\def\math_border_= matrix#1#2#3% adapted plain=C2=A0
{\begingroup=C2=A0
%=C2=A0
\pushmacro\cr=C2=A0
%=C2=A0
\setbox\= scratchbox\hbox\bgroup=C2=A0
\mr B%=C2=A0
\egroup=C2=A0
\scr= atchdimenone\wd\scratchbox=C2=A0
%=C2=A0
\scratchdimentwo.2\bodyfontsize=C2=A0
%=C2=A0
\mathsurround\zeropoint=C2=A0
%=C2=A0
\def\NC{\math_border_NC}%=C2=A0
\def\NR{\math_border_NR}%=C2=A0
%=C2=A0
\setbox\scratchboxone\vbox\bgroup=C2=A0
\def\cr{%=C2=A0
\crcr=C2=A0
\noalign\bgroup=C2=A0
\kern\scratchdimentwo=C2=A0
\global\let\cr\endline=C2=A0
\egroup=C2=A0
}%=C2=A0
\ialign{%=C2=A0
\startimath\alignmark\alignmark\stopimath=C2=A0
\hfil=C2=A0
\kern\dimexpr\scratchdimentwo+\s= cratchdimenone\relax=C2=A0
\aligntab=C2=A0
\thinspace=C2=A0
= \hfil=C2=A0
\startim= ath\alignmark\alignmark\stopimath=C2=A0
\hfil=C2=A0
\aligntab=C2=A0
\aligntab=C2=A0
\quad=C2=A0
\hfi= l=C2=A0
\startimath\= alignmark\alignmark\stopimath=C2=A0
\hfil=C2=A0
\crcr=C2=A0
= \omit=C2=A0
\strut= =C2=A0
\hfil=C2=A0
\crcr=C2=A0
\noalign{\kern-\baselineskip}= %=C2=A0
#3\crcr=C2= =A0
\omit=C2=A0
\strut=C2=A0
\cr=C2=A0
}%=C2=A0
\egroup=C2=A0
\setbox\scratchboxtwo\vbox\bgroup=C2=A0
\unvcopy\scratchboxone=C2=A0
\global\setbox\globalscratchb= ox\lastbox=C2=A0
\eg= roup=C2=A0
\setbox\s= cratchboxtwo\hbox\bgroup=C2=A0
\unhbox\globalscratchbox=C2=A0
\unskip=C2=A0
\global\setbox\globalscratchbox\lastbox=C2=A0
\egroup=C2=A0
\setbox\scratchboxtwo\hbox\bgroup=C2= =A0
\startimath=C2= =A0
\kern\dimexpr\wd= \globalscratchbox-\scratchdimenone\relax=C2=A0
\left#1\relax=C2=A0
\kern-\wd\globalscratchbox=C2=A0
\global\setbox\globalscratchbox\vbo= x\bgroup=C2=A0
\box\= globalscratchbox=C2=A0
\kern\scratchdimentwo=C2=A0
\egroup=C2=A0
\vcenter\bgroup=C2=A0
\kern-\ht\globalscratchbox=C2=A0
\unvbox\scratchboxone=C2=A0
\kern-\baselineskip=C2=A0
\egroup=C2=A0
\thinspace=C2=A0
\right#2\relax=C2=A0
\stopimath=C2=A0
\egroup=C2=A0
\null=C2=A0
\thickspace=C2=A0
\vbox\bgroup=C2=A0
\kern\ht\globalscratchbox=C2=A0
\box\scratchboxtwo=C2=A0
\egroup=C2=A0
%=C2=A0
\popmacro\cr=C2=A0
%=C2=A0
\endgrou= p}=C2=A0

<= div id=3D"bloop_customfont" style=3D"margin:0px">\unexpanded\def\bordermatr= ix {\math_border_matrix()}=C2=A0
\unexpanded\def\bbordermatrix{\math_border_matrix[]}=C2=A0

\unexpanded\def\startbordermatrix #1\s= topbordermatrix=C2=A0
{\math_border_matrix(){#1}}=C2=A0
\unexpanded\def\startbbordermatrix#1\stopbbordermatrix{\mat= h_border_matrix[]{#1}}=C2=A0

\let\s= topbordermatrix \relax=C2=A0
\let\stopbbordermatrix\relax=C2=A0

% =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94
% Should t= here be a "\ptotect" ?=C2=A0
%\protect=C2=A0
% =E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94

\startt= ext=C2=A0

=
A plain border matrix =C2= =A0:=C2=A0

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

\startformula=C2=A0
\startbbordermatrix=C2=A0
\NC a \NC b \NC c \NC d \NR=C2=A0
\NC e \NC f \NC G \NC h \NR=C2=A0
\NC i \NC j \NC k \NC l \NR=C2= =A0
\stopbbordermatr= ix=C2=A0
\stopformul= a=C2=A0

\startformula =C2=A0
<= div id=3D"bloop_customfont" style=3D"margin:0px">\eqalign{
& \lambda=3D5, \mu =3D5 \cr
% =E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94
% Does not work if the next line is uncomme= nted
% & \lambda= _1=3D5, \mu =3D4 \cr
% =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=
& \mu=3D8 \cr
}
\stopformula

\stoptext

% =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94
<= br>
Thanks for any h= elp. By the way. Is there with MKIV a more direct way to do such matrix ?
Fabrice.


Le 28 ao=C3=BBt 2017 =C3=A0 13:4= 7:59, Hans Hagen (pragma@wxs.nl) a =C3= =A9crit:

<= /div>
Hi,

Put this in cont-new.mkiv (after \unprotect):

\def\math_border_NC_indeed
{\gdef\math_border_NC{\aligntab}}

\let\math_border_NC\math_border_NC_indeed

\def\math_border_NR
{\glet\math_border_NC\math_border_NC_indeed
\cr}

\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
%
\def\NC{\math_border_NC}%
\def\NR{\math_border_NR}%
%
\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[]}

\unexpanded\def\startbordermatrix #1\stopbordermatrix =20
{\math_border_matrix(){#1}}
\unexpanded\def\startbbordermatrix#1\stopbbordermatrix{\math_border_mat= rix[]{#1}}

\let\stopbordermatrix \relax
\let\stopbbordermatrix\relax

Then you can do:

\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

\startformula
\startbordermatrix
\NC a \NC b \NC c \NC d \NR
\NC e \NC f \NC G \NC h \NR
\NC i \NC j \NC k \NC l \NR
\stopbordermatrix
\stopformula

\startformula
\startbbordermatrix
\NC a \NC b \NC c \NC d \NR
\NC e \NC f \NC G \NC h \NR
\NC i \NC j \NC k \NC l \NR
\stopbbordermatrix
\stopformula

\stoptext

Not the full matrix support of MKIV but good enough for plain simulatio= ns.


-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.p= ragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
--001a114e31e03d6254056a391961-- --===============3046818349772766429== 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 --===============3046818349772766429==--