LaTeX数学公式的矩阵、多行公式

LaTeX数学公式的矩阵、多行公式

目录

  1. 矩阵公式
  2. 数学公式的多行公式
  1. 矩阵公式
% 导言区
\documentclass{article}
\usepackage{ctex}

\usepackage{amsmath} %矩阵宏包

% 创建新命令,自定义省略号类型
\newcommand{\adots}{\mathinner{\mkern2mu%
\raisebox{0.1em}{.}\mkern2mu\raisebox{0.4em}{.}%
\mkern2mu\raisebox{0.7em}{.}\mkern1mu}}

% 正文区
\begin{document}

 %矩阵环境,用&分割列,用\\分割行
 \[
 \begin{matrix}
     0 & 1 \\
        1 & 0
 \end{matrix} \qquad
 %pmatrix环境
 \begin{pmatrix} %小括号
     0 & 1 \\
     1 & 0
 \end{pmatrix} \qquad
%bmatrix
 \begin{bmatrix} %中括号
        0 & 1 \\
        1 & 0
 \end{bmatrix} \qquad
 %Bmatrix
 \begin{Bmatrix} %大括号
     0 & 1 \\
     1 & 0
 \end{Bmatrix} \qquad
 %vmatrix
 \begin{vmatrix} %单竖线
     0 & 1 \\
     1 & 0
 \end{vmatrix} \qquad
 %Vmatrix 
 \begin{Vmatrix} %双竖线
     0 & 1 \\
     1 & 0
 \end{Vmatrix} 
 \]

% 可以使用上下标
 \[
 A = \begin{pmatrix}
 a_{11}^2 & a_{12}^2 & a_{13}^2 \\
 0 & a_{22} & a_{23} \\
 0 & 0 & a_{33}
 \end{pmatrix}
 \] 
 
 % 常用省略号:\dots、\vdots、\ddots
 % 自定义\adots 输出自定义省略号
 \[
 A = \begin{bmatrix}
 a_{11} & \dots & a_{1n} \\
 \adots & \ddots & \vdots \\
 0 & & a_{nn} 
 \end{bmatrix}_{n \times n}
 \]
 
 %分块矩阵(矩阵嵌套)
 \[
 \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}
 \]
 % 三角矩阵
 \[
 \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} 
 \]
 
 % 行内小矩阵(smallmatrix)环境
 复数 $ z = (x,y)$ 也可用矩阵
 \begin{math}
  \left( % 加左括号
  \begin{smallmatrix}
  x & -y \\ y & x
  \end{smallmatrix}
  \right) %
 \end{math} %加右括号
 
 % array 环境(类似于表格tabular)
 \[
 \begin{array}{r|r}
 \frac 12 & 0 \\
 \hline
 0 & - \frac abc \\
 \end{array} 
 \]
 
 % 用array 环境构造复杂矩阵
 \[
 % @{<内容>}——添加任意内容,不占表项计数
 % 此处添加一个负值空白,表示向左移-5pt的距离
 \begin{array}{c@{\hspace{-5pt}}l}
 % 第1行,第1列
 \left(
 \begin{array}{ccc|ccc}
 a & \cdots & a & b & \cdots & b \\
 & \ddots & \vdots & \vdots & \adots \\
 &        & a & b \\ \hline
 &        &   & c & \cdots & c \\
 &        &   & \vdots & & \vdots \\
 \multicolumn{3}{c|}{\raisebox{2ex}[0pt]{\Huge 0}}
 & c & \cdots & c 
 \end{array}
 \right)
 &
 % 第1行第2列
 \begin{array}{l}
 % \left.仅表示与\right}配对,什么都不输出
 \left.\rule{0mm}{7mm}\right\}p \\
 \\ 
 \left.\rule{0mm}{7mm}\right\}q 
 \end{array}
 \\ [-5pt]
 % 第2行第1列
 \begin{array}{cc}
 \underbrace{\rule{17mm}{0mm}}_m &
 \underbrace{\rule{17mm}{0mm}}_m
 \end{array}
 & % 第2行第2列
 \end{array}
 \]

\end{document}

在这里插入图片描述
在这里插入图片描述
2. 数学公式的多行公式

% 导言区
\documentclass{article}
\usepackage{ctex}

\usepackage{amsmath}
\usepackage{amssymb}

% 正文区
\begin{document}

% gather 和gather* 环境(可以使用\\换行)
 \begin{gather}
  a + b = b + a \\
  ab = ba
 \end{gather}
 
 % 不带编号
 \begin{gather*}
  3 + 5 = 5 + 3 = 8 \\
  3 \times 5 = 5 \times 3
 \end{gather*}
 
 % 在\\前使用\notage 阻止编号
 \begin{gather}
  3^2 + 4^2 = 5^2 \notag \\
  5^2 + 12^2 = 13^2 \notag \\
  a + b = b + a
 \end{gather}
 
 % align 和align* 环境(用&进行对齐)
 %带编号
 \begin{align}
  x &= t + \cos t + 1 \\
  y &= 2 \sin t
 \end{align}
 
 % 不带编号
 \begin{align*}
  x &= t & x &= \cos t & x &= t \\
  y &= 2t & y &= \sin (t+1) & y &= \sin t
 \end{align*}
 
 % solit 环境(对齐采用align环境的方式,编号在中间)
 \begin{equation}
  \begin{split}
  \cos 2x &= \cos^2 x - \sin^2 x \\
  &= 2\cos^2 x -1
  \end{split}
 \end{equation}
 
 % cass环境 (类似分段函数)
 % 每行公式中使用 & 分隔为两部分,
 % 通常表示值和后面的条件
 \begin{equation}
  D(x) = \begin{cases}
  1, & \text{如果} x \in \mathbb{Q}; \\
  0, & \text{如果} x \in \mathbb{R} \setminus\mathbb{Q}.
  \end{cases}
 \end{equation}

\end{document}

在这里插入图片描述

  • 3
    点赞
  • 28
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
LaTeX数学公式是一种排版数学表达式的标记语言。为了在LaTeX编译器中编写数学公式,你需要在导言区引用数学公式的宏包,代码为\usepackage{amsmath};如果你想修改公式的字体,还需要引用宏包\usepackage{amsfonts}。 在LaTeX中,你可以使用一系列的语法和符号来插入各种类型的数学公式,包括上下标、分式、开方、对数、极限、导数与偏导、矩阵等等。你可以参考官方文档来了解更多的数学公式语法和用法。 如果你使用的是Markdown编写LaTeX数学公式,CSDN支持LaTeX数学公式的显示,但一些本地编辑器可能不直接支持LaTeX数学公式的输入。你可以通过设置Typroa或通过在VS Code安装扩展来支持LaTeX数学公式的输入。 总结起来,LaTeX数学公式可以通过使用特定的语法和符号来编写,并借助相应的宏包进行排版和修改字体。在Markdown编辑器中,你可能需要做一些设置或安装扩展来支持LaTeX数学公式的输入。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* *3* [LaTeX数学公式-详细教程](https://blog.csdn.net/NSJim/article/details/109045914)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值