(十)Latex数学公式的矩阵

\documentclass{ctexart}
\usepackage{amsmath} % 包中有matrix等环境

\newcommand{\adots}{\mathinner{\mkern2mu \raisebox{0.1em}{.}\mkern2mu\raisebox{0.4em}{.}\mkern2mu\raisebox{0.7em}{.}\mkern1mu}}

\begin{document}
 <1>
 \[     
 \begin{matrix}
  0 & 1 \\    % &分隔列,\\:分隔行
  1 & 0
 \end{matrix}
 \]
 % 其他矩阵环境(在矩阵两边加括号):
 % pmatrix: 小括号
 % bmatrix: 中括号
 % Bmatrix: 大括号
 % vmatrix: 单竖线
 % Vmatrix: 双竖线
 
 <2>%使用上下标
 \[     
 \begin{pmatrix}
  a_{11}^2 & a_{12}^2 & a_{13}^2 \\   
         1 & a_{22} & a_{23}^2 \\
  a_{31}^2 & a_{32}^2 & a_{33}^2
 \end{pmatrix}
 \]
 
 <3>% 常用省略号: \dots (横三点)、\ddots (斜三点) \vdots (竖三点)
 \[
 A = \begin{bmatrix}
  a_{11} & \dots  & a_{1n} \\
         & \ddots & \vdots \\
  0      &        & a_{nn} 
 \end{bmatrix}_{n \times n}   % 矩阵下标nxn
 \]
 
 <4>%分块矩阵 (把矩阵当作元素)
 \[
 \begin{pmatrix}
  \begin{matrix} 1&0\\0&1\end{matrix} & \text{\Large 0} \\
  % ------------------
  \text{\Large 0} &
  \begin{matrix}
   1&0\\0&-1
  \end{matrix}
 \end{pmatrix}
 \]
 
 <5>% 三角矩阵
 \[
 \begin{pmatrix}
  a_{11} & a_{12} & \cdots & a_{1n} \\
         & a_{22} & \cdots & a_{2n} \\
         &        & \ddots & \vdots \\
  \multicolumn{2}{c}{\raisebox{1.3ex}[0pt]{\Huge 0}} & & a_{nn}
 \end{pmatrix}
 \] % multicolumn:合并多列,raisebox:调整高度
 
 %略
 % <6> 跨列的省略号: \hdotsfor{columns}
 % <7> 行内小矩阵: smallmatrix环境
 % <8> array环境: 类似于表格环境tabular
\end{document}

在这里插入图片描述

发布了23 篇原创文章 · 获赞 2 · 访问量 788

猜你喜欢

转载自blog.csdn.net/weixin_44378835/article/details/104189701