Latex\TexStudio多行数学公式排版

9 篇文章 1 订阅
3 篇文章 0 订阅

导入宏包\usepackage{amsmath} \usepackage{amssymb}

gather

gather

	% 带编号
	% gather 实现多行排版同时对公式进行编号
	\begin{gather}
		a + b = b + a \\
		abba
	\end{gather}

在这里插入图片描述

gather*

	\begin{gather*}
		3 + 5  = 5 + 3 = 8 \\
		3 \times 5  = 5 \times 3
	\end{gather*}

在这里插入图片描述

notag

	% 不带编号
	% 在 \\ 前使用\notag 阻止编号
	\begin{gather}
		3^2 + 4^2 = 5^2 \notag \\
		5^2 + 12^2 = 13^2 \notag \\
		a^2 + b^2 = c^2
	\end{gather}

在这里插入图片描述

align

align

	% 带编号 (用 & 对齐),设置公式对齐方式
	\begin{align}
		x &= t + \cos t + 1 \\	% 在=左边对齐
		y &= 2\sin t
	\end{align}

在这里插入图片描述

align*

	% 不带编号
	\begin{align*}
		x &= t & x &= \cos t & x &= t \\
		y &= 2t & y &= \sin(t+1) & y &= \sin t
	\end{align*} 

在这里插入图片描述

split

	% split将一个公式分成多行排版
	% split 环境,一定要equation环境中(对齐采用align环境的方式,编号在多个式子中间)
	\begin{equation}
		\begin{split}
			\cos 2x &= \cos^2 x - \sin^2 x \\
			&= 2\cos^2 x -1
		\end{split}
	\end{equation}

在这里插入图片描述

cases

	% cases 环境
	% 每行公式中使用 & 分隔为两部分,
	% 通常表示值和后面的条件
	\begin{equation}	
		D(x) = \begin{cases}
			1, & \text{如果} x \in \mathbb{Q}; \\	 % \in 表示属于  \text表示输出文本模式,在数学模式中处理中文
			0, & \text{如果} x \in \mathbb{R} \setminus \mathbb{Q}	% \mathbb输出花体字符,需要amssymb宏包支持
		\end{cases} 
	\end{equation}

在这里插入图片描述

  • 1
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值