【LaTeX笔记10】数学模式中的多行数学公式

1  代码部分

% 导言区
\documentclass{article}

\usepackage{ctex}
\usepackage{amsmath}
\usepackage{amssymb}

%标题、作者及日期
\title{数学模式中的多行数学公式}
\author{张三丰}
\date{\today}


% 正文区(文稿区)
\begin{document}
	\maketitle
	\begin{gather}
		a + b = b + a \\
		ab ba
	\end{gather}
	
	\begin{gather*}
	a + b = b + a \\
	ab ba
	\end{gather*}
	
	%在\\前使用\notag阻止编号
	\begin{gather}
	3^2 + 4^2 = 5^2 \notag \\
	5^2 + 12^2 = 13^2 \notag \\
	a^2 + b^2 =c^2\notag
	\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*}
	
	%split 环境(对齐采用align环境的方式,编号在中间)
	\begin{equation}
		\begin{split}
		\cos 2x &= \cos^2 x - \sin^2 x \\
		&= 2\cos^2 x - 1
		\end{split}
	\end{equation}
	
	%case环境
	%每行公式中使用 & 分隔为两个部分
	%通常表示值和后面的条件
	%在数学模式中需要text命令处理中文
	\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}

2  效果演示部分


猜你喜欢

转载自blog.csdn.net/yeler082/article/details/80718212