Open main menu

Changes

Replaced content with "moved to Math/Matrices"
In order moved to type matrices in math formulas, there is the command {{cmd|definemathmatrix}}. Once a certain type of matrix is defined, one can also add a simple command in order to type matrices in a Matlab or Scilab format. Here are a few examples <context source = yes>%% defining matrix with parentheses\definemathmatrix[pmatrix] [matrix:parentheses] [simplecommand=pmatrix] %% defining matrix with brackets\definemathmatrix[bmatrix] [matrix:brackets] [simplecommand=bmatrix] %% defining determinant with bars\definemathmatrix[determinant] [matrix:bars] [simplecommand=thedeterminant]\starttextLet $A$ be the matrix\startformulaA := \startpmatrix \NC 2 \NC 3 \NR \NC 1 \NC 2 \NR \stoppmatrix.\stopformulaShow that\startformula{\rm det}(A) = \startdeterminant \NC 2 \NC 3 \NR \NC 1 \NC 2 \NR\stopdeterminant = 1.\stopformulaCompute the matrix $AB$ where $B$ is the matrix\startformulaB := \pmatrix{2, -3 ; -1, 2}.\stopformula\stoptext</context>It is possible to have different delimiters on the left and on the right. For instance:<context source = yes >\definemathmatrix[pvmatrix] [left={\left(\thinspace}, right={\thinspace\right|}] \definemathmatrix[rpmatrix] [left={\left.\thinspace}, right={\thinspace\right)}] \starttext\startformula \startpvmatrix \NC 11 \NC 12 \NC 13 \NR \NC 21 \NC 22 \NC 23 \NR \NC 31 \NC 32 \NC 33 \NR \stoppvmatrix \startrpmatrix \NC 0 \NR \NC 1 \NR \NC 2 \NR \stoprpmatrix\stopformula \stoptext<Math/context> In ConTeXt LMTX beginning version 2020-11-27, it is possible to create « block » matrices where the blocks are separated by vertical or horizontal lines (respectively {{cmd|VL}} and {{cmd|HL}}). For instance the above example can be typeset more easily by the following (the output may be incorrect on this wiki: if this is the case copy the code below and typeset it on your machine with ConTeXt LMTX): <context source = yes>\definemathmatrix[mymatrixMatrices] [left={\left\lparent\thinspace}, % instead of the left parenthesis, one can use any other fence right={\thinspace\right\rparent}] % instead of the right parenthesis, one can use any other fence \starttextHere is $3 \times 3$ matrix with a column added to it\startformula \startmymatrix \NC 11 \NC 12 \NC 13 \VL 0 \NR \NC 21 \NC 22 \NC 23 \VL 1 \NR \NC 31 \NC 32 \NC 33 \VL 2 \NR \stopmymatrix\stopformulaHere is block matrix:\startformula \startmymatrix \NC A \VL B \NR \HL \NC C \VL D \NR \stopmymatrix\stopformulaand here is another one\startformula \startmymatrix \NC A \VL[3,green] B \NR % \HL[10,red] \NC C \VL D \NR \stopmymatrix\stopformula \stoptext</context>
1,047

edits