How to use Latex to Write Matrices

brief introduction

Latex’s formula function is very powerful. It’s not easy to talk about it all at once. These functions of latex are divided into smaller independent parts, which are convenient for you to consult separately on the one hand; on the other hand, all [CSDN] functions are easy to read_ [markdown] related articles are all put under the same column: CSDN markdown online editing, for your convenience.

This paper mainly introduces how to use latex formula command to obtain matrix in the markdown editor of CSDN.


Simple matrix

Use $$$begin {matrix} \End {matrix} $$ to generate a matrix, where ... represents the matrix command of latex, each line in the matrix command ends with \ \ and the elements of the matrix are separated by & amp; .

For example:

$$
  \begin{matrix}
   1 & 2 & 3 \\
   4 & 5 & 6 \\
   7 & 8 & 9
  \end{matrix} \tag{1}
$$

The results are as follows

147258369(1)


Matrix with brackets

I feel that the matrix in (1) is not very beautiful. You can add brackets to the matrix. There are many ways to add brackets, which can be roughly divided into two kinds: use - left... - right or change matrix in formula command to pMatrix , bMatrix , bMatrix , vmatrix , vmatrix , etc.

 

Use - left... - right

1. {… }

example:

$$
 \left\{
 \begin{matrix}
   1 & 2 & 3 \\
   4 & 5 & 6 \\
   7 & 8 & 9
  \end{matrix}
  \right\} \tag{2}
$$

The results are as follows

⎧⎩⎨⎪⎪147258369⎫⎭⎬⎪⎪(2)

2. [… ]

example:

$$
 \left[
 \begin{matrix}
   1 & 2 & 3 \\
   4 & 5 & 6 \\
   7 & 8 & 9
  \end{matrix}
  \right] \tag{3}
$$

The results are as follows

⎡⎣⎢147258369⎤⎦⎥(3)

 

Replace matrix

1. [… ]

example:

$$
 \begin{bmatrix}
   1 & 2 & 3 \\
   4 & 5 & 6 \\
   7 & 8 & 9
  \end{bmatrix} \tag{4}
$$

The results are as follows

⎡⎣⎢147258369⎤⎦⎥(4)

2. {… }

example:

$$
 \begin{Bmatrix}
   1 & 2 & 3 \\
   4 & 5 & 6 \\
   7 & 8 & 9
  \end{Bmatrix} \tag{5}
$$

The results are as follows

⎧⎩⎨⎪⎪147258369⎫⎭⎬⎪⎪(5)


Matrix with Ellipsis

If there are too many elements in the matrix, you can use

\ddots

\vdots

And so on.

For example:

$$
\left[
\begin{matrix}
 1      & 2      & \cdots & 4      \\
 7      & 6      & \cdots & 5      \\
 \vdots & \vdots & \ddots & \vdots \\
 8      & 9      & \cdots & 0      \\
\end{matrix}
\right]
$$

The results are as follows

⎡⎣⎢⎢⎢⎢⎢17⋮826⋮9⋯⋯⋱⋯45⋮0⎤⎦⎥⎥⎥⎥⎥(6)


Matrix with parameters

For example, to write an augmented matrix, you may need to consider the rightmost column separately. You can use the array command to process:

$$ 
\left[
    \begin{array}{cc|c}
      1 & 2 & 3 \\
      4 & 5 & 6
    \end{array}
\right] \tag{7}
$$

The results are as follows

[142536](7)

The C in represents the center aligned element, and | is used as the symbol to split the column.


Inter row matrix

You can use - bigl (,

For example:

We use the matrix $\bigl( \begin{smallmatrix} a & b \\ c & d \end{smallmatrix} \bigr)$ As a factor matrix, then...

The results are as follows

We use matrices

(acbd)

As a factor matrix, it is


summary

This paper mainly introduces how to use latex command to generate matrix in markdown editor. Mainly use and other commands to define the matrix. For more information, please refer to: http://www.ctan.org/pkg/lshort

Read More: