ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Problem with \definemathmatrix
@ 2018-01-17 18:19 Fabrice Couvreur
  2018-01-17 23:35 ` Otared Kavian
  2018-01-18  3:53 ` Aditya Mahajan
  0 siblings, 2 replies; 9+ messages in thread
From: Fabrice Couvreur @ 2018-01-17 18:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hello,
This macro that is not mine worked very well. I just tested the following
file and there is a problem.
Thank you
Fabrice

\definemathmatrix
  [pmatrix]
  [left={\left(\,},right={\,\right)}]

\starttext

\math{M^3=\startpmatrix
       \NC 2 \NC 3 \NC 6  \NC 4 \NC 2 \NC 7  \NC 3  \NC 1 \NR
       \NC 3 \NC 0 \NC 1  \NC 1 \NC 2 \NC 3  \NC 6  \NC 4 \NR
       \NC 6 \NC 1 \NC 4  \NC 4 \NC 4 \NC 9  \NC 10 \NC 6 \NR
       \NC 4 \NC 1 \NC 4  \NC 4 \NC 5 \NC 8  \NC 8  \NC 3 \NR
       \NC 2 \NC 2 \NC 4  \NC 5 \NC 2 \NC 7  \NC 3  \NC 1 \NR
       \NC 7 \NC 3 \NC 9  \NC 8 \NC 7 \NC 8  \NC 10 \NC 3 \NR
       \NC 3 \NC 6 \NC 10 \NC 8 \NC 3 \NC 10 \NC 4  \NC 1 \NR
       \NC 1 \NC 4 \NC 6  \NC 3 \NC 1 \NC 3  \NC 1  \NC 0 \NR

     \stoppmatrix}

\stoptext

