1. Background
When writing a paper using Latex, matrix formulas are inevitably involved. Some journals require matrices to use square brackets, and some journals require matrices to use round brackets. Therefore, we will record the difference between the two representation methods of Latex source code, as well as the expansion of arrays and equations.
2. Square bracket representation of matrix
First of all, all matrices must be in the tags \begin{eqnarray}
and \end{eqnarray}
. The specific representation is as shown in the source code below, such as unit matrix:
\begin{
eqnarray}
\begin{
bmatrix}
1 & \cdots & 0 \\
\vdots & \ddots & \vdots
\\0 & \cdots & 1
\end{
bmatrix}
\end{
eqnarray}
The matrix is inside the tags \begin{bmatrix}
and \end{bmatrix}
, the difference is bmatrix
3. Curly bracket representation of matrix
\begin{
eqnarray}
\begin{
Bmatrix}
1 & \cdots & 0 \\
\vdots & \ddots & \vdots
\\0 & \cdots & 1
\end{
Bmatrix}
\end{
eqnarray}
The matrix is in the tags \begin{Bmatrix}
and \end{Bmatrix}
, the difference is Bmatrix
4. Parentheses representation of matrix
\begin{
eqnarray}
\begin{
pmatrix}
1 & \cdots & 0 \\
\vdots & \ddots & \vdots
\\0 & \cdots & 1
\end{
pmatrix}
\end{
eqnarray}
The matrix is in the tags \begin{pmatrix}
and \end{pmatrix}
, the difference is pmatrix
5. The bracketless representation of the matrix looks strange.
\begin{
eqnarray}
\begin{
matrix}
1 & \cdots & 0 \\
\vdots & \ddots & \vdots
\\0 & \cdots & 1
\end{
matrix}
\end{
eqnarray}
The matrix is in the tags \begin{matrix}
and \end{matrix}
, the difference is matrix
6. Extension, array representation in Latex
\begin{
eqnarray}
\begin{
array}{
| c | c | c | c | }
a & b & c & d\\
\hline
1 & 2 & 3 & 3 \\
4 & 5 & 6 & 6 \\
7 & 8 & 9 & 9\\
\hline
1 & 1 & 1 & 1
\end{
array}
\end{
eqnarray}
The array is inside the tags\begin{array}
and \end{array}
, the difference isarray
7. Extension, representation of equations in Latex
\begin{
eqnarray}
\begin{
cases}
3x + 5y + z \\
7x - 2y + 4z \\
-6x + 3y + 2z
\end{
cases}
\end{
eqnarray}
The system of equations is in the tags \begin{cases}
and \end{cases}
, the difference is cases
7. Extension, piecewise function representation in Latex
\begin{
eqnarray}
f(x) =
\begin{
cases}
0, & \text{
if }x \le 0 \\
6x+1, & \text{
otherwise}
\end{
cases}
\end{
eqnarray}