现在的位置: 首页 > 综合 > 正文

Latex 中创建矩阵或向量

2017年10月21日 ⁄ 综合 ⁄ 共 1578字 ⁄ 字号 评论关闭

\begin{equation}
  s_{kk'}=
  \left(
  \begin{array}{ccc}
          h_{1k} &
          \cdots &
          h_{nk}
  \end{array}
  \right)
  \left(
  \begin{array}{ccc}
          \bar{q}_{11} & \cdots & \bar{q}_{12}\\
          \vdots & \ddots & \vdots\\
          \bar{q}_{n1} & \cdots & \bar{q}_{n2}
  \end{array}
  \right)
  \left(
  \begin{array}{c}
          h_{1k'} \\
          \vdots \\
          h_{nk'}
 \end{array}
 \right)
\end{equation}
我们可以得到如下效果:

We can create a matrix in LaTeX using the array environment, or simplematrix, matrix, pmatrix, bmatrix, vmatrix, and Vmatrix environments via amsmath package. This article provides some examples on how to create a matrix in LaTeX.

Creating a matrix with array

Here are some examples.

  1. unbracketed matrix

    m1

    \[
        M =
        \begin{array}{cc}
        x & y \    z & w \    \end{array}
        \]
  2. matrix surrounded by square brackets

    m2

    \[
        M =
        \left[ {\begin{array}{cc}
        x & y  \    z & w  \    \end{array} } \right]
        \]
  3. matrix surrounded by parentheses

    m3

    \[
        M =
        \left( {\begin{array}{cc}
        x & y  \    z & w  \    \end{array} } \right)
        \]
  4. matrix surrounded by single vertical lines

    m4

    \[
        M =
        \left| {\begin{array}{cc}
        x & y  \    z & w  \    \end{array} } \right|
        \]

Using amsmath package

Call \usepackage{amsmath} in the preamble, after \documentclass{}.

The amsmath package environment for matrix:

  1. smallmatrix: inline matrix

    m5

    $M = \begin{smallmatrix} x&y\\ z&w \end{smallmatrix}$
        $M = \left( \begin{smallmatrix} x&y\\ z&w \end{smallmatrix}\right)$
  2. matrix: unbracketed matrix

    m6

    $M = \begin{matrix} x&y\\ z&w \end{matrix}$
  3. pmatrix: matrix surrounded by parentheses

    m7

    $M = \begin{pmatrix} x&y\\ z&w \end{pmatrix}$
  4. bmatrix: matrix surrounded by square brackets

    m8

    $M = \begin{bmatrix} x&y\\ z&w \end{bmatrix}$
  5. vmatrix: matrix surrounded by single vertical lines

    m9

    $M = \begin{vmatrix} x&y\\ z&w \end{vmatrix}$
  6. Vmatrix: matrix surrounded by double vertical lines

    m10

    $M = \begin{Vmatrix} x&y\\ z&w \end{Vmatrix}$


    原文地址:http://www.360doc.com/content/10/0924/14/175261_55980937.shtml




抱歉!评论已关闭.