[-- Attachment #1.2: Type: text/html, Size: 1184 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] 9+ messages in thread

* Re: Problem with \definemathmatrix
  2018-01-17 18:19 Problem with \definemathmatrix Fabrice Couvreur
@ 2018-01-17 23:35 ` Otared Kavian
  2018-01-18  3:53 ` Aditya Mahajan
  1 sibling, 0 replies; 9+ messages in thread
From: Otared Kavian @ 2018-01-17 23:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hi Fabrice,

I think the problem comes from a blank line in your matrix (after your last line of entries in your matrix). The following works fine for me:

\definemathmatrix
  [pmatrix]
  [left={\left(\,},right={\,\right)}]
  
\starttext

\startformula
A = \startpmatrix
\NC 11 \NC 12 \NR
\NC 21 \NC 22 \NR
\stoppmatrix
\stopformula

\startformula
M^3 = \startpmatrix
       \NC 2 \NC 3 \NC 6  \NC 4 \NC 2 \NC 7  \NC 3  \NC 1 \NR 
       \NC 3 \NC 0 \NC 1  \NC 1 \NC 2 \NC 3  \NC 6  \NC 4 \NR  
       \NC 6 \NC 1 \NC 4  \NC 4 \NC 4 \NC 9  \NC 10 \NC 6 \NR  
       \NC 4 \NC 1 \NC 4  \NC 4 \NC 5 \NC 8  \NC 8  \NC 3 \NR  
       \NC 2 \NC 2 \NC 4  \NC 5 \NC 2 \NC 7  \NC 3  \NC 1 \NR  
       \NC 7 \NC 3 \NC 9  \NC 8 \NC 7 \NC 8  \NC 10 \NC 3 \NR  
       \NC 3 \NC 6 \NC 10 \NC 8 \NC 3 \NC 10 \NC 4  \NC 1 \NR  
       \NC 1 \NC 4 \NC 6  \NC 3 \NC 1 \NC 3  \NC 1  \NC 0 \NR  
\stoppmatrix
\stopformula

\stoptext

Best regards: OK


> On 17 Jan 2018, at 19:19, Fabrice Couvreur <fabrice1.couvreur@gmail.com> wrote:
> 
> Hello,
> This macro that is not mine worked very well. I just tested the following file and there is a problem.
> Thank you
> Fabrice
> 
> \definemathmatrix
>   [pmatrix]
>   [left={\left(\,},right={\,\right)}]
>   
> \starttext
> 
> \math{M^3=\startpmatrix
>        \NC 2 \NC 3 \NC 6  \NC 4 \NC 2 \NC 7  \NC 3  \NC 1 \NR 
>        \NC 3 \NC 0 \NC 1  \NC 1 \NC 2 \NC 3  \NC 6  \NC 4 \NR  
>        \NC 6 \NC 1 \NC 4  \NC 4 \NC 4 \NC 9  \NC 10 \NC 6 \NR  
>        \NC 4 \NC 1 \NC 4  \NC 4 \NC 5 \NC 8  \NC 8  \NC 3 \NR  
>        \NC 2 \NC 2 \NC 4  \NC 5 \NC 2 \NC 7  \NC 3  \NC 1 \NR  
>        \NC 7 \NC 3 \NC 9  \NC 8 \NC 7 \NC 8  \NC 10 \NC 3 \NR  
>        \NC 3 \NC 6 \NC 10 \NC 8 \NC 3 \NC 10 \NC 4  \NC 1 \NR  
>        \NC 1 \NC 4 \NC 6  \NC 3 \NC 1 \NC 3  \NC 1  \NC 0 \NR  
>        
>      \stoppmatrix}  
>   
> \stoptext
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________


[-- Attachment #1.2: Type: text/html, Size: 5273 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] 9+ messages in thread

* Re: Problem with \definemathmatrix
  2018-01-17 18:19 Problem with \definemathmatrix Fabrice Couvreur
  2018-01-17 23:35 ` Otared Kavian
@ 2018-01-18  3:53 ` Aditya Mahajan
  2018-01-18 17:21   ` Fabrice Couvreur
  2018-01-18 20:13   ` Otared Kavian
  1 sibling, 2 replies; 9+ messages in thread
From: Aditya Mahajan @ 2018-01-18  3:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1068 bytes --]

On Wed, 17 Jan 2018, Fabrice Couvreur wrote:

> Hello,
> This macro that is not mine worked very well. I just tested the following
> file and there is a problem.

Otared has already answered your question but ...

> \math{M^3=\startpmatrix
>       \NC 2 \NC 3 \NC 6  \NC 4 \NC 2 \NC 7  \NC 3  \NC 1 \NR
>       \NC 3 \NC 0 \NC 1  \NC 1 \NC 2 \NC 3  \NC 6  \NC 4 \NR
>       \NC 6 \NC 1 \NC 4  \NC 4 \NC 4 \NC 9  \NC 10 \NC 6 \NR
>       \NC 4 \NC 1 \NC 4  \NC 4 \NC 5 \NC 8  \NC 8  \NC 3 \NR
>       \NC 2 \NC 2 \NC 4  \NC 5 \NC 2 \NC 7  \NC 3  \NC 1 \NR
>       \NC 7 \NC 3 \NC 9  \NC 8 \NC 7 \NC 8  \NC 10 \NC 3 \NR
>       \NC 3 \NC 6 \NC 10 \NC 8 \NC 3 \NC 10 \NC 4  \NC 1 \NR
>       \NC 1 \NC 4 \NC 6  \NC 3 \NC 1 \NC 3  \NC 1  \NC 0 \NR
>
>     \stoppmatrix}

If you type a lot of such matrices, you might find the attached module 
interesting. Using it you can use matlab-like syntax for writing matrices:

\usemodule[simplematrix]
\definesimplematrix[MATRIX][fence=parenthesis, align=middle]

\starttext
$\MATRIX{1,2,3,4;5,6,7,8;9,10,11,12}$
\stoptext

Aditya

[-- Attachment #2: Type: TEXT/PLAIN, Size: 2365 bytes --]

%D \module
%D   [     file=t-simplematrix,
%D      version=2014.02.18,
%D        title=\CONTEXT\ User Module,
%D     subtitle=Simple matrix,
%D       author=Aditya Mahajan,
%D         date=\currentdate,
%D    copyright=Aditya Mahajan,
%D        email=adityam <at> ieee <dot> org,
%D      license=Simplified BSD License]

\writestatus{loading}{Simple matrix (ver: 2014.02.18)}

\startmodule[simplematrix]

\unprotect

\definenamespace
  [simplematrix]
  [   \c!type=module,
      \c!name=simplematrix,
   \c!command=\v!yes,
        setup=\v!list,
    \s!parent=simplematrix,
  ]

\setupsimplematrix
  [
    \c!distance=\emwidth,
    \c!mathstyle=,
    fence=bracket,
    \c!align=
  ]

\appendtoks
  \setevalue{\currentsimplematrix}{\usesimplematrix[\currentsimplematrix]}
\to \everydefinesimplematrix

\newtoks\simplematrixtoks

\define[1]\simplematrix_row
    {\processcommalist[#1]\simplematrix_col
     \appendtoks \NR \to \simplematrixtoks}

\define[1]\simplematrix_col
    {\appendtoks \NC #1 \to \simplematrixtoks}

\unexpanded\def\usesimplematrix
    {\dodoubleargument\usesimplematrix_indeed}

\def\simplematrix_left
    {\edef\p_left{\namedmathfenceparameter{\simplematrixparameter{fence}}\c!left}%
     \normalleft\ifx\p_left\empty.\else\Udelimiter\plusfour\fam\p_left\relax\fi
     \,}

\def\simplematrix_right
    {\edef\p_right{\namedmathfenceparameter{\simplematrixparameter{fence}}\c!right}%
     \,
     \normalright\ifx\p_right\empty.\else\Udelimiter\plusfive\fam\p_right\relax\fi}
     

\def\usesimplematrix_indeed[#name][#options]#matrix%
    {\begingroup
     \edef\currentsimplematrix{#name}%
     \setupsimplematrix[#name][#options]%
     \simplematrixtoks\emptytoks
     \startusemathstyleparameter\simplematrixparameter
     \appendtoks 
           \bgroup
           \startmathmatrix
            [
              \c!distance=\simplematrixparameter\c!distance,
              \c!left=\simplematrix_left,
              \c!right=\simplematrix_right,
              \c!align=\simplematrixparameter\c!align,
            ]
        \to \simplematrixtoks
     \processlist[];\simplematrix_row[#matrix]%
     \appendtoks \stopmathmatrix \egroup \to \simplematrixtoks
     \the\simplematrixtoks
     \stopusemathstyleparameter
     \endgroup}

\protect

\stopmodule

[-- Attachment #3: 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] 9+ messages in thread

* Re: Problem with \definemathmatrix
  2018-01-18  3:53 ` Aditya Mahajan
@ 2018-01-18 17:21   ` Fabrice Couvreur
  2018-01-18 18:12     ` Aditya Mahajan
  2018-01-18 20:13   ` Otared Kavian
  1 sibling, 1 reply; 9+ messages in thread
From: Fabrice Couvreur @ 2018-01-18 17:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hello,
Thank you.
@Adytan This module is not part of context standalone, in which directory
is it better to put it ?
Fabrice

2018-01-18 4:53 GMT+01:00 Aditya Mahajan <adityam@umich.edu>:

> On Wed, 17 Jan 2018, Fabrice Couvreur wrote:
>
> Hello,
>> This macro that is not mine worked very well. I just tested the following
>> file and there is a problem.
>>
>
> Otared has already answered your question but ...
>
> \math{M^3=\startpmatrix
>>       \NC 2 \NC 3 \NC 6  \NC 4 \NC 2 \NC 7  \NC 3  \NC 1 \NR
>>       \NC 3 \NC 0 \NC 1  \NC 1 \NC 2 \NC 3  \NC 6  \NC 4 \NR
>>       \NC 6 \NC 1 \NC 4  \NC 4 \NC 4 \NC 9  \NC 10 \NC 6 \NR
>>       \NC 4 \NC 1 \NC 4  \NC 4 \NC 5 \NC 8  \NC 8  \NC 3 \NR
>>       \NC 2 \NC 2 \NC 4  \NC 5 \NC 2 \NC 7  \NC 3  \NC 1 \NR
>>       \NC 7 \NC 3 \NC 9  \NC 8 \NC 7 \NC 8  \NC 10 \NC 3 \NR
>>       \NC 3 \NC 6 \NC 10 \NC 8 \NC 3 \NC 10 \NC 4  \NC 1 \NR
>>       \NC 1 \NC 4 \NC 6  \NC 3 \NC 1 \NC 3  \NC 1  \NC 0 \NR
>>
>>     \stoppmatrix}
>>
>
> If you type a lot of such matrices, you might find the attached module
> interesting. Using it you can use matlab-like syntax for writing matrices:
>
> \usemodule[simplematrix]
> \definesimplematrix[MATRIX][fence=parenthesis, align=middle]
>
> \starttext
> $\MATRIX{1,2,3,4;5,6,7,8;9,10,11,12}$
> \stoptext
>
> Aditya
> ____________________________________________________________
> _______________________
> 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
> ____________________________________________________________
> _______________________
>

[-- Attachment #1.2: Type: text/html, Size: 3438 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] 9+ messages in thread

* Re: Problem with \definemathmatrix
  2018-01-18 17:21   ` Fabrice Couvreur
@ 2018-01-18 18:12     ` Aditya Mahajan
  2018-01-18 18:29       ` Fabrice Couvreur
  0 siblings, 1 reply; 9+ messages in thread
From: Aditya Mahajan @ 2018-01-18 18:12 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, 18 Jan 2018, Fabrice Couvreur wrote:

> Hello,
> Thank you.
> @Adytan This module is not part of context standalone, in which directory
> is it better to put it ?
> Fabrice

You can put it any directory where ConTeXt can find it. I usually use

$TEXMFHOME/tex/context/personal/

On most systems, $TEXMFHOME is set to ~/texmf.

Aditya
___________________________________________________________________________________
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] 9+ messages in thread

* Re: Problem with \definemathmatrix
  2018-01-18 18:12     ` Aditya Mahajan
@ 2018-01-18 18:29       ` Fabrice Couvreur
  0 siblings, 0 replies; 9+ messages in thread
From: Fabrice Couvreur @ 2018-01-18 18:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Very great  job, I will save a lot of time !
Fabrice

2018-01-18 19:12 GMT+01:00 Aditya Mahajan <adityam@umich.edu>:

> On Thu, 18 Jan 2018, Fabrice Couvreur wrote:
>
> Hello,
>> Thank you.
>> @Adytan This module is not part of context standalone, in which directory
>> is it better to put it ?
>> Fabrice
>>
>
> You can put it any directory where ConTeXt can find it. I usually use
>
> $TEXMFHOME/tex/context/personal/
>
> On most systems, $TEXMFHOME is set to ~/texmf.
>
>
> Aditya
> ____________________________________________________________
> _______________________
> 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/list
> info/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ____________________________________________________________
> _______________________
>

[-- Attachment #1.2: Type: text/html, Size: 2387 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] 9+ messages in thread

* Re: Problem with \definemathmatrix
  2018-01-18  3:53 ` Aditya Mahajan
  2018-01-18 17:21   ` Fabrice Couvreur
@ 2018-01-18 20:13   ` Otared Kavian
  2018-01-18 21:34     ` Hans Hagen
  1 sibling, 1 reply; 9+ messages in thread
From: Otared Kavian @ 2018-01-18 20:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Aditya,

Thanks for sharing this nice module, it is really useful, especially when making documents for students while using Matlab or Scilab.

There is also in the distribution the module m-matrix.mkiv written by Hans and Jeong Dalyoung, which allows to manipulate matrices. 
Maybe one should add the functionality of your module to the one in the distribution and somehow unify their environments.

Best regards: OK

> On 18 Jan 2018, at 04:53, Aditya Mahajan <adityam@umich.edu> wrote:
> […]
> 
> If you type a lot of such matrices, you might find the attached module interesting. Using it you can use matlab-like syntax for writing matrices:
> 
> \usemodule[simplematrix]
> \definesimplematrix[MATRIX][fence=parenthesis, align=middle]
> 
> \starttext
> $\MATRIX{1,2,3,4;5,6,7,8;9,10,11,12}$
> \stoptext
> 
> Aditya<t-simplematrix.mkvi>___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

___________________________________________________________________________________
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] 9+ messages in thread

* Re: Problem with \definemathmatrix
  2018-01-18 20:13   ` Otared Kavian
@ 2018-01-18 21:34     ` Hans Hagen
  2018-01-19  0:13       ` Aditya Mahajan
  0 siblings, 1 reply; 9+ messages in thread
From: Hans Hagen @ 2018-01-18 21:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Otared Kavian

On 1/18/2018 9:13 PM, Otared Kavian wrote:
> Hi Aditya,
> 
> Thanks for sharing this nice module, it is really useful, especially when making documents for students while using Matlab or Scilab.

Nice indeed.

> There is also in the distribution the module m-matrix.mkiv written by Hans and Jeong Dalyoung, which allows to manipulate matrices.
> Maybe one should add the functionality of your module to the one in the distribution and somehow unify their environments.

I'll add this to the core:

\unprotect

%D The following code is derived from Aditya's simplematrix prototype but
%D adapted to regular mathmatrices (which saves some code so it can go into
%D the core):

\newtoks\t_math_matrix

\def\math_matrix_simple_row#1%
   {\rawprocesscommalist[#1]\math_matrix_simple_col
    \toksapp\t_math_matrix{\NR}}

\def\math_matrix_simple_col#1%
   {\toksapp\t_math_matrix{\NC#1}}

\unexpanded\def\math_matrix_simple[#1][#2]#3%
   {\begingroup
    \edef\currentmathmatrix{#1}%
    \ifsecondargument
      \setupcurrentmathmatrix[#2]%
    \fi
    \t_math_matrix\emptytoks
    \processlist[];\math_matrix_simple_row[#3]%
    \math_matrix_start\currentmathmatrix
    \the\t_math_matrix
    \math_matrix_stop
    \endgroup}

%D We hook it into the normal mathmatrix code:

\ifdefined\c!simplecommand\else\def\c!simplecommand{simplecommand}\fi

\appendtoks
     \edef\p_simplecommand{\mathmatrixparameter\c!simplecommand}%
     \ifx\p_simplecommand\empty\else
 
\setuevalue{\p_simplecommand}{\dodoubleempty\math_matrix_simple[\currentmathmatrix]}%
     \fi
\to \everydefinemathmatrix

%D And predefine some matrices:

\definemathmatrix[matrix:parentheses][\c!left={\left(\mskip\thinmuskip},\c!right={\mskip\thinmuskip\right)},\c!align=\v!middle]
\definemathmatrix[matrix:brackets] 
[\c!left={\left[\mskip\thinmuskip},\c!right={\mskip\thinmuskip\right]},\c!align=\v!middle]
\definemathmatrix[matrix:bars] 
[\c!left={\left|\mskip\thinmuskip},\c!right={\mskip\thinmuskip\right|},\c!align=\v!middle]

\definemathmatrix[thematrix][matrix:parentheses][\c!simplecommand=thematrix]

\protect

\starttext

$\thematrix{1,2,3,4;5,6,7,8;9,10,11,12}$

$\startthematrix
     \NC 1\NC 2\NC 3\NC 4\NR
     \NC 5\NC 6\NC 7\NC 8\NR
     \NC 9\NC10\NC11\NC12\NR
\stopthematrix$

\stoptext



> Best regards: OK
> 
>> On 18 Jan 2018, at 04:53, Aditya Mahajan <adityam@umich.edu> wrote:
>> […]
>>
>> If you type a lot of such matrices, you might find the attached module interesting. Using it you can use matlab-like syntax for writing matrices:
>>
>> \usemodule[simplematrix]
>> \definesimplematrix[MATRIX][fence=parenthesis, align=middle]
>>
>> \starttext
>> $\MATRIX{1,2,3,4;5,6,7,8;9,10,11,12}$
>> \stoptext
>>
>> Aditya<t-simplematrix.mkvi>___________________________________________________________________________________
>> 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
>> ___________________________________________________________________________________
> 
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
> 


-- 

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

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

* Re: Problem with \definemathmatrix
  2018-01-18 21:34     ` Hans Hagen
@ 2018-01-19  0:13       ` Aditya Mahajan
  0 siblings, 0 replies; 9+ messages in thread
From: Aditya Mahajan @ 2018-01-19  0:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Otared Kavian

On Thu, 18 Jan 2018, Hans Hagen wrote:

> On 1/18/2018 9:13 PM, Otared Kavian wrote:
>>  Hi Aditya,
>>
>>  Thanks for sharing this nice module, it is really useful, especially when
>>  making documents for students while using Matlab or Scilab.
>
> Nice indeed.
>
>>  There is also in the distribution the module m-matrix.mkiv written by Hans
>>  and Jeong Dalyoung, which allows to manipulate matrices.
>>  Maybe one should add the functionality of your module to the one in the
>>  distribution and somehow unify their environments.
>
> I'll add this to the core:
>
> % D We hook it into the normal mathmatrix code:
>
> \ifdefined\c!simplecommand\else\def\c!simplecommand{simplecommand}\fi
>
> \appendtoks
>     \edef\p_simplecommand{\mathmatrixparameter\c!simplecommand}%
>     \ifx\p_simplecommand\empty\else
>
> \setuevalue{\p_simplecommand}{\dodoubleempty\math_matrix_simple[\currentmathmatrix]}%
>    \fi
> \to \everydefinemathmatrix

Ah, this does make it more direct.

Thanks,
Aditya
___________________________________________________________________________________
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] 9+ messages in thread

end of thread, other threads:[~2018-01-19  0:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-17 18:19 Problem with \definemathmatrix Fabrice Couvreur
2018-01-17 23:35 ` Otared Kavian
2018-01-18  3:53 ` Aditya Mahajan
2018-01-18 17:21   ` Fabrice Couvreur
2018-01-18 18:12     ` Aditya Mahajan
2018-01-18 18:29       ` Fabrice Couvreur
2018-01-18 20:13   ` Otared Kavian
2018-01-18 21:34     ` Hans Hagen
2018-01-19  0:13       ` Aditya Mahajan

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