ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Border matrix
@ 2017-08-28 16:33 Fabrice L
  2017-08-28 17:29 ` Hans Hagen
       [not found] ` <7c38cc04-4408-9799-7a27-fcd1c3a47f6b@wxs.nl>
  0 siblings, 2 replies; 6+ messages in thread
From: Fabrice L @ 2017-08-28 16:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1843 bytes --]

Hi,

I’have a lot of courses notes in MKII. I’m trying to move to MKIV. I have a
problem that I’m not able to resolve, to make a border matrix 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`\@=11\relax
\newdimen\p@renwd
\font\tenex=cmex10 \setbox0=\hbox{\tenex B} \p@renwd=\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`\@=12\relax

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`\@=12\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’m in a dead end..
Thanks a lot.
F.

[-- Attachment #1.2: Type: text/html, Size: 6079 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

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

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

end of thread, other threads:[~2018-04-20  3:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-28 16:33 Border matrix Fabrice L
2017-08-28 17:29 ` Hans Hagen
2017-08-28 17:44   ` Fabrice L
     [not found] ` <7c38cc04-4408-9799-7a27-fcd1c3a47f6b@wxs.nl>
2018-04-19 20:05   ` Fabrice L
2018-04-19 20:14     ` Wolfgang Schuster
2018-04-20  3:07       ` Fabrice L

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